query
stringlengths 7
33.1k
| document
stringlengths 7
335k
| metadata
dict | negatives
sequencelengths 3
101
| negative_scores
sequencelengths 3
101
| document_score
stringlengths 3
10
| document_rank
stringclasses 102
values |
---|---|---|---|---|---|---|
This method was generated by Abator for iBATIS. This method sets the value of the database column HBDW1.EP_TASK_STEP.DEVICE_TYPE | public void setDeviceType(String deviceType) {
this.deviceType = deviceType;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setDeviceType(com.sforce.soap._2006._04.metadata.DeviceType deviceType) {\r\n this.deviceType = deviceType;\r\n }",
"public String getDevice_type() {\r\n\t\treturn device_type;\r\n\t}",
"public String getDeviceType() {\n return deviceType;\n }",
"public com.sforce.soap._2006._04.metadata.DeviceType getDeviceType() {\r\n return deviceType;\r\n }",
"public short getDeviceType() {\r\n return deviceType;\r\n }",
"public void setDeviceType(String argDeviceType){\n\t argDeviceType=argDeviceType.toUpperCase();\n\t if(argDeviceType.equals(\"CISCO\"))\n\t deviceType=RouterType.CISCO;\n\t else\n\t\t deviceType=RouterType.JUNIPER;\n }",
"public final String getDeviceType(){\n return TYPE;\n }",
"public void setTaskType(int taskType) throws java.beans.PropertyVetoException {\n\t\tif (fieldTaskType != taskType) {\n\t\t\tint oldValue = fieldTaskType;\n\t\t\tfireVetoableChange(\"taskType\", new Integer(oldValue), new Integer(taskType));\n\t\t\tfieldTaskType = taskType;\n\t\t\tfirePropertyChange(\"taskType\", new Integer(oldValue), new Integer(taskType));\n\t\t}\n\t}",
"public DeviceOptionType getType();",
"@Override\n public String getDeviceTypeId() {\n \n return this.strTypId;\n }",
"public Optional<DeviceType> getDeviceType() throws IllegalArgumentException{\n this.deviceTypeDropDown.getValue();\n return DeviceType.typeOf(this.deviceTypeDropDown.getText());\n }",
"private static void doUserRequestedStepType(String stepType) {\n dvm.setStepType(stepType);\n dvm.executeProgram();\n //When focus returns back to the UI, print out the sourcecode again.\n displayXCode();\n }",
"@Override\n\tpublic List<String> getSensorType(String deviceType) {\n\t\treturn null;\n\t}",
"public FieldInstruction setFieldType(String type) {\n return setField(getFieldDeclarerName(), getFieldName(), type);\n }",
"public FieldInstruction setFieldType(Class type) {\n String name = null;\n if (type != null)\n name = type.getName();\n return setFieldType(name);\n }",
"public void setTimeStep(TimeStep timeStep) throws java.beans.PropertyVetoException {\n\t\t// Only here to ensure it is being used correctly.\n\t\t// cbit.util.Assertion.assertNotNull(timeStep);\n\t\tif (!Matchable.areEqual(timeStep, fieldTimeStep)) {\n\t\t\tTimeStep oldValue = fieldTimeStep;\n\t\t\tfireVetoableChange(PROPERTY_TIME_STEP, oldValue, timeStep);\n\t\t\tfieldTimeStep = timeStep;\n\t\t\tfirePropertyChange(PROPERTY_TIME_STEP, oldValue, timeStep);\n\t\t}\n\t}",
"public void setTYPE(String TYPE) {\n this.TYPE = TYPE;\n }",
"public void setFeatureType(gov.weather.graphical.xml.dwmlgen.schema.dwml_xsd.FeatureTypeType.Enum featureType)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(FEATURETYPE$4, 0);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(FEATURETYPE$4);\n }\n target.setEnumValue(featureType);\n }\n }",
"public FieldInstruction setFieldType(BCClass type) {\n String name = null;\n if (type != null)\n name = type.getName();\n return setFieldType(name);\n }",
"void setProductType(x0401.oecdStandardAuditFileTaxPT1.ProductTypeDocument.ProductType.Enum productType);",
"public void setFlowType(String flowType);",
"public SmartDevice getDevice(String type) {\n\t\treturn null;\n\t}",
"@Override\n\tpublic void setType(java.lang.String type) {\n\t\t_dlSyncEvent.setType(type);\n\t}",
"public void setFileSystemType(String fileSystemType) {\n this.fileSystemType = fileSystemType;\n }",
"public void setMachineType(com.flexnet.opsembedded.webservices.DeviceMachineTypeQueryType machineType) {\n this.machineType = machineType;\n }",
"public void setDeviceId(com.flexnet.opsembedded.webservices.SimpleQueryType deviceId) {\n this.deviceId = deviceId;\n }",
"public void setType(int type)\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(TYPE$2);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(TYPE$2);\n }\n target.setIntValue(type);\n }\n }",
"public com.google.protobuf.Empty setDevice(org.thethingsnetwork.management.proto.HandlerOuterClass.Device request);",
"final public void setType(String type)\n {\n setProperty(TYPE_KEY, (type));\n }",
"public void set_type(String t)\n {\n type =t;\n }",
"public void setActiveHelperData(HelperDataType dataType);",
"public boolean isDeviceTypeFieldPresent() {\r\n\t\treturn isElementPresent(addVehiclesHeader.replace(\"Add Vehicle\", \"Select Device Type\"), SHORTWAIT);\r\n\t}",
"void setType(gov.nih.nlm.ncbi.www.MedlineSiDocument.MedlineSi.Type type);",
"public void setDriveType(DriveType driveType) {\n this.driveType = driveType;\n }",
"DeviceClass getDeviceClass();",
"public void setType(short type){\n\t\tthis.type = type;\n\t}",
"void setDataType(int type );",
"public void setDebtType(ch.crif_online.www.webservices.crifsoapservice.v1_00.DebtType.Enum debtType)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(DEBTTYPE$10, 0);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(DEBTTYPE$10);\n }\n target.setEnumValue(debtType);\n }\n }",
"protected void setType(String requiredType){\r\n type = requiredType;\r\n }",
"public void setType (String typ) {\n type = typ;\n }",
"public static void setHALRuntimeType(int type) {\n SimulatorJNI.setRuntimeType(type);\n }",
"public void setType(String type);",
"public void setType(String type);",
"public void setType(String type);",
"abstract protected void setDeviceName(String deviceName);",
"public void setProcessstep(ItemI v) throws Exception{\n\t\t_Processstep =null;\n\t\ttry{\n\t\t\tif (v instanceof XFTItem)\n\t\t\t{\n\t\t\t\tgetItem().setChild(SCHEMA_ELEMENT_NAME + \"/processStep\",v,true);\n\t\t\t}else{\n\t\t\t\tgetItem().setChild(SCHEMA_ELEMENT_NAME + \"/processStep\",v.getItem(),true);\n\t\t\t}\n\t\t} catch (Exception e1) {logger.error(e1);throw e1;}\n\t}",
"public void setType(String value) {\n this.type = value;\n }",
"public void setType( int type ) {\r\n typ = type;\r\n }",
"public void setType(String t) {\n\ttype = t;\n }",
"public void setType(String type) {\r\n\t\tthis.productType = type;\r\n\t}",
"public void setType(int t){\n this.type = t;\n }",
"@Override\n\tpublic void setType(int type) {\n\t\t_dmGtStatus.setType(type);\n\t}",
"public void setType(String type) {\r\n this.type = type.trim();\r\n }",
"public void setStepStart(FieldODEStateAndDerivative<T> stepStart2) {\r\n this.stepStart = stepStart2;\r\n }",
"public void setType(String type) {\n this.type = type;\n }",
"void setClassType(String classType);",
"public void setType(int t) {\r\n\t\ttype = t;\r\n\t}",
"void setType(java.lang.String type);",
"void setType(String type) {\n this.type = type;\n }",
"public void setType(String type) \n {\n this.type = type;\n }",
"public void setClassType(String classType) {\n\t\t\t\n\t\t\tfor(E_ClassType c : E_ClassType.values())\n\t\t\t{\n\t\t\t\tif(c.toString().equals(classType))\n\t\t\t\t{\n\t\t\t\t\tthis.classType = E_ClassType.valueOf(classType);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.classType = E_ClassType.Tourists;\n\t\t\t\n\t\t}",
"public String deviceType(){\n String deviceType;\n size = driver.manage().window().getSize();\n if((size.getHeight()>800)&&(size.getWidth()>500)){\n return deviceType = \"iPad\";\n } else {\n return deviceType = \"iPhone\";\n }\n }",
"public void setStep(int step)\n {\n this.step = step;\n this.stepSpecified = true;\n }",
"public void setType(String type){\n \tthis.type = type;\n }",
"public void setStep(double step) {\n\t\tthis.step = step;\n\t}",
"public void setType(String type) {\r\n this.type = type;\r\n }",
"public void setStepSize(T stepSize2) {\r\n this.stepSize = stepSize2;\r\n }",
"public void setType(Byte type) {\n this.type = type;\n }",
"public void setType(Byte type) {\n this.type = type;\n }",
"public void setType(Byte type) {\n this.type = type;\n }",
"public void setType(Byte type) {\n this.type = type;\n }",
"public void setType(Byte type) {\n this.type = type;\n }",
"public void setType(Byte type) {\n this.type = type;\n }",
"public void setProductType(String newProductType){\n productRelation.setProductTypeSpecification(newProductType);\n }",
"public void setType(String type){\n this.type = type;\n }",
"public void xsetType(org.apache.xmlbeans.XmlInt type)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlInt target = null;\n target = (org.apache.xmlbeans.XmlInt)get_store().find_attribute_user(TYPE$2);\n if (target == null)\n {\n target = (org.apache.xmlbeans.XmlInt)get_store().add_attribute_user(TYPE$2);\n }\n target.set(type);\n }\n }",
"public void setType(Byte type) {\n\t\tthis.type = type;\n\t}",
"public void setType(Type t) {\n type = t;\n }",
"public void setFileType(edu.umich.icpsr.ddi.FileTypeType fileType)\n {\n synchronized (monitor())\n {\n check_orphaned();\n edu.umich.icpsr.ddi.FileTypeType target = null;\n target = (edu.umich.icpsr.ddi.FileTypeType)get_store().find_element_user(FILETYPE$8, 0);\n if (target == null)\n {\n target = (edu.umich.icpsr.ddi.FileTypeType)get_store().add_element_user(FILETYPE$8);\n }\n target.set(fileType);\n }\n }",
"public void setType( String type )\n {\n this.type = type;\n }",
"public void setStep(int step) {\n\t\tthis.step = step;\n\t}",
"public void setType(type type) {\r\n\t\tthis.Type = type;\r\n\t}",
"public void setType(int type) {\n type_ = type;\n }",
"public void setType(String type) {\n this.type = type;\n }",
"public void setType(String type) {\n this.type = type;\n }",
"void xsetInstallmentType(org.apache.xmlbeans.XmlInteger installmentType);",
"public void setType(String val) {\n type = val;\n }",
"public void setType(int type) {\r\n this.type = type;\r\n }",
"public void setType(int type) {\r\n this.type = type;\r\n }",
"public void setFactType(FactType factType) {\r\n\t\tthis.factType = factType;\r\n\t}",
"public void setType(String t) {\n\t\tthis.type = t;\n\t}",
"public void setType(String type) {\r\n this.type = type;\r\n }",
"public void setType(String type) {\r\n this.type = type;\r\n }",
"public void setType(String type) {\r\n this.type = type;\r\n }",
"public void setType(String type) {\r\n this.type = type;\r\n }",
"public void setStep(int step) {\n this.step = step;\n }",
"public void setType(String type) {\n m_Type = type;\n }",
"public final void setType(String type){\n\t\tthis.type = type;\t\n\t}",
"void xsetProductType(x0401.oecdStandardAuditFileTaxPT1.ProductTypeDocument.ProductType productType);",
"public abstract void setSwitchType(String switchType);"
] | [
"0.6781715",
"0.5867084",
"0.5832732",
"0.5700322",
"0.5578186",
"0.5485166",
"0.5440626",
"0.52843004",
"0.52653015",
"0.52270275",
"0.5137665",
"0.5137505",
"0.4896131",
"0.4888178",
"0.48817226",
"0.4876523",
"0.48743343",
"0.48690724",
"0.48476106",
"0.48460874",
"0.4838137",
"0.4836148",
"0.48216587",
"0.48159897",
"0.4761525",
"0.47614706",
"0.47565207",
"0.47368523",
"0.472582",
"0.47142076",
"0.47131258",
"0.47084168",
"0.47063658",
"0.47039708",
"0.46967098",
"0.46880126",
"0.46744555",
"0.46738696",
"0.46695995",
"0.4665849",
"0.46627524",
"0.4656226",
"0.4656226",
"0.4656226",
"0.46435907",
"0.46377623",
"0.463533",
"0.4626957",
"0.46196654",
"0.461345",
"0.46133286",
"0.46115232",
"0.4609085",
"0.45833704",
"0.45778215",
"0.457737",
"0.45684612",
"0.45678085",
"0.45649907",
"0.45547056",
"0.45543572",
"0.45509192",
"0.4549179",
"0.45473167",
"0.45460066",
"0.45439124",
"0.4540651",
"0.45374447",
"0.45374447",
"0.45374447",
"0.45374447",
"0.45374447",
"0.45374447",
"0.45353302",
"0.45208442",
"0.45176336",
"0.45171362",
"0.45169312",
"0.45142505",
"0.45139793",
"0.45115647",
"0.45106062",
"0.45101762",
"0.45011446",
"0.45011446",
"0.450009",
"0.45000753",
"0.44953758",
"0.44953758",
"0.44943604",
"0.44924882",
"0.44905367",
"0.44905367",
"0.44905367",
"0.44905367",
"0.44897816",
"0.44893977",
"0.4484509",
"0.44816658",
"0.44761372"
] | 0.6530357 | 1 |
The handleMessage method takes in the message and processes the command based on what has been typed after the "/". This method first checks whether it is day or night as if it is night there is only one command accepted. | @Override
public void handleMessage(Message message, int origin) {
String text = message.messageText;
String remText = "";
String command = "";
if (text.indexOf(' ') < 0) {
remText = "";
command = message.messageText;
} else {
command = message.messageText.substring(0, text.indexOf(' '));
remText = text.substring(text.indexOf(' ') + 1);
}
if (!gameInProgress) {
if (command.equals("/ready")) { // no trailing text after /ready
if (!remText.isEmpty()) {
server.privateMessage("The command \"/ready\" cannnot have characters after it", origin);
} else {
ready(origin);
}
} else if (command.equals("/unready")) {
if (!remText.isEmpty()) {
server.privateMessage("The command \"/unready\" cannnot have characters after it", origin);
} else {
unready(origin);
}
} else if (command.equals("/start")) {// no trailing text after
// /start
if (!remText.isEmpty()) {
server.privateMessage("The command \"/start\" cannnot have characters after it", origin);
} else {
voteStart(origin);
}
} else {
server.privateMessage(message.messageText + " does not contain a valid command", origin);
}
} else {
if (day == true) {
if (command.equals("/elim")) { // space between /elim and player
// name, no trailing text after
// player name
if (remText.isEmpty() || remText.contains(" ")) {
server.privateMessage(
"The command \"/elim\" needs to be followed by a player's name with no spaces/characters thereafter",
origin);
} else {
elimDayVote(remText, origin);
}
} else if (command.equals("/save")) {
if (remText.isEmpty() || remText.contains(" ")) {
server.privateMessage(
"The command \"/save\" needs to be followed by a player's name with no spaces/characters thereafter",
origin);
} else {
saveVote(remText, origin);
}
} else if (command.equals("/night")) {
if (!remText.isEmpty()) {
server.privateMessage("The command \"/night\" cannnot have characters after it", origin);
} else {
voteNight(origin);
}
} else if (command.equals("/day")) {
if (!remText.isEmpty()) {
server.privateMessage("The command \"/day\" cannnot have characters after it", origin);
} else {
voteDay(origin);
}
} else {
server.privateMessage(message.messageText + " does not contain a valid command", origin);
}
} else {
if (command.equals("/elim")) {
if (remText.isEmpty() || remText.contains(" ")) {
server.privateMessage(
"The command \"/elim\" needs to be followed by a player's name with no spaces/characters thereafter",
origin);
} else {
elimNightVote(remText, origin);
}
} else {
server.privateMessage(
"The only valid command during the night is \"/elim\" followed a player's name (separated by a space)",
origin);
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void handleMessage(String message){\n\t\tString[] parts = message.split(\" \");\n\t\tboolean prevFor = false;\n//\t\tSystem.out.println(\"parts0 = \" + parts[0]);\n\t\tswitch(parts[0]){\n\t\t\tcase \"#quit\":\n\t\t\t\tclient.handleMessageFromClientUI(\"#quit\" + \"---\" + client.getUID() + \"---\" + \" \" + \"---\" + \" \");\n\t\t\t\tbreak;\n\t\t\tcase \"#stop\":\n\t\t\t\tclient.handleMessageFromClientUI(\"#stop\" + \"---\" + client.getUID() + \"---\" + \" \" + \"---\" + \" \");\n\t\t\t\tbreak;\n\t\t\tcase \"#close\":\n\t\t\t\tclient.handleMessageFromClientUI(\"#close\" + \"---\" + client.getUID() + \"---\" + \" \" + \"---\" + \" \");\n\t\t\t\tbreak;\n\t\t\tcase \"#setport\":\n\t\t\t\tclient.handleMessageFromClientUI(\"#setport\" + \"---\" + client.getUID() + \"---\" + \" \" + \"---\" + parts[1]);\n\t\t\t\tbreak;\n\t\t\tcase \"#getport\":\n\t\t\t\tclient.handleMessageFromClientUI(\"#getport\" + \"---\" + client.getUID() + \"---\" + \" \" + \"---\" + \" \");\n\t\t\t\tbreak;\n\t\t\tcase \"#start\":\n\t\t\t\tclient.handleMessageFromClientUI(\"#start\" + \"---\" + client.getUID() + \"---\" + \" \" + \"---\" + \" \");\n\t\t\t\tbreak;\n\t\t\tcase \"#block\":\n\t\t\t\tif(parts.length>1){\n\t\t\t\t\tclient.handleMessageFromClientUI(\"#block\" + \"---\" + client.getUID() + \"---\" + parts[1] + \"---\" + \" \");\t//this sends the info to the server to check if it's a valid user_id\n\t\t\t\t}\n\t\t\t\telse System.out.println(\"You haven't specified a user to block!\");\n\t\t\t\tbreak;\n\t\t\tcase \"#unblock\":\n\t\t\t\tif(parts.length>0){\n\t\t\t\t\tclient.handleMessageFromClientUI(\"#unblock\" + \"---\" + client.getUID() + \"---\" + parts[1] + \"---\" + \" \");\t//this sends the info to the server to check if it's a valid user_id\n\t\t\t\t\t\t\t//this also needs to be sent to server to send to all consoles to update block lists\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"#whoiblock\":\t\t//simply prints out the arraylist of users that i block\n\t\t\t\tif(blockedList.size()>0){\n\t\t\t\t\tSystem.out.print(\"The list of people you block is: \");\n\t\t\t\t\tfor(int i=0;i<blockedList.size();i++){\n\t\t\t\t\t\tSystem.out.print(blockedList.get(i)+\", \");\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}\n\t\t\t\telse System.out.println(\"You are not blocking any users\");\n\t\t\t\tbreak;\n\t\t\tcase \"#whoblocksme\":\t//simply prints out the arraylist of users that block me\n\t\t\t\tif(whoBlocksMe.size()>0){\n\t\t\t\t\tSystem.out.print(\"The list of people who block me is: \");\n\t\t\t\t\tfor(int i=0;i<whoBlocksMe.size();i++){\n\t\t\t\t\t\tSystem.out.print(whoBlocksMe.get(i)+\", \");\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}\n\t\t\t\telse System.out.println(\"There are no users that are blocking you\");\n\t\t\t\tbreak;\n\t\t\tcase \"#startforwarding\":\n\t\t\t\tprevFor = false;\n\t\t\t\ttry {\n\t\t\t\t\tif(whoIForward.size()>0) {\n\t\t\t\t\t\tfor(int i=0; i<whoIForward.size(); i++){\n\t\t\t\t\t\t\tif(parts[1].equals(whoIForward.get(i))) prevFor = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!prevFor) {\n\t\t\t\t\t\t\twhoIForward.add(parts[1]);\n\t\t\t\t\t\t\tSystem.out.println(\"You are now forwarding to user: \"+parts[1]);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse System.out.println(\"You are already forwarding to that user!\");\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\twhoIForward.add(parts[1]);\n\t\t\t\t\t\tSystem.out.println(\"You are now forwarding all messages to user: \"+parts[1]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch(ArrayIndexOutOfBoundsException e){\n\t\t\t\t\tSystem.out.println(\"You need to specify a user to forward to!\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"cancelforwarding\":\n\t\t\t\tprevFor = false;\n\t\t\t\ttry {\n\t\t\t\t\tif(whoIForward.size()>0){\n\t\t\t\t\t\tfor(int i=0; i<whoIForward.size(); i++){\n\t\t\t\t\t\t\tif(parts[1].equals(whoIForward.get(i))){\n\t\t\t\t\t\t\t\tprevFor = true;\n\t\t\t\t\t\t\t\twhoIForward.remove(i);\n\t\t\t\t\t\t\t\tSystem.out.println(\"You are no longer forwarding to user: \"+parts[1]);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!prevFor){\n\t\t\t\t\t\t\tSystem.out.println(\"You were not forwarding to that user!\");\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 System.out.println(\"You are not currently forwarding to anyone and connot stop forwarding to this user\");\n\t\t\t\t}\n\t\t\t\tcatch(ArrayIndexOutOfBoundsException e){\n\t\t\t\t\tSystem.out.println(\"You need to specify a user to stop forwarding to!\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"#private\":\n\t\t\t\tString[] messageArray = Arrays.copyOfRange(parts, 2, parts.length);\n\t\t\t\tStringBuilder builder = new StringBuilder();\n\t\t\t\tfor (String value : messageArray) {\n\t\t\t\t builder.append(value + \" \");\n\t\t\t\t}\n\t\t\t\tString messageToSend = builder.toString();\n\t\t\t\tclient.handleMessageFromClientUI(\"#private\" + \"---\" + client.getUID() + \"---\" + parts[1] + \"---\" + messageToSend);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault: client.handleMessageFromClientUI(\" \" + \"---\" + client.getUID() + \"---\" + \"*\" + \"---\" + message);\n\t\t}\n\t}",
"@Override\r\n public void onMessage(MessageEvent message) {\r\n String newMessage = message.getMessage();\r\n String response;\r\n\r\n //split the message on spaces to identify the command\r\n String[] messageArray = newMessage.split(\" \");\r\n \r\n switch (messageArray[0]) {\r\n case \"!command\":\r\n if (message.getChannel().getOps().contains(message.getUser())) {\r\n if (messageArray.length == 2) {\r\n if (messageArray[1].equals(\"off\")) {\r\n commandsActive = false;\r\n } \r\n if (messageArray[1].equals(\"on\")) {\r\n commandsActive = true;\r\n }\r\n }\r\n }\r\n break;\r\n //command to make a custom command for the bot\r\n case \"!addcom\":\r\n if (commandsActive) {\r\n if (message.getChannel().getOps().contains(message.getUser())) {\r\n response = addCom(messageArray, message.getChannel().getName());\r\n message.getChannel().send().message(response);\r\n } \r\n else {\r\n message.respond(\"You are not allowed to add commands.\");\r\n }\r\n }\r\n break;\r\n case \"!commands\":\r\n if (commandsActive) {\r\n if (messageArray.length ==1) {\r\n ArrayList<String> commands = manager.getCommands(message.getChannel().getName());\r\n String commandList = \"The custom commands available to everyone for this channel are: \";\r\n while (!commands.isEmpty()) {\r\n commandList += commands.remove(0) + \", \";\r\n }\r\n message.getChannel().send().message(commandList);\r\n }\r\n }\r\n break;\r\n //command to delete a custom command from the bot\r\n case \"!delcom\":\r\n if (commandsActive) {\r\n if (message.getChannel().getOps().contains(message.getUser())) {\r\n response = delCom(messageArray[1], message.getChannel().getName());\r\n message.getChannel().send().message(response);\r\n } \r\n else {\r\n message.respond(\"You are not allowed to remove commands.\");\r\n }\r\n }\r\n break;\r\n //command to edit a custom command the bot has\r\n case \"!editcom\":\r\n if (commandsActive) {\r\n if (message.getChannel().getOps().contains(message.getUser())) {\r\n response = editCom(messageArray, message.getChannel().getName());\r\n message.getChannel().send().message(response);\r\n } \r\n else {\r\n message.respond(\"You are not allowed to edit commands.\");\r\n }\r\n }\r\n break;\r\n\r\n //default message handling for custom commands\r\n default:\r\n if (commandsActive) {\r\n if (message.getMessage().startsWith(\"!\") && !messageArray[0].equals(\"!permit\")&& !messageArray[0].equals(\"!spam\")) {\r\n customCommands(message);\r\n }\r\n }\r\n break;\r\n }\r\n }",
"@Override\r\n\tpublic void onMessageCreate(MessageCreateEvent event) {\n\t\tif (event.getMessageContent().startsWith(\"!\") && event.getChannel().getId() == 310560101352210432L) {\r\n\t\t\t// remove prefix from string and anything after\r\n\t\t\tString command = event.getMessageContent().substring(1).split(\" \")[0].toLowerCase();\r\n\t\t\t// check if original command name\r\n\t\t\tif (commands.containsKey(command))\r\n\t\t\t\tcommands.get(command).process(event);\r\n\t\t\t// check if alternative name for command\r\n\t\t\telse if (commandAlternative.containsKey(command))\r\n\t\t\t\tcommands.get(commandAlternative.get(command)).process(event);\r\n\r\n\t\t\tlogger.info(event.getMessageAuthor().getDiscriminatedName() + \" invoked: \" + command);\r\n\t\t}\r\n\r\n\t}",
"@Override\n public void onMessageReceived(@NotNull MessageReceivedEvent event) {\n String message = event.getMessage().getContentRaw().toLowerCase();\n Commands commands = Main.getBOT().getCommands();\n\n // When message is intended for bob, check it\n if (message.startsWith(\"!bob\")) {\n commands.evaluateCommand(message.replace(\"!bob \", \"\"), event);\n } else if (message.contains(\"#blamekall\")) {\n event.getChannel().sendMessage(\"NO! BE NICE! GO TO NAUGHTY JAIL!\").queue();\n event.getChannel().sendMessage(\"https://tenor.com/view/bonk-gif-18805247\").queue();\n }\n\n }",
"private void HandleMessage(Message message)\n\t{\n\t\tswitch (message.messageType) {\n\t\tcase disconnect: ApplicationManager.Instance().Disconnect();\n\t\t\tbreak;\n\t\tcase log: PrintLogMessageOnTextChat((String)message.message);\n\t\t\tbreak;\n\t\tcase message: PrintMessageOnTextChat((MessageWithTime)message.message);\n\t\t\tbreak;\n\t\tcase UserJoinChannel: UserJoinChannel((ClientData)message.message);\n\t\t\tbreak;\n\t\tcase UserDisconnectChannel: UserDisconnectChannel((ClientData)message.message);\n\t\t\tbreak;\n\t\tcase changeChannel: OnChannelChanged((ChannelData)message.message);\n\t\t\tbreak;\n\t\tcase serverData: data = (ServerData) message.message; \n\t\t\t\t\t\t ApplicationManager.channelsList.DrawChannels(data);\n\t\t\t\tbreak;\n\t\tcase channelInfo: clientsData = (ClientsOnChannelData)message.message;\n\t\t\t\t\t\t ApplicationManager.informationsList.ShowInfo(clientsData);\n\t\t \t\tbreak;\n\t\tcase sendMessageToUser: ApplicationManager.textChat.write((MessageToUser)message.message);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t}",
"public void processMessage()\n {\n \tif(messageContents.getMessage().containsCommand())\n {\n \tCommand command = new Command(messageContents);\n CommandProcessor commandProcessor = new CommandProcessor(joeBot, command);\n commandProcessor.processCommand();\n }\n else\n {\n Speech speech = new Speech(messageContents);\n SpeechProcessor speechProcessor = new SpeechProcessor(joeBot, speech);\n speechProcessor.processSpeech();\n }\n }",
"public void processCommand(String command, MessageReceivedEvent event){\n command = command.toLowerCase();\n String[] parsing = command.split(\" \");\n switch(parsing[1]){\n case \"new\":\n validateNewCraftEntry(parsing, event);\n break;\n case \"list\":\n generateCraftingList(event);\n break;\n case \"help\":\n showHelp(event);\n break;\n case \"listall\":\n listall(event);\n break;\n case \"cancel\":\n cancelCraft(event);\n break;\n }\n }",
"@Override\n\tpublic void processMessage(MessageForm message)\n\t{\n\t\tswitch (message.code())\n\t\t{\n\t\tcase Mc.start:\n\t\t\tprocessStart(message);\n\t\tbreak;\n\n\t\tcase Mc.nastupTerm2Hotovy:\n\t\t\tprocessNastupTerm2Hotovy(message);\n\t\tbreak;\n\n\t\tdefault:\n\t\t\tprocessDefault(message);\n\t\tbreak;\n\t\t}\n\t}",
"private void handleMessage(EcologyMessage msg) {\n // Check the message type and route them accordingly.\n switch ((Integer) msg.fetchArgument()) {\n // A message destined for a room\n case ROOM_MESSAGE_ID:\n forwardRoomMessage(msg);\n break;\n\n // A message destined for ecology data sync\n case SYNC_DATA_MESSAGE_ID:\n getEcologyDataSync().onMessage(msg);\n break;\n }\n }",
"@Override\n public void onMessageReceived(MessageReceivedEvent event) {\n if(event.getAuthor().isBot())\n return;\n\n Message msg = event.getMessage();\n String content = msg.getContentRaw();\n\n if(content.charAt(0) == PREFIX) {\n handleCommand(msg, content.substring(1));\n }\n }",
"protected void handleMessage(Message msg) {}",
"public void handleMessage(Message message);",
"@Override\n\t\tpublic void handleMessage(Message msg) {\n\t\t\tsuper.handleMessage(msg);\n\t\t\tisExit = false;\n\t\t}",
"@OnMessage\n\tpublic void handleMessage(String message, Session session) {\n\t\tSystem.out.println(\"Received: \" + message);\n\n\t\ttry{\n\t\t\t// We always expect a single json object - all our commands are routed in via this mechanism, with each command having a different root json object name\n\t\t\tJsonReader jsonReader = Json.createReader(new StringReader(message));\n\t\t\tJsonObject o = jsonReader.readObject();\n\t\t\t\n\t\t\t// Every command should have an auth value on it...\n\t\t\tString auth = o.getString(\"auth\");\n\t\t\t//System.out.println(\"Auth is \" + auth);\n\t\t\tif (!sessionHandler.validAccounts.contains(auth))\n\t\t\t{\n\t\t\t\tsession.getBasicRemote().sendText(\"{\\\"noauth\\\":true}\");\n\t\t\t\tthrow new Exception(\"Invalid auth\");\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t// See what command the client has sent me - the name of the object denotes the command\n\t\t\tJsonObject console = o.getJsonObject(\"console\");\n\t\t\tif (null != console)\n\t\t\t{\n\t\t\t\tConsoleInfo ci = new ConsoleInfo();\n\t\t\t\tci.name = console.getString(\"name\");\n\t\t\t\tsessionHandler.addConsoleInfo(session, ci);\n\t\t\t}\t\t\t\n\t\t\tJsonObject reset = o.getJsonObject(\"reset\");\n\t\t\tif (null != reset)\n\t\t\t{\n\t\t\t\tif (reset.getString(\"type\").equals(\"full\"))\n\t\t\t\t{\n\t\t\t\t\t// Clear out the registered devices\n\t\t\t\t\tDevices.d.removeAll();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tDevices.d.remove(reset.getString(\"number\"));\n\t\t\t\t}\n\t\t\t}\n\t\t\tJsonObject deleteaudio = o.getJsonObject(\"deleteaudio\");\n\t\t\tif (null != deleteaudio)\n\t\t\t{\n\t\t\t\t// remove this audio\n\t\t\t\tAudios.a.remove(deleteaudio.getString(\"name\"));\n\t\t\t}\n\t\t\tJsonObject addaudiofolder = o.getJsonObject(\"addfolder\");\n\t\t\tif (null != addaudiofolder)\n\t\t\t{\n\t\t\t\t// Create a folder on disk\n\t\t String folder = addaudiofolder.getString(\"folder\");\n\t\t String newName = addaudiofolder.getString(\"name\");\n\t\t File uploads = new File(Settings.s.uploadDiskPath + \"/\" + (folder.length()==0?\"\" : folder + \"/\") + newName);\n\t\t // Prevent traversals\n\t\t if (!uploads.getParentFile().toPath().startsWith(new File(Settings.s.uploadDiskPath).toPath()))\n\t\t {\n\t\t \t// Naughty!\n\t\t \tthrow new ServletException(\"Cannot save to \" + uploads.getParentFile().toPath()); \t\n\t\t }\n\t\t // Create the folder if necessary\n\t\t if (!uploads.exists())\n\t\t {\n\t\t \tuploads.mkdirs();\n\t\t }\n\t\t // And tell everyone about it...\n\t\t\t\tAudios.a.add(uploads.toString(), newName, folder, true);\n\t\t\t}\n\t\t\tJsonObject playaudio = o.getJsonObject(\"playaudio\");\n\t\t\tif (null != playaudio)\n\t\t\t{\n\t\t\t\t// Play this audio to the listed devices\n\t\t\t\tString audio = playaudio.getString(\"audio\");\n\t\t\t\tJsonArray devices = playaudio.getJsonArray(\"devices\");\n\t\t\t\tAudio a = Audios.a.get(audio);\n\t\t\t\tif (null != a)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t// TODO - pass the array to Plivo instead of looping here, as I think the play API can take an array...\n\t\t\t\t\tfor (JsonValue device : devices)\n\t\t\t\t\t{\n\t\t\t\t\t\tDevice d = Devices.d.get(device.toString());\n\t\t\t\t\t\t// Is this a folder? If so, pick a random child audio, preferring one that this device has not had\n\t\t\t\t\t\tif (a.isFolder)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ta = Audios.a.getRandomChild(a, d);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// We should be able to handle ringing calls here\n\t\t\t\t\t\tif (null != d)\n\t\t\t\t\t\t\td.MakeCall(a);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tJsonObject patch = o.getJsonObject(\"patch\");\n\t\t\tif (null != patch)\n\t\t\t{\n\t\t\t\t// Connect this active device to an idle device, or connect 2 idle devices together\n\t\t\t\tJsonArray devices = patch.getJsonArray(\"devices\");\n\t\t\t\tDevices.patch(devices.get(0).toString(), devices.get(1).toString());\n\t\t\t}\n\t\t\t\n\t\t\tJsonObject playtext = o.getJsonObject(\"playtext\");\n\t\t\tif (null != playtext)\n\t\t\t{\n\t\t\t\t// As playAudio, but for sms - and the text can be edited in the console and not saved...\n\t\t\t\tString text = playtext.getString(\"text\");\n\t\t\t\tString activetext = playtext.getString(\"activetext\");\n\t\t\t\tText atext = Texts.t.get(activetext);\n\t\t\t\tJsonArray devices = playtext.getJsonArray(\"devices\");\n\t\t\t\tif (!text.isEmpty())\n\t\t\t\t{\n\t\t\t\t\tfor (JsonValue device : devices)\n\t\t\t\t\t{\n\t\t\t\t\t\tDevice d = Devices.d.get(device.toString());\n\t\t\t\t\t\tif (null != d)\n\t\t\t\t\t\t\td.Sms(text, atext);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tJsonObject ignore = o.getJsonObject(\"ignore\");\n\t\t\tif (null != ignore)\n\t\t\t{\n\t\t\t\tJsonArray devices = ignore.getJsonArray(\"devices\");\n\t\t\t\tfor (JsonValue device : devices)\n\t\t\t\t{\n\t\t\t\t\tDevices.hangup(device.toString(),\"failed\",\"Request from console\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tJsonObject deletetext = o.getJsonObject(\"deletetext\");\n\t\t\tif (null != deletetext)\n\t\t\t{\n\t\t\t\tTexts.t.remove(deletetext.getString(\"name\"));\n\t\t\t}\n\t\t\t\n\t\t\tJsonObject savetext = o.getJsonObject(\"savetext\");\n\t\t\tif (null != savetext)\n\t\t\t{\n\t\t\t\tTexts.t.add(savetext.getString(\"label\"),savetext.getString(\"name\"));\n\t\t\t}\n\t\t\t\n\t\t\tJsonObject updatestatus = o.getJsonObject(\"updatestatus\");\n\t\t\tif (null != updatestatus)\n\t\t\t{\n\t\t\t\tDevices.updateStatus();\n\t\t\t}\n\t\t\tJsonObject savedevice = o.getJsonObject(\"savedevice\");\n\t\t\tif (null != savedevice)\n\t\t\t{\n\t\t\t\tDevices.updateName(savedevice.getString(\"number\"), savedevice.getString(\"name\"));\n\t\t\t}\n\t\t\tJsonObject saveprogress = o.getJsonObject(\"saveprogress\");\n\t\t\tif (null != saveprogress)\n\t\t\t{\n\t\t\t\tDevices.updateProgress(saveprogress.getString(\"number\"), saveprogress.getString(\"progress\"));\n\t\t\t}\n\n\t\t\t\n\t\t\tJsonObject setmessagesread = o.getJsonObject(\"setmessagesread\");\n\t\t\tif (null != setmessagesread)\n\t\t\t{\n\t\t\t\tDevices.setMessagesRead(setmessagesread.getString(\"number\"));\n\t\t\t}\n\t\t\tJsonObject savegoal = o.getJsonObject(\"savegoal\");\n\t\t\tif (null != savegoal)\n\t\t\t{\n\t\t\t\tGoals.add(savegoal);\n\t\t\t}\n\t\t\tJsonObject deletegoal = o.getJsonObject(\"deletegoal\");\n\t\t\tif (null != deletegoal)\n\t\t\t{\n\t\t\t\tGoals.remove(deletegoal.getString(\"name\"));\n\t\t\t}\n\t\t\tJsonObject uncue = o.getJsonObject(\"uncue\");\n\t\t\tif (null != uncue)\n\t\t\t{\n\t\t\t\tDevices.uncue(uncue.getString(\"number\"));\n\t\t\t}\n\t\t\tJsonObject register = o.getJsonObject(\"register\");\n\t\t\tif (null != register)\n\t\t\t{\n\t\t\t\tDevices.d.add(register.getString(\"number\"),\"console\");\n\t\t\t}\n\t\t\t\n\t\t\t// IVR commands from the console\t\t\t\n\t\t\tJsonObject saveivrstep = o.getJsonObject(\"saveivrstep\");\n\t\t\tif (null != saveivrstep)\n\t\t\t{\n\t\t\t\tIvrSteps.i.add(saveivrstep).saveToDisk();\n\t\t\t}\n\t\t\tJsonObject deleteivrstep = o.getJsonObject(\"deleteivrstep\");\n\t\t\tif (null != deleteivrstep)\n\t\t\t{\n\t\t\t\tIvrSteps.i.remove(deleteivrstep.getString(\"name\"));\n\t\t\t}\n\t\t\t// System-wide settings\n\t\t\tJsonObject setting = o.getJsonObject(\"setting\");\n\t\t\tif (null != setting)\n\t\t\t{\n\t\t\t\tSwitchboard.s.parseJson(setting);\n\t\t\t\tSwitchboard.s.persist();\n\t\t\t\t\n\t\t\t\t// Tell everyone about this...\n\t\t\t\tsessionHandler.Broadcast(o);\n\t\t\t\t\n\t\t\t\t// And do any heartbeat changes that I need\n\t\t\t\tSwitchboard.s.setupHeartbeat(true);\n\t\t\t}\n\t\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tSystem.out.println(\"Failed to parse \" + message + \" with error \" + e.getMessage());\n\t\t}\n\t}",
"@Override\n public void dealWithCommand(MessageReceivedEvent event) {\n List<String> contentSplit = new ArrayList<>(Arrays.asList(event.getMessage().getContentStripped().split(\" \")));\n\n // remove the command part of the message\n contentSplit.remove(0);\n boolean isXpDesired = DetermineArguments.determineIsXpDesired(contentSplit);\n boolean isCollection = DetermineArguments.determineIsCollection(contentSplit);\n long timeToSpend = DetermineArguments.determineTimeToSpend(contentSplit, event.getTextChannel());\n int classLevel = DetermineArguments.determineClassLevel(contentSplit, event.getTextChannel());\n long amountDesired = DetermineArguments.determineAmountDesired(contentSplit, event.getTextChannel());\n\n // be done if something bad was found\n if (timeToSpend == -2 || classLevel == -2 || amountDesired == -2)\n return;\n\n if (contentSplit.isEmpty()) {\n // user did not specify what player they want\n event.getChannel().sendMessage(\"Specify what player you want to analyze.\").queue();\n return;\n }\n String username = contentSplit.get(0);\n WynncraftPlayer player = GetPlayerStats.get(username);\n if (player == null) {\n event.getChannel().sendMessage(\"Either the api is down, or '\" + username + \"' is not a player.\").queue();\n return;\n }\n\n // tell the user we're working on the answer\n event.getMessage().addReaction(\"\\uD83D\\uDEE0\").queue();\n\n List<String> classNames = new ArrayList<>();\n for (WynncraftClass playerClass : player.classes) {\n classNames.add(playerClass.name);\n }\n ChoiceArguments choiceArguments = new ChoiceArguments(\n isXpDesired, isCollection, timeToSpend, amountDesired, classLevel, classNames, player, true);\n\n\n long xpDesiredGivenPerc = 0;\n long emeraldDesiredGivenPerc = 0;\n for (WynncraftClass wynncraftClass : player.classes)\n for (Quest quest : wynncraftClass.questsNotCompleted) {\n if (quest.levelMinimum <= (classLevel == -1 ? wynncraftClass.combatLevel : classLevel)) {\n xpDesiredGivenPerc += quest.xp;\n emeraldDesiredGivenPerc += quest.emerald;\n }\n }\n xpDesiredGivenPerc *= GetAnswers.DEFAULT_PERCENTAGE_AMOUNT;\n emeraldDesiredGivenPerc *= GetAnswers.DEFAULT_PERCENTAGE_AMOUNT;\n\n FinalQuestOptionsAll finalQuestOptionsAll = GetAnswers.getAllFullAnswers(player, choiceArguments);\n String spreadsheetId = SheetsWrite.writeSheet(finalQuestOptionsAll, event.getAuthor().getIdLong(), player.name, true);\n if (spreadsheetId == null) return;\n new QuestRecommendationMessagePlayer(spreadsheetId, finalQuestOptionsAll, event.getChannel(), choiceArguments, xpDesiredGivenPerc, emeraldDesiredGivenPerc);\n\n event.getMessage().removeReaction(\"\\uD83D\\uDEE0\", DiscordBot.client.getSelfUser()).queue();\n }",
"private boolean handlePlayerChat(Player player, String message, PlayerEvent event)\n\t{\n\t\t//FEATURE: automatically educate players about claiming land\n\t\t//watching for message format how*claim*, and will send a link to the basics video\n\t\tif(this.howToClaimPattern == null)\n\t\t{\n\t\t\tthis.howToClaimPattern = Pattern.compile(this.dataStore.getMessage(Messages.HowToClaimRegex), Pattern.CASE_INSENSITIVE);\n\t\t}\n\n\t\tif(this.howToClaimPattern.matcher(message).matches())\n\t\t{\n\t\t\tinstance.sendMessage(player, TextMode.Info, Messages.SurvivalBasicsVideo2, 10L, DataStore.SURVIVAL_VIDEO_URL);\n\t\t}\n\t\t\n\t\t//FEATURE: automatically educate players about the /trapped command\n\t\t//check for \"trapped\" or \"stuck\" to educate players about the /trapped command\n\t\tString trappedwords = this.dataStore.getMessage(\n\t\t Messages.TrappedChatKeyword\n\t\t);\n\t\tif (!trappedwords.isEmpty()) {\n\t\t String[] checkWords = trappedwords.split(\";\");\n\n\t\t for (String checkWord : checkWords) {\n\t\t\tif (!message.contains(\"/trapped\")\n\t\t\t && message.contains(checkWord))\n\t\t\t{\n\t\t\t instance.sendMessage(\n\t\t\t\t player,\n\t\t\t\t TextMode.Info, \n\t\t\t\t Messages.TrappedInstructions,\n\t\t\t\t 10L\n\t\t\t );\n\t\t\t break;\n\t\t\t}\n\t\t }\n\t\t}\n\n return false;\n\t}",
"public boolean handleMessage(Message message)\n {\n return false;\n }",
"private void handleCommand(Message msg, String commands) {\n String[] tokens = commands.split(\" \");\n String command = tokens[0];\n\n switch(command) {\n case \"query\":\n queryProblems(msg, tokens);\n break;\n case \"help\":\n printHelpMessage(msg, tokens);\n break;\n default:\n // Implement more commands later\n break;\n }\n }",
"@Override\n public void processMessage(MessageForm message) {\n switch (message.code()) {\n case Mc.start:\n processStart(message);\n break;\n\n default:\n processDefault(message);\n break;\n }\n }",
"private void messageHandler(String read){\n\n try {\n buffer.append(read);\n }catch (MalformedMessageException e){\n System.out.println(\"[CLIENT] The message received is not in XML format.\");\n }\n\n while(!buffer.isEmpty()) {\n if (buffer.getPong()) pong = true;\n else if (buffer.getPing()) send(\"<pong/>\");\n else {\n try {\n clientController.onReceivedMessage(buffer.get());\n } catch (EmptyBufferException e) {\n System.out.println(\"[CLIENT] The buffer is empty!\");\n }\n }\n }\n\n }",
"public void handleMessage(String message) {\n\t\tinternalHandleMessage(message);\n\t}",
"@Override\n public void onGuildMessageReceived(@NotNull GuildMessageReceivedEvent event) {\n if (event.getAuthor().isBot()) { // ignore other bots and ourselves too\n return;\n }\n\n String[] args = event.getMessage().getContentRaw().split(\"\\\\s+\");\n\n if (args[0].startsWith(CommandHandler.prefix)) { // Check if prefix is correct\n Molly.logger.info(\"User \" + event.getAuthor().getName() + \" tried to invoke \" + args[0].substring(1).toLowerCase());\n switch (args[0].substring(1).toLowerCase()) {\n case \"info\":\n new Info(args, event).run();\n break;\n case \"summon\":\n new Summon(args, event).run();\n break;\n case \"ping\":\n new Pong(args, event).run();\n break;\n case \"sad\":\n new Sad(args, event).run();\n break;\n case \"annoy\":\n new Annoy(args, event).run();\n break;\n case \"say\":\n new Say(args, event).run();\n break;\n default:\n event.getChannel().sendMessage(\"I don't know this command. Type ** \" + CommandHandler.prefix + \"info** for a list of all commands.\").queue();\n }\n }\n }",
"@Override\n\t\tpublic void handleMessage(Message msg) {\n\t\t\tsuper.handleMessage(msg);\n\t\t\tswitch (msg.what) {\n\t\t\tcase 911:\n\t\t\t\tqueryMsg();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}",
"private void processMessage( String message )\n {\n displayMessage( \"Got message \\\"\" + message + \"\\\"\\n\" );\n if( message.equals( Gaming.ENTER_DENIED /*\"ENTER_DENIED\"*/ ) ) {\n JOptionPane.showMessageDialog( this, \"Error connecting to server\",\n Language.CAPTION_ERROR, JOptionPane.PLAIN_MESSAGE );\n stopClient();\n } else if( message.equals( Gaming.MAP /*\"MAP\"*/ ) ) {\n String map_size_string = input.nextLine();\n int map_size = Integer.parseInt( map_size_string );\n displayMessage( String.format( \"map size: %d\\n\", map_size ) );\n map = new Map( map_size );\n mapPanel.setMap( map );\n repaint();\n } else if( message.equals( Gaming.PLAYER /*\"PLAYER\"*/ ) ) {\n myMark = input.nextLine();\n displayMessage( \"myMark param = \" + myMark + \"\\n\" );\n SwingUtilities.invokeLater(\n new Runnable()\n {\n public void run()\n {\n // display player's mark\n idField.setText( Language.MESSAGE_PLAYER +\n \" \\\"\" + myMark + \"\\\"\" );\n } // end method run\n } // end anonymous inner class\n ); // end call to SwingUtilities.invokeLater\n } // end if\n else if( message.equals( Gaming.TURN /*\"TURN\"*/ ) )\n {\n myTurn = true;\n turnLabel.setText( Language.MESSAGE_TURN );\n } // end if\n else if( message.equals( Gaming.VALID_MOVE /*\"Valid move.\"*/ ) )\n {\n displayMessage( \"Valid move, please wait.\\n\" );\n map.setMark( currentLocation, myMark );\n mapPanel.repaint();\n turnLabel.setText( Language.MESSAGE_WAIT );\n } // end else if\n else if( message.equals( Gaming.INVALID_MOVE /*\"Invalid move, try again\"*/ ) )\n {\n displayMessage( message + \"\\n\" ); // display invalid move\n myTurn = true; // still this client's turn\n } // end else if\n else if( message.equals( Gaming.OPPONENT_MOVED /*\"Opponent moved\"*/ ) )\n {\n int location = input.nextInt(); // get move location\n input.nextLine(); // skip newline after int location\n map.setMark( location,\n ( myMark.equals( X_MARK ) ? O_MARK : X_MARK ) );\n mapPanel.repaint();\n displayMessage( \"Opponent moved. You turn.\\n\" );\n myTurn = true; // now this client's turn\n turnLabel.setText( Language.MESSAGE_TURN );\n } // end else if\n else if( message.equals( Gaming.GAMEOVER /*\"Game over\"*/ ) ) {\n myTurn = false;\n turnLabel.setText( \"\" );\n //gameover = true;\n String result = input.nextLine();\n if( result.equals( \"WINNER\" ) ) {\n result = Language.MESSAGE_WON;\n } else if( result.equals( \"LOSER\" ) ) {\n result = Language.MESSAGE_LOSE;\n } else {\n result = Language.MESSAGE_DRAW;\n }\n displayMessage( \"Game over. \" + result + \"\\n\" );\n JOptionPane.showMessageDialog( this, result,\n Language.CAPTION_GAMEOVER, JOptionPane.PLAIN_MESSAGE );\n } // end else if\n else if( message.equals( Gaming.CROSSOUT /*\"CROSSOUT\"*/ ) ) {\n int type = input.nextInt(); input.nextLine();\n int number = input.nextInt(); input.nextLine();\n mapPanel.setCrossed( type, number );\n mapPanel.repaint();\n } // end else if\n else if( message.equals( Gaming.REPLAY /*\"REPLAY\"*/ ) ) {\n displayMessage( \"Replay confirmed\\n\" );\n output.format( Gaming.REPLAY_CONFIRMED /*\"REPLAYCONFIRMED\"*/ + \"\\n\" );\n output.flush();\n } else if(message.equals( Gaming.REPLAY_CONFIRMED /*\"REPLAYCONFIRMED\"*/ ) ) {\n map.clear();\n mapPanel.setCrossed( TicTacToeServer.CROSS_NOTHING, 0 );\n mapPanel.repaint();\n myTurn = ( myMark.equals( X_MARK) );\n turnLabel.setText( myTurn? Language.MESSAGE_TURN :\n Language.MESSAGE_WAIT );\n displayMessage( \"Game cleared\\n\" );\n } else if(message.equals( Gaming.REPLAY_DENIED /*\"REPLAYDENIED\"*/ ) ) {\n stopClient();\n } else if(message.equals( Gaming.EXIT /*\"Exit\"*/ ) ) {\n JOptionPane.showMessageDialog( this, Language.ERROR_DISCONNECT,\n Language.CAPTION_ERROR, JOptionPane.PLAIN_MESSAGE );\n gameover = true;\n } else\n displayMessage( message + \"\\n\" ); // display the message\n }",
"private void parseMessage(String message) {\n\t\tJSONObject msg = (JSONObject) JSONValue.parse(message);\n\t\tswitch(msg.get(\"type\").toString()){\n\t\t\tcase \"join_match\":\n\t\t\t\tint id = Integer.parseInt(msg.get(\"match_id\").toString());\n\t\t\t\ttry {\n\t\t\t\t\tgetServerLobby().joinMatch(this, id);\n\t\t\t\t} catch (TooManyPlayersException e) {\n\t\t\t\t\tthis.alert(\"Cannot join match: match is full\");\n\t\t\t\t} catch (MatchAlreadyStartedException e) {\n\t\t\t\t\tthis.alert(\"Cannot join match: match already started\");\n\t\t\t\t} catch (PlayerAlreadyExistsException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} catch (PlayerNotExistsException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"create_match\":\n\t\t\t\tint maxPlayers = Integer.parseInt(msg.get(\"max_players\").toString());\n\t\t\t\tint maxDeaths = Integer.parseInt(msg.get(\"max_deaths\").toString());\n\t\t\t\tint turnDuration = Integer.parseInt(msg.get(\"turn_duration\").toString());\n\t\t\t\tint mapID = Integer.parseInt(msg.get(\"map_id\").toString());\n\t\t\t\ttry {\n\t\t\t\t\tgetServerLobby().hostMatch(this,maxPlayers,maxDeaths,turnDuration,mapID);\n\t\t\t\t} catch (TooManyMatchesException e) {\n\t\t\t\t\tthis.alert(\"Cannot create match: server is full\");\n\t\t\t\t} catch (PlayerNotExistsException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} catch (MatchAlreadyStartedException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} catch (PlayerAlreadyExistsException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} catch (TooManyPlayersException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"ready\":\n\t\t\t\tgetCurrentMatch().setPlayerReady(this, true);\n\t\t\t\tbreak;\n\t\t\tcase \"not_ready\":\n\t\t\t\tgetCurrentMatch().setPlayerReady(this, false);\n\t\t\t\tbreak;\n\t\t\tcase \"update_lobby\":\n\t\t\t\tif(getServerLobby()!=null) {\n\t\t\t\t\tthis.updateLobby(getServerLobby().lobby);\n\t\t\t\t} else {\n\t\t\t\t\toutput.print(\"NOT_IN_LOBBY\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"back_to_lobby\":\n\t\t\t\ttry {\n\t\t\t\t\tthis.backToLobby();\n\t\t\t\t} catch (MatchAlreadyStartedException | PlayerNotExistsException e) {\n\t\t\t\t\talert(\"Error leaving waiting room\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t}\n\t}",
"public synchronized void parseInput(String message) {\n\n try {\n int row, column, worker;\n String[] parts = message.split(\" \");\n String name = parts[0];\n InputString action = InputString.valueOf(parts[1].toLowerCase());\n boolean actionExecuted = false;\n UndoHandler undoThread = null;\n\n // The name is set by the connection so only the current player can execute actions\n if (name.equals(game.getCurrentPlayer().getName())) {\n\n\n switch (action) {\n case usepower -> {\n // Set the path of fsm as the one of the divinity\n if (fsm.getState() == State.start)\n fsm.setPath(game.getCurrentPlayer().getGodPower().getDivinity());\n String msg = \"Insert \" + game.getCurrentPlayer().getName() + \" wants to use the God Power\";\n game.sendBoard(new LiteBoard(msg, game.getBoard(), game));\n actionExecuted = true;\n lastAction = fsm.getState();\n }\n case normal -> {\n // Set the default path\n if (fsm.getState() == State.start) fsm.setPath(Divinity.Default);\n String msg = \"Insert \" + game.getCurrentPlayer().getName() + \" doesn't want to use the God Power\";\n game.sendBoard(new LiteBoard(msg, game.getBoard(), game));\n actionExecuted = true;\n lastAction = fsm.getState();\n }\n case placeworker -> {\n // Place the worker on the map\n // There isn't a state.placeworker because it happen only once\n if (fsm.getState() == State.start) fsm.setPath(Divinity.Default);\n if (fsm.getState() == State.move) fsm.setState(State.build);\n row = Integer.parseInt(parts[2]) - 1;\n column = Integer.parseInt(parts[3]) - 1;\n undoThread = new UndoHandler(game, this, fsm.getState());\n actionExecuted = game.placeWorker(row, column);\n lastAction = fsm.getState();\n }\n case move -> {\n // Move the worker\n row = Integer.parseInt(parts[2]) - 1;\n column = Integer.parseInt(parts[3]) - 1;\n worker = Integer.parseInt(parts[4]) - 1;\n if (fsm.getState() == State.move) {\n undoThread = new UndoHandler(game, this, fsm.getState());\n actionExecuted = game.move(row, column, worker);\n }\n if (fsm.getState() == State.superMove || fsm.getState() == State.secondTimeState) {\n undoThread = new UndoHandler(game, this, fsm.getState());\n actionExecuted = game.useGodPower(row, column, worker);\n }\n lastAction = fsm.getState();\n }\n case build -> {\n // Build with the worker\n row = Integer.parseInt(parts[2]) - 1;\n column = Integer.parseInt(parts[3]) - 1;\n worker = Integer.parseInt(parts[4]) - 1;\n if (fsm.getState() == State.build) {\n undoThread = new UndoHandler(game, this, fsm.getState());\n actionExecuted = game.build(row, column, worker);\n }\n if (fsm.getState() == State.superBuild || fsm.getState() == State.secondTimeState) {\n undoThread = new UndoHandler(game, this, fsm.getState());\n actionExecuted = game.useGodPower(row, column, worker);\n }\n lastAction = fsm.getState();\n }\n\n case undo -> {\n undoing = true;\n actionExecuted = false;\n undoThread = new UndoHandler(game, this, State.undo);\n new Thread(undoThread).start();\n String msg = \"Undo: \" + game.getCurrentPlayer().getName() + \" undoing\";\n game.sendBoard(new LiteBoard(msg, game.getBoard(), game));\n }\n\n case endturn -> {\n if (fsm.getState() == State.endTurn) {\n setUndoing(true);\n actionExecuted = game.endTurn();\n lastAction = fsm.getState();\n }\n }\n\n }\n\n // If something went wrong:\n // actionExecuted will be false,\n // the fsm stay in the current state and\n // the undoThread doesn't start so it can't undo last action\n if (actionExecuted) {\n setUndoing(false);\n fsm.nextState();\n if (undoThread != null) new Thread(undoThread).start();\n }\n }\n else throw new IllegalArgumentException();\n\n } catch (IllegalArgumentException | IndexOutOfBoundsException exception) {\n game.sendBoard(new LiteBoard(\"Please, be sure you're using the official software since last message was unexpected or had a wrong format\"));\n }\n }",
"@Override\n public void handleMessage(Message message) {}",
"public static final void parseMessage(String message) {\r\n if (message == null) return;\r\n String[] msg = message.split(\" \");\r\n user = getUser(msg[0]);\r\n \r\n if (msg[1].equals(\"PRIVMSG\")) {\r\n addUserToViewerList(user);\r\n msg[3] = msg[3].substring(1);\r\n \r\n /**\r\n * Write the input to console.\r\n */\r\n String s = \"\";\r\n for (int i = 3; i < msg.length - 1; i++) {\r\n s += msg[i] + \" \";\r\n }\r\n s += msg[msg.length - 1];\r\n Console.writeLine(user + \": \" + s);\r\n \r\n if (msg[3].equals(\"\") || msg[3].charAt(0) != cmd.getFlag()) {\r\n //Do some moderator functions if possible\r\n if (db.getUserLevel(user).getLevel() <= UserLevel.SUBSCRIBER.getLevel() && (canMod || db.getUserLevel(nick).getLevel() == UserLevel.OWNER.getLevel())) {\r\n String[] split = s.split(\" \");\r\n if (capsFilter && TwitchFilters.capsFilter(s, capsMinLength, capsTolerance) ) {\r\n purge(user, user + \", http://i.imgur.com/QApFb.jpg\");\r\n }\r\n else if (linksFilter && TwitchFilters.urlFilter(split)) {\r\n purge(user, user + \", links are disabled in this chat.\");\r\n }\r\n else if (bannedWordsFilter && TwitchFilters.bannedWordsFilter(split, TEST_WORDS)) {\r\n purge(user, user + \", HEEEEEEEY YOU SAID THE SECRET WORD!\");\r\n }\r\n else if (!emotes.isEmpty() && TwitchFilters.emotesFilter(split, emotes, emoteTolerance)) {\r\n purge(user, user + \", I have nothing witty to say here.\");\r\n }\r\n else if (symbolFilter && TwitchFilters.symbolFilter(s, symbolTolerance)) {\r\n purge(user, user + \" the spam is real.\");\r\n }\r\n }\r\n else if (user.equals(\"Jtv\") && message.contains(\"moderators of this room\")) {\r\n String mods = \"\";\r\n for (int i = 9; i < msg.length; i++) {\r\n mods += capName(msg[i]).replace(\",\", \"\") + \" \";\r\n }\r\n db.initMod(mods.trim().split(\" \"));\r\n canMod = db.getUserLevel(capName(nick)).getLevel() >= UserLevel.MODERATOR.getLevel();\r\n }\r\n return;\r\n }\r\n \r\n msg[3] = msg[3].substring(1);\r\n if (msg[3].equals(Commands.ADD_COMMAND)) {\r\n if (db.getUserLevel(user).getLevel() < UserLevel.MODERATOR.getLevel()) {\r\n sendMessage(user + \" does not have permission to add commands.\");\r\n return;\r\n }\r\n String com = \"\";\r\n try {\r\n if (msg.length >= 5 && msg[4].charAt(0) == cmd.getFlag()) {\r\n\t\t\tint i;\r\n\t\t\tfor (i = 5; i < msg.length; i++) {\r\n com += msg[i] + \" \";\r\n\t\t\t}\r\n sendMessage(cmd.addCommand(msg[4].replace(\"\" + cmd.getFlag(), \"\"), com.trim()));\r\n }\r\n else {\r\n sendMessage(\"Invalid parameters for !addcommand. Syntax is !addcommand ![Command Name] [Message]\");\r\n }\r\n }\r\n catch (ArrayIndexOutOfBoundsException e) {\r\n sendMessage(\"Invalid parameters for !addcommand. Syntax is !addcommand ![Command Name] [Message]\");\r\n }\r\n }\r\n else if (msg[3].equals(Commands.ADD_TIMER)) {\r\n if (db.getUserLevel(user).getLevel() < UserLevel.MODERATOR.getLevel()) {\r\n sendMessage(user + \" does not have permission to add timers.\");\r\n return;\r\n }\r\n try {\r\n String name = msg[4];\r\n int delay = Integer.parseInt(msg[5]);\r\n String output = \"\";\r\n for (int i = 6; i < msg.length; i++) {\r\n output += msg[i] + \" \";\r\n }\r\n sendMessage(tc.addCommand(name, output, delay));\r\n }\r\n catch (ArrayIndexOutOfBoundsException | NumberFormatException e) {\r\n sendMessage(\"Invalid parameters for !addtimer. Syntax is !addtimer [Name of timer] [Delay in minutes] [Message]\");\r\n }\r\n }\r\n else if (msg[3].equals(Commands.EDIT_COMMAND)) {\r\n\r\n }\r\n else if (msg[3].equals(Commands.EDIT_TIMER)) {\r\n\r\n }\r\n else if (msg[3].equals(Commands.REMOVE_COMMAND)) {\r\n try {\r\n s = cmd.removeCommand(msg[4], db.getUserLevel(user)).replace(Commands.USER_FLAG, user);\r\n sendMessage(s);\r\n }\r\n catch (ArrayIndexOutOfBoundsException e) {\r\n sendMessage(\"Invalid parameters for !removecommand. Syntax is !rmcmd ![Command Name]\");\r\n }\r\n }\r\n else if (msg[3].equals(Commands.REMOVE_TIMER)) {\r\n try {\r\n sendMessage(tc.removeCommand(msg[4]));\r\n }\r\n catch (ArrayIndexOutOfBoundsException e) {\r\n sendMessage(\"Invalid parameters for !removetimer. Syntax is !rmcmd [Name of timer]\");\r\n }\r\n }\r\n else if (msg[3].equals(Commands.DISABLE_TIMERS)) {\r\n tc.stopCommands();\r\n sendMessage(\"Timers have been disabled\");\r\n }\r\n else if (msg[3].equals(Commands.START_TIMERS)) {\r\n if (tc.isRunning()) {\r\n sendMessage(\"Timers are already running.\");\r\n }\r\n else {\r\n tc.startCommands();\r\n sendMessage(\"Timers have been started.\");\r\n }\t\r\n }\r\n else if (msg[3].equals(Commands.GREETING)) {\r\n try {\r\n switch (msg[4]) {\r\n case \"on\":\r\n case \"true\":\r\n case \"enable\":\r\n case \"enabled\":\r\n greetingOn = true;\r\n sendMessage(String.format(\"Greeting is set to %b\", greetingOn));\r\n break;\r\n case \"off\":\r\n case \"false\":\r\n case \"disable\":\r\n case \"disabled\":\r\n greetingOn = false;\r\n sendMessage(String.format(\"Greeting is set to %b\", greetingOn));\r\n break;\r\n case \"status\":\r\n sendMessage(String.format(\"Greeting is set to %b\", greetingOn));\r\n break;\r\n case \"message\":\r\n sendMessage(greeting);\r\n break;\r\n case \"test\":\r\n sendMessage(String.format(greeting, user));\r\n break;\r\n }\r\n }\r\n catch (ArrayIndexOutOfBoundsException e) {\r\n sendMessage(\"Invalid parameters for !greeting. Syntax is !greeting [on,true,enabled,off,false,disabled,status,message]\");\r\n }\r\n }\r\n else if (msg[3].equals(Commands.LINKS)) {\r\n if (db.getUserLevel(user).getLevel() < UserLevel.MODERATOR.getLevel()) return;\r\n try {\r\n switch(msg[4]) {\r\n case \"on\":\r\n case \"true\":\r\n case \"enable\":\r\n case \"enabled\":\r\n sendMessage(\"Links are enabled in this channel.\");\r\n linksFilter = false;\r\n break;\r\n case \"off\":\r\n case \"false\":\r\n case \"disable\":\r\n case \"disabled\":\r\n sendMessage(\"Links are disabled in this channel.\");\r\n linksFilter = true;\r\n break;\r\n case \"status\":\r\n sendMessage(String.format(\"Links are set to %b\", linksFilter));\r\n break;\r\n default:\r\n sendMessage(\"Invalid parameters for !links.\");\r\n break;\r\n }\r\n }\r\n catch (ArrayIndexOutOfBoundsException e) {\r\n sendMessage(\"Invalid parameters for !links.\");\r\n }\r\n }\r\n /* Figure out how to implement this cleaner */\r\n else if (msg[3].equals(\"lookup\")) {\r\n String lookup = capName(msg[5]);\r\n sendMessage(String.format(\"User: %s %s: %d User Level: %s Is a regular: %b\",\r\n lookup, currency, db.getPoints(lookup), db.getUserLevel(lookup).toString().toLowerCase(), db.isRegular(lookup)));\r\n }\r\n else if (msg[3].equals(\"set\")) {\r\n if (db.getUserLevel(user).getLevel() <= UserLevel.MODERATOR.getLevel() && !user.equals(\"Genodragon_sc\")) return;\r\n try {\r\n switch (msg[4]) {\r\n case \"level\":\r\n db.setUserLevel(capName(msg[6]), UserLevel.valueOf(msg[7].toUpperCase()));\r\n ObjectIO.writeObjectToFile(dbPath, db);\r\n break;\r\n case \"points\":\r\n db.changePoints(capName(msg[6]), Integer.parseInt(msg[7]));\r\n break;\r\n case \"regular\":\r\n db.setRegular(msg[6], Boolean.parseBoolean(capName(msg[7]))); //Boolean parse doesn't work\r\n break;\r\n default:\r\n throw new Exception(\"WHOS THAT POKEMON\");\r\n }\r\n }\r\n catch (Exception e) {\r\n sendMessage(\"Invalid parameters for set.\");\r\n }\r\n }\r\n else if (msg[3].equals(\"die\")) {\r\n sendMessage(\"T_T Goodbye.\");\r\n disconnect();\r\n }\r\n else if (msg[3].equals(Commands.IS_FOLLOWER)) {\r\n if (db.getUserLevel(user).getLevel() < UserLevel.ADMIN.getLevel()) return;\r\n try {\r\n if (TwitchAPI.isFollower(msg[4], admin)) {\r\n sendMessage(capName(msg[4]) + \" is a follower of \" + admin + \".\");\r\n }\r\n else {\r\n sendMessage(capName(msg[4]) + \" is not a follower of \" + admin + \".\");\r\n }\r\n }\r\n catch (ArrayIndexOutOfBoundsException e) {\r\n sendMessage(\"You goofed didn't you?\");\r\n }\r\n }\r\n else if (msg[3].equals(Commands.IS_SUBSCRIBER)) {\r\n if (db.getUserLevel(user).getLevel() < UserLevel.ADMIN.getLevel()) return;\r\n try {\r\n if (TwitchAPI.isSubscriber(msg[4], admin)) {\r\n sendMessage(capName(msg[4]) + \" is a subscriber of \" + admin + \".\");\r\n }\r\n else {\r\n sendMessage(capName(msg[4]) + \" is not a subscriber of \" + admin + \".\");\r\n }\r\n }\r\n catch (ArrayIndexOutOfBoundsException e) {\r\n sendMessage(\"You goofed didn't you?\");\r\n }\r\n }\r\n else if (msg[3].equals(\"sudo\")) {\r\n if (db.getUserLevel(user).getLevel() <= UserLevel.MODERATOR.getLevel() || !user.equals(\"Genodragon_sc\")) return;\r\n String com = \"\";\r\n for (int i = 4; i < msg.length; i++) {\r\n com += msg[i] + \" \";\r\n }\r\n sendMessage(com.trim());\r\n }\r\n else if (cmd.contains(msg[3])) {\r\n String output = cmd.getCommand(msg[3]);\r\n output = output.replace(Commands.USER_FLAG, user);\r\n sendMessage(output);\t\r\n }\r\n }\r\n else if (msg[1].equals(\"JOIN\")) {\r\n addUserToViewerList(user);\r\n if (greetingOn) {\r\n String greet = greeting.replace(Commands.USER_FLAG, user);\r\n sendMessage(greet);\r\n }\r\n Console.writeLine(msg[1] + \" \" + user);\r\n }\r\n else if (msg[1].equals(\"PART\")) {\r\n removeUserFromViewerList(user);\r\n Console.writeLine(msg[1] + \" \" + user);\r\n }\r\n else if (msg[0].equals(\"PING\")) {\r\n sendRaw(\"PONG \" + msg[1]);\r\n }\r\n }",
"private void handleCommand(String command, Update update){\r\n\t\tSendMessage message= new SendMessage();\t\t\r\n\t\tLong chatId = update.getMessage().getChatId();\r\n\t\tswitch (command){\r\n\t\tcase BotConfig.START_COMMAND:\t\t\t\t\r\n\t\t\tmessage.setText(BotConfig.WELCOME_STRING);\r\n\t\t\tbreak;\r\n\t\tcase BotConfig.HELP_COMMAND:\t\t\t\r\n\t\t\tmessage.setText(BotConfig.HELP_STRING);\r\n\t\t\tbreak;\r\n\t\tcase BotConfig.POLL_COMMAND:\t\t\t\r\n\t\t\tmessage.setText(BotConfig.POLL_STRING);\r\n\t\t\tpoll = new Poll();//Iniciamos la clase...\r\n\t\t\tisPolling = true;//\"Encendemos\" el modo encuesta.\t\t\t\r\n\t\t\tbreak;\r\n\t\tcase BotConfig.POLL_COMMAND_DONE:\r\n\t\t\tisPolling = false;//Reiniciamos la variable al finalizar el comando.\r\n\t\t\thaveQuestion = false;//Reiniciamos la variable para la pregunta.\r\n\t\t\tsendSurvey = true;//Marcamos para enviar la encuesta.\t\t\t\t\r\n\t\t\tmessage.setText(BotConfig.POLL_DONE_STRING);\r\n\t\t\tbreak;\r\n\t\t\r\n\t\t}\t\t\r\n\t\ttry {\r\n\t\t\tmessage.setChatId(chatId);\r\n\t\t\texecute(message);//Enviamos el mensaje... \r\n if (sendSurvey == true){ \t\r\n \t\r\n \texecute(poll.sendFinishedSurvey(chatId, poll.createSurveyString(poll.createSurvey())));//Enviamos encuesta antes de compartir.\r\n \tsendSurvey = false;//Marcamos como no enviada despues de haberlo hecho.\r\n }\r\n } catch (TelegramApiException e) {\r\n \tBotLogger.error(LOGTAG, e);//Guardamos mensaje y lo mostramos en pantalla de la consola.\r\n e.printStackTrace();\r\n }\r\n\t}",
"public boolean handleMessage(int what, String message) {\r\n\t\treturn handleMessage(what, -1, null, message, false);\r\n\t}",
"public void handleStringMessage(String message) {\n\n }",
"protected void handleMessage(Object lineObj){\n String line = (String)lineObj;\n \n if (logStream != null)\n logStream.println(line);\n \n if (handleGameInfo(line))\n return;\n if (handleExaminedGameInfo(line))\n return;\n if (handleStyle12(line))\n return;\n if (handleDeltaBoard(line))\n return;\n if (handleSeeksCleared(line))\n return;\n if (handleSeekAdded(line))\n return;\n if (handleSeeksRemoved(line))\n return;\n if (handleBughouseHoldings(line))\n return;\n if (handleGameEnd(line))\n return;\n if (handleStoppedObserving(line))\n return;\n if (handleStoppedExamining(line))\n return;\n if (handleEnteredBSetupMode(line))\n return;\n if (handleExitedBSetupMode(line))\n return;\n if (handleIllegalMove(line))\n return;\n if (handleChannelTell(line))\n return;\n if (handleLogin(line))\n return;\n if (handleIvarStateChanged(line))\n return;\n if (handlePersonalTell(line))\n return;\n if (handleSayTell(line))\n return;\n if (handlePTell(line))\n return;\n if (handleShout(line))\n return;\n if (handleIShout(line))\n return;\n if (handleTShout(line))\n return;\n if (handleCShout(line))\n return;\n if (handleAnnouncement(line))\n return;\n if (handleKibitz(line))\n return;\n if (handleWhisper(line))\n return;\n if (handleQTell(line))\n return;\n if (handleOffer(line))\n return;\n if (handleOfferRemoved(line))\n return;\n if (handlePlayerOffered(line)) //\n return; // We have to handle these\n if (handlePlayerDeclined(line)) // \"manually\", since the \n return; // server currently does \n if (handlePlayerWithdrew(line)) // not inform us of offers\n return; // in games we're \n if (handlePlayerCounteredTakebackOffer(line)) // observing. \n return; // \n if (handleSimulCurrentBoardChanged(line))\n return;\n if (handlePrimaryGameChanged(line))\n return;\n if (handleUserChannelListNext(line))\n return;\n if (handleChannelListArrives(line))\n return;\n if (handleChannelListChanged(line))\n return;\n if (handleMessagesInfo(line))\n return;\n if (handleMessages(line))\n return;\n\n if (linesToFilter.remove(line) == null)\n processLine(line);\n }",
"@Override\n public void sendMessage(String message) {\n if(\"YOURMOVE\".equals(message)) {\n makeMove();\n }\n }",
"private void handleDeadMansSwitchMessage(JsonNode message) {\n try {\n String cancelTime = message.get(\"cancelTime\").asText();\n if (cancelTime.equals(\"0\")) {\n LOG.info(\"Dead man's switch disabled\");\n dmsDisposable.dispose();\n dmsDisposable = null;\n dmsCancelTime=0;\n } else {\n SimpleDateFormat sdf = new SimpleDateFormat(BitmexMarketDataEvent.BITMEX_TIMESTAMP_FORMAT);\n sdf.setTimeZone(TimeZone.getTimeZone(ZoneOffset.UTC));\n long now = sdf.parse(message.get(\"now\").asText()).getTime();\n dmsCancelTime = sdf.parse(cancelTime).getTime();\n }\n } catch (ParseException e) {\n LOG.error(\"Error parsing deadman's confirmation \");\n }\n return;\n }",
"public void handleCommand(String command);",
"public String processCommand(Command command) //refactored\n {\n boolean wantToQuit = false;\n //System.out.println(\"hitter boolean\");\n commandWord = command.getAction();//fehler\n //System.out.println(command);\n //System.out.println(\"enum == null\" + (commandWord == null));\n String result = \"\";\n //System.out.println(\"heyho\");\n //System.out.println(result);\n switch(commandWord){\n //case UNKNOWN: return \"I don't know what you mean...\"; break;\n \n case HELP: result += printHelp(); break;\n case GO: result += goRoom(command); break;\n case QUIT: return quit(command);//refactored from refactoring\n default: result += \"I don't know what you mean...\";\n }\n return result;\n }",
"public void handleEvent(Message event)\r\n {\r\n m_tsm.handleEvent(event);\r\n\r\n String msg = event.getMessage().toLowerCase();\r\n\r\n String name = m_botAction.getPlayerName(event.getPlayerID());\r\n\r\n if(event.getMessageType() == Message.PRIVATE_MESSAGE && m_opList.isER(name))\r\n {\r\n if(msg.equals(\"!safeson\"))\r\n {\r\n c_Activate(name, true);\r\n }\r\n else if(msg.equals(\"!safesoff\"))\r\n {\r\n c_Activate(name, false);\r\n m_entryTimes.clear();\r\n } else if(msg.startsWith(\"!default\")) {\r\n cmd_default(name, msg);\r\n }\r\n }\r\n }",
"public void handleMessage(Message msg) {\n super.handleMessage(msg);\n switch (msg.what) {\n case 1:\n if (!isStop) {\n updateTimeSpent();\n mHandler.sendEmptyMessageDelayed(1, 1000);\n }\n break;\n case 0:\n break;\n }\n }",
"@PluginApi(since = 300)\n public boolean handleMessageLogic(Message message) {\n return false;\n }",
"private void handleWordMessage(String channel, String sender, String message, String[] args)\n\t{\n\t\tmessage = message.toLowerCase();\n\n\t\t// Handle weather case\n\t\tif (message.contains(\"weather\"))\n\t\t{\n\t\t\tlong potentialZipcode;\n\n\t\t\tfor (int i = 0; i < args.length; i++)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tpotentialZipcode = Long.parseLong(removeSpecialCharacters(args[i]));\n\n\t\t\t\t\t// If valid parse, then print zipcode weather to user\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tString zipToString = Long.toString(potentialZipcode);\n\n\t\t\t\t\t\t// Handles zipcodes beginning with 0\t\n\t\t\t\t\t\twhile(zipToString.length() < 5)\n\t\t\t\t\t\t\tzipToString = \"0\" + zipToString;\n\n\t\t\t\t\t\tString weatherDataString;\n\n\t\t\t\t\t\tString[] data = getRawWeatherDataByZipcode(zipToString);\n\n\t\t\t\t\t\tweatherDataString = \"The weather in \" + zipToString + \" is \" + data[0]\n\t\t\t\t\t\t\t\t+ \" and the max temperature is \" + kelvinToFahrenheit(Double.parseDouble(data[1]))\n\t\t\t\t\t\t\t\t+ \"F while the minimum temperature is \"\n\t\t\t\t\t\t\t\t+ kelvinToFahrenheit(Double.parseDouble(data[2])) + \"F and the current temperature is \"\n\t\t\t\t\t\t\t\t+ kelvinToFahrenheit(Double.parseDouble(data[3])) + \"F\";\n\n\t\t\t\t\t\tsendMessageAndAppend(this.channel, weatherDataString);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception e)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (Exception ex)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"- Argument \" + i + \" is not a valid zipcode number\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Handle representative case\n\t\telse if (message.contains(\"representative\"))\n\t\t{\n\t\t\tlong potentialZipcode;\n\n\t\t\tfor (int i = 0; i < args.length; i++)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t// A potential zipcode to be used\n\t\t\t\t\tpotentialZipcode = Long.parseLong(removeSpecialCharacters(args[i]));\n\n\t\t\t\t\t// If valid parse, then print zipcode weather to user\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tString zipToString = Long.toString(potentialZipcode);\n\n\t\t\t\t\t\t// Handles zipcodes beginning with 0\n\t\t\t\t\t\twhile(zipToString.length() < 5)\n\t\t\t\t\t\t\tzipToString = \"0\" + zipToString;\n\n\t\t\t\t\t\tSystem.out.println(zipToString);\n\t\t\t\t\t\tArrayList<String> representativeDataArray = getRepresentativeDataByZipcode(zipToString);\n\t\t\t\t\t\tString representativeDataString = \"\";\n\n\t\t\t\t\t\t// Construct return string to user\n\t\t\t\t\t\tint num = 1;\n\t\t\t\t\t\tfor (int pos = 0; pos < representativeDataArray.size(); pos += 4)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\trepresentativeDataString += \"Rep. \" + num++ + \" = { Name: \"\n\t\t\t\t\t\t\t\t\t+ representativeDataArray.get(pos);\n\t\t\t\t\t\t\trepresentativeDataString += \" / Party: \" + representativeDataArray.get(pos + 1);\n\t\t\t\t\t\t\trepresentativeDataString += \" / Phone: \" + representativeDataArray.get(pos + 2);\n\t\t\t\t\t\t\trepresentativeDataString += \" / Link: \" + representativeDataArray.get(pos + 3) + \" } \";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tsendMessageAndAppend(this.channel, representativeDataString);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception e)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (Exception ex)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"- Argument \" + i + \" is not a valid zipcode number\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"void processGameCommand(String command, ClientSocket socket) {\n \n if(!command.contains(\":\")) return;\n\n String substring = command.substring(0, command.indexOf(\":\")+1); //should be fold:, check:, call:, or raise:\n //System.out.println(substring);\n \n String upperString = command.substring(substring.length());\n \n //System.out.println(substring);\n \n if(substring.equals(\"fold:\")) {\n Integer index = Integer.parseInt(upperString);\n //System.out.println(\"fold \"+index);\n if(dat.seatIsOccupied(index) && dat.playerOnSeat(index).getSocket().equals(socket) && dat.playerOnSeat(index).isInHand()) {\n dat.playerOnSeat(index).setAction(PokerAction.FOLD);\n }\n return;\n }\n if(substring.equals(\"check:\")) {\n Integer index = Integer.parseInt(upperString);\n //System.out.println(\"check \"+ index);\n if(dat.seatIsOccupied(index) && dat.playerOnSeat(index).getSocket().equals(socket) && dat.playerOnSeat(index).isInHand()) {\n dat.playerOnSeat(index).setAction(PokerAction.CHECK);\n }\n return;\n }\n \n if(substring.equals(\"call:\")) {\n Integer index = Integer.parseInt(upperString);\n //System.out.println(\"call \"+index);\n //System.out.println(\"call, \"+index);\n //System.out.println(dat.seatIsOccupied(index)+\", \"+dat.playerOnSeat(index).getSocket().equals(socket)+\", \"+dat.playerOnSeat(index).isInHand());\n if(dat.seatIsOccupied(index) && dat.playerOnSeat(index).getSocket().equals(socket) && dat.playerOnSeat(index).isInHand()) {\n //System.out.println(\"Setting action\");\n dat.playerOnSeat(index).setAction(PokerAction.CALL);\n }\n return;\n }\n \n if(!upperString.contains(\":\")) return;\n \n if(substring.equals(\"raise:\")) {\n substring = upperString.substring(0, upperString.indexOf(\":\")); \n upperString = upperString.substring(substring.length()+1);\n Integer index = Integer.parseInt(substring);\n Integer amount = Integer.parseInt(upperString);\n if(dat.seatIsOccupied(index) && dat.playerOnSeat(index).getSocket().equals(socket) && dat.playerOnSeat(index).isInHand()) {\n dat.playerOnSeat(index).setAction(PokerAction.RAISE);\n dat.playerOnSeat(index).raise = amount;\n }\n //return;\n } \n }",
"private boolean processCommand(Command command) \n {\n boolean wantToQuit = false;\n\n CommandWord commandWord = command.getCommandWord();\n\n if(commandWord == CommandWord.UNKNOWN) {\n Logger.Log(\"I don't know what you mean...\");\n return false;\n }\n \n if (commandWord == CommandWord.HELP) {\n printHelp();\n }\n else if (commandWord == CommandWord.GO) {\n goRoom(command);\n }\n \n else if (commandWord == CommandWord.TAKE) {\n takeItem(command);\n }\n \n else if (commandWord == CommandWord.USE) {\n useItem(command);\n }\n \n else if (commandWord == CommandWord.LOOK) {\n Logger.Log(currentRoom.getLongDescription());\n }\n \n else if (commandWord == CommandWord.VIEW) {\n viewPlayer(command);\n }\n \n else if (commandWord == CommandWord.QUIT) {\n wantToQuit = quit(command);\n }\n // else command not recognised.\n return wantToQuit;\n }",
"public void acceptMessage(java.util.Date time, OSCMessage message) {\n\t\t// FOR DEBUGGING: to print the full message:\n\t\tif (debugging) {\n\t\t\tSystem.out.print(message.getAddress());\n\t\t\tfor(int i = 0; i < message.getArguments().length; i++) {\n\t\t\t\tSystem.out.print(\", \" + message.getArguments()[i].toString());\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t\t\n\t\tif (message.getAddress().matches(\"/done\")) {\n\t\t\tif (message.getArguments()[0].toString().matches(\"/b_allocRead\")) {\n\t\t\t\t//debugPrintln(\"A buffer was created.\");\n\t\t\t}\n\t\t}\n\n\t\t//TODO: this /synced watch will work as long as the buffers load correctly.\n\t\t//but there's not yet any way to know if they fail.\n\t\telse if (message.getAddress().matches(\"/synced\")) {\n\t\t\tint id = (Integer)(message.getArguments()[0]) - _bufferReadIdOffset;\n\t\t\tsynchronized (this) {\n\t\t\t\tif (_bufferMap.containsKey(id)) {\n\t\t\t\t\tdebugPrintln(\"Buffer \" + id + \" was loaded.\");\n\t\t\t\t\tif (_notifyListener != null) { _notifyListener.receiveNotification_BufferLoaded(id, _bufferMap.get(id)); }\n\t\t\t\t\tif (_controlPanel != null && _controlPanel._statsDisplay != null) {\n\t\t\t\t\t\t_controlPanel._statsDisplay.receiveNotification_BufferLoaded(id, _bufferMap.get(id));\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\telse if (message.getAddress().matches(\"/n_go\") ||\n\t\t\tmessage.getAddress().matches(\"/n_info\")) {\n\t\t\t//if it was node 1, then we can get going.\n\t\t\tif ((Integer)(message.getArguments()[0]) == _motherGroupID && \n\t\t\t\t(Integer)(message.getArguments()[1]) == 1 ) {\n\t\t\t\tif (!_serverBooted) {\n\t\t\t\t\t_serverBooted = true;\n\t\t\t\t\thandleServerBooted();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// handle notices of freed nodes\n\t\telse if (message.getAddress().matches(\"/n_end\")) {\n\t\t\t// take message.getArguments()[0] (the node id that was freed)\n\t\t\t// and free up any resources associated with it.\n\t\t\t//debugPrintln(\"node \" + message.getArguments()[0].toString() + \" was freed.\");\n\t\t\tInteger id = (Integer) (message.getArguments()[0]);\n\t\t\tif (id > _motherGroupID) {\n\t\t\t\t// it's a group node. a SoundNode has died.\n\t\t\t\tsynchronized (this) {\n\t\t\t\t\tSoundNode sn = _soundNodes.get(id);\n\t\t\t\t\tif (sn != null) {\n\t\t\t\t\t\tsn.setAlive(false);\n\t\t\t\t\t\tfreeBus(sn.get_busID());\n\t\t\t\t\t}\n\t\t\t\t\t_soundNodes.remove(id);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// free up that node from the node id list.\n\t\t\t\tsynchronized (this) {\n\t\t\t\t\t_nodeIdList.remove(message.getArguments()[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//handle /status responses (status.reply)\n\t\telse if (message.getAddress().matches(\"/status.*\")) {\n\t\t\t//TODO update control panel display with status data\n\t\t\tInteger numUgens = (Integer)(message.getArguments()[1]);\n\t\t\tInteger numSynths = (Integer)(message.getArguments()[2]);\n\t\t\tInteger numGroups = (Integer)(message.getArguments()[3]);\n\t\t\tInteger numSynthdefs = (Integer)(message.getArguments()[4]);\n\t\t\tFloat avgCPU = (Float)(message.getArguments()[5]);\n\t\t\tFloat peakCPU = (Float)(message.getArguments()[6]);\n\t\t\thandleServerStatusUpdate(numUgens, numSynths, numGroups, numSynthdefs, avgCPU, peakCPU);\n\t\t}\n\t\t\n\t}",
"public void processMessage(String message);",
"private void processMessage(Message message) {\n log(\"\");\n log(\"\");\n// log(\"recon list: \" + reconciliation);\n log(\"message\", message);\n\n switch (message.type) {\n // Response from server when registering\n case \"accepted\":\n accepted = true;\n\n // lobby leader, this user sets the info for all users.\n if (message.stringData != null && message.stringData.equals(\"leader\")) {\n\n LobbySettings lobbySettings = new LobbySettings();\n if (requestedGameType != null)\n lobbySettings.updateType(requestedGameType);\n log(\"req points\", requestedMapCntrlPoints);\n lobbySettings.setMap(requestedMapCntrlPoints);\n\n sendLobbySettingsToServer(lobbySettings);\n }\n\n if (message.name != name) {\n name = message.name;\n System.out.println(\"Name rejected. New name: \" + name);\n }\n\n break;\n // Resend register message\n case \"rejected\":\n try {\n Thread.sleep(500);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n sendRegisterMessage();\n break;\n // the first game message from the server\n case \"initialUpdate\":\n EntityHandler eh = message.entityHandler;\n game.entityHandler = eh;\n game.modelLayer.setEntities(eh);\n game.lobbySettings = message.lobbySettings;\n game.timeRemaining = message.timeRemaining;\n game.teamsList = message.teamsList;\n game.tankID = message.stringData;\n game.teamID = message.teamID;\n tankToUsernameMap = message.tankToNameMap;\n log(String.format(\"We are '%s' on team %d.\", message.stringData, message.teamID));\n\n // TODO this is the shit\n game.map.loadMap(message.lobbySettings.getMap());\n game.setupTerrainFlag = true;\n\n started = true;\n\n game.postConnect();\n log(\"game started!!\");\n break;\n // main update case\n case \"update\":\n if (!started)\n return;\n\n log(\"received new entity handler\");\n\n EntityHandler serverEntityHandler = message.entityHandler;\n game.entityHandler = serverEntityHandler;\n tankToHeldLength = message.tankToHeldLength;\n game.modelLayer.setEntities(serverEntityHandler);\n\n game.entityHandler.constrainTanks(game.map);\n game.entityHandler.constrainCrates(game.map);\n game.entityHandler.constrainTurrets(game.tankID, Input.cursorPos);\n\n game.timeRemaining = message.timeRemaining;\n\n double serverPacketNumber = message.packetNum;\n log(\"server packet:\" + serverPacketNumber + \", last packet we sent:\" + packetNum);\n\n int i = 0;\n while (i < reconciliation.size()) {\n Message reconMessage = reconciliation.get(i);\n\n if (reconMessage.packetNum <= serverPacketNumber) {\n log(\"reconcile!, m packet:\" + reconMessage.packetNum + \"<= server packet:\" + serverPacketNumber);\n reconciliation.remove(i);\n } else {\n log(\"server lagging behind, apply inputs again for packet: \" + reconMessage.packetNum);\n\n Integer[] keysPressed = reconMessage.keysPressed;\n double mouseHeldTime = reconMessage.mouseHeldTime;\n reconciliationUpdate(keysPressed, mouseHeldTime);\n i++;\n }\n }\n break;\n case \"endUpdate\":\n if (!started)\n return;\n\n log(\"received final entity handler\");\n accepted = false;\n started = false;\n ended = true;\n game.entityHandler = message.entityHandler;\n game.modelLayer.setEntities(message.entityHandler);\n game.entityHandler.constrainTanks(game.map);\n game.entityHandler.constrainTurrets(game.tankID, Input.cursorPos);\n game.setEndOfGame(); // assuming we are in online mode\n break;\n case \"debug\":\n String str = message.stringData;\n log(str);\n testMessages.add(message);\n break;\n default:\n error(\"unknown type: \" + message.type);\n break;\n }\n }",
"private boolean processCommand(Command command) \n {\n boolean wantToQuit = false;\n\n CommandWord commandWord = command.getCommandWord();\n\n switch (commandWord) \n {\n case UNKNOWN:\n System.out.println(\"I don't know what you mean...\");\n break;\n\n case HELP:\n printHelp();\n break;\n\n case GO:\n goRoom(command);\n break;\n\n //my command expect when i Quit\n case PICK:\n pickItem();\n break;\n \n //drink the redbull\n case DRINK:\n drink();\n break;\n \n //show inventory\n case SHOW:\n showInventory();\n break;\n \n //show objective\n case GOAL:\n remindGoal();\n break;\n\n case QUIT:\n wantToQuit = quit(command);\n break;\n }\n return wantToQuit;\n }",
"public void doChatMessage(GameServer gameServer, User user, String name, String message) {\n if (message.startsWith(\"/\")) {\n String toSend = \"\";\n if (message.startsWith(\"/help\")) {\n //Todo: do help\n toSend = \"List of all inner chat commands:\\n\" +\n \"/help (Command) --> Gets help for that command\\n\" +\n \"/list [all, online, RankName, lobby, clients, propertys] --> get a list of users that meet the criteria\\n\" +\n \"/ping --> Pong!\";\n }\n if (message.startsWith(\"/list all\")) {\n List<String> toSendList = Authenticate.getUserList();\n //toSend = Authenticate.getUserList();\n for (String string: toSendList) {\n toSend += string + \"\\n\";\n }\n }\n else if (message.startsWith(\"/ping\")) {\n toSend = \"Pong\";\n }\n else if (message.startsWith(\"/list lobby\")) {\n Lobby lobby = user.getCurrentLobby();\n if (lobby != null) {\n List<User> users = lobby.getUsers();\n for (User u: users) {\n toSend += u.chatFormatDisplay() + \"\\n\";\n }\n }\n }\n else if (message.startsWith(\"/list clients\")) {\n if (Authenticate.checkRank(user.getRank(), Rank.Op)) {\n for (ClientWorker w: gameServer.getClients()) {\n toSend += w.toString() + \"\\n\";\n }\n }\n }\n else if (message.startsWith(\"/list propertys\")) {\n if (Authenticate.checkRank(user.getRank(), Rank.Op)) {\n toSend = Settings.listPropertys();\n }\n }\n else if (message.startsWith(\"/changeproperty\")) {\n if (Authenticate.checkRank(user.getRank(), Rank.Op)) {\n String[] split = message.split(\" \");\n Settings.setProperty(split[1], split[2]);\n toSend = \"Changed property: \" + split[1] + \" to \" + split[2] + \".\\n\" + Settings.listPropertys();\n }\n }\n else if (message.startsWith(\"/loadpropertys\")) {\n if (Authenticate.checkRank(user.getRank(), Rank.Op)) {\n Settings.load();\n toSend = \"Loaded propertys.\\n\" + Settings.listPropertys();\n }\n }\n\n else if (message.startsWith(\"/snake\")) {\n if (user.getCurrentLobby() == null) {\n SingleUserChatContext chatContext = new SingleUserChatContext(user, \"Snake-->\" + user.getName(), \"Snake\");\n addNewContext(chatContext);\n SnakeLobby snakeLobby = new SnakeLobby(user, chatContext);\n user.setCurrentLobby(snakeLobby);\n gameServer.lobbys.addNewLobby(snakeLobby);\n snakeLobby.start();\n }\n }\n\n else if (message.startsWith(\"/statesnake\")) {\n if (user.getCurrentLobby() == null) {\n SingleUserChatContext chatContext = new SingleUserChatContext(user, \"Snake-->\" + user.getName(), \"Snake\");\n addNewContext(chatContext);\n StateSnakeLobby snakeLobby = new StateSnakeLobby(user, chatContext);\n user.setCurrentLobby(snakeLobby);\n gameServer.lobbys.addNewLobby(snakeLobby);\n snakeLobby.start();\n }\n }\n\n else if (message.startsWith(\"/leavelobby\")) {\n Lobby lobby = user.getCurrentLobby();\n if (lobby != null) {\n gameServer.lobbys.removeUser(lobby, user);\n toSend = \"Left the lobby\";\n }\n }\n\n// else if (message.startsWith(\"/load\")) {\n// String[] split = message.split(\" \");\n// File file = new File(split[1]);\n// System.out.println(file.exists());\n// if (file.exists()) {\n// try {\n// String in = \"\";\n// BufferedReader reader = new BufferedReader(new FileReader(file));\n// while ((in = reader.readLine()) != null) {toSend += in + \"\\n\";}\n// reader.close();\n// //toSend = in;\n// //Get the chat context, if it exists send the chat message\n// ChatContext chatContext = getContext(name);\n// if (chatContext == null) return;\n// chatContext.sendMessage(toSend);\n// toSend = \"\";\n// }\n// catch (Exception e) {\n// e.printStackTrace();\n// }\n// }\n// }\n\n if (!toSend.isEmpty()) {\n StringWriter stringWriter = new StringWriter();\n new JSONWriter(stringWriter).object()\n .key(\"argument\").value(\"chatmessage\")\n .key(\"name\").value(\"Server-->\" + user.getName())\n .key(\"displayname\").value(\"Server\")\n .key(\"message\").value(toSend)\n .endObject();\n user.clientWorker.sendMessage(stringWriter.toString());\n }\n\n }\n else {\n //Get the chat context, if it exists send the chat message\n ChatContext chatContext = getContext(name);\n if (chatContext == null) return;\n chatContext.sendMessage(user.chatFormatDisplay() + \" \" + message);\n }\n }",
"@Override\n public void handleMessage(ACLMessage message) {\n try {\n onMessage(message);\n } catch (Exception e) {\n e.getMessage();\n }\n }",
"@Override\r\n\tpublic void handleMessage(Message msg) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tBundle msg_data = msg.getData();\r\n\t\tboolean drone_fuel_stop = msg_data.getBoolean(\"d_fuel_stop\");\r\n\t\tboolean drone_user_stop = msg_data.getBoolean(\"d_user_stop\");\r\n\r\n\t\tif (drone_fuel_stop) {\r\n\t\t\tToast.makeText(dashboardActivity, msgFuelStop, Toast.LENGTH_LONG)\r\n\t\t\t\t\t.show();\r\n\t\t\trefreshLastMarker();\r\n\t\t} else if (drone_user_stop) {\r\n\t\t\tToast.makeText(dashboardActivity, msgUserStop, Toast.LENGTH_LONG)\r\n\t\t\t\t\t.show();\r\n\t\t\trefreshLastMarker();\r\n\t\t} else {\r\n\t\t\tdrone_speed = msg_data.getInt(\"d_speed\");\r\n\t\t\tdrone_fuel = msg_data.getDouble(\"d_fuel\");\r\n\t\t\tdrone_distance = msg_data.getDouble(\"d_distance\");\r\n\t\t\tdrone_latitude = msg_data.getDouble(\"d_latitude\");\r\n\t\t\tdrone_longitude = msg_data.getDouble(\"d_longitude\");\r\n\t\t\tdrone_altitude = msg_data.getDouble(\"d_altitude\");\r\n\t\t\trefreshOSF(drone_speed, drone_fuel, drone_distance, drone_altitude);\r\n\t\t\thandlePosition(drone_latitude, drone_longitude);\r\n\t\t}\r\n\t}",
"abstract public Object handleMessage(Object message) throws Exception;",
"public void handleMessage(Message msg) {\n \t\t\tif (msg.what < 0) {\n \t\t\t\tMyOrder.getFlaovorFromSetting();\n \t\t\t} else {\n \t\t\t\tMyOrder.saveFlavorToSetting();\n \t\t\t}\n \t\t}",
"private void customCommands(MessageEvent message) {\r\n String command = message.getMessage();\r\n \r\n if (!reservedCommands.contains(command)) {\r\n String[]info;\r\n info = manager.getCommandFromDatabase(command, message.getChannel().getName());\r\n\r\n //checks if the command is in custom mod commands\r\n if (info[1].matches(\"-m\")) {\r\n if (message.getChannel().getOps().contains(message.getUser())) {\r\n message.getChannel().send().message(info[0]);\r\n } \r\n else {\r\n message.respond(\"You're not allowed to use this command.\");\r\n }\r\n }\r\n //checks if the command is in the custom commands available to everyone\r\n else if (info[1].matches(\"-e\")) {\r\n message.getChannel().send().message(info[0]);\r\n } \r\n else {\r\n message.respond(\"No such command exists\");\r\n }\r\n }\r\n }",
"private int handleMessage (String msg)\n {\n \tif (state == STATE_CONNECTION_OPEN && msg.equals (expectedRequest))\n \t\t\treturn STATE_REQUEST_RECEIVED;\n \t\n \tif (state == STATE_REQUEST_RECEIVED && msg.matches (expectedUserAgent))\n \t\treturn STATE_AGENT_RECEIVED;\n \t\n \tif (state == STATE_AGENT_RECEIVED && msg.equals (expectedAuthorisation))\n \t\treturn STATE_AUTORISATION_RECEIVED;\n \t\n \tif (state == STATE_AUTORISATION_RECEIVED && msg.equals (\"\"))\n \t\treturn STATE_HEADER_COMPLETE;\n \t\n \tif (state == STATE_HEADER_COMPLETE && msg.equals (expectedLocation))\n \t\treturn STATE_LOCATION_RECEIVED;\n \t\n \treturn STATE_INVALID_HEADER;\n }",
"public boolean handleMessage(Message msg) \r\n\t{\t\r\n\t\tswitch (msg.what)\r\n\t\t{\r\n\t\tcase TCPClient.MSG_COMSTATUSCHANGE:\r\n\t\tcase MSG_UIREFRESHCOM:\r\n\t\t\t{\r\n\t\t\t\tif (msg.arg2==uitoken)\r\n\t\t\t\t\tUI_RefreshConnStatus ();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\tcase TCPClient.MSG_NEWSTATUSMESSAGE:\r\n\t\tcase MSG_NEWSTATUSMESSAGE:\t\r\n\t\t\t{\r\n\t\t\t\tif (msg.arg2==uitoken)\r\n\t\t\t\t{\r\n\t\t\t\t\tLog.e(TAG,\"Status Message ACCE : \" + (String)msg.obj);\r\n\t\t\t\t}\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\tcase TCPClient.MSG_CONNECTIONSTART:\r\n\t\t\t{\r\n\t\t\t\tif (msg.arg2==uitoken)\r\n\t\t\t\t{\r\n\t\t\t\t\tonRobotConnect (true);\r\n\t\t\t\t}\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\tcase TCPClient.MSG_CONNECTIONSTOP:\r\n\t\t\t{\r\n\t\t\t\tif (msg.arg2==uitoken)\r\n\t\t\t\t{\r\n\t\t\t\t\tboolean bbNotify;\r\n\t\t\t\t\tsynchronized (this)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tbbNotify=_bbCanSend;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tonRobotDisconnect (bbNotify);\r\n\t\t\t\t}\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\tcase TCPClient.MSG_SENT:\r\n\t\t\t{\r\n\t\t\t\tif (msg.arg2==uitoken)\r\n\t\t\t\t\tlast_sent_msg = (String)msg.obj;\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\tcase MSG_CENTER:\r\n\t\t\t{\r\n\t\t\t\tif (isConnecting())\r\n\t\t\t\t{\r\n\t\t\t\t\tstopConnection(true);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tstartConnection();\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}",
"private boolean processCommand(Command command)//Method was given\n {\n if(command.isUnknown())\n {\n System.out.println(\"I don't know what you mean...\");\n return false;\n }\n\n String commandWord = command.getCommandWord();\n if (commandWord.equals(\"help\"))\n printHelp();\n else if (commandWord.equals(\"go\"))\n goRoom(command);\n else if (commandWord.equals(\"talk\"))\n talkToCharacter(currentRoom);\n else if (commandWord.equals(\"grab\"))\n {\n secondWord = command.getSecondWord();\n if (secondWord == null)\n {\n System.out.println(\"Grab what?\");\n }\n else\n {\n grabItem(secondWord);\n }\n }\n else if (commandWord.equals(\"eat\"))\n {\n secondWord = command.getSecondWord();\n if (secondWord == null)\n {\n System.out.println(\"Eat what?\");\n }\n else\n {\n eatItem(secondWord);\n }\n }\n else if (commandWord.equals(\"inventory\")) \n player.getInventory();\n else if (commandWord.equals(\"drop\"))\n {\n secondWord = command.getSecondWord();\n if (secondWord == null)\n {\n System.out.println(\"Drop what?\");\n }\n else\n {\n dropItem(secondWord);\n }\n }\n else if (commandWord.equals(\"inspect\"))\n {\n secondWord = command.getSecondWord();\n if (secondWord == null)\n {\n System.out.println(\"Inspect what?\");\n }\n else\n {\n inspectItem(secondWord);\n }\n }\n else if (commandWord.equals(\"quit\"))\n {\n if(command.hasSecondWord())\n System.out.println(\"Quit what?\");\n else\n return true; // signal that we want to quit\n }\n else if (commandWord.equals(\"look\"))\n {\n System.out.println(currentRoom.longDescription());\n }\n return false;\n }",
"private void handleCommand(String commands) throws IOException {\n String[] command = commands.split(String.valueOf(Command.DELIMITER));\n String cmdResult;\n if (command[0].equalsIgnoreCase(String.valueOf(Command.PLAYER_JOINED))) {\n // handlePlayerJoined\n handlePlayerJoined(command[1]);\n } else if (command[0].equalsIgnoreCase(String.valueOf(Command.UPDATE_COLOR))) {\n // handleUpdateColor\n handleColorUpdate(Color.fromString(command[1]));\n } else if (command[0].equalsIgnoreCase(String.valueOf(Command.SYNC_BOARD))) {\n // handleSyncBoard\n updateBoard(command);\n } else if (command[0].equalsIgnoreCase(String.valueOf(Command.MAKE_MOVE))) {\n // handleMakeMove\n handleMove();\n\n\n// } else if (command.equals(Character.toString(ProtocolMessages.EXIT))) {\n// in.close();\n// out.close();\n// sock.close();\n } else {\n clientTUI.showMessage(\"Check your parameters\");\n try {\n sendMessage(\"Unknown Command\");\n } catch (ServerUnavailableException e) {\n e.printStackTrace();\n }\n }\n }",
"@Override\r\n\tpublic boolean handleMessage(Message msg) {\n\t\treturn false;\r\n\t}",
"protected String processCommand(String command)\n {\n switch (command)\n {\n case \"HELLO\":\n return \"h\";\n case \"MOVE N\":\n return \"mn\";\n case \"MOVE S\":\n return \"ms\";\n case \"MOVE E\":\n return \"me\";\n case \"MOVE W\":\n return \"mw\";\n case \"PICKUP\":\n return \"p\";\n case \"LOOK\":\n return \"l\";\n case \"QUIT\":\n return \"q\";\n default:\n return \"i\";\n }\n }",
"abstract public boolean handleMessage(int what, int result, Object data, String message, boolean option);",
"private void handleCommand(String input) throws ClientOfflineException, ServerException {\n String[] params = input.split(\" \");\n Command command = this.availableCommandMap.get(params[0]);\n String argument = (params.length <= 1) ? null : params[1];\n command.execute(this, argument);\n }",
"@Override\n public void handleMessage(Message msg) {\n String turnDirection = (String) msg.obj;\n\n int distance = 0;\n\n // if there are two or more waypoints to go\n if(navigationPath.size()>=2)\n distance = (int) GeoCalulation.getDistance(navigationPath.get(0), navigationPath.get(1));\n\n navigationInstructionDisplay(turnDirection, distance);\n\n }",
"private boolean processCommand(Command command) \n {\n boolean wantToQuit = false;\n\n CommandWord commandWord = command.getCommandWord();\n\n switch (commandWord) {\n case UNKNOWN:\n System.out.println(\"I don't know what you mean...\");\n break;\n\n case HELP:\n printHelp();\n break;\n\n case GO:\n goRoom(command);\n break;\n\n case QUIT:\n wantToQuit = quit(command);\n break;\n \n case LOOK:\n look();\n break;\n \n case RELAX:\n relax();\n break;\n \n case BACK:\n back();\n break;\n }\n return wantToQuit;\n }",
"public void Decipher(String message){\n try{\n int tile = Integer.parseInt(message);\n MoveTileOpponent(tile);\n\n }catch (NumberFormatException e){\n // bomb\n if(message.equals(\"win\")){\n onWin();\n return;\n }\n if(message.equals(\"opponent_confusion\")){\n confused = true;\n return;\n }\n String[] sep = message.split(\" \");\n String tile = sep[1];\n if(sep[0].equals(\"bomb\")){\n placeBomb(Integer.parseInt(tile), true);\n }\n if(sep[0].equals(\"bomb_remove\")){\n bombs_location.remove(Integer.parseInt(tile));\n return;\n }\n if(sep[0].equals(\"powerup\")){\n placePowerup(tile);\n return;\n }\n if(sep[0].equals(\"powerup_remove\")){\n powerup_location.remove(Integer.parseInt(tile));\n return;\n }\n }\n }",
"private boolean processCommand(Command command) \n {\n boolean wantToQuit = false;\n\n if(command.isUnknown()) {\n System.out.println(\"I don't know what you mean...\");\n return false;\n }\n\n String commandWord = command.getCommandWord();\n if (commandWord.equals(\"help\"))\n printHelp();\n else if (commandWord.equals(\"go\"))\n goRoom(command);\n else if (commandWord.equals(\"quit\"))\n wantToQuit = quit(command);\n\n return wantToQuit;\n }",
"public synchronized boolean process(Connection con, String msg) {\n\t\tJsonObject receivedMSG;\n\n\t\ttry {\n\t\t\treceivedMSG = parser.parse(msg).getAsJsonObject();\n\t\t\t// System.out.println(\"string to json \" + receivedMSG);\n\t\t} catch (JsonSyntaxException e) {\n\t\t\treturn true;\n\t\t}\n\t\ttry {\n\t\t\t// Check the integrity of the message\n\t\t\tif (!checkMsgIntegrity(con, receivedMSG)) {\n\t\t\t\tcon.closeCon();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tString message = receivedMSG.get(\"command\").getAsString();\n\t\t\tswitch (message) {\n\t\t\tcase REGISTER:\n\t\t\t\treturn !register(con, receivedMSG);\n\t\t\tcase LOGIN:\n\t\t\t\treturn !login(con, receivedMSG);\n\t\t\tcase AUTHENTICATE:\n\t\t\t\treturn !auth(con, receivedMSG);\n\t\t\tcase INVALID_MESSAGE:\n\t\t\t\tcon.closeCon();\n\t\t\t\treturn false;\n\t\t\tcase SERVER_ANNOUNCE:\n\t\t\t\treturn !announce(con, receivedMSG);\n\t\t\tcase LOGOUT:\n\t\t\t\tcon.closeCon();\n\t\t\t\treturn false;\n\t\t\tcase LOCK_REQUEST:\n\t\t\t\treturn !lockRequest(con, receivedMSG);\n\t\t\tcase LOCK_DENIED:\n\t\t\t\treturn !lockProcess(con, receivedMSG);\n\t\t\tcase LOCK_ALLOWED:\n\t\t\t\treturn !lockProcess(con, receivedMSG);\n\t\t\tcase ACTIVITY_BROADCAST:\n\t\t\t\treturn !broadcast(con, receivedMSG);\n\t\t\tcase ACTIVITY_MESSAGE:\n\t\t\t\treturn !broadcast(con, receivedMSG);\n\t\t\tcase AUTHENTICATION_FAIL:\n\t\t\t\tcon.closeCon();\n\t\t\t\treturn false;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} catch (NullPointerException e) {\n\t\t\te.printStackTrace();\n\t\t\tInvalidMessage invalid = new InvalidMessage();\n\t\t\tinvalid.setInfo(\"Not enough info in message,\" + \" possibly no authenticated user in ACTIVITY_BROADCAST ?\");\n\t\t\tcon.writeMsg(invalid.toJsonString());\n\t\t}\n\t\treturn false;\n\t}",
"@Override\n public void onMessage(MessageEvent event) throws InterruptedException, Exception {\n \n String message = Colors.removeFormattingAndColors(event.getMessage());\n \n if (message.startsWith(Global.commandPrefix)&&!message.matches(\"([ ]{0,}\"+Global.commandPrefix+\"{1,}[ ]{0,}){1,}\")){\n \n String command = message.split(Global.commandPrefix)[1];\n String[] cmdSplit = command.split(\" \");\n \n if (cmdSplit[0].equalsIgnoreCase(\"blackjack\")&&!GameUtils.areGamesBlocked(event.getChannel().getName())){\n \n String gameChan = event.getChannel().getName();\n \n if (!GameListener.activeGame.contains(new String[] {gameChan, \"blackjack\", \"long\"})){\n \n int minBet = 10;\n String options = null;\n \n // OPTIONS FOR THE GAME\n if (cmdSplit.length>1&&cmdSplit.length<=3){\n for (int i=1;i<cmdSplit.length;i++){\n \n if (cmdSplit[i].matches(\"[0-9]+\")){\n minBet = Integer.parseInt(cmdSplit[i]);\n }\n \n else if(cmdSplit[i].matches(\"\\\\-[0-9\\\\.]+\")){\n event.getBot().sendIRC().notice(event.getUser().getNick(),\"The minimum bet must be a non-negative integer\");\n return;\n }\n \n else if(cmdSplit[i].matches(\"[a-z]+\")){\n if (cmdSplit[i].equalsIgnoreCase(\"multi\")||cmdSplit[i].equalsIgnoreCase(\"single\")){\n options = cmdSplit[i];\n }\n else{\n event.getBot().sendIRC().notice(event.getUser().getNick(),\"Unknown option. Available options include 'Single' and 'Multi'\");\n return;\n }\n }\n }\n }\n else if (cmdSplit.length>3){\n event.getBot().sendIRC().notice(event.getUser().getNick(),\"BlackJack accepts at most 2 options\");\n }// END OPTIONS PARSING\n \n \n if (GameListener.scores.getScore(event.getUser().getNick())<minBet){\n event.getBot().sendIRC().notice(event.getUser().getNick(),\"You don't have enough money to play blackjack with a minimum bet of $\"+minBet);\n }\n else{\n \n GameListener.activeGame.add(gameChan, \"blackjack\", \"long\");//Lets add the game to the array well after the input checks\n \n int key=(int) (Math.random()*100000+1);\n int counter = 1; // Current player number, as Wheatley (dealer) is 0, starts at 1\n int prev = 0;\n int busted = 0; // Number of people who've busted their hand\n boolean running = true;\n \n ArrayList<String> users = new ArrayList<>();\n users.add(event.getBot().getNick()); // BOT is user 0\n users.add(event.getUser().getNick()); // Any other users are added after the dealer/bot\n \n if (options!=null){\n if (options.equalsIgnoreCase(\"multi\")){\n event.getBot().sendIRC().message(gameChan,event.getUser().getNick()+\" wants to play blackjack, type !dealmein to join\");\n MultiplayerArrayGetQueue getPlayers = new MultiplayerArrayGetQueue(event,\"dealmein\",25,maxUsers-2);\n getPlayers.setScoringRequirements(GameListener.scores,minBet);\n users.addAll(getPlayers.getPlayers());\n }\n }\n \n \n QueueTime gameUpdater = new QueueTime(event,time,key);\n Thread t = new Thread(gameUpdater);\n gameUpdater.giveT(t);\n t.start();\n \n DeckOfCards deck = new DeckOfCards();\n deck.shuffle();\n ArrayList<CardHand> hands = new ArrayList<>();\n \n for (int i=0;i<users.size();i++){\n hands.add(new CardHand(users.get(i))); // Bot is user 0\n }\n \n // DEAL CARDS TO ALL PLAYERS AND DEALER\n for (int i=0;i<2;i++){\n for (int j=0;j<hands.size();j++){\n hands.get(j).addCard(deck.dealCard());\n }\n }// END DEALING\n \n if (hands.size()>2){ // MASK HANDS WHEN THERE ARE MULTIPLE PLAYERS IN ONE CHANNEL\n event.getBot().sendIRC().notice(hands.get(counter).getPlayer(),\"Your hand: \"+hands.get(counter).toColoredString()+\"Total: \"+hands.get(counter).getBlackjackHandValue());\n event.getBot().sendIRC().message(gameChan,hands.get(counter).getPlayer()+\"'s turn, will you hit (h) or stay (s)?\");\n prev = counter;\n }\n else{\n event.getBot().sendIRC().message(gameChan,\"Your hand: \"+hands.get(counter).toColoredString()+\"Total: \"+hands.get(counter).getBlackjackHandValue()+\" Will you hit (h) or stay (s)?\");\n }\n \n WaitForQueue queue = new WaitForQueue(event.getBot());\n \n while (running){\n \n MessageEvent currentEvent = queue.waitFor(MessageEvent.class);\n String currentMessage = Colors.removeFormattingAndColors(currentEvent.getMessage());\n String currentChan = currentEvent.getChannel().getName();\n \n if (currentMessage.equalsIgnoreCase(Integer.toString(key))){\n \n for (int i=0;i<users.size();i++){\n if (users.get(i).equalsIgnoreCase(hands.get(counter).getPlayer())){\n users.remove(i);\n break;\n }\n }\n event.getBot().sendIRC().message(gameChan,hands.get(counter).getPlayer()+\"'s turn will be skipped and they will be dealt out next hand due to inactivity\");\n counter++;\n \n if (users.size()>1&&counter<hands.size()){\n if (hands.size()>2){ // HIDE YOUR HAND IF THERES MORE THAN JUST TWO PLAYERS (PLAYER AND BOT)\n event.getBot().sendIRC().notice(hands.get(counter).getPlayer(),\"Your hand: \"+hands.get(counter).toColoredString()+\"Total: \"+hands.get(counter).getBlackjackHandValue());\n if (prev!=counter){\n event.getBot().sendIRC().message(gameChan,hands.get(counter).getPlayer()+\"'s turn, will you hit (h) or stay (s)?\");\n prev=counter;\n }\n }\n else{\n event.getBot().sendIRC().message(gameChan,\"Your hand: \"+hands.get(counter).toColoredString()+\"Total: \"+hands.get(counter).getBlackjackHandValue()+\" Will you hit (h) or stay (s)?\");\n }\n }\n \n key=(int) (Math.random()*100000+1);\n gameUpdater.interrupt();\n gameUpdater = new QueueTime(event,time,key);\n t = new Thread(gameUpdater);\n gameUpdater.giveT(t);\n t.start();\n\n }\n else if(currentChan.equalsIgnoreCase(gameChan)){\n if (hands.get(counter).getPlayer().equalsIgnoreCase(currentEvent.getUser().getNick())){\n if (currentMessage.equalsIgnoreCase(\"h\")||currentMessage.equalsIgnoreCase(\"s\")){\n \n if (currentMessage.equalsIgnoreCase(\"h\")){\n hands.get(counter).addCard(deck.dealCard());\n \n if (hands.get(counter).getBlackjackHandValue()>21){\n event.getBot().sendIRC().message(gameChan, \"You have BUSTED! \"+hands.get(counter).getPlayer()+\"'s hand was \" +hands.get(counter).toColoredString() + \"Total: \"+hands.get(counter).getBlackjackHandValue());\n counter++;\n busted++;\n }\n }// END HIT\n \n else if (currentMessage.equalsIgnoreCase(\"s\")){\n counter++;\n }// END STAY\n \n if (counter<hands.size()){ // SHOW THE PLAYER THEIR HAND\n if (hands.size()>2){ // HIDE YOUR HAND IF THERES MORE THAN JUST TWO PLAYERS (PLAYER AND BOT)\n event.getBot().sendIRC().notice(hands.get(counter).getPlayer(),\"Your hand: \"+hands.get(counter).toColoredString()+\"Total: \"+hands.get(counter).getBlackjackHandValue());\n if (prev!=counter){\n event.getBot().sendIRC().message(gameChan,hands.get(counter).getPlayer()+\"'s turn, will you hit (h) or stay (s)?\");\n prev=counter;\n }\n }\n else{\n event.getBot().sendIRC().message(gameChan,\"Your hand: \"+hands.get(counter).toColoredString()+\"Total: \"+hands.get(counter).getBlackjackHandValue()+\" Will you hit (h) or stay (s)?\");\n }\n }// END CURRENT HAND DISPLAY\n \n key=(int) (Math.random()*100000+1);\n gameUpdater.interrupt();\n gameUpdater = new QueueTime(event,time,key);\n t = new Thread(gameUpdater);\n gameUpdater.giveT(t);\n t.start();\n \n }\n \n else if (currentMessage.equalsIgnoreCase(\"!dealmeout\")){\n boolean removed = false;\n for (int i=0;i<users.size();i++){\n if (users.get(i).equalsIgnoreCase(currentEvent.getUser().getNick())){\n users.remove(i);\n event.getBot().sendIRC().notice(currentEvent.getUser().getNick(),\"You will be dealt out of the next hand\");\n break;\n }\n }\n if (removed)\n event.getBot().sendIRC().notice(currentEvent.getUser().getNick(),\"You're is not currently an active player in this game\");\n }// END REMOVE USER FROM CURRENT GAME\n \n \n \n else if (currentMessage.equalsIgnoreCase(\"!fuckthis\")||currentMessage.equalsIgnoreCase(\"i give up\")){\n if (hands.size()==2){\n currentEvent.respond(\"You have given up. \" + Global.mainNick + \"'s hand was \"+hands.get(getHandByPlayer(hands, event.getBot().getNick())).toColoredString() + \"Total: \"+hands.get(getHandByPlayer(hands, event.getBot().getNick())).getBlackjackHandValue());\n queue.close();\n break;\n }\n else{\n currentEvent.respond(\"You have given up. \");\n for (int i=0;i<users.size();i++){\n if (users.get(i).equalsIgnoreCase(currentEvent.getUser().getNick())){\n users.remove(i);\n event.getBot().sendIRC().notice(currentEvent.getUser().getNick(),\"You will be dealt out of the next hand\");\n break;\n }\n }\n }\n }\n }\n else if (currentMessage.equalsIgnoreCase(\"!dealmein\")){\n if (users.size()<maxUsers){\n users.add(currentEvent.getUser().getNick());\n event.getBot().sendIRC().notice(currentEvent.getUser().getNick(),\"You will be dealt into the next hand\");\n }\n else{\n event.getBot().sendIRC().notice(currentEvent.getUser().getNick(),\"Current game is full, please wait till another user leaves\");\n }\n }// END ADD USER TO GAME\n else if (currentMessage.equalsIgnoreCase(\"!dealmeout\")){\n boolean removed = false;\n for (int i=0;i<users.size();i++){\n if (users.get(i).equalsIgnoreCase(currentEvent.getUser().getNick())){\n users.remove(i);\n removed = true;\n event.getBot().sendIRC().notice(currentEvent.getUser().getNick(),\"You will be dealt out of the next hand\");\n break;\n }\n }\n if (!removed)\n event.getBot().sendIRC().notice(currentEvent.getUser().getNick(),\"You're not currently an active player in this game\");\n }// END REMOVE USER FROM CURRENT GAME\n }\n \n // Wheatley's Move\n if (counter>=hands.size()){\n counter = 0;\n if (busted < (hands.size()-1)){\n while (hands.get(counter).getBlackjackHandValue()<17||(hands.get(counter).isBlackjackHandSoft()&&hands.get(counter).getBlackjackHandValue()==17)){\n hands.get(counter).addCard(deck.dealCard());\n event.getBot().sendIRC().message(gameChan,Global.mainNick+\" hits: \"+hands.get(counter).toMaskedString());\n }\n if (hands.get(counter).getBlackjackHandValue()>21){\n event.getBot().sendIRC().message(gameChan, Global.mainNick+\" has BUSTED! \"+Global.mainNick+\"'s hand was \" +hands.get(counter).toColoredString() + \"Total: \"+hands.get(counter).getBlackjackHandValue());\n }\n }\n busted = 0;\n }// END WHEATLEY'S MOVE\n \n // Wheatley is the last player to go, if he's done, then all players are done\n if (counter == 0){\n \n ArrayList<Integer> winner = new ArrayList<>();\n {\n int i=0;\n while (winner.size()<1&&i<hands.size()){\n if (hands.get(i).getBlackjackHandValue()<=21)\n winner.add(i);\n i++;\n }\n }\n \n for (int i=0; i<hands.size();i++)\n System.out.println(hands.get(i).getPlayer());\n \n for (int i=0;i<hands.size();i++){ // START SCORING\n \n if (hands.get(i).getBlackjackHandValue()<=21){\n \n if (hands.get(i).getBlackjackHandValue()>hands.get(winner.get(0)).getBlackjackHandValue()){//|| hands.get(winningHand).getBlackjackHandValue()>21){\n winner.clear();\n winner.add(i);\n }\n \n else if (hands.get(i).getBlackjackHandValue()==hands.get(winner.get(0)).getBlackjackHandValue()){\n//if hands are equal to 21, player with blackjack wins\n// if both have blackjack, dealer wins, if neither are the dealer, winnings are split\n \n if (hands.get(i).isHandBlackjack()&&!hands.get(winner.get(0)).isHandBlackjack()){\n winner.clear();\n winner.add(i);\n }\n else if (hands.get(i).isHandBlackjack()&&hands.get(winner.get(0)).isHandBlackjack()){\n if(hands.get(i).getPlayer().equalsIgnoreCase(event.getBot().getNick())||hands.get(winner.get(0)).getPlayer().equalsIgnoreCase(event.getBot().getNick())){\n winner.clear();\n winner.add(0);\n }\n else{\n winner.add(i);\n }\n }\n else if (hands.get(i).getPlayer().equalsIgnoreCase(event.getBot().getNick())||hands.get(winner.get(0)).getPlayer().equalsIgnoreCase(event.getBot().getNick())){\n winner.clear();\n winner.add(0);\n }\n else if (!winner.contains(i)){\n winner.add(i);\n }\n }\n }\n }// END SCORING\n \n double multiplier=1;\n if (hands.get(winner.get(0)).isHandBlackjack()&&!hands.get(winner.get(0)).getPlayer().equalsIgnoreCase(event.getBot().getNick()))\n multiplier=1.5;\n \n int earnings = (int) ((minBet*(hands.size()-1) * multiplier) / winner.size());\n \n for (int i=0;i<winner.size();i++){\n event.getBot().sendIRC().message(gameChan,hands.get(winner.get(i)).getPlayer()+\" has won! The winning hand was \"+ hands.get(winner.get(i)).toColoredString()+\"totaling \"+hands.get(winner.get(i)).getBlackjackHandValue()+\" and earning $\"+earnings+\", everyone else has lost $\"+minBet);\n GameListener.scores.addScore(hands.get(winner.get(i)).getPlayer(),earnings);\n }\n \n//subtract bet from all players scores, winners included\n//add all losses/bets into winning pool, split by number of winners evenly\n\n // SUBTRACT BET FROM ALL USERS BUT THE WINNER\n for (int i=0;i<hands.size();i++){\n if(!winner.contains(i)){\n \n if (i==0)\n GameListener.scores.subtractScore(hands.get(i).getPlayer(),(int) (minBet*(1.5*winner.size())));\n else\n GameListener.scores.subtractScore(hands.get(i).getPlayer(),minBet);\n }\n }// END UPDATE ALL USERS SCORES BUT THE WINNER\n \n for (int i=0;i<users.size();i++){\n if(GameListener.scores.getScore(users.get(i))<minBet){\n event.getBot().sendIRC().message(currentEvent.getChannel().getName(),users.get(i)+\" does not have enough money to cover the current bet and will not be dealt in this round\");\n users.remove(i);\n i--;\n }\n }// End cleaning user array\n\n \n // ONLY CONTINUE IF MORE THAN THE DEALER ARE PLAYING\n if (users.size()>1){\n counter=1;\n deck = new DeckOfCards();\n deck.shuffle();\n hands.clear();\n \n // CREATE HANDS\n for (int i=0;i<users.size();i++){\n hands.add(new CardHand(users.get(i)));\n }// END CREATE HANDS\n \n // DEAL CARDS\n for (int i=0;i<2;i++){\n for (int j=0;j<hands.size();j++){\n hands.get(j).addCard(deck.dealCard());\n }\n }// END DEAL CARDS\n \n if (hands.size()>2){ // HIDE YOUR HAND IF THERES MORE THAN JUST TWO PLAYERS (PLAYER AND BOT)\n event.getBot().sendIRC().notice(hands.get(counter).getPlayer(),\"Your hand: \"+hands.get(counter).toColoredString()+\"Total: \"+hands.get(counter).getBlackjackHandValue());\n if (prev!=counter){\n event.getBot().sendIRC().message(gameChan,hands.get(counter).getPlayer()+\"'s turn, will you hit (h) or stay (s)?\");\n prev=counter;\n }\n }\n else{\n event.getBot().sendIRC().message(gameChan,\"Your hand: \"+hands.get(counter).toColoredString()+\"Total: \"+hands.get(counter).getBlackjackHandValue()+\" Will you hit (h) or stay (s)?\");\n }\n }// END NEXT HAND START\n else if(users.isEmpty()||users.size()==1){\n event.getBot().sendIRC().message(gameChan,\"Looks like nobody is around, Thanks for playing BlackJack! Come again soon!\");\n running = false;\n queue.close();\n }\n } // ENDS AFTER WHEATLEY'S MOVE\n }\n GameListener.activeGame.remove(gameChan,\"blackjack\"); //updated current index of the game\n }\n }\n else\n event.getBot().sendIRC().notice(event.getUser().getNick(),\"Game Currently running in this channel\");\n }\n }\n }",
"private void handleMessage (Message message, Update update){\r\n\t\tSendMessage sendMessage = new SendMessage();\r\n\t\tLong chatId = update.getMessage().getChatId();\r\n\t\tif (isPolling == true){//Si el comando de la encuesta ha sido pulsado, modo encuesta...\t\t\t\r\n\t\t\tif (haveQuestion == false){//Si es falso todavia no se ha asignado la pregunta...\r\n\t\t\t\tpoll.setQuestion(message.getText());//Asignamos\tla pregunta.\t\t\t\r\n\t\t\t\tsendMessage.setChatId(chatId);\r\n\t\t\t\tsendMessage.setParseMode(Poll.parseMode);\r\n\t\t\t\tsendMessage.setText(BotConfig.POLL_QUESTION_STRING+ message.getText() +BotConfig.POLL_FIRST_ANSWER_STRING);\r\n\t\t\t\thaveQuestion = true;//Marcamos que hay pregunta.\r\n\t\t\t} else {//En este estado tenemos la pregunta, asignamos las respuestas.\r\n\t\t\t\tpoll.setAnswers(message.getText());\t\t\t\t\r\n\t\t\t\tsendMessage.setChatId(chatId);\r\n\t\t\t\tsendMessage.setText(BotConfig.POLL_ANSWER_STRING);\r\n\t\t\t}\t\t\t\r\n\t\t} else if(update.getMessage().getFrom().getId() != null){//Si el id del usuario no es null...\r\n\t\t\tInteger id = update.getMessage().getFrom().getId();\r\n\t\t\tif (id == BotConfig.DEV_ID){//Si es mi id...\r\n\t\t\t\tsendMessage.setChatId(chatId);\r\n\t\t\t\tsendMessage.setText(BotConfig.DEV_WORDS);//Mensaje personalizado...xD\r\n\t\t\t}\t\r\n\t\t} else {//Sino respondemos con el mismo texto enviado por el usuario.\r\n\t\t\tsendMessage.setChatId(chatId);\r\n\t\t\tsendMessage.setText(update.getMessage().getText());\r\n\t\t} \t\t\r\n try { \t\r\n execute(sendMessage);//Enviamos mensaje. \r\n } catch (TelegramApiException e) {\r\n \tBotLogger.error(LOGTAG, e);//Guardamos mensaje y lo mostramos en pantalla de la consola.\r\n e.printStackTrace();\r\n }\r\n\t}",
"public void\n\t\t\thandleCommand(/*@ non_null */ String command);",
"private void processCommand(Command command) {\n if (command.commandIsUnknown()) {\n System.out.println(\"I don't know what you mean...\");\n } else {\n String commandWord = command.getCommandWord();\n // process all possible commands\n if (commandWord.equals(\"help\")) {\n printHelp();\n } else if (commandWord.equals(\"go\")) {\n if (!command.hasSecondWord()) {\n System.out.println(\"Go where?\");\n } else {\n goDirection(command);\n }\n } else if (commandWord.equals(\"quit\")) {\n if (command.hasSecondWord()) {\n System.out.println(\"Quit what?\");\n } else {\n finished = true;\n }\n }\n }\n }",
"private void processMessage(String msg) {\n\t\t\tif (msg.equals(Message.TEST_SERVER)) {\n\t\t\t\tSystem.out.println(\"Server test passed. Testing client...\");\n\t\t\t\tpw.println(Message.TEST_CLIENT);\n\t\t\t}\n\t\t}",
"boolean processCommand() throws IOException\n\t{\n\t\tString[] commands = in.readLine().split(\" \");\n\t\tif (commands[0].equalsIgnoreCase(\"F\") && isNum(commands[1]) && isNum(commands[2])) {\n\t\t\tprocessFireCmd(new String[] {commands[1], commands[2]});\n\t\t} else if (commands[0].equalsIgnoreCase(\"C\")) {\n\t\t\tprocessChatCmd (Arrays.copyOfRange(commands, 1, commands.length).toString());\n\t\t} else if (commands[0].equalsIgnoreCase(\"D\")) {\n\t\t\tout.println(\"My board: \\n\");\n\t\t\tboard.draw();\n\t\t\tout.println(\"Target's board: \\n\");\n\t\t\ttargets.draw();\n\t\t\tout.flush();\n\t\t} else {\n\t\t\tout.println(\"Unknown command.\");\n\t\t\tout.flush();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"public void handleEvent(Message event) {\n\r\n if(m_ensureLock && event.getMessageType() == Message.ARENA_MESSAGE && event.getMessage().equals(\"Arena UNLOCKED\")) {\r\n m_botAction.toggleLocked();\r\n return;\r\n }\r\n\r\n if(event.getMessageType() != Message.PRIVATE_MESSAGE) {\r\n return;\r\n }\r\n\r\n int id = event.getPlayerID();\r\n String name = m_botAction.getPlayerName(id);\r\n String msg = event.getMessage().trim().toLowerCase();\r\n\r\n if(name == null || msg == null || msg.length() == 0) {\r\n return;\r\n }\r\n\r\n String lcname = name.toLowerCase();\r\n\r\n boolean isSmod = m_operatorList.isSmod(lcname);\r\n boolean hasAccess = isSmod || m_access.contains(lcname);\r\n\r\n /* public pm commands */\r\n //!help\r\n if(msg.equals(\"!help\")) {\r\n m_botAction.privateMessageSpam(id, help_player);\r\n\r\n if(hasAccess) {\r\n m_botAction.privateMessageSpam(id, help_staff);\r\n }\r\n\r\n if(isSmod) {\r\n m_botAction.privateMessageSpam(id, help_smod);\r\n m_botAction.sendPrivateMessage(id, \"Database: \" + (m_botAction.SQLisOperational() ? \"online\" : \"offline\"));\r\n }\r\n\r\n //!status\r\n } else if(msg.equals(\"!status\")) {\r\n cmdStatus(id);\r\n\r\n //!spec\r\n } else if(msg.equals(\"!spec\")) {\r\n if(m_state.isStarting() || m_state.isStartingFinal()) {\r\n m_botAction.specWithoutLock(id);\r\n }\r\n\r\n //!about\r\n } else if(msg.equals(\"!about\")) {\r\n m_botAction.sendPrivateMessage(id, \"KimBot! (2007-12-15) by flibb <ER>\", 7);\r\n\r\n //!lagout/!return\r\n } else if(msg.equals(\"!lagout\") || msg.equals(\"!return\")) {\r\n KimPlayer kp = m_allPlayers.get(lcname);\r\n\r\n if(kp == null) {\r\n return;\r\n }\r\n\r\n if(!kp.m_isOut) {\r\n synchronized(m_state) {\r\n if((m_state.isMidGame() || m_state.isMidGameFinal()) && m_lagoutMan.remove(lcname)) {\r\n putPlayerInGame(id, kp, false);\r\n } else if((m_state.isStarting() || m_state.isStartingFinal()) && m_startingLagouts.remove(lcname)) {\r\n m_startingReturns.add(kp);\r\n m_botAction.sendPrivateMessage(id, \"You will be put in at the start of the game.\");\r\n }\r\n }\r\n } else {\r\n m_botAction.sendPrivateMessage(id, \"Cannot return to game.\");\r\n }\r\n\r\n //poll vote\r\n } else if(Tools.isAllDigits(msg)) {\r\n if(m_poll != null) {\r\n m_poll.handlePollCount(id, name, msg);\r\n }\r\n\r\n /* staff commands */\r\n } else if(hasAccess) {\r\n //!start\r\n if(msg.equals(\"!start\")) {\r\n m_deathsToSpec = 10;\r\n m_maxTeamSize = 1;\r\n cmdStart(id);\r\n } else if(msg.startsWith(\"!start \")) {\r\n String[] params = msg.substring(7).split(\" \");\r\n m_deathsToSpec = 10;\r\n m_maxTeamSize = 1;\r\n\r\n for(String p : params) {\r\n try {\r\n if(Tools.isAllDigits(p)) {\r\n m_deathsToSpec = Integer.parseInt(p);\r\n } else if(p.startsWith(\"teams=\")) {\r\n m_maxTeamSize = Integer.parseInt(p.substring(6));\r\n }\r\n } catch(NumberFormatException e) {\r\n m_botAction.sendPrivateMessage(id, \"Can't understand: \" + p);\r\n return;\r\n }\r\n }\r\n\r\n m_deathsToSpec = Math.max(1, Math.min(99, m_deathsToSpec));\r\n m_maxTeamSize = Math.max(1, Math.min(99, m_maxTeamSize));\r\n cmdStart(id);\r\n //!stop\r\n } else if(msg.equals(\"!stop\")) {\r\n cmdStop(id);\r\n //!die\r\n } else if(msg.equals(\"!die\")) {\r\n if(m_state.isStopped()) {\r\n m_lvz.clear();\r\n\r\n try {\r\n Thread.sleep(3000);\r\n } catch(InterruptedException e) {}\r\n\r\n m_botAction.die(\"!die by \" + name);\r\n } else {\r\n m_botAction.sendPrivateMessage(id, \"A game is in progress. Use !stop first.\");\r\n }\r\n\r\n //!startinfo\r\n } else if(msg.equals(\"!startinfo\")) {\r\n if(m_state.isStopped() || m_startedBy == null) {\r\n m_botAction.sendPrivateMessage(id, \"No one started a game.\");\r\n } else {\r\n m_botAction.sendPrivateMessage(id, \"Game started by \" + m_startedBy);\r\n }\r\n\r\n //!reset\r\n } else if(msg.equals(\"!reset\")) {\r\n if(m_state.isStopped()) {\r\n resetArena();\r\n m_botAction.sendPrivateMessage(id, \"Resetted.\");\r\n } else {\r\n m_botAction.sendPrivateMessage(id, \"A game is in progress. Use !stop first.\");\r\n }\r\n\r\n //!remove\r\n } else if(msg.startsWith(\"!remove \")) {\r\n synchronized(m_state) {\r\n if(m_state.isStopped()) {\r\n m_botAction.sendPrivateMessage(id, \"The game is not running.\");\r\n } else {\r\n cmdRemove(id, msg.substring(8));\r\n }\r\n }\r\n\r\n //!test\r\n } else if(msg.startsWith(\"!test\")) {\r\n m_botAction.sendArenaMessage(Tools.addSlashes(\"test'test\\\"test\\\\test\"));\r\n\r\n } else if(isSmod) {\r\n //!addstaff\r\n if(msg.startsWith(\"!addstaff \")) {\r\n String addname = msg.substring(10);\r\n\r\n if(addname.length() <= 1 || addname.indexOf(':') >= 0) {\r\n m_botAction.sendPrivateMessage(id, \"Invalid name. Access list not changed.\");\r\n } else if(addname.length() > MAX_NAMELENGTH) {\r\n m_botAction.sendPrivateMessage(id, \"Name too long. Max. 18 characters.\");\r\n } else if(m_access.add(msg.substring(10))) {\r\n updateAccessList(id);\r\n } else {\r\n m_botAction.sendPrivateMessage(id, \"That name already has access.\");\r\n }\r\n\r\n //!delstaff\r\n } else if(msg.startsWith(\"!delstaff \")) {\r\n if(m_access.remove(msg.substring(10))) {\r\n updateAccessList(id);\r\n } else {\r\n m_botAction.sendPrivateMessage(id, \"Name not found.\");\r\n }\r\n\r\n //!accesslist\r\n } else if(msg.equals(\"!accesslist\")) {\r\n for(String s : m_access) {\r\n m_botAction.sendPrivateMessage(id, s);\r\n }\r\n\r\n m_botAction.sendPrivateMessage(id, \"End of list.\");\r\n //!purge\r\n } else if(msg.equals(\"!purge\")) {\r\n cmdPurge(id, 90);\r\n } else if(msg.startsWith(\"!purge \")) {\r\n try {\r\n cmdPurge(id, Integer.parseInt(msg.substring(7)));\r\n } catch(NumberFormatException e) {\r\n m_botAction.sendPrivateMessage(id, \"Nothing done. Check your typing.\");\r\n }\r\n }\r\n }\r\n }\r\n }",
"@Override\r\n public void handleMessage(Message msg) {\n }",
"private void processCommand(Command command) {\n // Switch construct\n System.out.println(); // formatting\n CommandWord commandWord = command.getCommandWord();\n switch (commandWord) {\n case ATTACK:\n System.out.println(\"You attack the monster!\");\n\n // calculate the damage this enemy will do\n int playerDifferenceHit = player.getMaxHit() - player.getMinHit(); // 5 - 3 = 2. \n int playerMinimumDamage = randomize.getRandomDamage(playerDifferenceHit); // returns 1-3\n int damage = playerDifferenceHit + playerMinimumDamage; // add the minimum damage, to random hit damage.\n\n System.out.println(\"You deal \" +damage+ \" damage!\");\n enemy.removeHealth(damage);\n\n enemyturn(); // let the enemy attack\n break;\n\n case EAT: // reach out to the main game again, then parse the command as usual\n int tempHealth = player.getHealth();\n eatItem(command);\n\n if (tempHealth == player.getHealth()) {\n // The player failed to eat something. Decrease the round\n round--;\n } else {\n // The player succesfully ate and recovered some HP.\n enemyturn(); // let the enemy attack\n }\n break;\n\n case INSPECT:\n System.out.println(\"You have a good look at the enemy:\");\n System.out.println(enemy.getDescription() + \" The enemy has \" + enemy.getHealth() + \" health left.\");\n System.out.println(\"You have a good look at yourself:\");\n System.out.println(\"You have \" + player.getHealth() + \" health left.\");\n round--;\n break;\n\n case RUN:\n System.out.println(\"You try to run...\");\n int canRun = randomize.getRandomNumber(4); // gets back 1 -4\n if (canRun == 4) {\n System.out.println(\".. but fail!\");\n enemyturn(); // let the enemy attack\n } else {\n System.out.println(\".. and succeed!\");\n succeededrun = true;\n }\n break;\n\n default:\n System.out.println(\"That option does not exist! Please try again.\");\n System.out.println(\"Your battle options are: Attack, Eat, Inspect, Run\");\n System.out.println(\"\");\n round--;\n break;\n }\n }",
"private boolean handleServerMessage(String serverMessage){\r\n\t\t// Separating the message STATUS + OTHER\r\n\t\tString[] messageParts = serverMessage.split(SEPARATOR);\r\n\r\n\t\t// Get status code from message\r\n\t\tint messageStatus = Integer.parseInt(messageParts[0]);\r\n\r\n\t\t// Process status\r\n\t\tswitch (messageStatus) {\r\n\t\tcase REQUEST_OK:\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Send Request OK\");\t\t\t\r\n\t\t\treturn true;\r\n\r\n\t\tcase INCORRECT_REQUEST_FORMAT:\r\n\t\t\t\t\t\t\r\n\t\t\tSystem.err.println(\"Oups! \\nSomethin went wrong!\\n Request format was invalid\");\r\n\t\t\tbreak;\r\n\r\n\t\tcase INCORRECT_USER_OR_PASSWOROD:\r\n\t\t\t\r\n\t\t\tJOptionPane.showMessageDialog(null,\"Username or password is incorrect!\", \"Error\",\r\n\t\t\t\t\tJOptionPane.ERROR_MESSAGE);\r\n\t\t\tbreak;\r\n\r\n\t\tcase USER_NAME_ALREADY_EXIST:\r\n\t\t\tJOptionPane.showMessageDialog(null,\"Username alredy exists!\", \"Error\",\r\n\t\t\t\t\tJOptionPane.ERROR_MESSAGE);\r\n\t\t\tbreak;\r\n\r\n\t\tdefault:\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"@Override\n public void execute() {\n if(state.getState()!=1) {\n client.printParseMessage();\n return;\n } else if(inputArgs.length < 1) {\n System.out.println(client.strings.getString(\"manage_command_message\"));\n return;\n }\n try {\n client.setDraftTag(inputArgs[0]);\n channel.send(new ReadRequest(client.getDraftTag()));\n ReadReply reply = (ReadReply) channel.receive();\n if(!reply.lines.isEmpty()) {\n String replyLine = reply.lines.get(reply.lines.size() - 1);\n if(Push.CLOSE_LINE.equals(replyLine)) {\n System.out.println(client.strings.getString(\"manage_close_command_message\"));\n return;\n }\n }\n } catch (IOException | ClassNotFoundException ex) {\n Logger.getLogger(ReadCommand.class.getName())\n .log(Level.SEVERE, null, ex);\n }\n state.setState(2);\n }",
"@Override\r\n public void onMessage(Message message) {\r\n LOG.info(\"Message received\");\r\n\r\n try {\r\n if (message instanceof TextMessage) {\r\n LOG.debug(\"Process TextMessage\");\r\n TextMessage tMsg = (TextMessage) message;\r\n LOG.debug(\"Message content is: \" + tMsg.getText());\r\n String[] param = tMsg.getText().split(\";\");\r\n\r\n if (param[0] != null && param[1] != null && !param[0].isEmpty() && !param[1].isEmpty()) {\r\n LOG.debug(\"DELETE from \" + param[0] + \" to \" + param[1]);\r\n atl.deleteBetween(param[0], param[1]);\r\n }\r\n else {\r\n LOG.warn(\"Message has wrong content\");\r\n }\r\n }\r\n else if (message instanceof ObjectMessage) {\r\n LOG.debug(\"Process ObjectMessage\");\r\n\r\n if (((ObjectMessage) message).getObject() instanceof DtIntervalMessage) {\r\n DtIntervalMessage dtiMsg = (DtIntervalMessage) ((ObjectMessage) message).getObject();\r\n\r\n if (!dtiMsg.getFrom().isEmpty() && !dtiMsg.getTo().isEmpty()) {\r\n LOG.debug(\"DELETE from \" + dtiMsg.getFrom() + \" to \" + dtiMsg.getTo());\r\n atl.deleteBetween(dtiMsg.getFrom(), dtiMsg.getTo());\r\n }\r\n else {\r\n LOG.warn(\"Message has wrong content\");\r\n }\r\n }\r\n else if (((ObjectMessage) message).getObject() instanceof KickMessage) {\r\n LOG.info(\"Kick message does nothing ;-)\");\r\n }\r\n else {\r\n LOG.warn(\"Message of wrong class:\" + ((ObjectMessage) message).getObject().getClass().getName());\r\n }\r\n }\r\n if (message != null) {\r\n LOG.error(\"Message of wrong type: \" + message.getClass().getName());\r\n }\r\n else {\r\n LOG.error(\"message == null\");\r\n }\r\n }\r\n catch (JMSException jmse) {\r\n LOG.fatal(\"\", jmse);\r\n mdc.setRollbackOnly();\r\n }\r\n\r\n LOG.info(\"Message processed\");\r\n }",
"@Override\n public void onMessageReceived(MessageReceivedEvent event) {\n if (event.getAuthor().isBot()) {\n return ;\n }\n\n Parser.parse(event.getMessage().getContentRaw(), event);\n }",
"@Override\n\tpublic void onMessageReceived(MessageEvent messageEvent) {\n\t\tLog.i(TAG, \"Received message: \" + messageEvent.getPath());\n\n\t\tif(messageEvent.getPath().equals(WearableComm.PATH_SHOW_BREAD_LIST)) {\n\t\t\t// Start the PickFromListActivity, pass Bread path and Bread list\n\t\t\tIntent showBreads = new Intent(getBaseContext(), PickFromListActivity.class);\n\t\t\tshowBreads.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n\t\t\tshowBreads.putExtra(PickFromListActivity.KEY_TITLE, \n\t\t\t\t\tgetString(R.string.title_bread));\n\t\t\tshowBreads.putExtra(PickFromListActivity.KEY_SELECTION_PATH, \n\t\t\t\t\tWearableComm.PATH_BREAD_PICKED);\n\t\t\tshowBreads.putExtra(PickFromListActivity.KEY_LIST_ITEMS, \n\t\t\t\t\tSandwichOptions.BREAD_OPTIONS);\n\t\t\tshowBreads.putExtra(PickFromListActivity.KEY_CANCEL_PATH, \n\t\t\t\t\tWearableComm.PATH_ORDER_CANCELED);\n\n\t\t\tgetApplication().startActivity(showBreads);\n\t\t} else if(messageEvent.getPath().equals(WearableComm.PATH_SHOW_CHEESE_LIST)) {\n\t\t\t// Start the PickFromListActivity, pass Cheese path and Cheese list\n\t\t\tIntent showCheeses= new Intent(getBaseContext(), PickFromListActivity.class);\n\t\t\tshowCheeses.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n\t\t\tshowCheeses.putExtra(PickFromListActivity.KEY_TITLE, getString(R.string.title_cheese));\n\t\t\tshowCheeses.putExtra(PickFromListActivity.KEY_SELECTION_PATH, WearableComm.PATH_CHEESE_PICKED);\n\t\t\tshowCheeses.putExtra(PickFromListActivity.KEY_LIST_ITEMS, SandwichOptions.CHEESE_OPTIONS);\n\t\t\tshowCheeses.putExtra(PickFromListActivity.KEY_CANCEL_PATH, WearableComm.PATH_ORDER_CANCELED);\n\t\t\tgetApplication().startActivity(showCheeses);\n\t\t} else if(messageEvent.getPath().equals(WearableComm.PATH_SHOW_SANDWICH_ALERT)) {\n\t\t\t// Start the OrderDoneActivity\n\t\t\tIntent showOrderDone = new Intent(getBaseContext(), OrderDoneActivity.class);\n\t\t\tshowOrderDone.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n\t\t\tgetApplication().startActivity(showOrderDone);\n\t\t} else {\n\t\t\t// Uh-oh\n\t\t\tLog.e(TAG, \"Unknown message\");\n\t\t}\n\t}",
"@Override\n\tpublic void processMessage(Message message) {\n\t\t\n\t}",
"@Override\n public void handleMessage(Message message) {\n invalidate();\n\n // only visible and interaction mode, we active the handler\n // AmbientMode use another time.\n if (isVisible() && !isInAmbientMode()) {\n\n // run again in next 500 milliseconds\n // the first parameter is message code, we don't use it here, so put 0.\n mUpdateTimeHandler.sendEmptyMessageDelayed(0, 500);\n }\n }",
"private void handleMessageFromServer(String theMessage) {\n //Some contants that will come from the server in the message itself:\n final String DIRECTION_JSON_KEY = \"DIRECTION\";\n final String FINAL_PRICE_JSON_KEY = \"FINAL_PRICE\";\n final String THE_FOLLOW_JSON_KEY = \"THEFOLLOW\";\n //and those are the possible values for the 'direction' key\n final String UP_VALUE = \"UP\";\n final String DOWN_VALUE = \"DOWN\";\n\n if(!isJson(theMessage)){\n handleSimpleMessageFromServer(theMessage);\n }\n\n\n //Let's start by parsing the message\n try {\n JSONObject theMessageInJson = new JSONObject(theMessage);\n String direction = theMessageInJson.getString(DIRECTION_JSON_KEY);\n double finalPrice = theMessageInJson.getDouble(FINAL_PRICE_JSON_KEY);\n String theFollowString = theMessageInJson.getString(THE_FOLLOW_JSON_KEY);\n Gson gson = new GsonBuilder().registerTypeAdapter(Date.class, new gsonUTCdateAdapter()).create();\n Follow theFollow = gson.fromJson(theFollowString, Follow.class);\n double [] followParams=theFollow.getFollowParams();\n double lowValue=followParams[0];\n double highValue=followParams[1];\n\n\n NotificationManager mNotificationManager =\n (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n\n Intent launchSecurityShow=new Intent(this, SecurityPresent.class);\n launchSecurityShow.putExtra(SecurityPresent.THE_SECURITY,theFollow.getTheSecurity());\n launchSecurityShow.putExtra(SecurityPresent.MODE,SecurityPresent.NOTIFIED);\n //launchSecurityShow.putExtra(SecurityPresent.THE_FOLLOW_AND_STATUS,theFollow);\n PendingIntent contentIntent =\n PendingIntent.getActivity(this, 0, launchSecurityShow, PendingIntent.FLAG_ONE_SHOT);\n FollowAndStatus theFollowWhichWasReceived=new FollowAndStatus();\n theFollowWhichWasReceived.setFollow(theFollow);\n ContentValues valuesToUpdate=new ContentValues();\n valuesToUpdate.put(FollowEntry.COLUMN_FINAL_PRICE,finalPrice);\n Timestamp now=new Timestamp(System.currentTimeMillis());\n valuesToUpdate.put(FollowEntry.COLUMN_DATE_EXPIRY,now.toString());\n valuesToUpdate.put(FollowEntry.COLUMN_STATUS,FollowAndStatus.STATUS_NOTIFIED);\n //TODO: take the following off the main thread\n UtilityForDatabase.updateFollowInDatabase(this,theFollowWhichWasReceived,valuesToUpdate);\n\n int drawableArrow= direction.equals(UP_VALUE)?R.drawable.uparrow:R.drawable.downarrow;\n int iconArrow=direction.equals(UP_VALUE)?R.drawable.ic_stat_uparrow:R.drawable.ic_stat_downarrow;\n int notificationColor=direction.equals(UP_VALUE)?Color.GREEN:Color.RED;\n\n\n String title=theFollow.getTheSecurity().getName()+\" IS \"+direction+\"!\";\n String content=title+\" at \"+finalPrice+\". You wanted me to notify you at (\"+lowValue+','+highValue+\")\";\n\n // Notifications using both a large and a small icon (which yours should!) need the large\n // icon as a bitmap. So we need to create that here from the resource ID, and pass the\n // object along in our notification builder. Generally, you want to use the app icon as the\n // small icon, so that users understand what app is triggering this notification.\n Bitmap largeIcon = BitmapFactory.decodeResource(getResources(), drawableArrow);\n NotificationCompat.Builder mBuilder =\n new NotificationCompat.Builder(this)\n .setSmallIcon(iconArrow)\n .setLargeIcon(largeIcon)\n .setContentTitle(title)\n .setStyle(new NotificationCompat.BigTextStyle().bigText(content))\n .setContentText(content)\n .setLights(notificationColor, 1000, 1000)\n .setPriority(NotificationCompat.PRIORITY_HIGH);\n mBuilder.setContentIntent(contentIntent);\n mNotificationManager.notify(FOLLOW_NOTIFICATION_ID, mBuilder.build());\n } catch(JSONException e){}\n }",
"private boolean processCommand(Command command) \n {\n boolean wantToQuit = false;\n\n if(command.isUnknown()) {\n System.out.println(\"I don't know what you mean...\");\n return false;\n }\n\n String commandWord = command.getCommandWord();\n if (commandWord.equals(\"help\")) {\n printHelp();\n }\n else if (commandWord.equals(\"go\")) {\n player.goRoom(command); \n }\n else if (commandWord.equals(\"look\")) { \n player.look();\n }\n else if (commandWord.equals(\"eat\")) {\n player.eat();\n }\n else if (commandWord.equals(\"quit\")) {\n wantToQuit = quit(command);\n }\n else if (commandWord.equals(\"back\")) {\n player.goBack(); \n }\n else if (commandWord.equals(\"take\")) {\n player.take(command);\n }\n else if (commandWord.equals(\"drop\")) {\n player.drop(command);\n }\n else if (commandWord.equals(\"items\")) {\n player.getItems();\n }\n else if (commandWord.equals(\"equipar\")) {\n player.equipar(command);\n }\n return wantToQuit;\n }",
"public SensorState handleMessage(String message) {\n\t\tlog.log(Level.FINE, \"Splitting the message in parts using \" + InternetOfThingsConstants.MESSAGE_SEPERATOR + \" as the seperator\");\n\t\tString[] messageParts = message.split(InternetOfThingsConstants.MESSAGE_SEPERATOR);\n\t\t\n\t\tString deviceName = messageParts[InternetOfThingsConstants.SENSORSTATE_DEVICENAME_POSITION];\n\t\t\n\t\tSensorState sensorState;\n\t\tDevice device = deviceService.getDevice(deviceName); // contains the name of the device\n\t\tif (device != null) {\n\t\t\tlog.log(Level.FINE, \"Device \" + device.getName() + \" already exists.\");\n\t\t\tString sensorName = messageParts[InternetOfThingsConstants.SENSORSTATE_NAME_POSITION];\n\t\t\tlog.log(Level.FINE, \"Checking if sensor \" + sensorName + \" already exists!\");\n\t\t\tsensorState = sensorStateDAO.findByNameAndDevice(sensorName, device);\n\t\t\tif (sensorState != null) {\n\t\t\t\tlog.log(Level.FINE, \"Sensor already exists(\" + sensorState.getId() + \"), so we will update it\");\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tsensorState = create(device, messageParts);\n\t\t\t}\n\t\t} else {\n\t\t\tdevice = deviceService.create(deviceName);\n\t\t\tsensorState = create(device, messageParts);\n\t\t}\n\t\treturn sensorState;\n\t}",
"public final void manageMessage(Message message)\n\t{\n\t\tif(message.getText() != null)\n\t\t{\n\t\t\ttextMessage(message);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(message.getAudio() != null)\n\t\t{\n\t\t\taudioMessage(message);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(message.getDocument() != null)\n\t\t{\n\t\t\tdocumentMessage(message);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(message.getPhoto() != null)\n\t\t{\n\t\t\tphotoMessage(message);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(message.getSticker() != null)\n\t\t{\n\t\t\tstickerMessage(message);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(message.getVideo() != null)\n\t\t{\n\t\t\tvideoMessage(message);\n\t\t\treturn;\n\t\t}\n\n\t\tif(message.getVideoNote() != null)\n\t\t{\n\t\t\tvideoNoteMessage(message);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(message.getVoice() != null)\n\t\t{\n\t\t\tvoiceMessage(message);\n\t\t\treturn;\n\t\t}\n\t\tif(message.getContact() != null)\n\t\t{\n\t\t\tcontactMessage(message);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(message.getLocation() != null)\n\t\t{\n\t\t\tlocationMessage(message);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(message.getVenue() != null)\n\t\t{\n\t\t\tvenueMessage(message);\n\t\t\treturn;\n\t\t}\n\n\t\tif (message.getDice() != null)\n\t\t{\n\t\t\tdiceMessage(message);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(message.getNewChatMember() != null)\n\t\t{\n\t\t\tnewChatMemberMessage(message);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(message.getNewChatMembers() != null)\n\t\t{\n\t\t\tnewChatMembersMessage(message);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(message.getLeftChatMember() != null)\n\t\t{\n\t\t\tleftChatMemberMessage(message);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(message.getPinned_message() != null)\n\t\t{\n\t\t\tpinnedMessage(message);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(message.getNewChatTitle() != null)\n\t\t{\n\t\t\tnewChatTitleMessage(message);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(message.getNewChatPhoto() != null)\n\t\t{\n\t\t\tnewChatPhotoMessage(message);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(message.GetDeleteChatPhoto())\n\t\t{\n\t\t\tgroupChatPhotoDeleteMessage(message);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(message.GetGroupChatCreated())\n\t\t{\n\t\t\tgroupChatCreatedMessage(message);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(message.getGame() != null)\n\t\t{\n\t\t\tgameMessage(message);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(message.getSuccessfulPayment() != null)\n\t\t{\n\t\t\tsuccessfulPaymentMessage(message);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(message.getInvoice() != null)\n\t\t{\n\t\t\tinvoiceMessage(message);\n\t\t\treturn;\n\t\t}\n\t}",
"private boolean checkDadBot(MessageReceivedEvent event) {\n String message = event.getMessage().getContentDisplay();\n\n // Ignore messages that are too short or long to be funny\n if (message.length() < 5 || message.length() > 40)\n return false;\n\n String name = null;\n\n if (message.toLowerCase(Locale.ROOT).startsWith(\"i'm \"))\n name = message.substring(4);\n else if (message.toLowerCase(Locale.ROOT).startsWith(\"im \"))\n name = message.substring(3);\n\n if (name != null && Math.random() < Setting.DAD_BOT_CHANCE) {\n event.getMessage().reply(\"Hi \" + name + \", I'm StatsBot!\").queue();\n return true;\n }\n\n return false;\n }",
"@Override\n\tpublic void handleMsg(String in) {\n\n\t}",
"@Override\r\n\tpublic void processMessage(BattleResultMessage message,\r\n\t\t\tITollgateInfoService p) throws MessageProcessException {\n\t\tp.acceptBattleResult(message.getTollgateId(), message.getNodeId(), message.getStar());\r\n\t}",
"void handleMessage(byte messageType, Object message);",
"private void handleInput() {\n String result = \"\";\n while (!clientSocket.isClosed() && result != null) {\n try {\n result = inFromServer.readLine();\n if (result == null || result.equals(\"null\")) {\n RoboRally.scheduleSync(() -> game.setScreen(new ErrorScreen(game, \"You where disconnected from the host\")), 0);\n\n return;\n }\n ClientAction command = ClientAction.fromCommandString(result.substring(0, result.indexOf(\":\")));\n String data = result.substring(result.indexOf(\":\") + 1);\n switch (command) {\n case START_GAME:\n setupGame(data);\n break;\n case GIVE_CARDS:\n giveCards(data);\n break;\n case NAME:\n //clientName = data;\n // Only used to check connectivity\n break;\n case CONNECTED_PLAYERS:\n receiveConnectedPlayers(data);\n break;\n case THREAD_NAME:\n //Do nothing\n break;\n case START_ROUND:\n GameScreen.getUiHandler().updateCountDown(0);\n playerHandler.runRound(GameGraphics.gson.fromJson(data, StartRoundDto.class));\n break;\n case COUNT_DOWN:\n // This seconds int has the information about the current number for the countdown\n int seconds = 30 - GameGraphics.gson.fromJson(data, Integer.class); // Count down, not count up\n GameScreen.getUiHandler().updateCountDown(seconds);\n break;\n case PARTY_MODE:\n InputHandler.enableMode();\n break;\n default:\n System.out.println(\"Unknown operation :\" + result);\n break;\n }\n } catch (IOException e) {\n System.out.println(\"IOExeption \" + e);\n }\n }\n }",
"private void processMessage(String message)\n {\n String card, strLabel;\n int nc;\n JLabel lbCard;\n switch(message.trim()) {\n case Player.HIT : \n card = player.hitting();\n nc = player.getHand().size();\n strLabel = \"player\" + player.getNumber() + \"_C\" + nc;\n lbCard = (JLabel) serverGUI.getComponentByName(strLabel);\n lbCard.setVisible(true);\n lbCard.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/br/ufc/smd/italoboss/socketjack/images/\" \n + card + \".png\")));\n break;\n \n case Player.STAND : \n player.standing();\n break;\n \n case Player.DOUBLE : \n card = player.doublingDown();\n nc = player.getHand().size();\n strLabel = \"player\" + player.getNumber() + \"_C\" + nc;\n lbCard = (JLabel) serverGUI.getComponentByName(strLabel);\n lbCard.setVisible(true);\n lbCard.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/br/ufc/smd/italoboss/socketjack/images/\" \n + card + \".png\")));\n break;\n }\n }",
"public static void processCommand(String command) {\n\n\t\tString commandType = command.substring(0, command.indexOf(\" \"));\n\n\t\tswitch (commandType) {\n\t\t\n\t\tcase COMMAND_ADD:\n\t\t\tFileStorage.addEvent(command);\n\t\t\tbreak;\n\n\t\tcase COMMAND_DELETE:\n\t\t\tFileStorage.deleteEvent(command);\n\t\t\tbreak;\n\n\t\tcase COMMAND_EDIT:\n\t\t\tFileStorage.editEvent(command);\n\t\t\tbreak;\n\t\t\n\t\tcase COMMAND_RECUR:\n\t\t\tFileStorage.recurEvent(command);\n\t\t\tbreak;\n\t\t\t\n\t\tcase COMMAND_NAVIGATE:\n\t\t\tFileStorage.navigateDay(command);\n\t\t\tbreak;\n\t\t\t\n\t\tdefault:\n\t\t\tSystem.out.println(MESSAGE_INVALID);\n\t\t\tbreak;\n\t\t\t\n\t\t}\n\t}",
"public void handleMessage(Msg clientMsg) {\n switch (clientMsg.getMsgType()) {\n case ID_IS_SET:\n handle_id_is_set(clientMsg);\n break;\n\n case SHIPS_PLACED:\n handle_ships_placed(clientMsg);\n break;\n\n case WAITING:\n break;\n\n case SHOT_PERFORMED:\n handle_shot_performed(clientMsg);\n break;\n }\n }",
"Message handle(Message query, String kind);",
"@Override\r\n public void handleMessage(Message message) \r\n {\r\n switch (message.what) \r\n {\r\n case BlueToothService.MESSAGE_REMOTE_CODE:\r\n Utilities.popToast (\"MESSAGE_REMOTE_CODE : \" + message.obj);\r\n break;\r\n case BlueToothService.MESSAGE_REQUEST:\r\n Utilities.popToast (\"MESSAGE_REQUEST : \" + message.obj);\r\n break;\r\n default:\r\n super.handleMessage(message);\r\n }\r\n }",
"private boolean handleMessages(String line) {\n int number;\n String user;\n String date;\n String content;\n Matcher matcher = MESSAGE_RECEIVED.matcher(line);\n \n if (!matcher.matches()){\n return false;\n }\n \n number = Integer.parseInt(matcher.group(1));\n user = matcher.group(2);\n date = matcher.group(3);\n content = matcher.group(4);\n \n if (!processMessages(number, user, date, content)){\n processLine(line);\n }\n \n \n return true;\n }",
"@Override\n\tpublic String processCommand(String command) {\n\t\tif (this.isValid(\"c\", command)) {\n\t\t\t// structure matches the quit command, check to see if\n\t\t\t// the first\n\t\t\t// char is right\n\t\t\tif (command.charAt(0) == 'Q') {\n\t\t\t\trunning = false;\n\t\t\t} else {\n\t\t\t\tSystem.out\n\t\t\t\t\t\t.print((testing) ? \"\" : \"Invalid command!\");\n\t\t\t}\n\t\t} else if (this.isValid(\"c| |c| |n\", command)) {\n\t\t\t// structure matches the insert command, check to see if\n\t\t\t// the first\n\t\t\t// char is right\n\t\t\tif (command.charAt(0) == 'a') {\n\t\t\t\tchar insertChar = command.charAt(2);\n\t\t\t\tint index = Integer.parseInt(command.substring(4));\n\t\t\t\tif (linkedList.insert(insertChar, index)) {\n\t\t\t\t\tunMixCode = \"r\" + (index + 1) + unMixCode;\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"Invalid index!\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tSystem.out\n\t\t\t\t\t\t.print((testing) ? \"\" : \"Invalid command!\");\n\t\t\t}\n\t\t} else if (this.isValid(\"c| |c\", command)) {\n\t\t\t// structure matches the remove command, check to see if\n\t\t\t// the first\n\t\t\t// char is right\n\t\t\tif (command.charAt(0) == 'r') {\n\t\t\t\tchar removeChar = command.charAt(2);\n\t\t\t\tlinkedList.remove(removeChar);\n\t\t\t\tfor (int i = curMessage.length() - 1; i >= 0; i--) {\n\t\t\t\t\tif (removeChar == curMessage.charAt(i)) {\n\t\t\t\t\t\tunMixCode = \"a\" + removeChar + (i - 1)\n\t\t\t\t\t\t\t\t+ unMixCode;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tSystem.out\n\t\t\t\t\t\t.print((testing) ? \"\" : \"Invalid command!\");\n\t\t\t}\n\t\t} else if (this.isValid(\"c| |n| |n| |n\", command)) {\n\t\t\t// structure matches the cut command, check to see if\n\t\t\t// the first char\n\t\t\t// is right\n\t\t\tif (command.charAt(0) == 'c') {\n\t\t\t\tcommand = command.substring(2);\n\t\t\t\tint space1 = command.indexOf(\" \");\n\t\t\t\tint space2 = command.indexOf(\" \", space1 + 1);\n\t\t\t\tint startIndex = Integer\n\t\t\t\t\t\t.parseInt(command.substring(0, space1));\n\t\t\t\tint endIndex = Integer.parseInt(\n\t\t\t\t\t\tcommand.substring(space1 + 1, space2));\n\t\t\t\tint clipboardIndex = Integer\n\t\t\t\t\t\t.parseInt(command.substring(space2 + 1));\n\t\t\t\tboolean ok = true;\n\t\t\t\tif (startIndex < 0\n\t\t\t\t\t\t|| startIndex >= curMessage.length()) {\n\t\t\t\t\tok = false;\n\t\t\t\t}\n\t\t\t\tif (endIndex < startIndex || endIndex < 0\n\t\t\t\t\t\t|| endIndex >= curMessage.length()) {\n\t\t\t\t\tok = false;\n\t\t\t\t}\n\t\t\t\tif (clipboardIndex < 0 || clipboardIndex >= 1000) {\n\t\t\t\t\tok = false;\n\t\t\t\t}\n\t\t\t\tif (ok) {\n\t\t\t\t\tLinkedList temp = new LinkedList();\n\t\t\t\t\ttemp.setToString(linkedList.toString()\n\t\t\t\t\t\t\t.substring(startIndex, endIndex + 1));\n\t\t\t\t\tclipboards.add(clipboardIndex, temp.getTop());\n\t\t\t\t\tfor (int i = endIndex; i >= startIndex; i--) {\n\t\t\t\t\t\tunMixCode = \"a\"\n\t\t\t\t\t\t\t\t+ curMessage.toString().charAt(i)\n\t\t\t\t\t\t\t\t+ (i - 1) + unMixCode;\n\t\t\t\t\t\tlinkedList.removeAt(i);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(\n\t\t\t\t\t\t\t(testing) ? \"\" : \"Invalid command!\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tSystem.out\n\t\t\t\t\t\t.print((testing) ? \"\" : \"Invalid command!\");\n\t\t\t}\n\t\t} else if (this.isValid(\"c| |n| |n\", command)) {\n\t\t\t// structure matches the paste command, check to see if\n\t\t\t// the first\n\t\t\t// char is right\n\t\t\tif (command.charAt(0) == 'p') {\n\t\t\t\tcommand = command.substring(2);\n\t\t\t\tint spc1 = command.indexOf(' ');\n\t\t\t\tint startIndex = Integer\n\t\t\t\t\t\t.parseInt(command.substring(0, spc1));\n\t\t\t\tint clipboardIndex = Integer\n\t\t\t\t\t\t.parseInt(command.substring(spc1 + 1));\n\t\t\t\tboolean ok = true;\n\t\t\t\tif (startIndex < 0\n\t\t\t\t\t\t|| startIndex >= curMessage.length()) {\n\t\t\t\t\tif (startIndex != -1) {\n\t\t\t\t\t\tok = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (clipboardIndex < 0 || clipboardIndex >= 1000) {\n\t\t\t\t\tok = false;\n\t\t\t\t}\n\t\t\t\tLinkedList temp = new LinkedList();\n\t\t\t\ttemp.setTop(clipboards.get(clipboardIndex));\n\t\t\t\tif (temp.getTop() == null) {\n\t\t\t\t\tok = false;\n\t\t\t\t}\n\t\t\t\tif (ok) {\n\t\t\t\t\tfor (char c : temp.toString().toCharArray()) {\n\t\t\t\t\t\tif (linkedList.insert(c, startIndex)) {\n\t\t\t\t\t\t\tunMixCode = \"r\" + (startIndex + 1)\n\t\t\t\t\t\t\t\t\t+ unMixCode;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstartIndex++;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(\n\t\t\t\t\t\t\t(testing) ? \"\" : \"Invalid command!\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tSystem.out\n\t\t\t\t\t\t.print((testing) ? \"\" : \"Invalid command!\");\n\t\t\t}\n\t\t} else if (this.isValid(\"c| |s\", command)) {\n\t\t\t// structure matches the save command, check to see if\n\t\t\t// the first\n\t\t\t// char is right\n\t\t\tif (command.charAt(0) == 's') {\n\t\t\t\tString fileName = command.substring(2,\n\t\t\t\t\t\tcommand.length());\n\t\t\t\ttry {\n\t\t\t\t\tPrintWriter saver = new PrintWriter(\n\t\t\t\t\t\t\tnew BufferedWriter(\n\t\t\t\t\t\t\t\t\tnew FileWriter(fileName)));\n\t\t\t\t\tsaver.print(unMixCode);\n\t\t\t\t\tsaver.close();\n\t\t\t\t\tif (!testing) {\n\t\t\t\t\t\tSystem.out.println(\"Saved successfully\");\n\t\t\t\t\t}\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tSystem.out\n\t\t\t\t\t\t.print((testing) ? \"\" : \"Invalid command!\");\n\t\t\t}\n\t\t} else {\n\t\t\tSystem.out.print((testing) ? \"\" : \"Invalid command!\");\n\t\t}\n\t\tcurMessage = linkedList.toString();\n\t\treturn curMessage;\n\t}",
"@Override\n public void onMessage(String channel, String message) {\n if (redisHandler.isAuth()) redisHandler.getJedisPool().getResource().auth(redisHandler.getPassword());\n if (!channel.equalsIgnoreCase(redisHandler.getChannel())) return;\n\n executor.execute(() -> {\n String[] strings = message.split(\"///\");\n\n System.out.println(strings[1]);\n System.out.println(strings[0]);\n\n Object jsonObject = null;\n try {\n jsonObject = redisHandler.getGson().fromJson(strings[0], Class.forName(strings[1]));\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n }\n\n RedisPacket redisPacket = (RedisPacket) jsonObject;\n\n if (redisPacket == null) {\n System.out.println(\"The redis packet received seems to be null!\");\n return;\n }\n\n redisPacket.onReceived();\n });\n }",
"void onMessage(String pattern, String channel, String message);",
"protected abstract boolean startParsing(String message);"
] | [
"0.68317443",
"0.65230453",
"0.63762015",
"0.630106",
"0.6221496",
"0.6145196",
"0.6144832",
"0.6138207",
"0.61065996",
"0.60295665",
"0.59825635",
"0.5973086",
"0.59350836",
"0.589208",
"0.5847148",
"0.5842904",
"0.5824263",
"0.58139557",
"0.58028424",
"0.57702184",
"0.57539135",
"0.57444614",
"0.57387835",
"0.57091105",
"0.5693754",
"0.5687566",
"0.56412035",
"0.5633484",
"0.5627599",
"0.5617575",
"0.5611682",
"0.5606206",
"0.5604958",
"0.5599835",
"0.55902016",
"0.55877703",
"0.5573631",
"0.5556803",
"0.55351645",
"0.55349046",
"0.55121785",
"0.55085",
"0.5495853",
"0.5485431",
"0.5448804",
"0.54456675",
"0.5445049",
"0.5429965",
"0.54284143",
"0.5427625",
"0.5426832",
"0.54170376",
"0.54016596",
"0.53987646",
"0.5380089",
"0.5377756",
"0.5376623",
"0.5373397",
"0.5355089",
"0.53460026",
"0.53438026",
"0.53346896",
"0.53332174",
"0.5320714",
"0.53166616",
"0.5305728",
"0.52965647",
"0.52964604",
"0.52791965",
"0.52770114",
"0.5276041",
"0.5269286",
"0.52674156",
"0.5247017",
"0.52461636",
"0.5245915",
"0.5245669",
"0.52448577",
"0.5239579",
"0.5238496",
"0.52260333",
"0.5225442",
"0.52223676",
"0.521792",
"0.5211804",
"0.51978904",
"0.51952803",
"0.5191981",
"0.51751065",
"0.5175076",
"0.5157391",
"0.51572424",
"0.51571983",
"0.5156654",
"0.51529384",
"0.514826",
"0.51414365",
"0.5135578",
"0.51307744",
"0.51285243"
] | 0.7616591 | 0 |
TODO: implement muting players that are not in the game | private void gameStart() {
ready.clear();
players = new TreeBidiMap<>();
mafia = new ArrayList<>();
innocentIDs = new ArrayList<>();
for (int i = 0; i < votedStart.size(); i++) {
int id = votedStart.get(i);
// playerIDs.add(id);
players.put(id, server.getUsername(id));
}
int numMafia = (int) Math.round((double) votedStart.size() / 3);
mafiaAtStart = new String[numMafia];
for (int j = 0; j < numMafia; j++) {
// int index = mafiaPicker.nextInt(votedStart.size());
int index = ThreadLocalRandom.current().nextInt(votedStart.size());
int id = votedStart.get(index);
mafia.add(id);
mafiaAtStart[j] = server.getUsername(id);
votedStart.remove(index);
}
for (int k = 0; k < votedStart.size(); k++) {
int id = votedStart.get(k);
innocentIDs.add(id);
}
votedStart.clear();
int[] innocentIDArray = innocentIDs.stream().mapToInt(i -> i).toArray();
server.privateMessage("you are an innocent", innocentIDArray);
int[] mafiaIDArray = innocentIDs.stream().mapToInt(i -> i).toArray();
String[] mafiaNameArray = new String[mafiaIDArray.length];
for (int l = 0; l < mafiaIDArray.length; l++) {
mafiaNameArray[l] = server.getUsername(mafiaIDArray[l]);
}
// currently uses the default toSting method for array. Also i think it
// will display the id numbers rather than the players names - need to
// convert if so would be good to only show only the other mafia members
// rather than including the players own name in the list
server.privateMessage("you are one of the mafia, the mafia members (including " + "you) are " + mafiaIDArray,
mafiaIDArray);
day = true;
gameInProgress = true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Player updatePlayer(Player player);",
"void updatePlayer(Player player);",
"public static void overridePlayers(Player... players)\n {\n getBackgammonTournamentData().setPlayers(players);\n\n storeTournamentData();\n }",
"protected void updatePlayer(Player player, PacketBuilder packet) {\n\n /*\n * The update block packet holds update blocks and is send after the\n * master packet.\n */\n PacketBuilder updateBlock = new PacketBuilder();\n\n /*\n * Updates this player.\n */\n manageMovement(true, player, packet);\n masks(player, updateBlock, false);\n\n /*\n * Write the current size of the player list.\n */\n packet.putBits(8, player.getLocalPlayers().size());\n\n /*\n * Iterate through the local player list.\n */\n for (Iterator<Player> it$ = player.getLocalPlayers().iterator(); it$.hasNext(); ) {\n /*\n * Get the next player.\n */\n Player otherPlayer = it$.next();\n\n /*\n * If the player should still be in our list.\n */\n if (WorldModule.getLogic().getPlayers().contains(otherPlayer)\n && !otherPlayer.basicSettings().isTeleporting()\n && otherPlayer.getLocation().withinRange(\n player.getLocation())) {\n /*\n * Update the movement.\n */\n manageMovement(false, otherPlayer, packet);\n\n /*\n * Check if an update is required, and if so, send the update.\n */\n if (otherPlayer.getMasks().requiresUpdate()) {\n masks(otherPlayer, updateBlock, false);\n }\n } else {\n /*\n * Otherwise, remove the player from the list.\n */\n it$.remove();\n\n /*\n * Tell the client to remove the player from the list.\n */\n packet.putBits(1, 1);\n packet.putBits(2, 3);\n }\n }\n\n /*\n * Loop through every player.\n */\n for (Player otherPlayer : WorldModule.getLogic().getLocalPlayers(player.getLocation())) {\n /*\n * Check if there is room left in the local list.\n */\n if (player.getLocalPlayers().size() >= 255) {\n /*\n * There is no more room left in the local list. We cannot\n * add more players, so we just ignore the extra ones. They\n * will be added as other players get removed.\n */\n break;\n }\n\n /*\n * If they should not be added ignore them.\n */\n if (otherPlayer == null || otherPlayer == player\n || player.getLocalPlayers().contains(otherPlayer) || otherPlayer.isReleased()) {\n continue;\n }\n\n /*\n * Add the player to the local list if it is within distance.\n */\n player.getLocalPlayers().add(otherPlayer);\n\n /*\n * Add the player in the packet.\n */\n addPlayer(packet, player, otherPlayer);\n\n /*\n * Update the player, forcing the appearance flag.\n */\n masks(otherPlayer, updateBlock, true);\n }\n\n /*\n * Check if the update block is not empty.\n */\n if (updateBlock.getPosition() != 0) {\n /*\n * Write a magic id indicating an update block follows.\n */\n packet.putBits(11, 2047);\n packet.recalculateBitPosition();\n\n /*\n * Add the update block at the end of this packet.\n */\n packet.put(updateBlock.toPacket().getBytes());\n } else {\n /*\n * Terminate the packet normally.\n */\n packet.recalculateBitPosition();\n }\n /*\n * Write the packet.\n */\n player.write(packet.toPacket());\n }",
"public static void updatePlayer(Player p){\n\t\tp.clearMoves();\n\t\tboard.possibleMoves(p);\n\t}",
"public void setPlayer(Player myPlayer){\n battlePlayer=myPlayer;\n }",
"private void loadPlayers() {\r\n this.passive_players.clear();\r\n this.clearRoster();\r\n //Map which holds the active and passive players' list\r\n Map<Boolean, List<PlayerFX>> m = ServiceHandler.getInstance().getDbService().getPlayersOfTeam(this.team.getID())\r\n .stream().map(PlayerFX::new)\r\n .collect(Collectors.partitioningBy(x -> x.isActive()));\r\n this.passive_players.addAll(m.get(false));\r\n m.get(true).stream().forEach(E -> {\r\n //System.out.println(\"positioning \"+E.toString());\r\n PlayerRosterPosition pos = this.getPlayerPosition(E.getCapnum());\r\n if (pos != null) {\r\n pos.setPlayer(E);\r\n }\r\n });\r\n }",
"public void setData(List<Player> players, Player owningPlayer) {\n this.players = players;\n thisPlayer = owningPlayer;\n }",
"private void savePlayers() {\r\n this.passive_players.stream()\r\n .filter(E -> E.isChanged())\r\n .forEach(e -> {\r\n e.save();\r\n });\r\n }",
"public void setPlayers(Player[] players) {\n this.players = players;\n }",
"public void setOwner(Player player) {\n owner = player;\n }",
"abstract void updatePlayer();",
"public void savePlayers()\r\n {\r\n for(User p : players.values())\r\n {\r\n \r\n }\r\n }",
"public void setPlayers(ArrayList<Player> players) {\n this.players = players;\n }",
"private void updatePlayersOptions(){\n\t\tfor(Player player : players.keySet()){\n\t\t\tif(player != null) {\n\t\t\t\tBlackjackHand hand = players.get(player).get(0);\n\t\t\t\tList<GameOptionsEnumeration> options = getGameOptions(player);\n\t\t\t\tupdateHandOptions(player, hand, options);\n\t\t\t}\n\t\t}\n\t}",
"private void addPlayers(@NotNull MapHandler map, @NotNull NewGameDto newGameDto) {\n ComparableTuple<Integer, Stack<SpawnTile>> result = analyseMap(map);\n flagCount = result.key;\n Stack<SpawnTile> spawnTiles = result.value;\n if (!spawnTiles.isEmpty()) {\n for (PlayerDto player : newGameDto.players) {\n SpawnTile spawnTile = spawnTiles.pop();\n if (player.id == newGameDto.userId) {\n user = new Player(spawnTile.getX(), spawnTile.getY(), Direction.NORTH, map, new ComparableTuple<>(GameGraphics.mainPlayerName + \" (you)\", player.color), player.id);\n user.setDock(spawnTile.getSpawnNumber());\n players.add(user);\n } else {\n IPlayer onlinePlayer = new OnlinePlayer(spawnTile.getX(), spawnTile.getY(), Direction.NORTH, map, new ComparableTuple<>(player.name, player.color), player.id);\n onlinePlayer.setDock(spawnTile.getSpawnNumber());\n players.add(onlinePlayer);\n }\n }\n } else {\n for (int i = 0; i < playerCount; i++) {\n NonPlayer nonPlayer = new NonPlayer(i, 0, Direction.NORTH, map, new ComparableTuple<>(\"blue\", Color.BLUE));\n nonPlayer.setDock(i);\n players.add(nonPlayer);\n }\n }\n }",
"public void setPlayers(Hashtable<Integer, Player> players) {\r\n\t\tthis.players = players;\r\n\t}",
"public void setPlayers(Player a_players[], int a_numPlayers)\n {\n m_numPlayers = a_numPlayers;\n \n for(int i = 0; i < m_numPlayers; i++)\n {\n m_currentPlayers.add(a_players[i]);\n m_players.add(a_players[i]);\n }\n }",
"private Set<SteamUserNode> bindGames(Set<SteamUserNode> players) {\n\t\tString dest = \"http://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?\" +\r\n\t\t\t\t\"key=%s&steamid=%d&include_appinfo=1&include_played_free_games=1&format=json\";\r\n\t\tString response = \"\";\r\n\t\tfor (SteamUserNode p : players) {\r\n\t\t\ttry {\r\n\t\t\t\tthis.apiCalls += 1;\r\n\t\t\t\tString query = String.format(dest, key, p.getId());\r\n\t\t\t\tURL url = new URL(query);\r\n\t\t\t\tHttpURLConnection con = (HttpURLConnection) url.openConnection();\r\n\t\t\t\tcon.setRequestMethod(\"GET\");\r\n\t\t\t\tcon.setConnectTimeout(3000);\r\n\t\t\t\tcon.connect();\r\n\t\t\t\tint respCode = con.getResponseCode();\r\n\t\t\t\tif (respCode != 200)\r\n\t\t\t\t\tSystem.out.println(\"Status code: \" + respCode + \"\\nFor request: \" + query);\r\n\t\t\t\telse {\r\n\t\t\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(con.getInputStream()));\r\n\t\t\t\t\tresponse = reader.lines().collect(Collectors.joining());\r\n\t\t\t\t\tint numGames = new JSONObject(response).getJSONObject(\"response\").getInt(\"game_count\");\r\n\t\t\t\t\tif (numGames > 0) {\r\n\t\t\t\t\t\tJSONArray ownedGames = new JSONObject(response).getJSONObject(\"response\").getJSONArray(\"games\");\r\n\t\t\t\t\t\tfor (int i=0;i<ownedGames.length();++i) {\r\n\t\t\t\t\t\t\tJSONObject g = ownedGames.getJSONObject(i);\r\n\t\t\t\t\t\t\tlong appId = g.getLong(\"appid\");\r\n\t\t\t\t\t\t\tString name = g.getString(\"name\");\r\n\t\t\t\t\t\t\tString logoHash = g.getString(\"img_logo_url\");\r\n\t\t\t\t\t\t\tint playForever = g.getInt(\"playtime_forever\");\r\n\t\t\t\t\t\t\tint play2Wks = g.has(\"playtime_2weeks\") ? g.getInt(\"playtime_2weeks\") : 0;\r\n\t\t\t\t\t\t\tPlayedGame game = new PlayedGame(appId, name, logoHash, play2Wks, playForever);\r\n\t\t\t\t\t\t\tp.addPlayedGame(game);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif (!knownGames.contains(game)) {\r\n\t\t\t\t\t\t\t\tknownGames.add((SteamGame) game);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (localWrite) {\r\n\t\t\t\t\t\t\tjsonWriter.writeOwnedGames(response, p);\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} catch (JSONException jse) {\r\n\t\t\t\tSystem.err.println(jse.getMessage());\r\n\t\t\t\tSystem.out.println(response);\r\n\t\t\t} catch (MalformedURLException mue) {\r\n\t\t\t\t//once again, this better not happen...\r\n\t\t\t\tSystem.err.println(mue.getMessage());\r\n\t\t\t} catch (IOException ioe) {\r\n\t\t\t\tSystem.err.println(ioe.getMessage());\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn players;\r\n\t}",
"public static void set_players(){\n\t\tif(TossBrain.compselect.equals(\"bat\")){\n\t\t\tbat1=PlayBrain1.myteam[0];\n\t\t\tbat2=PlayBrain1.myteam[1];\n\t\t\tStriker=bat1;\n\t\t\tNonStriker=bat2;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\n\t\t\t\tbat1=PlayBrain1.oppteam[0];\n\t\t\t\tbat2=PlayBrain1.oppteam[1];\n\t\t\t\tStriker=bat1;\n\t\t\t\tNonStriker=bat2;\n\n\t\t\t\t}\n\t}",
"public void updatePlayer(Player player) {\n\t\t// update the flag GO TO JAIL in Player class\n\t}",
"public void setPlayers(ArrayList<Player> players) {\n\t\tthis.players = players;\n\t}",
"public void selectProtectPlayer(Player[] players){\n int x,xTemp;\n Player playerSelected;\n if( team == 0){\n xTemp = 0;\n for(Player p : players ){\n x = (int) p.getPosition().getX();\n if( x > xTemp && p != playerOne ){\n xTemp = x;\n playerSelected = p;\n }\n }\n playerOne = playerSelected;\n }else{\n xTemp = 14;\n for(Player p : players ){\n x = (int) p.getPosition().getX();\n if( x < xTemp && p != playerOne ){\n xTemp = x;\n playerSelected = p;\n }\n }\n playerOne = playerSelected;\n }\n }",
"private void getPlayers() {\r\n\t\tSystem.out.println(\"How Many Players: \");\r\n\t\tpnum = getNumber(1, 3);\r\n\r\n\t\tfor(int i=0; i < pnum; i++){\r\n\t\t\tSystem.out.println(\"What is player \" + (i + 1) + \"'s name? \");\r\n\t\t\tString name = sc.next();\r\n\t\t\tboolean dupe = true;\r\n\t\t\twhile(dupe){\r\n\t\t\t\tint samecounter = 0;\r\n\t\t\t\tfor(Player p : players){\r\n\t\t\t\t\tif(name.equals(p.getName())){\r\n\t\t\t\t\t\tsamecounter += 1;\r\n\t\t\t\t\t\tSystem.out.println(\"Name is the same as another players. Please choose another name: \");\r\n\t\t\t\t\t\tname = sc.next();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(samecounter == 0){\r\n\t\t\t\t\tdupe = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tplayers.add(new Player(name));\r\n\r\n\t\t}\r\n\t}",
"public void setPlayers(ArrayList<Integer> players) {\n this.players= new ArrayList<>(players);\n }",
"public void setPlayersAtGo()\n {\n for(int i = 0; i < m_numPlayers; i++)\n {\n m_gameBoard.addPlayerToSpace(i + 1, 0);\n }\n }",
"public static void setScoreBoard(Player p) {\n\t\n}",
"public void updatePlayerInstances()\r\n {\r\n long var1 = this.theWorldServer.getTotalWorldTime();\r\n int var3;\r\n PlayerManager.PlayerInstance var4;\r\n\r\n if (var1 - this.previousTotalWorldTime > 8000L)\r\n {\r\n this.previousTotalWorldTime = var1;\r\n\r\n for (var3 = 0; var3 < this.playerInstanceList.size(); ++var3)\r\n {\r\n var4 = (PlayerManager.PlayerInstance)this.playerInstanceList.get(var3);\r\n var4.onUpdate();\r\n var4.processChunk();\r\n }\r\n }\r\n else\r\n {\r\n for (var3 = 0; var3 < this.playerInstancesToUpdate.size(); ++var3)\r\n {\r\n var4 = (PlayerManager.PlayerInstance)this.playerInstancesToUpdate.get(var3);\r\n var4.onUpdate();\r\n }\r\n }\r\n\r\n this.playerInstancesToUpdate.clear();\r\n\r\n if (this.players.isEmpty())\r\n {\r\n WorldProvider var5 = this.theWorldServer.provider;\r\n\r\n if (!var5.canRespawnHere())\r\n {\r\n this.theWorldServer.theChunkProviderServer.unloadAllChunks();\r\n }\r\n }\r\n }",
"@Override\n\tpublic void updatePlayer(Joueur joueur) {\n\t\t\n\t}",
"public void copyAllTournamentPlayers(Tournament tournament, Round round) {\r\n\t\tround.getPlayers().clear();\r\n\t\tround.getPlayers().addAll(tournament.getPlayers());\r\n\t}",
"public List<Player> lookForShootPeople(Player player)\n {\n List<Player> playerList = new LinkedList<>();\n\n playerList.addAll(player.getSquare().getRoom().getPlayerRoomList()); //adds all the players in the room\n\n /*\n * Now i have to check if the player is close to a door. In this case i can see all the players in this adiacent room.\n * I will implement the method in this way:\n * 1. I check if the player can move to a different room with a distance 1 using the method squareReachableNoWall\n * 2. If the player can effectively move to a different room it means it is close to a door\n * 3. I will add to the list all the players in this different room\n */\n\n for (Square square : player.getSquare().getGameBoard().getArena().squareReachableNoWall(player.getSquare().getX(), player.getSquare().getY(), 1))\n {\n if (!(player.getSquare().getColor().equals(square.getColor()))) // if the color of the reachable square is different from the color of the square\n // where the player is this means player can see in a different room\n {\n playerList.addAll(player.getSquare().getRoom().getPlayerRoomList()); //adds all the players in the room\n }\n\n }\n\n Set<Player> playerSet = new HashSet<>();\n playerSet.addAll(playerList);\n\n playerList.clear();\n\n playerList.addAll(playerSet);\n playerList.remove(player);\n\n\n return playerList;\n }",
"public void win(int player)\r\n\t{\r\n\t\taccountValue[player]+=pool;\r\n\t\tendRund();\r\n\t}",
"public void setPlayer(Player player) {\r\n this.player = player;\r\n }",
"private void eliminatePlayers() {\n \n Iterator<Player> iter = players.iterator();\n\n while (iter.hasNext()) {\n Player player = iter.next();\n\n if (player.getList().isEmpty()) {\n iter.remove();\n if (player.getIsHuman()) {\n setGameState(GameState.HUMAN_OUT);\n }\n // need to remember that due to successive draws, the active player could run\n // out of cards\n // select a new random player if player gets eliminated\n if (!players.contains(activePlayer)) {\n selectRandomPlayer();\n }\n }\n }\n }",
"public abstract void isUsedBy(Player player);",
"@Override\n\tpublic void setPlayer(Player player) {\n\n\t}",
"@SuppressWarnings(\"deprecation\")\n private void update(Player player) {\n Team team = teams.getTeam(player);\n\n if (team == null) {\n for (Player online : game.getPlayers()) {\n player.showPlayer(online);\n online.showPlayer(player);\n }\n return;\n }\n\n for (Player online : game.getPlayers()) {\n if (team.hasPlayer(online)) {\n player.hidePlayer(online);\n online.hidePlayer(player);\n } else {\n player.showPlayer(online);\n online.showPlayer(player);\n }\n }\n }",
"public abstract boolean updatePlayerInGame(int gameId, String username, String role) throws SQLException;",
"public void setPlayer(Player _player) { // beallit egy ezredest az adott mapElementre, ha az rajta van\n player = _player;\n }",
"private void wins(Player player){\n int win = 1;\n player.setWins(win);\n }",
"public void processPlayerCollision(ArrayList<Player> players) {\n for(Player p : players) {\n boolean collided = collision.generalCollision(this, p); //Test for general collision\n if(collided) //if general collision occurs\n {\n int collisionY = collision.testCollisionY(this, p); //change collision state for y axis\n int cornerCollision = collision.testCornerCollision(this, p);\n\n if(collisionY == Collision.COLLISION_TOP || cornerCollision == Collision.TOP_CORNERS) {\n if(p.getState() != DYING_STATE && getState() != DESTROYED_STATE) {\n setState(KOOPA_STUNNED);\n setVelocityX(0f);\n hitCounter++;\n shelled = true;\n if(pointsCollected == false) {\n game.scoreBoard.addScorePoints(100);\n pointsCollected = true;\n }\n }\n }\n else {\n if(getState() != DYING_STATE && getState() != DESTROYED_STATE && getState() != KOOPA_STUNNED && shelled == false && hitCounter == 0) //if enemy isn't dying or dead, kill player\n p.die();\n }\n }\n }\n }",
"public void setPlayer(Player player) {\n this.player = player;\n }",
"void playerPositionChanged(Player player);",
"public void setPlayer(Player player) {\n this.player = player;\n }",
"@Override\n public ArrayList<Player> getPlayers() {return steadyPlayers;}",
"private void ReplacePlayer()\n {\n String oldPlayer = GetPlayerString(mTeamsComboBox.getSelectedItem().toString(),\n mPositionComboBox.getSelectedItem().toString());\n if( oldPlayer == null )\n return;\n\n String newPlayer = GetPlayerString_UI();\n String team = mTeamsComboBox.getModel().getElementAt(mTeamsComboBox.getSelectedIndex()).toString();\n ReplacePlayer(team, oldPlayer, newPlayer);\n }",
"public void update(Player player) {\n\t\t\n\t}",
"public abstract void changePlayerAt(ShortPoint2D pos, Player player);",
"void notifyPlayerChanged(PlayerNumber newPlayer);",
"@Test\n void removePlayersFromScoreBoardWhenRemovingSinglePlayer(){\n //make sure map is not empty at beginning of game\n assertEquals(4, scoreboard.getScore().size());\n //add player to the list of players that should be removed\n List<String> usersToBeRemoved=new ArrayList<>();\n usersToBeRemoved.add(\"A\");\n //remove players in list\n scoreboard.removePlayersFromScoreBoard(usersToBeRemoved);\n //check that players were removed\n assertEquals(3, scoreboard.getScore().size());\n assertEquals(3,scoreboard.getCorrectlyGuessedMysteryWordsPerPlayer().size());\n assertFalse(scoreboard.getScore().containsKey(\"A\"));\n assertFalse(scoreboard.getCorrectlyGuessedMysteryWordsPerPlayer().containsKey(\"A\"));\n\n }",
"public void resetPlayers() {\n Player curPlayer;\n for(int i = 0; i < players.size(); i++){\n curPlayer = players.peek();\n curPlayer.resetRole();\n curPlayer.setLocation(board.getSet(\"trailer\"));\n curPlayer.setAreaData(curPlayer.getLocation().getArea());\n view.setDie(curPlayer);\n players.add(players.remove());\n }\n\n }",
"@Test\n void testGameContext() {\n Set<Player> playersNotMatched = new HashSet<>(players);\n for(Player player : gameContext.getPlayersTurnOrder()) {\n assertTrue(playersNotMatched.contains(player));\n playersNotMatched.remove(player);\n }\n assertTrue(playersNotMatched.isEmpty());\n\n assertNotNull(gameContext.getMarket());\n assertNotNull(gameContext.getDevelopmentCardsTable());\n assertNotNull(gameContext.getFaithPath());\n assertNotNull(gameContext.getPlayersTurnOrder());\n\n for(Player player : players)\n assertNotNull(gameContext.getPlayerContext(player));\n }",
"public void setPlayer(Player newPlayer) {\n roomPlayer = newPlayer;\n }",
"public void takeOut(final StandardPlayer p) {\n if (p == firstPlayerOnPos[p.getPosR()][p.getPosC()]) {\n firstPlayerOnPos[p.getPosR()][p.getPosC()]\n = secondPlayerOnPos[p.getPosR()][p.getPosC()];\n }\n secondPlayerOnPos[p.getPosR()][p.getPosC()] = null;\n deadPlayers[p.getPosR()][p.getPosC()].add(p);\n }",
"public void updateLobby(Set<String> players) {\r\n lobbyFrame.updateList(players);\r\n }",
"public void replacePlayer(Player out, Player in) {\n\n\t\tfor (Player p : players) {\n\t\t\tif (p == out) {\n\t\t\t\tint i = players.indexOf(p);\n\t\t\t\tplayers.set(i, in);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}",
"void updateOnlinePlayers(String skipone) { \r\n DynmapPlayer[] players = server.getOnlinePlayers();\r\n DynmapPlayer[] pl = new DynmapPlayer[players.length];\r\n System.arraycopy(players, 0, pl, 0, pl.length);\r\n if(skipone != null) {\r\n for(int i = 0; i < pl.length; i++)\r\n if(pl[i].getName().equals(skipone))\r\n pl[i] = null;\r\n }\r\n online = pl;\r\n }",
"private void setupPlayers() {\n\t\tuserData=(UserData) Main.currentStage.getUserData();\n\t\tnumberPlayers=userData.getNumberPlayers();\n\t\tplayerNames=userData.getPlayerNames();\n\t\tcurrentPlayer=userData.getFirstPlayer();\n\t\tlb_currentplayername.setText(playerNames[currentPlayer]);\n\t\tplayers =new Player[4];\n\t\tfor(int i=0;i<4;i++) {\n\t\t\tif(i<numberPlayers) {\n\t\t\t\tplayers[i]=new Player(playerNames[i], false, i) {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void rollDices() {\n\t\t\t\t\t\trotatedDice1();\n\t\t\t\t\t\trotatedDice2();\n\t\t\t\t\t\t//waiting for player choose what way to go then handler that choice\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t\telse {\n\t\t\t\tplayers[i]=new Player(playerNames[i], true, i) {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void rollDices() {\n\t\t\t\t\t\trotatedDice1();\n\t\t\t\t\t\trotatedDice2();\n\t\t\t\t\t\t//randomchoice and next player rolldice\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t\tswitch (i) {\n\t\t\t\tcase 0:{\n\t\t\t\t\tplayers[i].setHorseColor(yh0, yh1, yh2, yh3);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 1:{\n\t\t\t\t\tplayers[i].setHorseColor(bh0, bh1, bh2, bh3);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 2:{\n\t\t\t\t\tplayers[i].setHorseColor(rh0, rh1, rh2, rh3);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 3:{\n\t\t\t\t\tplayers[i].setHorseColor(gh0, gh1, gh2, gh3);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}",
"public void switchPlayer(){\n // Menukar giliran player dalam bermain\n Player temp = this.currentPlayer;\n this.currentPlayer = this.oppositePlayer;\n this.oppositePlayer = temp;\n }",
"public void updateUserTeam() {\n\t\tUser user = users.get(userTurn);\n\t\tSystem.out.println(user.getName());\n\t\tSystem.out.println(tmpTeam.size());\n\t\tUserTeam roundTeam = new UserTeam();\n\t\troundTeam.putAll(tmpTeam.getPlayers());\n\t\tSystem.out.println(roundNumber);\n\t\tSystem.out.println(roundTeam.size());\n\t\tSystem.out.println(\"dfdfdfd\");\n\t\tuser.setUserTeam(roundTeam, roundNumber);\n\t\tSystem.out.println(\"dfdfdfd\");\n\t\ttmpTeam = new UserTeam();\n\t}",
"public void addPlayer(String playerID) {\r\n\t\tplayerCount++;\r\n\t\tString name = guild.getMemberById(playerID).getEffectiveName();\r\n\t\t// Set up each player uniquely\r\n\t\tif (p2 == null) {\r\n\t\t\tp2 = new Player(1,playerID,GlobalVars.pieces.get(\"blue\"));\r\n\t\t\tp2.getPiece().setX(GlobalVars.playerCoordsPerRoom[0][0]+GlobalVars.playersOffset[1][0]);\r\n\t\t\tp2.getPiece().setY(GlobalVars.playerCoordsPerRoom[0][1]+GlobalVars.playersOffset[1][1]);\r\n\t\t\tplayers.add(p2);\r\n\t\t\tp1.setNextPlayer(p2);\r\n\t\t\tp2.setNextPlayer(p1);\r\n\t\t\tgameChannel.sendMessage(\"**\"+name+\"** has reincarnated as the BLUE adventurer\").queue();\r\n\t\t} else if (p3 == null) {\r\n\t\t\tp3 = new Player(2,playerID,GlobalVars.pieces.get(\"yellow\"));\r\n\t\t\tp3.getPiece().setX(GlobalVars.playerCoordsPerRoom[0][0]+GlobalVars.playersOffset[2][0]);\r\n\t\t\tp3.getPiece().setY(GlobalVars.playerCoordsPerRoom[0][1]+GlobalVars.playersOffset[2][1]);\r\n\t\t\tplayers.add(p3);\r\n\t\t\tp2.setNextPlayer(p3);\r\n\t\t\tp3.setNextPlayer(p1);\r\n\t\t\tgameChannel.sendMessage(\"**\"+name+\"** has reincarnated as the YELLOW adventurer\").queue();\r\n\t\t} else if (p4 == null) {\r\n\t\t\tp4 = new Player(3,playerID,GlobalVars.pieces.get(\"green\"));\r\n\t\t\tp4.getPiece().setX(GlobalVars.playerCoordsPerRoom[0][0]+GlobalVars.playersOffset[3][0]);\r\n\t\t\tp4.getPiece().setY(GlobalVars.playerCoordsPerRoom[0][1]+GlobalVars.playersOffset[3][1]);\r\n\t\t\tplayers.add(p4);\r\n\t\t\tp3.setNextPlayer(p4);\r\n\t\t\tp4.setNextPlayer(p1);\r\n\t\t\tgameChannel.sendMessage(\"**\"+name+\"** has reincarnated as the GREEN adventurer\").queue();\r\n\t\t}\r\n\t}",
"public abstract Player freshCopy();",
"public void setPlayer(Player p) {\n\t\tplayer = p;\n\t}",
"public static void pauseGame() {\r\n\t\tfor (MovingUnit mu : _players) {\r\n\t\t\t((WinningInterface) mu).pauseUnit();\r\n\t\t}\r\n\t}",
"public void updateWithPointWonBy(Player player) {\n if(managerTennisMatch.statusTennisMatch == \"ClassicalGame\") {\n if (player == player1) {\n managerTennisMatch.checkScoreAndUpdateGame(player, player2);\n } else {\n managerTennisMatch.checkScoreAndUpdateGame(player, player1);\n }\n } else if(managerTennisMatch.statusTennisMatch == \"TieBreakInProgress\") {\n player.setScore(player.getScore() + 1);\n if((player1.getScore() >= 7 && player1.getScore() - player2.getScore() >= 2) || (player2.getScore() >= 7 && player2.getScore() - player1.getScore() >= 2)) {\n tennisSetList.get(tennisSetList.size() - 1).getBaseGameList().add(new TieBreakGame(player));\n player1.setScore(0);\n player2.setScore(0);\n }\n } else {\n return;\n }\n }",
"public void switchPlayers(Player p1, Player p2) {\r\n\t\tint p1Place = getPlace(p1);\r\n\t\tint p2Place = getPlace(p2);\r\n\t\tplayers.remove(p1Place);\r\n\t\tplayers.remove(p2Place);\r\n\t\tif (p2 != null)\r\n\t\t\taddPlayer(p1Place, p2);\r\n\t\tif (p1 != null)\r\n\t\t\taddPlayer(p2Place, p1);\r\n\t}",
"public void setPlayers(){\n System.out.println();\n System.out.println(\"First, please enter the number of players:\");\n Scanner sc = new Scanner(System.in);\n int number;\n\n while(true){\n try {\n number = sc.nextInt();\n if(number > maxPlayer || number < minPlayer){\n System.out.println(\"Please enter a number between \" + minPlayer + \" and \" + maxPlayer+ \":\");\n continue;\n }\n } catch (InputMismatchException e){\n System.out.println(\"Invalid input! Please enter a number between \" + minPlayer + \" and \" + maxPlayer + \":\");\n sc.next();\n continue;\n }\n players = new ArrayList<>(number);\n for(int i = 0; i < number; i ++){\n players.add(new Player(\"Player \" + (i + 1)));\n }\n setNames();\n return;\n }\n }",
"@Test\n void removePlayersFromScoreBoardWorksWhenAllPlayersAreRemovedAtOnce(){\n assertEquals(4, scoreboard.getScore().size());\n //add all players to the list of players that should be removed\n List<String> usersToBeRemoved=new ArrayList<>();\n usersToBeRemoved.add(\"A\");\n usersToBeRemoved.add(\"B\");\n usersToBeRemoved.add(\"C\");\n usersToBeRemoved.add(\"D\");\n //remove players\n scoreboard.removePlayersFromScoreBoard(usersToBeRemoved);\n //check that players were removed\n assertTrue(scoreboard.getScore().isEmpty());\n assertTrue(scoreboard.getCorrectlyGuessedMysteryWordsPerPlayer().isEmpty());\n }",
"public void setPlayer(Player player) {\n this.currentPlayer = player;\n }",
"private void linkPlayersToDB(@Nullable Game game) {\n if (game == null) {\n throw new IllegalArgumentException(\"game should not be null.\");\n }\n\n gamesRef.child(game.getId())\n .child(DATABASE_GAME_PLAYERS)\n .addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot snapshot) {\n List<Player> newData = snapshot.getValue(new GenericTypeIndicator<List<Player>>() {\n });\n if (newData != null) {\n game.setPlayers(newData, true);\n }\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError error) {\n Log.e(TAG, \"failed \" + error.getMessage());\n }\n });\n }",
"private void updatePlayerList() \n\t{\n\t\tplayerStatus.clear();\n\n\t\tfor(Player thisPlayer: players) // Add the status of each player to the default list model.\n\t\t{\n\t\t\tplayerStatus.addElement(thisPlayer.toString());\n\t\t}\n\n\t}",
"private void updateActivePlayer() {\n indexOfActivePlayer++;\n if (indexOfActivePlayer == players.size()) {\n String previousPlayer = players.get(indexOfActivePlayer - 1).getName();\n Collections.shuffle(players);\n while (players.get(0).getName() == previousPlayer) {\n Collections.shuffle(players);\n }\n indexOfActivePlayer = 0;\n }\n }",
"public static void setPlayer(Player p) {\n\t\tUniverse.player = p;\n\t}",
"private void updatePlayersWorth(){\n for (Player e : playerList) {\n e.setPlayerWorth(getTotalShareValue(e) + e.getFunds());\n }\n }",
"private void setPlayerRoom(){\n player.setRoom(currentRoom);\n }",
"public interface Player {\n /**\n * has to be implemented\n * wird von update() in Game aufgerufen.\n * @return eine der Actions aus Rules.getActionsTileMove()\n */\n GameState requestActionTile();\n /**\n * has to be implemented\n * wird von update() in Game aufgerufen.\n * @return eine der Actions aus Rules.getActionsGamePieceMove()\n */\n GameState requestActionGamePiece();\n\n /**\n * has to be implemented\n * wird von update() aufgerufen.\n * @param gameState aktueller GameState\n */\n void updateGameState(GameState gameState);\n\n GameState getGameState();\n\n /**\n * has to be implemented\n * @return the color of the Player\n */\n Color getColor();\n\n void setRules(Rules rules);\n Rules getRules();\n\n void setName(String name);\n String getName();\n\n void setThread(ThreadUpdate thread);\n void setSynchronizer(Object synchronizer);\n\n /**\n * wird von update aufgerufen, sobald ein anderer Spieler eine Karte gewinnt.\n * @param color Farbe des Spielers, der eine Karte gewonnen hat\n * @param symbol auf dieser Karte\n */\n void notifyWonCards(Color color, Symbol symbol);\n\n /**\n * legt die Karte ganz oben auf dem Stapel, die der Spieler als nächstes gewinnen muss fest.\n * Wird von Game_Impl aufgerufen um dem Player seine Karte mitzuteilen\n * @param symbol neue zu erreichende Karte/Symbol\n */\n void setActiveCard(Symbol symbol);\n\n /**\n * has to be implemented\n * @return the activeCard, that was set by Game_Impl\n */\n Symbol getActiveCard();\n\n\n /**\n * creates new instance of chosen player\n *\n * Correct place to add new and more KI players!\n *\n * @param className name of the class to create an instance of\n * @param color chosen color for a player\n * @return new instance of playerclass\n */\n static Player createNewPlayer(String className, Color color) throws IllegalArgumentException {\n switch (className) {\n case \"PlayerKI\":\n return new PlayerKI(color);\n case \"PlayerKI2\":\n return new PlayerKI2(color);\n case \"PlayerKI3\":\n return new PlayerKI3(color);\n case \"PlayerKI4\":\n return new PlayerKI4(color);\n case \"PlayerHuman\":\n return new PlayerPhysical(color);\n default:\n throw new IllegalArgumentException(\"createNewPlayer in Player.java doesn't know how to handle this!\");\n }\n }\n}",
"public static void updatePlayerCaches() {\n\t\tfor (Player player : getOnlinePlayers()) {\n\t\t\tPlayerCache cache = getCache(player);\n\n\t\t\tcache.reloadCache();\n\t\t}\n\t}",
"public static void WorkAtCompany(Player gamer){\r\n gamer.zen = gamer.zen-30;\r\n gamer.money = gamer.money+10;\r\n gamer.turn = gamer.turn+1; \r\n }",
"public void setPlayer(Player player) {\n\t\tthis.player = player;\r\n\t}",
"public interface Player {\n\n\n /**\n * Represents the attack result of random strategy.\n *\n * @return an attack result\n */\n AttackResult randomAttack();\n\n /**\n * Represents the attack result of user strategy.\n *\n * @return an attack result\n */\n AttackResult userAttack();\n\n /**\n * Represents the attack result of smart strategy.\n *\n * @return an attack result\n */\n AttackResult smartAttack();\n\n /**\n * Tells if one of the players has win the game.\n *\n * @return true if wins the game and false otherwise\n */\n boolean winGame();\n\n /**\n * Prints the fleet map.\n *\n * @param printer the printer to print the map\n */\n void printFleet(ConsolePrinter printer);\n\n /**\n * Prints the battle map.\n *\n * @param printer the printer to print the map\n */\n void printBattle(ConsolePrinter printer);\n\n /**\n * Creates a user player.\n *\n * @param randPlace true if place the ship randomly and false to place the ship by the player\n * @param fleetMap the fleet map of the player\n * @param battleMap the battle map of the player\n * @return a new user player\n */\n static Player createUserPlayer(boolean randPlace, FleetMap fleetMap, BattleMap battleMap) {\n return new AbstractPlayer(fleetMap, battleMap, randPlace);\n }\n\n /**\n * Creates a robot player.\n *\n * @param fleetMap the fleet map of the player\n * @param battleMap the battle map of the player\n * @return a new robot player\n */\n static Player createRobotPlayer(FleetMap fleetMap, BattleMap battleMap) {\n return new AbstractPlayer(fleetMap, battleMap, true);\n }\n}",
"void setPlayerId(int playerId);",
"void gameWin(Player player);",
"void addPlayer(Player newPlayer);",
"private void initPlayers() {\n this.playerOne = new Player(1, 5, 6);\n this.playerTwo = new Player(2, 0, 1);\n this.currentPlayer = playerOne;\n\n }",
"@Test\n void removePlayersFromScoreBoardDoesNothingIfNoPlayerMarkedForRemoval(){\n assertEquals(4, scoreboard.getScore().size());\n //do not add players to the list of players that should be removed\n List<String> usersToBeRemoved=new ArrayList<>();\n //remove players in list\n scoreboard.removePlayersFromScoreBoard(usersToBeRemoved);\n //check that players were removed\n assertEquals(4, scoreboard.getScore().size());\n assertEquals(4,scoreboard.getCorrectlyGuessedMysteryWordsPerPlayer().size());\n }",
"public void sendGameInfoToAll(){\r\n\t\t\r\n\t\tVector<Player> players = lobby.getLobbyPlayers();\t\r\n\t\tString message = \"UDGM\" + lobby.getGameString();\r\n\t\t\r\n\t\tif(!players.isEmpty()){\r\n\t \tfor(int i=0; i<players.size(); i++){\t \t\t\r\n\t \t\tsendOnePlayer(players.get(i), message);\t \t\t\r\n\t \t}\r\n\t\t}\r\n\t}",
"private static void addNewlyArrivedUsersAsPlayers(Match match, boolean hasTheGameStarted) {\n LinkedList<Player> playersInGame = match.getGame().listOfAllPlayersAndDealer_LastPosition();\n LinkedList<User> allUsers = match.getUsers();\n List<User> newUsers = getUsersWhoAreNotRegisteredAsPlayers(playersInGame, allUsers);\n\n for (User newUser : newUsers) {\n Player newPlayer = new Player(newUser);\n match.getGame().preparePlayerForNextRound(newPlayer, hasTheGameStarted);\n match.getGame().addPlayer(newPlayer);\n }\n }",
"private void removePlayerFromTheGame(){\n ServerConnection toRemove = currClient;\n\n currClient.send(\"You have been removed from the match!\");\n updateCurrClient();\n server.removePlayerFromMatch(gameID, toRemove);\n\n if ( toRemove == client1 ){\n this.client1 = null;\n }\n else if ( toRemove == client2 ){\n this.client2 = null;\n }\n else {\n client3 = null;\n }\n gameMessage.notify(gameMessage);\n\n if ( (client1 == null && client2 == null) || (client2 == null && client3 == null) || (client1 == null && client3 == null) ){\n gameMessage.notify(gameMessage);\n }\n if ( liteGame.isWinner() ) endOfTheGame = true;\n playerRemoved = true;\n }",
"public void assignPlayerPieces(Map<Player, Integer> playerHash) {\n List<Integer> nums = new ArrayList<>(playerHash.values());// get all the numbers from playerHash\n List<Player> players = new ArrayList<>(playerHash.keySet()); // get all the players from the hash map\n Collections.sort(nums); // sort the list of numbers\n Collections.reverse(nums);// reverse the list so the highest numbers are first\n int pieceIndex = 0; // variable used to represent the index for the playerPiece\n List<Integer> usedNums = new ArrayList<Integer>();// Empty list that will be used to know what numbers have been used.\n for (Integer num : nums) { // go through each number in numbers\n if (!usedNums.contains(num)) {// if the usedNums list doesn't contain num\n for (Player player : players) { // for each player\n if (playerHash.get(player).equals(num)) {// if the num is the number they got from their dice roll\n player.setPiece(this.playerPieces.get(pieceIndex)); // give them the playerPiece at index pieceIndex\n pieceIndex++;// increment pieceIndex\n usedNums.add(num);//add the used number into usedNums list\n }\n }\n }\n }\n }",
"public void saveAllPlayers() {\n for (Player player : bukkitService.getOnlinePlayers()) {\n savePlayer(player);\n }\n }",
"public void setActivePlayer()\n {\n activePlayer = !activePlayer;\n }",
"@Override\n public void addPlayer(Player player) {\n\n if(steadyPlayers.size()>0){\n PlayersMeetNotification.firePropertyChange(new PropertyChangeEvent(this, \"More than one Player in this Panel\",steadyPlayers,player));\n }\n steadyPlayers.add(player);\n\n }",
"public abstract Scoreboard update(Player player);",
"public int putPlayerOnField(CPlayerEntity pPlayer, CPositionEntity pPosition){\r\n int i = 0;\r\n int lReturnValue = PUT_PLAYER_FAILURE_PLAYER_NOT_IN_SQUAD;\r\n for (CYourPlayerEntry lPlayerEntry : mYourPlayerEntries) {\r\n if (lPlayerEntry.getPlayer() != null) {\r\n if (lPlayerEntry.getPlayer().getId() == pPlayer.getId() && lPlayerEntry.getPosition() == null) {\r\n lReturnValue = PUT_PLAYER_SUCCESS_NO_SWAP;\r\n }\r\n }\r\n }\r\n\r\n /*\r\n * if we found the player we want to put in our squad\r\n * we go through every player of the squad\r\n */\r\n if (lReturnValue == PUT_PLAYER_SUCCESS_NO_SWAP){\r\n for (CYourPlayerEntry lPlayerEntry : mYourPlayerEntries){\r\n if (lPlayerEntry.getPosition() != null) {\r\n /*\r\n * if a player in the squad already has the position\r\n * where we want to put our passed player, we set his\r\n * position to null (to swap him to the bench)\r\n */\r\n if (lPlayerEntry.getPosition().getName().equals(pPosition.getName())) {\r\n editPlayerPosition(i, null);\r\n lReturnValue = PUT_PLAYER_SUCCESS_WITH_SWAP;\r\n }\r\n }\r\n /*\r\n * when we finally find our passed player, we set\r\n * his position to the passed one\r\n */\r\n if (lPlayerEntry.getPlayer() != null) {\r\n if (lPlayerEntry.getPlayer().getId() == pPlayer.getId()) {\r\n editPlayerPosition(i, pPosition);\r\n }\r\n }\r\n i++;\r\n }\r\n }\r\n return lReturnValue;\r\n }",
"void removeFromGame() {\n\t\t// remove from game\n\t\t//only for multi-player\n\t}",
"void createNewGame(Player player);",
"public void initializePlayers(){\r\n allPlayers = new ArrayList<Player>();\r\n currentPlayerIndex = 0;\r\n Player redPlayer = new Player(1, new Location(2, 2), Color.RED);\r\n Player bluePlayer = new Player(2, new Location(4, 2), Color.BLUE);\r\n Player whitePlayer = new Player(3, new Location(2, 4), Color.WHITE);\r\n Player yellowPlayer = new Player(4, new Location(4, 4), Color.YELLOW);\r\n allPlayers.add(redPlayer);\r\n allPlayers.add(bluePlayer);\r\n allPlayers.add(whitePlayer);\r\n allPlayers.add(yellowPlayer);\r\n }",
"public void selectAttackerPlayer(Player[] players){\n int x,xTemp;\n Player playerSelected;\n if( team == 0){\n xTemp = 0;\n for(Player p : players ){\n x = (int) p.getPosition().getX();\n if( x > xTemp ){\n xTemp = x;\n playerSelected = p;\n }\n }\n playerOne = playerSelected;\n }else{\n xTemp = 14;\n for(Player p : players ){\n x = (int) p.getPosition().getX();\n if( x < xTemp ){\n xTemp = x;\n playerSelected = p;\n }\n }\n playerOne = playerSelected;\n }\n }",
"private void removePlayerFromLobby() {\n\n //Added Firebase functionality assuming var player is the player who wants to leave the game.\n }",
"public void checkSetPlayerTurn() // Check and if needed set the players turns so it is their turn.\n\t{\n\t\tswitch (totalPlayers) // Determine how many players there are...\n\t\t{\n\t\tcase 2: // For two players...\n\t\t\tswitch (gameState)\n\t\t\t{\n\t\t\tcase twoPlayersNowPlayerOnesTurn: // Make sure it's player one's turn.\n\t\t\t\tplayers.get(0).setIsPlayerTurn(true);\n\t\t\t\tbreak;\t\t\t\t\n\t\t\tcase twoPlayersNowPlayerTwosTurn: // Make sure it's player two's turn.\n\t\t\t\tplayers.get(1).setIsPlayerTurn(true);\n\t\t\t\tbreak;\t\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t}",
"private void setPlayer()\t{\n\t\tgrid.setGameObject(spy, Spy.INITIAL_X, Spy.INITIAL_Y);\n\t}"
] | [
"0.7006622",
"0.69356364",
"0.67229474",
"0.6670169",
"0.66506803",
"0.6644181",
"0.6638765",
"0.658141",
"0.65694034",
"0.65651256",
"0.65308076",
"0.65084594",
"0.6502714",
"0.6492385",
"0.64894706",
"0.6488754",
"0.6461402",
"0.6443889",
"0.6440921",
"0.6412721",
"0.641181",
"0.6398069",
"0.63939506",
"0.63882226",
"0.63758534",
"0.63675267",
"0.63578165",
"0.63497055",
"0.6339699",
"0.633957",
"0.6338923",
"0.6336296",
"0.6334322",
"0.6330726",
"0.63276684",
"0.63229865",
"0.6320772",
"0.6317823",
"0.63060397",
"0.63033724",
"0.63004667",
"0.62833697",
"0.62828416",
"0.62795633",
"0.6278632",
"0.62737596",
"0.6260331",
"0.6259504",
"0.62538445",
"0.62537146",
"0.6248645",
"0.6248598",
"0.622572",
"0.6218525",
"0.6209211",
"0.620778",
"0.61972314",
"0.61964697",
"0.6192347",
"0.61894614",
"0.6187155",
"0.6183345",
"0.61792576",
"0.61723137",
"0.61720526",
"0.6167713",
"0.6167609",
"0.61638266",
"0.61566776",
"0.6125994",
"0.6121645",
"0.6115484",
"0.61133456",
"0.6106367",
"0.60960543",
"0.6094789",
"0.6089822",
"0.60893464",
"0.60859513",
"0.6080045",
"0.60751104",
"0.60703546",
"0.60700035",
"0.6062838",
"0.6061487",
"0.6060944",
"0.6059889",
"0.6056854",
"0.6054831",
"0.60500926",
"0.60493016",
"0.60445935",
"0.6043565",
"0.60425186",
"0.6036285",
"0.60331327",
"0.60315716",
"0.6031287",
"0.6030136",
"0.6029436",
"0.6027443"
] | 0.0 | -1 |
The elimDay method either starts the vote to eliminate a player during the day or adds subsequent votes to the total number of votes for the player on trial. It also takes the origin of the message and checks whether the player it corresponds to has already voted to eliminate said player (in which case doesn't add their vote) and checks if they have already voted to save said payer (in which case it removes their vote from the save vote and adds their vote to the eliminate vote). | private void elimDayVote(String player, int origin) {
// int playerID = server.getUserID(player);
if (players.containsValue(player)) {
OrderedBidiMap<String, Integer> invPlayers = players.inverseBidiMap();
int playerID = invPlayers.get(player);
// if (nightVote.size() > 0) {
if (nightVoteInProgress) {
server.privateMessage(
"cannot vote to eliminate a player while there is a vote to change the game to night", origin);
// } else if (!playerIDs.contains(playerID)) { // this is for
// when
// using ArrayList of playerIDs
} else if (playerID == origin) {
server.privateMessage("you cannot vote for yourself", origin);
} else if (elimDay.contains(origin)) {
server.privateMessage("you have already voted to start", origin);
} else if (!players.containsKey(origin)) {
server.privateMessage("you are not in the game, so cannot participate", origin);
} else if (playerOnTrialID == null) {
elimDayVoteInProgress = true;
playerOnTrialID = playerID;
elimDay.add(origin);
TimerTask dayElimVoteTimeout = new TimerTask() { // not sure if
// this
// will work
// properly
// (method
// should
// continue
// without
// waiting for
// it
// to finish
@Override
public void run() {
dayElimVoteTimeout(); // this might need a catch
}
};
dayElimTimer = new Timer();
dayElimTimer.schedule(dayElimVoteTimeout, 20000);
} else {
if (playerOnTrialID != playerID) {
server.privateMessage("cannot vote for " + player + " while the vote for "
+ server.getUsername(playerOnTrialID) + " is in progress", origin);
} else {
if (save.contains(origin)) {
int index = save.indexOf(origin);
save.remove(index);
}
elimDay.add(origin);
checkElim(origin);
}
}
} else if (!players.containsValue(player)) {
server.privateMessage(player + " is not in this game/has already been eliminated", origin);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void checkElim(int origin) {\r\n\r\n\t// if (elimDay.size() > playerIDs.size() / 2) {\r\n\tserver.publicMessage(players.get(origin) + \" has voted to eliminate \" + server.getUsername(playerOnTrialID));\r\n\r\n\tif (elimDay.size() > players.size() / 2) {\r\n\t eliminateDay();\r\n\t}\r\n\r\n }",
"private void voteDay(int origin) {\r\n\tif (!nightVoteInProgress) {\r\n\t server.privateMessage(\"cannot use this command when there isn't a vote to change to night\", origin);\r\n\r\n\t} else if (dayVote.contains(origin)) {\r\n\t server.privateMessage(\"you have already voted to keep the game in the day phase\", origin);\r\n\r\n\t} else if (!players.containsKey(origin)) {\r\n\t server.privateMessage(\"you are not in the game, so cannot participate\", origin);\r\n\r\n\t} else {\r\n\t if (nightVote.contains(origin)) {\r\n\t\tint index = nightVote.indexOf(origin);\r\n\t\tnightVote.remove(index);\r\n\t }\r\n\r\n\t dayVote.add(origin);\r\n\t checkDay(origin);\r\n\t}\r\n }",
"private void eliminateDay() {\r\n\tdayElimTimer.cancel();\r\n\tdayElimTimer.purge();\r\n\r\n\t// playerIDs.remove(playerOnTrialID);\r\n\tplayers.remove(playerOnTrialID);\r\n\r\n\tif (mafia.contains(playerOnTrialID)) {\r\n\t int index = mafia.indexOf(playerOnTrialID);\r\n\t mafia.remove(index);\r\n\r\n\t} else {\r\n\t int index = innocentIDs.indexOf(playerOnTrialID);\r\n\t innocentIDs.remove(index);\r\n\t}\r\n\r\n\tserver.setPlayerMuted(playerOnTrialID, true);\r\n\r\n\tserver.publicMessage(server.getUsername(playerOnTrialID) + \" has been eliminated\");\r\n\r\n\tplayerOnTrialID = null;\r\n\telimDay.clear();\r\n\tsave.clear();\r\n\telimDayVoteInProgress = false;\r\n\r\n\tcheckWin();\r\n }",
"private void checkDay(int origin) {\r\n\tserver.publicMessage(players.get(origin) + \" has voted for it to remain day\");\r\n\r\n\t// if (dayVote.size() > playerIDs.size() / 2) {\r\n\tif (dayVote.size() > players.size() / 2) {\r\n\t day();\r\n\t} else if (dayVote.size() == players.size() / 2 && players.size() % 2 == 0) {\r\n\t day();\r\n\t}\r\n }",
"private void voteNight(int origin) {\r\n\t// if (playerOnTrialID != null) {\r\n\tif (elimDayVoteInProgress) {\r\n\t server.privateMessage(\"you cannot start a vote for it to be night when there is a vote in progress \"\r\n\t\t + \"to eliminate a player\", origin);\r\n\r\n\t} else if (nightVote.contains(origin)) {\r\n\t server.privateMessage(\"you have already voted to change the game to night\", origin);\r\n\r\n\t} else if (!players.containsKey(origin)) {\r\n\t server.privateMessage(\"you are not in the game, so cannot participate\", origin);\r\n\r\n\t} else {\r\n\t nightVoteInProgress = true;\r\n\r\n\t if (dayVote.contains(origin)) {\r\n\t\tint index = dayVote.indexOf(origin);\r\n\t\tdayVote.remove(index);\r\n\t }\r\n\r\n\t nightVote.add(origin);\r\n\r\n\t if (nightVote.size() == 1) {\r\n\t\tTimerTask nightVoteTimeout = new TimerTask() {\r\n\r\n\t\t @Override\r\n\t\t public void run() {\r\n\t\t\tnightVoteTimeout(); // this might need a catch\r\n\r\n\t\t }\r\n\t\t};\r\n\r\n\t\tnightVoteTimer = new Timer();\r\n\r\n\t\tnightVoteTimer.schedule(nightVoteTimeout, 20000);\r\n\t } else {\r\n\t\tcheckNight(origin);\r\n\t }\r\n\r\n\t}\r\n }",
"private void saveVote(String player, int origin) {// suspicious player do\r\n\t\t\t\t\t\t // need\r\n\t// to vote for themselves\r\n\r\n\tif (players.containsValue(player)) {\r\n\t OrderedBidiMap<String, Integer> invPlayers = players.inverseBidiMap();\r\n\t // int playerID = server.getUserID(player);\r\n\t int playerID = invPlayers.get(player);\r\n\r\n\t if (playerOnTrialID == null) {\r\n\t\tserver.privateMessage(\"you cannot vote to save someone when there is no-one on trial\", origin);\r\n\r\n\t\t// } else if (!playerIDs.contains(playerID)) {\r\n\t } else {\r\n\t\tif (playerOnTrialID != playerID) {\r\n\t\t server.privateMessage(\"cannot vote for \" + player + \" while the vote for \"\r\n\t\t\t + server.getUsername(playerOnTrialID) + \" is in progress\", origin);\r\n\r\n\t\t} else if (!players.containsKey(origin)) {\r\n\t\t server.privateMessage(\"you are not in the game, so cannot participate\", origin);\r\n\r\n\t\t} else {\r\n\t\t if (elimDay.contains(origin)) {\r\n\t\t\tint index = elimDay.indexOf(origin);\r\n\t\t\telimDay.remove(index);\r\n\t\t }\r\n\r\n\t\t save.add(origin);\r\n\t\t checkSave(origin);\r\n\t\t}\r\n\t }\r\n\t} else if (!players.containsValue(player)) {\r\n\t server.privateMessage(player + \" is not in this game/has already been eliminated\", origin);\r\n\r\n\t}\r\n\r\n }",
"private void checkNight(int origin) {\r\n\tserver.publicMessage(players.get(origin) + \" has voted for it to remain night\");\r\n\r\n\t// if (nightVote.size() > playerIDs.size() / 2) {\r\n\tif (nightVote.size() > players.size() / 2) {\r\n\t night();\r\n\t}\r\n }",
"public void resign(){\n\t\tint turn = DBCommunicator.requestInt(\"SELECT id FROM beurt WHERE spel_id = \" + id + \" AND account_naam = '\" + app.getCurrentAccount().getUsername() + \"' ORDER BY id DESC\");\n\t\tturn += 2;\n\t\tint totalScore = DBCommunicator.requestInt(\"SELECT totaalscore FROM score WHERE spel_id = \" + id + \" AND account_naam = '\" + app.getCurrentAccount().getUsername() + \"'\");\n\t\ttotalScore = totalScore * -1;\n\t\tDBCommunicator.writeData(\"INSERT INTO beurt (id, spel_id, account_naam, score, aktie_type) VALUES(\" + turn + \", \" + id + \", '\" + app.getCurrentAccount().getUsername() + \"', \" + totalScore +\", 'Resign')\");\n\t\tfor(int e : gameStones){\n\t\t\tDBCommunicator.writeData(\"INSERT INTO letterbakjeletter (spel_id, letter_id, beurt_id) VALUES (\" + id + \", \" + e + \", \" + turn + \")\");\n\t\t}\n\t\tDBCommunicator.writeData(\"UPDATE spel SET toestand_type = 'Resigned' WHERE id = \" + id );\n\t\t\n\t\tint opTurn = turn + 1;\n\t\tint myTurn = opTurn + 1;\n\t\tDBCommunicator.writeData(\"INSERT INTO beurt (id, spel_id, account_naam, score, aktie_type) VALUES \"\n\t\t\t\t+ \"(\" + opTurn + \", \" + id + \", '\" + opponent + \"', 0, 'End'),\"\n\t\t\t\t+ \"(\" + myTurn + \", \" + id + \", '\" + app.getCurrentAccount().getUsername() + \"', 0, 'End')\");\n\t}",
"@Override\r\n\t\t public void run() {\r\n\t\t\tdayElimVoteTimeout(); // this might need a catch\r\n\r\n\t\t }",
"public void surrender() {\n playerCash += playerBet / 2;\n\n //Play dealer's turn\n dealerTurn();\n\n //End the game and change the views\n restartGame();\n }",
"private void endDay(Player p){\r\n\t\tp.setActions(2);\r\n\t\tArrayList<Pet> pets = p.getPets();\r\n\t\tfor(Pet pet : pets){\r\n\t\t\tpet.nextDay();\r\n\t\t}\r\n\t\tstore.nextDay();\r\n\t}",
"@Override\n public void run() {\n\n try {\n LocalDateTime now = LocalDateTime.now();\n voda bot = new voda();\n\n List<Integer> notifyTime = Arrays.asList(7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23);\n int currentHour = now.getHour();\n\n ArrayList<Integer> consulted = dbmodel.MysqlCon.getFollowers();\n\n for (Integer ntime : notifyTime) {\n if (ntime == currentHour) {\n for (Integer consultedUser : consulted) {\n bot.sendTextToIdMessage(consultedUser, dbmodel.MysqlCon.getEveryDayWaterUserWaterCountView(consultedUser));\n }\n }\n }\n\n\n } catch (Exception e) {\n System.out.println();\n }\n }",
"private void receiveVote() {\n\t\t//Se la postazione termina la connessione informiamo lo staff con un messaggio di errore\n\t\tif(!link.hasNextLine()) {\n\t\t\tcontroller.printError(\"Errore di Comunicazione\", \"La postazione \"+ ip.getHostAddress() + \" non ha inviato i pacchetti di voto.\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//Vengono recuperati i voti cifrati\n\t\tMessage request;\n\t\tWrittenBallot[] encryptedBallots;\n\t\ttry {\n\t\t\trequest = (Message) Message.fromB64(link.read(), \"postazione \" + ip.getHostAddress());\n\t\t\tString[] required = {\"encryptedBallots\"};\n\t\t\tClass<?>[] types = {WrittenBallot[].class};\n\t\t\t\n\t\t\trequest.verifyMessage(Protocol.sendVoteToStation, required, types, \"postazione \" + ip.getHostAddress());\n\t\t\tencryptedBallots = request.getElement(\"encryptedBallots\");\n\t\t\t\n\t\t\t//I voti vengono memorizzati nel seggio in attesa dell'invio all'urna\n\t\t\tif(((Controller) controller).storeVoteLocally(encryptedBallots, ip))\n\t\t\t\tlink.write(Protocol.votesReceivedAck);\n\t\t\telse\n\t\t\t\tlink.write(Protocol.votesReceivedNack);\n\t\t\t\n\t\t} catch (PEException e) {\n\t\t\tlink.write(Protocol.votesReceivedNack);\n\t\t\tcontroller.printError(e);\n\t\t}\n\t}",
"@Override\r\n public void handleMessage(Message message, int origin) {\r\n\r\n\tString text = message.messageText;\r\n\tString remText = \"\";\r\n\tString command = \"\";\r\n\r\n\tif (text.indexOf(' ') < 0) {\r\n\t remText = \"\";\r\n\t command = message.messageText;\r\n\t} else {\r\n\t command = message.messageText.substring(0, text.indexOf(' '));\r\n\t remText = text.substring(text.indexOf(' ') + 1);\r\n\t}\r\n\r\n\tif (!gameInProgress) {\r\n\r\n\t if (command.equals(\"/ready\")) { // no trailing text after /ready\r\n\t\tif (!remText.isEmpty()) {\r\n\t\t server.privateMessage(\"The command \\\"/ready\\\" cannnot have characters after it\", origin);\r\n\t\t} else {\r\n\t\t ready(origin);\r\n\t\t}\r\n\r\n\t } else if (command.equals(\"/unready\")) {\r\n\t\tif (!remText.isEmpty()) {\r\n\t\t server.privateMessage(\"The command \\\"/unready\\\" cannnot have characters after it\", origin);\r\n\t\t} else {\r\n\t\t unready(origin);\r\n\t\t}\r\n\r\n\t } else if (command.equals(\"/start\")) {// no trailing text after\r\n\t\t\t\t\t\t // /start\r\n\r\n\t\tif (!remText.isEmpty()) {\r\n\t\t server.privateMessage(\"The command \\\"/start\\\" cannnot have characters after it\", origin);\r\n\t\t} else {\r\n\t\t voteStart(origin);\r\n\t\t}\r\n\t } else {\r\n\t\tserver.privateMessage(message.messageText + \" does not contain a valid command\", origin);\r\n\t }\r\n\r\n\t} else {\r\n\t if (day == true) {\r\n\r\n\t\tif (command.equals(\"/elim\")) { // space between /elim and player\r\n\t\t // name, no trailing text after\r\n\t\t // player name\r\n\t\t if (remText.isEmpty() || remText.contains(\" \")) {\r\n\t\t\tserver.privateMessage(\r\n\t\t\t\t\"The command \\\"/elim\\\" needs to be followed by a player's name with no spaces/characters thereafter\",\r\n\t\t\t\torigin);\r\n\t\t } else {\r\n\t\t\telimDayVote(remText, origin);\r\n\t\t }\r\n\r\n\t\t} else if (command.equals(\"/save\")) {\r\n\t\t if (remText.isEmpty() || remText.contains(\" \")) {\r\n\t\t\tserver.privateMessage(\r\n\t\t\t\t\"The command \\\"/save\\\" needs to be followed by a player's name with no spaces/characters thereafter\",\r\n\t\t\t\torigin);\r\n\t\t } else {\r\n\t\t\tsaveVote(remText, origin);\r\n\t\t }\r\n\r\n\t\t} else if (command.equals(\"/night\")) {\r\n\t\t if (!remText.isEmpty()) {\r\n\t\t\tserver.privateMessage(\"The command \\\"/night\\\" cannnot have characters after it\", origin);\r\n\t\t } else {\r\n\t\t\tvoteNight(origin);\r\n\t\t }\r\n\r\n\t\t} else if (command.equals(\"/day\")) {\r\n\t\t if (!remText.isEmpty()) {\r\n\t\t\tserver.privateMessage(\"The command \\\"/day\\\" cannnot have characters after it\", origin);\r\n\t\t } else {\r\n\t\t\tvoteDay(origin);\r\n\t\t }\r\n\r\n\t\t} else {\r\n\t\t server.privateMessage(message.messageText + \" does not contain a valid command\", origin);\r\n\t\t}\r\n\r\n\t } else {\r\n\r\n\t\tif (command.equals(\"/elim\")) {\r\n\t\t if (remText.isEmpty() || remText.contains(\" \")) {\r\n\t\t\tserver.privateMessage(\r\n\t\t\t\t\"The command \\\"/elim\\\" needs to be followed by a player's name with no spaces/characters thereafter\",\r\n\t\t\t\torigin);\r\n\t\t } else {\r\n\t\t\telimNightVote(remText, origin);\r\n\t\t }\r\n\t\t} else {\r\n\t\t server.privateMessage(\r\n\t\t\t \"The only valid command during the night is \\\"/elim\\\" followed a player's name (separated by a space)\",\r\n\t\t\t origin);\r\n\t\t}\r\n\t }\r\n\t}\r\n\r\n }",
"@Override\n public MessageWrapper[] onMsgReceive(MSGGameVote msg, Player sender) {\n Lobby lobby = playerLobbyMap.get(sender);\n lobby.getGameSession().addVote(msg.isAccepted(), msg.getOrient());\n\n if (lobby.getGameSession().allVoted()) {\n // all players voted, move onto next player\n Player prevPlayer = lobby.getGameSession().getCurrentTurn();\n lobby.getGameSession().nextTurn(false);\n\n Message msgNextTurn = new MSGNewTurn(\n prevPlayer,\n lobby.getGameSession().getCurrentTurn(),\n lobby.getGameSession().getScores().get(prevPlayer),\n false);\n\n // if board is full, end the game\n if (lobby.getGameSession().isBoardFull()) {\n Message msgEndGame = new MSGGameStatus(MSGGameStatus.GameStatus.ENDED, null);\n\n // TODO: Better structure protocol\n // send additional message to end game\n return MessageWrapper.prepWraps(\n new MessageWrapper(msgNextTurn, lobby.getPlayers()),\n new MessageWrapper(msgEndGame, lobby.getPlayers()));\n } else {\n return MessageWrapper.prepWraps(\n new MessageWrapper(msgNextTurn, lobby.getPlayers()));\n }\n }\n\n return null;\n }",
"public void voteEnd(String playerID) {\r\n\t\tfor (int i = 0; i < players.size(); i++) {\r\n\t\t\tPlayer p = players.get(i);\r\n\t\t\tif (p.getPlayerID().contentEquals(playerID) && !p.votedForEnd()) {\r\n\t\t\t\tp.setVotedForEnd(true);\r\n\t\t\t\tvotedForEnd++;\r\n\t\t\t\tgameChannel.sendMessage(\"**\"+Utils.getName(playerID, guild)+\"** voted to end the game prematurely\").queue();\r\n\t\t\t\t// Needs one less than playerCount\r\n\t\t\t\tif (votedForEnd >= (playerCount-1)) gameOver();\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private static void verifPayement(){\n\t\tint x,y, dime;\n\t\tx=jeu.getAssam().getXPion()-1;\n\t\ty=jeu.getAssam().getYPion()-1;\n\t\tint caseInfoTapis = jeu.cases[x][y].getCouleurTapis();\n\t\tif(caseInfoTapis == tour || caseInfoTapis == 0){\n\t\t\treturn;\n\t\t}\n\t\telse{\n\t\t\tdime = jeu.payerDime(caseInfoTapis,x,y,0,new boolean[7][7]);\n\t\t\tJoueur payeur = jeu.getJoueurs()[tour-1];\n\t\t\tJoueur paye = jeu.getJoueurs()[caseInfoTapis-1];\n\t\t\tif(jeu.payerVraimentDime(payeur,paye,dime)){\n\t\t\t\tjoueurElimine++;\n\t\t\t}\n\t\t\tconsole.afficherPayeurPaye(payeur, paye, dime);\n\t\t}\n\t}",
"@ScheduledMethod(start= 1, interval =1, priority=5.5)\n\tpublic void meetUp(){\n\t\tif(CFG.MEETUP_VEG()){\n\t\t\tPContext affordanceToRemove =null;\n\t\t\tfor(PContext affordance:getMeatPractice().getAffordances()){\n\t\t\t\tif(affordance.getMyLocation().getClass() == myMeetUpPlace.getClass()) affordanceToRemove = affordance;\n\t\t\t}\n\t\t\t if(affordanceToRemove != null) getMeatPractice().removeAffordance(affordanceToRemove); //After one time it isnt there anymore\n\t\t}\n\t\tif(CFG.isMeetUp() &&!isLocated){\n\t\t\tif(CFG.MEETUP_INVITE()){\n\t\t\t\tif(acceptInvitation(myMeetUpPlace)) diningOutToMeetUp(); //Only if you want to eat Veg you organize a dining party.\n\t\t\t}\n\t\t\telse goTo(myMeetUpPlace); //maar anders ga je er ok heen?!\n\t\t//\tSystem.out.println(\"Agents MEETUP\");\n\t\t}\n\t}",
"public static void doVote() {\n }",
"@External\n\tpublic BigInteger record_excess() {\n\t\tAddress sender = Context.getCaller();\n\t\t\n\t\tif (!sender.equals( this.roulette_score.get()) ) {\n\t\t\tContext.revert(\"This method can only be called by Roulette score\");\n\t\t}\n\t\tBigInteger positive_excess = BigInteger.ZERO;\n\t\tBigInteger game_developers_amount = BigInteger.ZERO;\n\t\tBigInteger day = BigInteger.ZERO;\n\t\t\n\t\tBigInteger now = BigInteger.valueOf(Context.getBlockTimestamp());\t\t\n\t\tday = day.add(now.divide(U_SECONDS_DAY));\n\t\t\n\t\tfor (int i= 0; i< this.get_approved_games().size(); i++ ) {\n\t\t\tAddress game = this.get_approved_games().get(i);\n\t\t\tBigInteger game_excess = this.todays_games_excess.get(game);\n\t\t\tthis.games_excess_history.at(day.subtract(BigInteger.ONE)).set(game, game_excess);\n\t\t\tif (game_excess!= null &&\n\t\t\t\t\tgame_excess.compareTo(BigInteger.ZERO)>= 0) {\n\t\t\t\tpositive_excess = positive_excess.add(game_excess);\n\t\t\t\tthis.todays_games_excess.set(game, BigInteger.ZERO);\n\t\t\t}\n\t\t}\n\t\tgame_developers_amount = this.game_developers_share.get().multiply(positive_excess);\n\t\tgame_developers_amount = game_developers_amount.divide(BigInteger.valueOf(100L));\n\n\t\treturn game_developers_amount;\n\t}",
"public void runOff(int round) {\n\t\tfor (int i = 0; i < voteOrder.size(); i++) {\n\n\t\t\t// Depending on the round, get the number voted\n\t\t\tint count = voteOrder.elementAt(i).elementAt(round) - 1;\n\n\t\t\tCandidat candidat = Candidats.elementAt(count);\n\n\t\t\tif (candidat.getId() == count && !candidat.isEliminated) {\n\t\t\t\tint vow = candidat.getVows() + 1;\n\t\t\t\tcandidat.setVows(vow);\n\n\t\t\t\t// candidat.calculatePercentage(voteOrder.size());\n\t\t\t}\n\n\t\t}\n\n\t}",
"public void unvoteEnd(String playerID) {\r\n\t\tfor (int i = 0; i < players.size(); i++) {\r\n\t\t\tPlayer p = players.get(i);\r\n\t\t\tif (p.getPlayerID().contentEquals(playerID) && p.votedForEnd()) {\r\n\t\t\t\tp.setVotedForEnd(false);\r\n\t\t\t\tvotedForEnd--;\r\n\t\t\t\tgameChannel.sendMessage(\"**\"+Utils.getName(playerID, guild)+\"** retracted their vote to end the game prematurely\").queue();\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private void postVote() {\n if ( unvotedParties() == 0 )\n TransactionManager.getTransactionManager().resolveTransaction(txId);\n }",
"public void dayStartNew() {\n dateOfLastEdit = currentDate;\n sumOfExpenses = 0;\n challengeDaysRunning++;\n\n expensesRefresh();\n carry = moneyLeft;\n\n currentStateSaveToSharedPref();\n expensesUpdateWaterfallChart();\n }",
"private void declareWinner(){\r\n System.out.println(\"All proposals received\");\r\n AID best = proposals.get(0).getSender();\r\n for(ACLMessage proposal: proposals){\r\n String time = proposal.getContent().replaceFirst(\"bid\\\\(\", \"\");\r\n time = time.replaceFirst(\" sec\\\\)\", \"\");\r\n String bestTimeString = \r\n proposal.getContent().\r\n replaceFirst(\"bid\\\\(\", \"\").\r\n replaceFirst(\" sec\\\\)\", \"\");\r\n int bestTime = Integer.parseInt(bestTimeString);\r\n int propTime = Integer.parseInt(time);\r\n if (bestTime > propTime) {\r\n best = proposal.getSender();\r\n }\r\n }\r\n sendMessage(best, \"\", ACLMessage.ACCEPT_PROPOSAL);\r\n Object[] ob = new Object[2];\r\n ob[0] = best;\r\n ob[1] = currentPartial;\r\n expectedReturn.add(ob);\r\n System.out.println(\"Accepting proposal from \" + best.getLocalName());\r\n for(ACLMessage proposal: proposals){\r\n if(!proposal.getSender().equals(best)){\r\n sendMessage(proposal.getSender(), \"\", ACLMessage.REJECT_PROPOSAL);\r\n }\r\n }\r\n proposals.clear();\r\n solvables.remove(0);\r\n if(!solvables.isEmpty()){\r\n \r\n auctionJob(solvables.get(0));\r\n }\r\n }",
"public void resetForNextDay(){\n board.xml.set.generateSceneCards();\n int playerCount = board.getPlayerCount();\n Player[] players = board.getPlayers();\n for(int i = 0; i < playerCount; i++) {\n players[i].setPos(\"Trailer\");\n }\n\n board.incrementDay();\n board.resetTurn();\n if(board.getDay() > this.dayLimit){\n endGame(players);\n }\n }",
"public void countVotes() {\n int[] voteResponses = RaftResponses.getVotes(mConfig.getCurrentTerm());\n int numVotes = 0;\n if(voteResponses == null) {\n //System.out.println(mID + \" voteResponses null\");\n //System.out.println(\"cur \" + mConfig.getCurrentTerm() + \" RR: \" + RaftResponses.getTerm());\n }\n else {\n for(int i = 1; i <= mConfig.getNumServers(); i++) {\n //If vote has not been received yet, resend request\n //if(voteResponses[i] == -1)\n //this.remoteRequestVote(i, mConfig.getCurrentTerm(), mID, mLog.getLastIndex(), mLog.getLastTerm());\n if(voteResponses[i] == 0)\n numVotes++;\n }\n }\n //If election is won, change to leader\n if(numVotes >= (mConfig.getNumServers()/2.0)) {\n electionTimer.cancel();\n voteCountTimer.cancel();\n RaftServerImpl.setMode(new LeaderMode());\n }\n else {\n voteCountTimer = scheduleTimer((long) 5, 2);\n }\n }",
"private void sendWinnerMessage(RaceTrackMessage playerDisconnectsMessage) {\n\t\tif(playerDisconnectsMessage != null)\n\t\t\ttry{\n\n\t\t\t\tint playerWhoWon = getPlayerWhoWonByPlayerID(((DisconnectMessage) playerDisconnectsMessage).getNextPlayerToMove()); \n\t\t\t\tint playerWhoWonID = getPlayerIDWhoWonByPlayerID(((DisconnectMessage) playerDisconnectsMessage).getNextPlayerToMove());\n\t\t\t\tif(playerWhoWon != -1){\n\t\t\t\t\tPoint2D lastVec = null;\n\t\t\t\t\tif(getPlayerMap().get(playerWhoWonID) != null)\n\t\t\t\t\t\tlastVec = getPlayerMap().get(playerWhoWonID).getCurrentPosition();\n\n\n\t\t\t\t\tPlayerWonMessage answer;\n\n\t\t\t\t\tanswer = VectorMessageServerHandler.generatePlayerWonMessage(playerWhoWon, playerWhoWon, lastVec);\n\n\t\t\t\t\tcloseGameByPlayerID(playerWhoWon);\n\n\t\t\t\t\tanswer.addClientID(playerWhoWonID);\n\n\t\t\t\t\tsendMessage(answer);\n\t\t\t\t\t\n\t\t\t\t\t//inform the AIs that game is over!!\n\n\t\t\t\t}\n\t\t\t}catch(ClassCastException e){\n\n\t\t\t}\n\t}",
"private void handlePlayerConnect(Player player) {\n server.runTaskLater(() -> server.getPaymentLog().checkPendingAccepts(player), 1500, TimeUnit.MILLISECONDS);\n\n if (player.hasPermission(Rank.ADMIN)) {\n server.runTaskLater(() -> server.getDataSource().getCollection(\"archon\", \"dailytop\").count((result, t) -> {\n if (result == null) {\n result = 0L;\n }\n\n List<String> msg = new ArrayList<>();\n msg.add(\"&8\" + Message.BAR);\n msg.add(\"&6[&c&lArchon&6] &aProxy \" + player.getProxy().getId() + \" &7[\" + player.getRegion().name() + \" Network]\");\n msg.add(\"\");\n msg.add(\"&e[Today]\");\n int mostOnlineToday = server.getCache().getCurrentMostOnline();\n int uniqueLoginsToday = (int) (long) result;\n int newPlayersToday = server.getCache().getCurrentNewPlayers();\n\n try (Connection conn = server.getDataSource().getConnection();\n Statement stmt = conn.createStatement()) {\n // 1-day stats\n try (ResultSet rs = stmt.executeQuery(\"SELECT most_online, unique_logins, new_players FROM dailytop WHERE date = (SELECT MAX(date) FROM dailytop)\")) {\n if (rs.next()) {\n int mostOnlineYesterday = rs.getInt(\"most_online\");\n int uniqueLoginsYesterday = rs.getInt(\"unique_logins\");\n int newPlayersYesterday = rs.getInt(\"new_players\");\n\n double mostOnlineChange = Util.getPercentageChange(mostOnlineYesterday, mostOnlineToday);\n String disp = (mostOnlineChange < 0 ? \"&7(&c\" : \"&7(&a+\") + format.format(mostOnlineChange) + \"% &7from yesterday)\";\n msg.add(\"&7* &6Most Online: &d\" + Util.addCommas(mostOnlineToday) + \" \" + disp);\n\n double uniqueLoginsChange = Util.getPercentageChange(uniqueLoginsYesterday, uniqueLoginsToday);\n disp = (uniqueLoginsChange < 0 ? \"&7(&c\" : \"&7(&a+\") + format.format(uniqueLoginsChange) + \"% &7from yesterday)\";\n msg.add(\"&7* &6Unique Logins: &d\" + Util.addCommas(uniqueLoginsToday) + \" \" + disp);\n\n double newPlayersChange = Util.getPercentageChange(newPlayersYesterday, newPlayersToday);\n disp = (newPlayersChange < 0 ? \"&7(&c\" : \"&7(&a+\") + format.format(newPlayersChange) + \"% &7from yesterday)\";\n msg.add(\"&7* &6New Players: &d\" + Util.addCommas(newPlayersToday) + \" \" + disp);\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n ZonedDateTime time = ZonedDateTime.now(ZoneId.of(\"America/Los_Angeles\"));\n msg.add(\"&e[From yesterday at this hour: \" + time.format(DateTimeFormatter.ofPattern(\"h a\")) + \" \" + time.getZone().getDisplayName(TextStyle.FULL, Locale.ENGLISH) + \"]\");\n // prev day (same hour) stats\n try (ResultSet rs = stmt.executeQuery(\"SELECT online, most_online, unique_logins, new_players FROM daily_stats WHERE DATE(time) = DATE(SUBDATE(UTC_TIMESTAMP, 1)) && HOUR(time) = HOUR(UTC_TIMESTAMP) LIMIT 1;\")) {\n if (rs.next()) {\n int onlineYesterday = rs.getInt(\"online\");\n int mostOnlineYesterday = rs.getInt(\"most_online\");\n int uniqueLoginsYesterday = rs.getInt(\"unique_logins\");\n int newPlayersYesterday = rs.getInt(\"new_players\");\n\n double currentOnlineChange = Util.getPercentageChange(onlineYesterday, server.getOnlineCount());\n String disp = (currentOnlineChange < 0 ? \"&7(&c\" : \"&7(&a+\") + format.format(currentOnlineChange) + \"% &7from yesterday at this hour)\";\n msg.add(\"&7* &3Online: &b\" + Util.addCommas(onlineYesterday) + \" \" + disp);\n\n double mostOnlineChange = Util.getPercentageChange(mostOnlineYesterday, mostOnlineToday);\n disp = (mostOnlineChange < 0 ? \"&7(&c\" : \"&7(&a+\") + format.format(mostOnlineChange) + \"% &7from yesterday at this hour)\";\n msg.add(\"&7* &3Most Online: &b\" + Util.addCommas(mostOnlineYesterday) + \" \" + disp);\n\n double uniqueLoginsChange = Util.getPercentageChange(uniqueLoginsYesterday, uniqueLoginsToday);\n disp = (uniqueLoginsChange < 0 ? \"&7(&c\" : \"&7(&a+\") + format.format(uniqueLoginsChange) + \"% &7from yesterday at this hour)\";\n msg.add(\"&7* &3Unique Logins: &b\" + Util.addCommas(uniqueLoginsYesterday) + \" \" + disp);\n\n double newPlayersChange = Util.getPercentageChange(newPlayersYesterday, newPlayersToday);\n disp = (newPlayersChange < 0 ? \"&7(&c\" : \"&7(&a+\") + format.format(newPlayersChange) + \"% &7from yesterday at this hour)\";\n msg.add(\"&7* &3New Players: &b\" + Util.addCommas(newPlayersYesterday) + \" \" + disp);\n } else {\n msg.add(\"&7&oNo data to display from this time.\");\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n msg.add(\"&8\" + Message.BAR);\n\n try (ResultSet rs = stmt.executeQuery(\"SELECT (SELECT COUNT(*) FROM votes) AS total, COUNT(*) AS today FROM votes WHERE DATE(time) = CURDATE();\")) {\n if (rs.next()) {\n msg.add(\"&aVotes Today: &7\" + Util.addCommas(rs.getInt(\"today\"))\n + \"&a, Total Votes: &7\" + Util.addCommas(rs.getInt(\"total\")) + \" (\" + Util.humanReadableNumber(rs.getInt(\"total\")) + \")\");\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n player.message(msg);\n }), 1, TimeUnit.SECONDS);\n }\n }",
"public void handleEndAuctionRound(String winner);",
"public void checkVotes() {\r\n\t\tnew Timer().scheduleAtFixedRate(new TimerTask() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void run() {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tURLConnection connection = new URL(\"https://glowning.dev/discordminer/webhook/votes.txt\").openConnection();\r\n\t\t\t\t\tconnection.setRequestProperty(\"User-Agent\", \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11\");\r\n\t\t\t\t\tconnection.connect();\r\n\r\n\t\t\t\t\tBufferedReader r = new BufferedReader(new InputStreamReader(connection.getInputStream(), Charset.forName(\"UTF-8\")));\r\n\r\n\t\t\t\t\tString line = \"\";\r\n\t\t\t\t\twhile ((line = r.readLine()) != null) {\r\n\t\t\t\t\t\tSystem.out.println(line);\r\n\t\t\t\t\t\tUser u = getShards().getUserById(line);\r\n\t\t\t\t\t\tif (u != null) {\r\n\t\t\t\t\t\t\tint crate;\r\n\r\n\t\t\t\t\t\t\tCalendar cal = Calendar.getInstance();\r\n\t\t\t\t\t\t\tcal.setTimeInMillis(System.currentTimeMillis());\r\n\t\t\t\t\t\t\tcal.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\r\n\r\n\t\t\t\t\t\t\tif (cal.get(Calendar.DAY_OF_WEEK) == Calendar.FRIDAY || cal.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY || cal.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) {\r\n\t\t\t\t\t\t\t\tcrate = 2;\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tcrate = 1;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tMiner miner = new Miner(u.getIdLong());\r\n\t\t\t\t\t\t\tif (miner.exists()) {\r\n\t\t\t\t\t\t\t\tSystem.out.println(\"Crates given to \" + u.getName() + \" (\" + u.getIdLong() + \")\");\r\n\t\t\t\t\t\t\t\tu.openPrivateChannel().complete().sendMessage(\"Hey! Thank you for your vote.\\nAs a reward, I give you **\" + crate + \" crate\" + (crate == 2 ? \"s\" : \"\") + \"**.\").queue();\r\n\r\n\t\t\t\t\t\t\t\tminer.addCrates(\"vote\", crate);\r\n\t\t\t\t\t\t\t\tminer.getStats().put(\"votes\", miner.getStats().getInt(\"votes\") + 1);\r\n\t\t\t\t\t\t\t\tminer.update();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tHttpClient httpclient = HttpClients.createDefault();\r\n\t\t\t\t\t\tHttpPost httppost = new HttpPost(\"https://glowning.dev/discordminer/webhook/discordbots.php\");\r\n\t\t\t\t\t\tList<NameValuePair> params = new ArrayList<NameValuePair>(2);\r\n\t\t\t\t\t\tparams.add(new BasicNameValuePair(\"Authorization\", \"DiscordMiner\"));\r\n\t\t\t\t\t\tparams.add(new BasicNameValuePair(\"user\", line));\r\n\t\t\t\t\t\thttppost.setEntity(new UrlEncodedFormEntity(params, \"UTF-8\"));\r\n\t\t\t\t\t\thttpclient.execute(httppost);\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}, 0, 1000);\r\n\t}",
"protected boolean processPlayerDeclined(int gameNum, String playerName, String offer){\n return false;\n }",
"void addVote(UserId userId, QuestionId questionId, int vote);",
"private void check4voteAndClean()\n\t{\n\t\tif( noBeepersPresent())\n\t\t{\tturnLeft();\n\t\t\tmove();\n\t\t\tpickAll();\n\t\t\tturnAround();\n\t\t\tmove();\n\t\t\tmove();\n\t\t\tpickAll();\n\t\t\tturnAround();\n\t\t\tmove();\n\t\t\tturnRight();\n\t\t}\n\t}",
"public void trigger()\r\n\t{\r\n\t\tif(!this.inProgress && this.round >= Config.RoundLimit)\r\n\t\t{\r\n\t\t\tthis.sendMessages(new String[]{\"The game has already ended.\"});\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tint count = this.playerCount();\r\n\t\t\tif(count > 1 && count - this.readyCount() == 0)\r\n\t\t\t{\r\n\t\t\t\tList<String> messages = new LinkedList<>();\r\n\t\t\t\tif(this.inProgress)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(Config.Phases[this.phase].equals(Config.VotePhaseName))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmessages.add(\"Voting ended. Counting votes.\");\r\n\t\t\t\t\t\t// Sum all the votes from each player.\r\n\t\t\t\t\t\tint[] votes = new int[Config.TableCards];\r\n\t\t\t\t\t\tfor(Player player : this.players)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(player != null)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tint[] playerVotes = player.getVotes();\r\n\t\t\t\t\t\t\t\tint i = 0;\r\n\t\t\t\t\t\t\t\twhile(i < playerVotes.length)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tif(playerVotes[i] != 0)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tvotes[i] += playerVotes[i];\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t++i;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tplayer.resetVotes();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// Pick the cards with more yes votes than no votes.\r\n\t\t\t\t\t\tList<Card> picked = new LinkedList<>();\r\n\t\t\t\t\t\tint pos = 0;\r\n\t\t\t\t\t\twhile(pos < this.onTable.size())\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(votes[pos] > 0)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tCard card = this.onTable.get(pos);\r\n\t\t\t\t\t\t\t\tpicked.add(card);\r\n\t\t\t\t\t\t\t\tfor(Share price : this.prices)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tif(price.getStock().equals(card.stock))\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tprice.addShares(card.effect);\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t++pos;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// Prepare the output string for the picked cards.\r\n\t\t\t\t\t\tString message = \"\";\r\n\t\t\t\t\t\tboolean isNotFirst = false;\r\n\t\t\t\t\t\tfor(Card card : picked)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(isNotFirst)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tmessage += \", \";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tisNotFirst = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tmessage += card.stock;\r\n\t\t\t\t\t\t\tif(card.effect > 0)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tmessage += \"+\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tmessage += card.effect;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tthis.dealToTable();\r\n\t\t\t\t\t\tmessages.add(\"Picked influence cards: \" + message);\r\n\t\t\t\t\t\tmessages.add(\"\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t++this.phase;\r\n\t\t\t\t\tif(this.phase >= Config.Phases.length)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tthis.phase = 0;\r\n\t\t\t\t\t\t++this.round;\r\n\t\t\t\t\t\tif(this.round >= Config.RoundLimit)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tthis.stopGame();\r\n\t\t\t\t\t\t\tShare[] prices = this.prices.toArray(new Share[0]);\r\n\t\t\t\t\t\t\tfor(Player player : this.players)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif(player != null)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tplayer.sellAll(prices);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tmessages.add(\"Game over. Scores:\");\r\n\t\t\t\t\t\t\t// Copy and sort the players list by total money.\r\n\t\t\t\t\t\t\tPlayer[] winners = Arrays.copyOf(this.players, this.players.length);\r\n\t\t\t\t\t\t\tArrays.sort(winners, (Player o1, Player o2) -> {\r\n\t\t\t\t\t\t\t\tif(o1 == null && o2 == null)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\treturn 0;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if(o1 == null)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\treturn 1;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if(o2 == null)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\treturn -1;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\treturn o2.getMoney() - o1.getMoney();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\tint lastScore = winners[0].getMoney();\r\n\t\t\t\t\t\t\tint num = 0;\r\n\t\t\t\t\t\t\tint i = 0;\r\n\t\t\t\t\t\t\twhile(i < winners.length)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif(winners[i] == null)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tif(lastScore > winners[i].getMoney())\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tnum = i;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tmessages.add(Config.PlayerPositions[num] + \": Player \" + winners[i].getPlayerNumber() + \", \" + winners[i].getName() + \" - \" + Config.Currency + winners[i].getMoney());\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t++i;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tmessages.add(\"Round \" + (this.round + 1) + \" of \" + Config.RoundLimit + \".\");\r\n\t\t\t\t\t\t\tmessages.add(Config.Phases[this.phase] + \" phase started.\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmessages.add(Config.Phases[this.phase] + \" phase started.\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tthis.inProgress = true;\r\n\t\t\t\t\tmessages.add(\"Game started. Round \" + (this.round + 1) + \" of \" + Config.RoundLimit + \".\");\r\n\t\t\t\t\tmessages.add(Config.Phases[this.phase] + \" phase started.\");\r\n\t\t\t\t}\r\n\t\t\t\tthis.sendMessages(messages.toArray(new String[0]));\r\n\t\t\t\tfor(Player player : this.players)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(player != null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tplayer.setReady(false);\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 boolean applyWinner(UUID winner) {\r\n\t\tPennyGame plugin = PennyGame.getPlugin(PennyGame.class);\r\n\t\tRegisteredServiceProvider<Economy> rsp = plugin.getServer().getServicesManager().getRegistration(Economy.class);\r\n\t\tEconomy econ = rsp.getProvider();\r\n\t\tOfflinePlayer player = Bukkit.getOfflinePlayer(winner);\r\n\t\t\r\n\t\tif(econ.depositPlayer(player, jackpot).transactionSuccess()) {\r\n\t\t\tthis.tickets.clear();\r\n\t\t\tplugin.getSettings().set(\"jackpot\", startingPot);\r\n\t\t\tplugin.getSettings().set(\"last-winner\", player.getName());\r\n\t\t\tplugin.getSettings().set(\"last-winner-sum\", jackpot);\r\n\t\t\tplugin.saveSettings();\r\n\t\t\tjackpot = startingPot;\r\n\t\t\t\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public void announceElimination(String loserName){\n currentMessage = loserName;\n gameState = GameState.ELIMINATION;\n notifyObservers();\n currentMessage = \"\";\n }",
"private void setupInvitedDripFlow() {\n // all the entries created in invite in the last interval.\n List<DProjectInvites> invites = AppConfig.getInstance().getdProjectInvitesDAO().findAllInternal();\n if (invites == null || invites.isEmpty()) return;\n List<DProjectInvites> newInvites = new ArrayList<>();\n for (DProjectInvites invite : invites) {\n if (invite.getCreated_timestamp().after(lastRunDate)) {\n newInvites.add(invite);\n }\n }\n LOG.info(\"setupInvitedDripFlow newInvites = \" + newInvites.size());\n if (newInvites.isEmpty()) return;\n\n DripFlows.addToProjectInviteFlow(newInvites);\n }",
"public void vaccinate(int day){\r\n\t\tfor(int i = 0; i < this.getnVillages(); i++){\r\n\t\t\tvVillages[i].resetNVaccinated();\r\n\t\t\tif(vVillages[i].getVaccDay() == day){\r\n\t\t\t\tvVillages[i].vaccinate();\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void handleLastAcceptedOffer(String participant, long price);",
"@Override\n\tpublic void handleOnNextDay() {\n\t\trecommendDao.updateTimes();\n\t}",
"@Override\n public void opponentSurrender(int id) {\n try {\n if (getClientInterface() != null)\n getClientInterface().notifyOpponentSurrender(id);\n }\n catch (RemoteException e) {\n System.out.println(\"remote sending opponent surrender error\");\n }\n }",
"public synchronized void reportVotes() {\n StringBuilder voteReport = new StringBuilder(\"\");\n for (Player player : playerVotes.keySet()) {\n voteReport.append(player.getUserName()).append(\": \").append(\n playerVotes.get(player) ? \"yes\\n\" : \"no\\n\");\n }\n sendPublicMessage(\"The votes were:\\n\" + voteReport.toString());\n }",
"public void sendVoteRequests() {\n for(int i = 1; i <= mConfig.getNumServers(); i++) {\n this.remoteRequestVote(i, mConfig.getCurrentTerm(), mID, mLog.getLastIndex(), mLog.getLastTerm());\n }\n //Initiate count vote timer\n voteCountTimer = scheduleTimer((long) 5, 2);\n }",
"public void voteIdea(String username, Long ideaId, boolean vote) throws VotingException, DataAccessException {\n try {\n MyUser user = myUserFacade.getUser(username);\n Idea idea = this.find(ideaId);\n Boolean previousVote = user.getVotes().get(idea);\n if (previousVote == null) {\n // If the user never voted for this idea, then create a new Vote:\n user.addVote(idea, vote);\n if (vote) {\n idea.upvote();\n } else {\n idea.downvote();\n }\n } else {\n // The user had previously voted for this idea.\n // Case 1: trying to upvote twice the idea:\n if (previousVote && vote) {\n throw new VotingException((null), \"Cannot upvote twice the same post\");\n } // Case 2: trying to downvote twice the idea:\n else if (!previousVote && !vote) {\n throw new VotingException((null), \"Cannot downvote twice the same post\");\n } // Case 3: one is upvote and the other downvote. Vote is removed\n else {\n user.removeVote(idea);\n if (vote) {\n idea.setUpvotes(idea.getUpvotes() - 1);\n } else {\n idea.setDownvotes(idea.getDownvotes() - 1);\n }\n }\n }\n myUserFacade.edit(user);\n this.edit(idea);\n } catch (PersistenceException | EJBException pe) {\n throw new DataAccessException(pe, \"Error while voting post\");\n }\n }",
"public void verSesionCandidato(Candidato actualcandidat)\r\n\t{\r\n\t\tSesion sesio = new Sesion();\r\n\t\tGregorianCalendar calendario = new GregorianCalendar();\r\n\t\tString fechasesion = calendario.get(Calendar.YEAR)+\"-\"+(calendario.get(Calendar.MONTH)+1)+\"-\"+calendario.get(Calendar.DAY_OF_MONTH);\r\n\t\tString horainicial = calendario.get(Calendar.HOUR_OF_DAY)+\":\"+calendario.get(Calendar.MINUTE)+\":\"+calendario.get(Calendar.SECOND);\r\n\t\tsesio.setFechasesion(fechasesion);\r\n\t\tsesio.setHorainicial(horainicial);\r\n\t\tsesio.setHorafinal(\"NULL\");\r\n\t\ttry \r\n\t\t{\r\n\t\t\tConector conector = new Conector();\r\n\t\t\tconector.iniciarConexionBaseDatos();\r\n\t\t\tSesionBD.insertar(sesio, conector);\r\n\t\t\tconector.terminarConexionBaseDatos();\r\n\t\t}\r\n\t\tcatch (Exception e)\r\n\t\t{\r\n\t\t\tJOptionPane.showMessageDialog(this,\"Error al conectar con la Base de Datos.\",\"Error\", JOptionPane.ERROR_MESSAGE,new ImageIcon(\"./images/IconosInterfaz/error.PNG\"));\r\n\t\t}\r\n\t\tSesion sesioningr = null;\r\n\t\ttry \r\n\t\t{\r\n\t\t\tConector conector = new Conector();\r\n\t\t\tconector.iniciarConexionBaseDatos();\r\n\t\t\tsesioningr = SesionBD.buscarFechaHora(fechasesion, horainicial, conector);\r\n\t\t\tconector.terminarConexionBaseDatos();\r\n\t\t}\r\n\t\tcatch (Exception e)\r\n\t\t{\r\n\t\t\tJOptionPane.showMessageDialog(this,\"Error al conectar con la Base de Datos.\",\"Error\", JOptionPane.ERROR_MESSAGE,new ImageIcon(\"./images/IconosInterfaz/error.PNG\"));\r\n\t\t}\r\n\t\tif(sesioningr != null)\r\n\t\t{\r\n\t\t\tSesionCandidato nuevasesion = new SesionCandidato();\r\n\t\t\tnuevasesion.setIdsesion(sesioningr.getIdsesion());\r\n\t\t\tnuevasesion.setIdcandidato(actualcandidat.getIdcandidato());\r\n\t\t\ttry \r\n\t\t\t{\r\n\t\t\t\tConector conector = new Conector();\r\n\t\t\t\tconector.iniciarConexionBaseDatos();\r\n\t\t\t\tSesionCandidatoBD.insertar(nuevasesion, conector);\r\n\t\t\t\tconector.terminarConexionBaseDatos();\r\n\t\t\t\t\r\n\t\t\t\tsesioncandidato = new SesionCandidatoI(this, actualcandidat, sesioningr);\r\n\t\t\t\tsesioncandidato.setVisible(true);\r\n\t\t\t}\r\n\t\t\tcatch (Exception e)\r\n\t\t\t{\r\n\t\t\t\tJOptionPane.showMessageDialog(this,\"Error al conectar con la Base de Datos.\",\"Error\", JOptionPane.ERROR_MESSAGE,new ImageIcon(\"./images/IconosInterfaz/error.PNG\"));\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void removeKickVote()\n\t{\n\t\tnumberOfKickVotes--;\n\t}",
"@Override\n public List<IEpisode> prune(List<IEpisode> candidates, IObserver observer, \n SessionInfo session)\n {\n if (DEBUG) { \n System.out.println(\"NegativeStrengthThreshold: pruning episodes base on individual predictions\");\n System.out.println(\"NegativeStrengthThreshold: start count ->\" + candidates.size());\n } \n observer.setExtent( candidates.size() );\n observer.startup();\n IEventDataStream sequence = session.getSequence();\n for (ListIterator<IEpisode> li = candidates.listIterator(); li.hasNext(); ) \n {\n IEpisode episode = li.next();\n if (episode.size() == 1) return candidates;\n \n if (DEBUG)\n {\n System.out.println(episode.toString(sequence.getEventFactor()) + \n \" : \" + episode.getVoteString() + \" < \" + episode.getRequiredVoteString());\n }\n \n boolean flag = false;\n for(int index = 0; index < session.getSegIndexLen(); index++)\n {\n if (episode.getVotes(index) > episode.getRequiredVotes(index))\n {\n flag = true;\n break;\n }\n }\n if (flag)\n {\n li.remove();\n }\n if (observer.update(li.nextIndex())) break;\n }\n observer.shutdown();\n if (DEBUG) System.out.println(\"NegativeStrengthThreshold: final count ->\" + candidates.size());\n return candidates;\n }",
"private void eliminate() {\n\t\t// when the election is not closed,\n\t\ttry{\n\t\t\tMap<String,Integer> results = election.getResultsFromPolls();\n\t\t\tList<Map.Entry<String,Integer>> entryList = new ArrayList(results.entrySet());\n\n\t\t\tCollection<Integer> values = results.values();\n\t\t\tint totalVotes = 0;\n\n\t\t\tfor(Integer i:values){\n\t\t\t\ttotalVotes += i;\n\t\t\t}\n\n\t\t\tif(entryList.get(entryList.size()-1).getValue()/(double)totalVotes > 0.5) {\n\t\t\t\t// when the election already has a winner,\n\t\t\t\tSystem.out.println(\"A candidate already has a majority of the votes.\");\n\t\t\t\tSystem.out.println(\"You cannot remove any more candidates.\");\n\t\t\t}else {\n\n\t\t\t\t// when we can eliminate a candidate,\n\t\t\t\tSystem.out.println(\"Eliminating the lowest-ranked candidate.\");\n\t\t\t\tList lowestCans = new ArrayList();\n\t\t\t\tlowestCans.add(entryList.get(0).getKey());\n\t\t\t\tint i = 1;\n\t\t\t\twhile (i<entryList.size() && entryList.get(i).getValue() == entryList.get(0).getValue() ){\n\t\t\t\t\tlowestCans.add(entryList.get(i).getKey());\n\t\t\t\t\ti++;\n\t\t\t\t}\n\n\t\t\t\tif (lowestCans.size() >1) {\n\t\t\t\t\tCollections.sort(lowestCans);\n\t\t\t\t\tCollections.reverse(lowestCans);\n\t\t\t\t}\n\t\t\t\t\telection.eliminateCandidateWithName((String) lowestCans.get(0));\n\n\t\t\t\tSystem.out.println(\"Eliminated \"+lowestCans.get(0)+\".\");\n\t\t\t}\n\n\t\t}catch(UnsupportedOperationException uso){\n\t\t\tSystem.out.println(\"The election is still open for votes.\");\n\t\t\tSystem.out.println(\"You must close the election before eliminating candidates.\");\n\t\t}\n\n\t}",
"private void quit() {\n\t\t\tArrayList<ClientThread> delList = new ArrayList<ClientThread>();\n\t\t\tdelList.add(this);\n\t\t\tplayers.removeAll(delList);\n\t\t\twaitingPlayers.removeAll(delList);\n\t\t\tview.changeInAndWait(players.size(),waitingPlayers.size());\t\t\n\t\t\tif(dealer == this) {\n\t\t\t\tdealer = null;\n\t\t\t\tview.writeLog(\"Dealer: \" + name + \" has quited. NO DEALER NOW.\");\n\t\t\t}else view.writeLog(\"Player: \" + name + \" has quited.\");\n\t\t\tstatusCheck();\n\t\t}",
"public void updateWithPointWonBy(Player player) {\n if(managerTennisMatch.statusTennisMatch == \"ClassicalGame\") {\n if (player == player1) {\n managerTennisMatch.checkScoreAndUpdateGame(player, player2);\n } else {\n managerTennisMatch.checkScoreAndUpdateGame(player, player1);\n }\n } else if(managerTennisMatch.statusTennisMatch == \"TieBreakInProgress\") {\n player.setScore(player.getScore() + 1);\n if((player1.getScore() >= 7 && player1.getScore() - player2.getScore() >= 2) || (player2.getScore() >= 7 && player2.getScore() - player1.getScore() >= 2)) {\n tennisSetList.get(tennisSetList.size() - 1).getBaseGameList().add(new TieBreakGame(player));\n player1.setScore(0);\n player2.setScore(0);\n }\n } else {\n return;\n }\n }",
"@Override\n public int dues(Person person) {\n List<TransactionInformation> statement = person.statement();\n if (statement.size() == 0){\n return -1 * expensePerPerson();\n }\n TransactionInformation total = statement.get(statement.size() - 1);\n\n return total.balance - expensePerPerson();\n }",
"private void botVoting(){\n int stockPos;\n int myStockPos = getMostShares(playerList.lastIndexOf(player));\n Collections.sort(playerList);\n if(playerList.get(0) == player){ //if i am the leader\n stockPos = getMostShares(1); //get the second players info\n }else{\n stockPos = getMostShares(0); //else get the first players info\n }\n\n //if my most shares are the same as other players most shares, don't vote.\n if(game.getStockByIndex(stockPos) != game.getStockByIndex(myStockPos)){\n //offensive play against leader\n if(game.isCardPositive(game.getStockByIndex(stockPos))){\n game.getStockByIndex(stockPos).vote(0);\n player.getVotedStocks().append(game.getStockByIndex(stockPos).getName().charAt(0));\n player.deductVotesLeft();\n System.out.println(\"bot voted NO for \" + game.getStockByIndex(stockPos).getName() );\n }else{\n game.getStockByIndex(stockPos).vote(1);\n player.getVotedStocks().append(game.getStockByIndex(stockPos).getName().charAt(0));\n player.deductVotesLeft();\n System.out.println(\"bot voted YES for \" + game.getStockByIndex(stockPos).getName());\n }\n //defensive play, votes that will benefit me\n if(game.isCardPositive(game.getStockByIndex(myStockPos))){\n game.getStockByIndex(myStockPos).vote(1);\n player.getVotedStocks().append(game.getStockByIndex(myStockPos).getName().charAt(0));\n player.deductVotesLeft();\n System.out.println(\"bot voted YES for \" + game.getStockByIndex(myStockPos).getName());\n }else{\n game.getStockByIndex(myStockPos).vote(0);\n player.getVotedStocks().append(game.getStockByIndex(myStockPos).getName().charAt(0));\n player.deductVotesLeft();\n System.out.println(\"bot voted NO for \" + game.getStockByIndex(myStockPos).getName());\n }\n }\n }",
"void record2_liveprices(DdfMarketBase msg, Quote quote, FeedEvent fe) {\n\t\t// /////////////////////////////////////////////////////////\n\t\t// record = 2 Exchange live quote messages\n\t\t// ///////////////////////////////////////////////////////////\n\n\t\t// ///////////////////////////\n\t\t// Update cached quote\n\t\t// ///////////////////////////\n\t\tquote.updateLastUpdated();\n\t\t// Save Original DDF message\n\t\tquote.setMessage(msg);\n\n\t\t/*\n\t\t * Session Logic\n\t\t */\n\t\tboolean bDoNotSetFlag = false;\n\t\t// Running cumulative Volume\n\t\tCumulativeVolume cv = getCumulativeVolume(msg.getSymbol());\n\n\t\tSession pCombinedSession = null;\n\t\tSession pPreviousSession = null;\n\n\t\t/*\n\t\t * Set current session to the message's \"day\", probably first message of\n\t\t * the day.\n\t\t */\n\t\tif (quote._combinedSession.getDayCode() == '\\0') {\n\t\t\tquote._combinedSession.setDayCode(msg.getDay());\n\t\t}\n\n\t\tint day1_dayFromCurrentQuoteSession = DDFDate.convertDayCodeToNumber(quote._combinedSession.getDayCode());\n\t\tint day2_dayFromMessage = DDFDate.convertDayCodeToNumber(msg.getDay());\n\n\t\tif (day1_dayFromCurrentQuoteSession == day2_dayFromMessage) {\n\t\t\t/*\n\t\t\t * The message is for the current session.\n\t\t\t */\n\t\t\tpCombinedSession = quote._combinedSession;\n\t\t\tpPreviousSession = quote._previousSession;\n\t\t} else if (msg.getDay() == quote._previousSession.getDayCode()) {\n\t\t\t/*\n\t\t\t * Message is for the previous session\n\t\t\t */\n\t\t\tpCombinedSession = quote._previousSession;\n\t\t\tpPreviousSession = new Session(quote);\n\n\t\t\t/* Don't set any flags, since we're in \"yesterday\" */\n\t\t\tbDoNotSetFlag = true;\n\t\t\tif (log.isDebugEnabled()) {\n\t\t\t\tlog.debug(\"Previous session: \" + msg);\n\t\t\t}\n\n\t\t} else if ((day2_dayFromMessage > day1_dayFromCurrentQuoteSession)\n\t\t\t\t|| ((day1_dayFromCurrentQuoteSession - day2_dayFromMessage) > 5)) {\n\t\t\t/*\n\t\t\t * Message is for a new session/day, so we have changed sessions.\n\t\t\t */\n\n\t\t\t/*\n\t\t\t * Only roll if the combined session has a valid last. The previous\n\t\t\t * day could have a been a holiday or there was no trades for that\n\t\t\t * day.\n\t\t\t */\n\t\t\tif (quote._combinedSession.getLast() == 0.0f) {\n\t\t\t\tif (log.isDebugEnabled()) {\n\t\t\t\t\tlog.debug(\"New session, last == 0: \" + msg);\n\t\t\t\t}\n\t\t\t\tpCombinedSession = quote._combinedSession;\n\t\t\t\tpPreviousSession = quote._previousSession;\n\t\t\t} else {\n\t\t\t\t// Current Session has a last price, start a new session\n\t\t\t\tif (log.isDebugEnabled()) {\n\t\t\t\t\tlog.debug(\"New session, last > 0: \" + msg);\n\t\t\t\t}\n\n\t\t\t\tSession pPrevious = quote._previousSession;\n\t\t\t\tquote._previousSession = quote._combinedSession;\n\t\t\t\t// Create new current session\n\t\t\t\tquote._combinedSession = new Session(quote, DDFDate.fromDayCode(msg.getDay()), msg.getSession());\n\t\t\t\tquote.setFlag('p');\n\n\t\t\t\t// Add MarketEvent.PreOpen\n\t\t\t\tMarketEvent me = addMarketEvent(fe, msg, MarketEventType.PreOpen, quote.getSymbolInfo().getSymbol());\n\t\t\t\tif (log.isDebugEnabled()) {\n\t\t\t\t\tlog.debug(me.toString());\n\t\t\t\t}\n\n\t\t\t\tquote._combinedSession._open = 0.0f;\n\t\t\t\tquote._combinedSession._high = 0.0f;\n\t\t\t\tquote._combinedSession._low = 0.0f;\n\t\t\t\tquote._combinedSession.setPrevious(quote._previousSession.getLast());\n\n\t\t\t\tif (quote._previousSession.getOpenInterest() == 0) {\n\t\t\t\t\tquote._previousSession._openInterest = pPrevious._openInterest;\n\t\t\t\t}\n\t\t\t\tpCombinedSession = quote._combinedSession;\n\t\t\t\tpPreviousSession = quote._previousSession;\n\n\t\t\t\tif (cv != null) {\n\t\t\t\t\t// It is a new session clear the cumulative volume for this\n\t\t\t\t\t// session\n\t\t\t\t\tDDFDate d = DDFDate.fromDayCode(msg.getDay());\n\t\t\t\t\tcv.setDate(d.getMillisCST());\n\t\t\t\t\tcv.getData().clear();\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Should never happen\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t * We should update the Quote's Session session value with the inbound\n\t\t * message. Otherwise, we get stuck on something like a Form-T\n\t\t */\n\t\tpCombinedSession._session = msg.getSession();\n\n\t\tSession session = quote.createSession(msg.getDay(), msg.getSession());\n\n\t\tif (session == pCombinedSession) {\n\t\t\tsession = null;\n\t\t}\n\n\t\tif ((session != null) && (session.getPrevious() == 0.0f)) {\n\t\t\tsession.setPrevious(pCombinedSession.getPrevious());\n\t\t}\n\n\t\t// //////////////////////////////////////////////////////////\n\t\t// Process based on record type and subrecord type\n\t\t// ///////////////////////////////////////////////////////////\n\t\tif (msg instanceof DdfMarketParameter) {\n\t\t\t// ////////////////////////////////////////////\n\t\t\t// record 2, subrecord 0, Price Elements\n\t\t\t// ///////////////////////////////////////////\n\t\t\trecord2_subrecord0(msg, fe, quote, bDoNotSetFlag, pCombinedSession, pPreviousSession, session);\n\n\t\t} else if (msg instanceof DdfMarketRefresh) {\n\t\t\t// ////////////////////////////////////////////\n\t\t\t// record 2, subrecord 1,2,3,4,6\n\t\t\t// ///////////////////////////////////////////\n\t\t\trecord2_subrecord12346(msg, fe, quote, bDoNotSetFlag, pCombinedSession, pPreviousSession, session);\n\n\t\t} else if ((msg instanceof DdfMarketTrade) && (msg.getSession() == 'T')) {\n\t\t\t// ////////////////////////////////////////////\n\t\t\t// record 2, subrecord 7,T\n\t\t\t// Electronic (Form-T) Trade\n\t\t\t// ///////////////////////////////////////////\n\t\t\t/*\n\t\t\t * A 'T' session is for pre and post equities. These trades normally\n\t\t\t * do not affect the statistics (hi, low, etc..)\n\t\t\t */\n\t\t\tSession s2 = quote.createSession(pCombinedSession.getDayCode(), 'T');\n\n\t\t\trecord2_subrecord7T(msg, pCombinedSession, s2, session);\n\n\t\t} else if (msg instanceof DdfMarketTrade) {\n\t\t\t// ////////////////////////////////////////////\n\t\t\t// record 2, subrecord 7,Z\n\t\t\t// ///////////////////////////////////////////\n\t\t\trecord2_subrecord7Z(msg, quote, bDoNotSetFlag, cv, pCombinedSession, session);\n\n\t\t} else if (msg instanceof DdfMarketBidAsk) {\n\t\t\t// ////////////////////////////////////////////\n\t\t\t// record 2, subrecord 8\n\t\t\t// ///////////////////////////////////////////\n\t\t\trecord2_subrecord8(msg, quote, pCombinedSession, session);\n\n\t\t} else if (msg instanceof DdfMarketCondition) {\n\t\t\t// ////////////////////////////////////////////\n\t\t\t// record 2, subrecord 9 Market Condition/Trading Status\n\t\t\t// ///////////////////////////////////////////\n\t\t\tMarketConditionType marketConditon = ((DdfMarketCondition) msg).getMarketCondition();\n\t\t\tquote.setMarketCondition(marketConditon);\n\t\t\t// Send Market Event\n\t\t\tif (marketConditon == MarketConditionType.TRADING_HALT) {\n\t\t\t\t/* MarketEvent me = */ addMarketEvent(fe, msg, MarketEventType.TradingHalt,\n\t\t\t\t\t\tquote.getSymbolInfo().getSymbol());\n\t\t\t} else if (marketConditon == MarketConditionType.TRADING_RESUMTPION) {\n\t\t\t\t/* MarketEvent me = */ addMarketEvent(fe, msg, MarketEventType.TradingResumption,\n\t\t\t\t\t\tquote.getSymbolInfo().getSymbol());\n\t\t\t}\n\t\t}\n\t}",
"public void win(int player)\r\n\t{\r\n\t\taccountValue[player]+=pool;\r\n\t\tendRund();\r\n\t}",
"public boolean invitePlayer(QKPlayer player) {\n try {\n java.sql.PreparedStatement s = QuartzKingdoms.DBKing.prepareStatement(\"INSERT INTO invitations (player_id, kingdom_id) VALUES (?, ?);\");\n s.setInt(1, player.getID());\n s.setInt(2, this.id);\n if (s.executeUpdate() == 1) {\n player.getQPlayer().alert(new AlertBuilder()\n .setType(\"kingdom_invite\")\n .setMessage(\"You have been invited to the kingdom \" + this.name)\n .setArgs(new AlertArgs().setInt(\"kingdom_id\", this.id))\n .setReceiver(player.getQPlayer()));\n return true;\n } else {\n return false;\n }\n } catch (SQLException e) {\n e.printStackTrace();\n return false;\n }\n }",
"@Override\n public void RageQuit() {\n //They won't have a score\n timer.stopTimer();\n\n if (view.confirmRageQuit()){\n // Punish them!\n DesktopAudio.getInstance().playPunish();\n grid = game.getSolved();\n for (int i = 0; i < 9; i++){\n for (int j = 0; j < 9; j++){\n view.setGiven(i, j, grid.getNumber(i, j));\n }\n }\n if (view.confirmNewGame()){\n setNextGame();\n }\n }else{\n timer.startTimer();\n }\n }",
"public void upVoteCommentApplied(final ConsultComment consultComment) {\n ConsultDataManager.getInstance(this.mContext, (Activity) null).upVoteContent(consultComment.getContentId(), consultComment.getContentTypeId(), new ICommunityDataReceivedListener() {\n public void onCommunityDataReceived(JSONObject jSONObject) {\n ConsultCommentViewHolder.this.updateVoteVisibility(true, false);\n if (jSONObject != null) {\n consultComment.setIsUpVoted(true);\n ConsultComment consultComment = consultComment;\n consultComment.setUpVoteCount(consultComment.getUpVoteCount() + 1);\n ConsultCommentViewHolder.this.updateUpVoteView(consultComment);\n if (consultComment.isDownVoted()) {\n consultComment.setIsDownVoted(false);\n ConsultComment consultComment2 = consultComment;\n consultComment2.setDownVoteCount(consultComment2.getDownVoteCount() - 1);\n ConsultCommentViewHolder.this.updateDownVoteView(consultComment);\n return;\n }\n return;\n }\n onFailedToReceiveCommunityData(new MedscapeException(ConsultCommentViewHolder.this.mContext.getString(R.string.consult_error_message_title), ConsultCommentViewHolder.this.mContext.getString(R.string.consult_error_missing_contentId)));\n }\n\n public void onFailedToReceiveCommunityData(MedscapeException medscapeException) {\n ConsultCommentViewHolder.this.updateVoteVisibility(true, false);\n try {\n if (ConsultCommentViewHolder.this.mContext != null && (ConsultCommentViewHolder.this.mContext instanceof Activity)) {\n medscapeException.showAlert((Activity) ConsultCommentViewHolder.this.mContext, ConsultCommentViewHolder.this.mContext.getResources().getString(R.string.alert_dialog_confirmation_ok_button_text), new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialogInterface, int i) {\n dialogInterface.dismiss();\n }\n }, (String) null, (DialogInterface.OnClickListener) null);\n }\n } catch (Exception unused) {\n Trace.w(ConsultCommentViewHolder.TAG, \"Failed to show error liking comment\");\n }\n }\n });\n }",
"void castVote(Peer candidate) {\n votedFor = candidate;\n }",
"private Management castVote(Management mgmt, boolean isNew) {\n\t\tif (!mgmt.hasElection())\n\t\t\treturn null;\n\n\t\tLeaderElection req = mgmt.getElection();\n\t\tif (req.getExpires() <= System.currentTimeMillis()) {\n\t\t\tlogger.info(\"Node \" + this.nodeId + \" says election expired - not voting\");\n\t\t\treturn null;\n\t\t}\n\n\t\t// DANGER! If we return because this node ID is in the list, we have a\n\t\t// high chance an election will not converge as the maxHops determines\n\t\t// if the graph has been traversed!\n\t\tboolean allowCycles = true;\n\n\t\tif (!allowCycles) {\n\t\t\tList<RoutingPath> rtes = mgmt.getHeader().getPathList();\n\t\t\tfor (RoutingPath rp : rtes) {\n\t\t\t\tif (rp.getNodeId() == this.nodeId) {\n\t\t\t\t\t// logger.info(\"Node \" + this.nodeId +\n\t\t\t\t\t// \" already in the routing path - not voting\");\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// okay, the message is new (to me) so I want to determine if I should\n\t\t// nominate\n\t\t// myself\n\n\t\tLeaderElection.Builder elb = LeaderElection.newBuilder();\n\t\tMgmtHeader.Builder mhb = MgmtHeader.newBuilder();\n\t\tmhb.setTime(System.currentTimeMillis());\n\n\t\t// reversing path. If I'm the farthest a message can travel, reverse the\n\t\t// sending\n\t\tif (elb.getHops() == 0)\n\t\t\tmhb.clearPath();\n\t\telse\n\t\t\tmhb.addAllPath(mgmt.getHeader().getPathList());\n\n\t\tmhb.setOriginator(mgmt.getHeader().getOriginator());\n\n\t\telb.setElectId(req.getElectId());\n\t\telb.setAction(ElectAction.NOMINATE);\n\t\telb.setDesc(req.getDesc());\n\t\telb.setExpires(req.getExpires());\n\t\telb.setCandidateId(req.getCandidateId());\n\n\t\t// my vote\n\t\tif (req.getCandidateId() == this.nodeId) {\n\t\t\t// if I am not in the list and the candidate is myself, I can\n\t\t\t// declare myself to be the leader.\n\t\t\t//\n\t\t\t// this is non-deterministic as it assumes the message has\n\t\t\t// reached all nodes in the network (because we know the\n\t\t\t// diameter or the number of nodes).\n\t\t\t//\n\t\t\t// can end up with a partitioned graph of leaders if hops <\n\t\t\t// diameter!\n\n\t\t\tnotify(true, this.nodeId);\n\t\t\telb.setAction(ElectAction.DECLAREWINNER);\n\t\t\telb.setHops(mgmt.getHeader().getPathCount());\n\t\t\tlogger.info(\"Node \" + this.nodeId + \" is declaring itself the leader\");\n\t\t} else {\n\t\t\tif (req.getCandidateId() < this.nodeId)\n\t\t\t\telb.setCandidateId(this.nodeId);\n\t\t\t\n\t\t\tif (req.getHops() == -1)\n\t\t\t\telb.setHops(-1);\n\t\t\telse\n\t\t\t\telb.setHops(req.getHops() - 1);\n\n\t\t\tif (elb.getHops() == 0) {\n\t\t\t\t// reverse travel of the message to ensure it gets back to\n\t\t\t\t// the originator\n\t\t\t\telb.setHops(mgmt.getHeader().getPathCount());\n\n\t\t\t\t// no clear winner, send back the candidate with the highest\n\t\t\t\t// known ID. So, if a candidate sees itself, it will\n\t\t\t\t// declare itself to be the winner (see above).\n\t\t\t} else {\n\t\t\t\t// forwarding the message on so, keep the history where the\n\t\t\t\t// message has been\n\t\t\t\tmhb.addAllPath(mgmt.getHeader().getPathList());\n\t\t\t}\n\t\t}\n\n\t\t// add myself (may allow duplicate entries, if cycling is allowed)\n\t\tRoutingPath.Builder rpb = RoutingPath.newBuilder();\n\t\trpb.setNodeId(this.nodeId);\n\t\trpb.setTime(System.currentTimeMillis());\n\t\tmhb.addPath(rpb);\n\n\t\tManagement.Builder mb = Management.newBuilder();\n\t\tmb.setHeader(mhb.build());\n\t\tmb.setElection(elb.build());\n\n\t\treturn mb.build();\n\t}",
"public void inativarMovimentacoes() {\n\n\t\ttry {\n\n\t\t\tif (((auxMovimentacao.getDataMovimentacao())\n\t\t\t\t\t.before(permitirCadastrarMovimentacao(movimentacao.getAlunoTurma()).getDataMovimentacao()))\n\t\t\t\t\t|| (auxMovimentacao.getDataMovimentacao()).equals(\n\t\t\t\t\t\t\tpermitirCadastrarMovimentacao(movimentacao.getAlunoTurma()).getDataMovimentacao())\n\t\t\t\t\t) {\n\t\t\t\tExibirMensagem.exibirMensagem(Mensagem.MOVIMENTACOES_ANTERIORES);\n\t\t\t} else {\n\n\t\t\t\tDate dataFinal = auxMovimentacao.getDataMovimentacao();\n\t\t\t\tCalendar calendarData = Calendar.getInstance();\n\t\t\t\tcalendarData.setTime(dataFinal);\n\t\t\t\tcalendarData.add(Calendar.DATE, -1);\n\t\t\t\tDate dataInicial = calendarData.getTime();\n\n\t\t\t\tMovimentacao mov = new Movimentacao();\n\t\t\t\tmov = (Movimentacao) movimentacaoAlunoDAO.listarTodos(Movimentacao.class,\n\t\t\t\t\t\t\" a.dataMovimentacao = (select max(b.dataMovimentacao) \"\n\t\t\t\t\t\t\t\t+ \" from Movimentacao b where b.alunoTurma = a.alunoTurma) \"\n\t\t\t\t\t\t\t\t+ \" and a.status is true and a.alunoTurma.status = true and dataMovimentacaoFim = null and a.alunoTurma = \"\n\t\t\t\t\t\t\t\t+ movimentacao.getAlunoTurma().getId())\n\t\t\t\t\t\t.get(0);\n\n\t\t\t\tmov.setControle(false);\n\t\t\t\tmov.setDataMovimentacaoFim(dataInicial);\n\t\t\t\tmovimentacaoService.inserirAlterar(mov);\n\n\t\t\t\tAlunoTurma aluno = new AlunoTurma();\n\t\t\t\taluno = daoAlunoTurma.buscarPorId(AlunoTurma.class, movimentacao.getAlunoTurma().getId());\n\t\t\t\taluno.setControle(0);\n\t\t\t\t\n\n\t\t\t\tauxMovimentacao.setAlunoTurma(movimentacao.getAlunoTurma());\n\t\t\t\tauxMovimentacao.setStatus(true);\n\t\t\t\tauxMovimentacao.setControle(false);\n\n\t\t\t\tmovimentacaoService.inserirAlterar(auxMovimentacao);\n\t\t\t\t\n\t\t\t\tif(auxMovimentacao.getSituacao()==5){\n//\t\t\t\t\t\n//\t\t\t\t\tCurso cursoAluno = new Curso();\n//\t\t\t\t\tcursoAluno = daoCurso.buscarPorId(Curso.class, auxMovimentacao.getAlunoTurma().getTurma().getCurso().getId());\n\t\t\t\t\t\n\t\t\t\t\taluno.setSituacao(5);\n\t\t\t\t\taluno.setLiberado(false);\n\t\t\t\t\talunoTurmaService.inserirAlterar(aluno);\n\t\t\t\t\t\n\t\t\t\t\t//liberar para responder o questionário\n\t\t\t\t\tAluno alunoResponde = new Aluno(); \n\t\t\t\t\talunoResponde = daoAluno.buscarPorId(Aluno.class, aluno.getAluno().getId());\n\t\t\t\t\t \n\t\t\t\t // email.setCursos(auxMovimentacao.getAlunoTurma().getTurma().getCurso());\n\t\t\t\t\t//email.setTurma(auxMovimentacao.getAlunoTurma().getTurma());\n\t\t\t\t\temail.setEnviado(false);\n\t\t\t\t\temail.setStatus(true);\n\t\t\t\t\temail.setAlunoTurma(auxMovimentacao.getAlunoTurma());\n\t\t\t\t\t\n\t\t\t\t\t//email.setAluno(alunoResponde);\n\t\t\t\t\temailService.inserirAlterar(email);\n\t\t\t\t\t//enviar o email para responder \n\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\taluno.setSituacao(0);\n\t\t\t\t\talunoTurmaService.inserirAlterar(aluno);\n\t\t\t\t}\n\t\t\t\taluno = new AlunoTurma();\n\t\t\t\temail = new Email();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tFecharDialog.fecharDialogAlunoCursoEditar();\n\t\t\t\tFecharDialog.fecharDialogAlunoEditarCurso();\n\t\t\t\tFecharDialog.fecharDialogAlunoTrancamento();\n\t\t\t\talterar(movimentacao);\n\n\t\t\t\tExibirMensagem.exibirMensagem(Mensagem.SUCESSO);\n\t\t\t\tauxMovimentacao = new Movimentacao();\n\n\t\t\t\talunoTurmaService.update(\" AlunoTurma set permiteCadastroCertificado = 2 where id = \"\n\t\t\t\t\t\t+ movimentacao.getAlunoTurma().getId());\n\n\t\t\t\n\t\t\t\tcriarNovoObjetoAluno();\n\t\t\t\tatualizarListas();\n\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tExibirMensagem.exibirMensagem(Mensagem.ERRO);\n\t\t}\n\n\t}",
"boolean voteSpoiled(ParticipantUserData participant) {\n for (Entry e : participantsList) {\n if (e.userData == participant) {\n\treturn e.voteSpoiled();\n }\n }\n throw new ShouldNotHappenException(\"participant unknown.\");\n }",
"private ActionInterface timeSchedulingTest(PlayerInfo playerInfo, Timestamp executionTime, double responseFactor) {\r\n\r\n User user = playerInfo.getUser();\r\n int favouriteTime = playerInfo.getReceptivityForPlayer().getFavouriteTimeOfDay(ReceptivityProfile.SignificanceLevel.SPECIFIC);\r\n\r\n switch(favouriteTime){\r\n\r\n case ReceptivityProfile.DAY:\r\n\r\n if(randomize3(user, 0)){\r\n\r\n // Schedule correctly\r\n return new NotificationAction(\"Hello \"+ user.name+\", your daily bonus is waiting for you at Slot America. Click here to claim it NOW!\",\r\n user, executionTime, getPriority(), getTag(), Name, 1000, getState(), responseFactor)\r\n .scheduleInTime( ReceptivityProfile.DAY );\r\n }\r\n\r\n if(randomize3(user, 1)){\r\n\r\n // Schedule later\r\n return new NotificationAction(\"Hello \"+ user.name+\", your daily bonus is waiting for you at Slot America. Click here to claim it NOW!\",\r\n user, executionTime, getPriority(), getTag(), Name, 1001, getState(), responseFactor)\r\n .scheduleInTime( ReceptivityProfile.EVENING );\r\n }\r\n\r\n // Schedule earlier\r\n return new NotificationAction(\"Hello \"+ user.name+\", your daily bonus is waiting for you at Slot America. Click here to claim it NOW!\",\r\n user, executionTime, getPriority(), getTag(), Name, 1002, getState(), responseFactor)\r\n .scheduleInTime( ReceptivityProfile.NIGHT );\r\n\r\n case ReceptivityProfile.EVENING:\r\n\r\n if(randomize3(user, 0)){\r\n\r\n // Schedule correctly\r\n return new NotificationAction(\"Hello \"+ user.name+\", your daily bonus is waiting for you at Slot America. Click here to claim it NOW!\",\r\n user, executionTime, getPriority(), getTag(), Name, 1011, getState(), responseFactor)\r\n .scheduleInTime( ReceptivityProfile.EVENING );\r\n }\r\n\r\n if(randomize3(user, 1)){\r\n\r\n // Schedule later\r\n return new NotificationAction(\"Hello \"+ user.name+\", your daily bonus is waiting for you at Slot America. Click here to claim it NOW!\",\r\n user, executionTime, getPriority(), getTag(), Name, 1012, getState(), responseFactor)\r\n .scheduleInTime( ReceptivityProfile.NIGHT );\r\n }\r\n\r\n // Schedule earlier\r\n return new NotificationAction(\"Hello \"+ user.name+\", your daily bonus is waiting for you at Slot America. Click here to claim it NOW!\",\r\n user, executionTime, getPriority(), getTag(), Name, 1010, getState(), responseFactor)\r\n .scheduleInTime( ReceptivityProfile.DAY );\r\n\r\n case ReceptivityProfile.NIGHT:\r\n\r\n if(randomize3(user, 0)){\r\n\r\n // Schedule correctly\r\n return new NotificationAction(\"Hello \"+ user.name+\", your daily bonus is waiting for you at Slot America. Click here to claim it NOW!\",\r\n user, executionTime, getPriority(), getTag(), Name, 1022, getState(), responseFactor)\r\n .scheduleInTime( ReceptivityProfile.DAY );\r\n }\r\n\r\n if(randomize3(user, 1)){\r\n\r\n // Schedule later\r\n return new NotificationAction(\"Hello \"+ user.name+\", your daily bonus is waiting for you at Slot America. Click here to claim it NOW!\",\r\n user, executionTime, getPriority(), getTag(), Name, 1020, getState(), responseFactor)\r\n .scheduleInTime( ReceptivityProfile.EVENING );\r\n }\r\n\r\n // Schedule earlier\r\n return new NotificationAction(\"Hello \"+ user.name+\", your daily bonus is waiting for you at Slot America. Click here to claim it NOW!\",\r\n user, executionTime, getPriority(), getTag(), Name, 1021, getState(), responseFactor)\r\n .scheduleInTime( ReceptivityProfile.NIGHT );\r\n\r\n\r\n default:\r\n\r\n // No specific time of day for user.\r\n\r\n return new NotificationAction(\"Hello \"+ user.name+\", your daily bonus is waiting for you at Slot America. Click here to claim it NOW!\",\r\n user, executionTime, getPriority(), getTag(), Name, 3, getState(), responseFactor)\r\n .scheduleInTime( favouriteTime );\r\n\r\n }\r\n\r\n\r\n\r\n\r\n\r\n }",
"private void updateTokens(ArrayList<Player> winners) {\r\n // le joueur courant a-t-il été traité ? (gagné ou perdu)\r\n boolean done;\r\n for(Player player : players) {\r\n if( ! player.isDealer()) {\r\n done = false;\r\n for(Player winner : winners) {\r\n if(winner == player) {\r\n done = true;\r\n int gain = player.getStake();\r\n String txt = \"\";\r\n if(total(player).max() == 32) {\r\n gain = (int) (gain * 1.5);\r\n txt = \"avec un blackjack\";\r\n }\r\n player.addTokens(gain);\r\n Logger.write(player.getName() + \" a gagné \" + txt + \", il reçoit \" + gain + \" jetons [\" + player.getTokens() + \"]\");\r\n }\r\n }\r\n if(! done) {\r\n player.removeTokens(player.getStake());\r\n Logger.write(player.getName() + \" a perdu, il donne \" + player.getStake() + \" au croupier. [\" + player.getTokens() + \"]\");\r\n // si le joueur n'a plus de jetons, il quitte la partie.\r\n if(player.getTokens() <= 0) {\r\n players.remove(player);\r\n Logger.write(player.getName() + \" n'a plus de jetons, il quitte la partie.\");\r\n }\r\n }\r\n }\r\n }\r\n }",
"@Override\n public void run() {\n try {\n pendingConfirms.remove(target.getName(),sender.getName());\n } catch (Exception ignored) {/*player has already confirmed*/}\n }",
"private void deletePastEvents() {\n Date now = new Date(); //gets the current date\n ArrayList<Integer> listofEventIDS = eventManager.getListOfEventIDs(); //gets list of all eventIDs in the system\n //checks every eventID, and if its in the past, then deletes everything related to that event\n for (Integer eventID: listofEventIDS) {\n //if the event happened before right now, delete the event, and remove all attendees that are attending that event, organizer, speaker and free up the room.\n if (eventManager.getEvent(eventID).getTime().before(now)){\n ArrayList<String> peopleAttending = eventManager.getEvent(eventID).getAttendees(); //list of userid of all people attending\n\n for (String attendeeID: peopleAttending){\n //check if attendee is a organizer attending the event\n if (organizerManager.userExist(attendeeID)){\n organizerManager.removeEvent(eventID, attendeeID);\n }\n //if its not a organizer, it must be a attendee\n else {\n attendeeManager.removeEvent(eventID,attendeeID);\n }\n }\n //NOTE: THIS WORKS RIGHT NOW BECAUSE WE ONLY HAVE 1 SPEAKER, IN PHASE 2 WE WILL HAVE MULTIPLE SPEAKERS\n speakerManager.getSpeaker(eventManager.getEvent(eventID).getSpeakerID()).removeAssignEvent(eventID);\n String organizerOfThisEvent = eventManager.getEvent(eventID).getOrganizerID(); //gets the userid of the organizer of this event\n //in the organizer's list of events that he/she created, this event is removed.\n organizerManager.removeEvent(eventID, organizerOfThisEvent);\n //removes the event from the room. NOTE THIS IS NOT NECESSARY AS YOU WILL NEVER BE ABLE TO ASSIGN A ROOM IN THE PAST, BUT JUST AS A SAFETY MEASURE.\n roomManager.removeEventFromRoom(eventManager.getEvent(eventID).getLocation(), eventID, eventManager.getTime(eventID));\n // and finally removes the event object itself from the event manager.\n eventManager.removeEvent(eventID);\n }\n }\n }",
"public static void howDoesTheLotteryWorkDialogueOption(Player player) {\n\t\tString times = \"\";\n\t\tfor (int index = 0; index < DRAW_TIME_ANNOUNCEMENT.length; index++) {\n\t\t\tString extra = \" & \";\n\t\t\tif (index == DRAW_TIME_ANNOUNCEMENT.length - 1) {\n\t\t\t\textra = \"\";\n\t\t\t}\n\t\t\ttimes = times + DRAW_TIME_ANNOUNCEMENT[index][1] + extra;\n\t\t}\n\t\tplayer.getDH().sendNpcChat(\"I am here to make one lucky player a millionaire!\", \"Everyday at \" + times + \" server time,\", \"the lottery will be, drawn and a new millionare will\", \"be announced!\",\n\t\t FacialAnimation.HAPPY.getAnimationId());\n\t\tplayer.nextDialogue = 598; // Bring back to lottery option menu.\n\t}",
"public void setParticipantsToday (byte p) {\n\t\tParticipantsToday = p;\n\t}",
"public void addKickVote()\n\t{\n\t\tthis.numberOfKickVotes++;\n\t}",
"public void rise(int player,int value)\r\n\t{\r\n\t\tif(playerBet[player]<maxBet)call(player);\r\n\t\tif((playerBet[player]+value)>accountValue[player])System.out.print(\"wyjatek\");\r\n\t\tplayerBet[player]+=value;\r\n\t\taccountValue[player]=accountValue[player]-value;\r\n\t\tmaxBet+=value;\r\n\t\tpool+=value;\r\n\t\t\r\n\t}",
"private synchronized void delegateVoted(Vote voteType) {\n\t\tvotes.put(currentlyVoting, voteType);\n\t\tif (currentlyVoting.getStatus().hasVetoPower && voteType.isVoteAgainst) {\n\t\t\t// A delegate with veto power voted against.\n\t\t\tvetoed = true;\n\t\t}\n\t\tsynchronized (votingThread) {\n\t\t\tvotingThread.notify();\n\t\t}\n\t}",
"public final void dyE() {\n AppMethodBeat.i(29674);\n com.tencent.mm.blink.b.HQ().o(new Runnable() {\n public final void run() {\n AppMethodBeat.i(29666);\n w.this.ynU = true;\n al.af(w.this.ynV);\n al.n(w.this.ynV, 300);\n AppMethodBeat.o(29666);\n }\n });\n AppMethodBeat.o(29674);\n }",
"@External\n\tpublic void accumulate_daily_wagers(Address game, BigInteger wager ) {\n\t\tAddress sender = Context.getCaller();\n\t\t\n\t\tif (!sender.equals(this.roulette_score.get()) ) {\n\t\t\tContext.revert(\"Only roulette score can invoke this method.\");\t\t\t\n\t\t}\n\t\tBigInteger now = BigInteger.valueOf(Context.getBlockTimestamp());\n\t\tBigInteger day = now.divide(U_SECONDS_DAY);\n\n\t\tBigInteger wagerValue = this.wagers.at(day).get(game);\n\t\tthis.wagers.at(day).set(game, wager.add(wagerValue));\n\n\t\tBigInteger newTime =this.new_div_changing_time.get();\n\n\t\tif ( newTime!= null && now.compareTo(newTime)>=1 ) {\n\t\t\tBigInteger excess = this.todays_games_excess.get(game);\n\t\t\tthis.todays_games_excess.set(game, excess.add(wager));\n\t\t}\n\t\t\t\t\n\t}",
"public void rePointFromServer(int winnerid,int money) {\n\t\tint winner = winnerid;\n\t\tString winName = \"您\" ;\n\t\tif(winner == left_gamerID) {\n\t\t\twinName = left_name;\n\t\t\tleft_coin+=money;\n\t\t}else if(winner == right_gamerID) {\n\t\t\twinName = right_name;\n\t\t\tright_coin+=money;\n\t\t}else {\n\t\t\tme_coin+=money;\n\t\t}\n\t\trefreshCoins();\n\t\t\n\t\t\n\t\tif(round<7) {\n\t\t\topeLabel.setText(winName+\"获得了本轮游戏的胜利,准备进行下一回合\");\n\t\t\ttextHistory.append(winName+\"获得了本轮游戏的胜利,准备进行下一回合\");\n\t\t}else {\n\t\t\tString str = \"\";\n\t\t\tif(left_coin>right_coin) {\n\t\t\t\t//找出最大值\n\t\t\t\tif(left_coin>me_coin) {\n\t\t\t\t\tstr=left_name+\"玩家拥有最多的硬币,获得了整局比赛的胜利!\";\n\t\t\t\t}else {\n\t\t\t\t\tstr=\"您拥有最多的硬币,获得了整局比赛的胜利!\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else {\n\t\t\t\t\n\t\t\t\tif(right_coin>me_coin) {\n\t\t\t\t\tstr=right_name+\"玩家拥有最多的硬币,获得了整局比赛的胜利!\";\n\t\t\t\t}else {\n\t\t\t\t\tstr=\"您拥有最多的硬币,获得了整局比赛的胜利!\";\n\t\t\t\t}\n\t\t\t}\n\t\t\ttextHistory.append(str+\"\\n\");\n\t\t}\n\t\t\n\t\tleft_ready = 0;\n\t\tright_ready = 0;\n\t\tme_ready = 0;\n\n\t\t\n\t\t\n\t\tbtnReadyCancel.setVisible(true);\n\t\tbtnReadyCancel.setEnabled(false);\n\t\tbtnReady.setVisible(true);\n\t\tbtnReady.setEnabled(true);\n\t\t\n\t\t\n\t\t\n\t}",
"public void dispersePayout(Room room){\n \n Dice d = new Dice();\n ArrayList<Integer> payoutVals = d.rollPayout(room.getSceneCard().getSceneBudget());\n \n ArrayList<Player> players = room.getOccupants();\n \n ArrayList<Role> roles = room.getSceneCard().getRoles();\n ArrayList<Integer> ranks = new ArrayList<Integer>();\n \n for(Role r : roles){\n ranks.add(r.getRank());\n }\n \n Collections.sort(ranks);\n Collections.reverse(ranks);\n \n //loop through roles and pay respective players\n for(int i = 0; i < payoutVals.size(); i++){\n int roleRank = ranks.get(i % ranks.size()); \n \n for(Player p : players){\n if(p.getCurrentRole() != null){\n if(p.getCurrentRole().isOnCard() && p.getCurrentRole().getRank() == roleRank){\n p.addMoney(payoutVals.get(i));\n }\n }\n \n \n }\n }\n for(Player p : players){\n if(p.getCurrentRole() != null){\n if(!(p.getCurrentRole().isOnCard())){\n p.addMoney(p.getCurrentRole().getRank());\n }\n }\n \n }\n }",
"public void diminueVies() {\n\n nbVies_restantes.set(nbVies_restantes.get()-1);\n\n }",
"private void updateChatAttendees() {\n if (updateChatAttendeeIdList.size() == 1) { //size()==0 indicates user has been dropped\n Toast.makeText(this, R.string.error_chat_participant, Toast.LENGTH_LONG).show();\n return;\n }\n ArrayList<String> dropAttendeeIdList = new ArrayList<>();\n dropAttendeeIdList.addAll(chatAttendeeIdList);\n dropAttendeeIdList.removeAll(updateChatAttendeeIdList);\n ArrayList<String> addAttendeeIdList = new ArrayList<>();\n addAttendeeIdList.addAll(updateChatAttendeeIdList);\n addAttendeeIdList.removeAll(chatAttendeeIdList);\n if (addAttendeeIdList.isEmpty() && dropAttendeeIdList.isEmpty()) { //no changes\n return;\n }\n\n if (!chat.creatorId.equals(myId)) {\n Toast.makeText(this, R.string.only_creator_change_attendee, Toast.LENGTH_LONG).show();\n return;\n }\n\n if (!dropAttendeeIdList.isEmpty()) {\n String message = null;\n switch (httpServerManager.dropConversationAttendees(conversationId, dropAttendeeIdList)) {\n case 3: //ok\n break;\n case 1: //no user\n message = \"Cannot find one or more participants in database\";\n break;\n case 4:\n message = \"Cannot find chat with id: \" + conversationId + \"in database\";\n break;\n case -1:\n message = \"Server error. Please try again\";\n //TODO: mark Conversation_Attendees table as Sync_Needed\n break;\n }\n if (message != null) {\n Toast.makeText(this, message, Toast.LENGTH_SHORT).show();\n return;\n }\n }\n\n if (!addAttendeeIdList.isEmpty()) {\n // save unregistered attendees (those with negative ids)\n for (int j = 0; j < addAttendeeIdList.size(); j++) {\n String attendeeId = addAttendeeIdList.get(j);\n if (attendeeId.startsWith(\"-\")) {\n Attendee attendee = null;\n for (int i = 0; i < chat.attendees.size(); i++) {\n if (attendeeId.equals(chat.attendees.get(i).id)) {\n attendee = chat.attendees.get(i);\n break;\n }\n }\n if (attendee == null || !conversationManager.saveUnregisteredAttendee(attendee)) {\n Toast.makeText(this, R.string.error_create_chat, Toast.LENGTH_SHORT).show();\n return;\n }\n\n chatAttendeeIdList.add(attendee.id);\n updateChatAttendeeIdList.remove(attendeeId);\n updateChatAttendeeIdList.add(attendee.id);\n addAttendeeIdList.set(j, attendee.id);\n }\n }\n String message = null;\n switch (httpServerManager.addConversationAttendees(conversationId, addAttendeeIdList)) {\n case 3: //ok\n break;\n case 1: //no user\n message = \"Cannot find one or more users in database\";\n break;\n case 4:\n message = \"Cannot find chat with id: \" + conversationId + \"in database\";\n break;\n case -1:\n message = \"Server unavailable. Please check your network connection\";\n //TODO: mark Conversation_Attendees table as Sync_Needed\n break;\n }\n if (message != null) {\n Toast.makeText(this, message, Toast.LENGTH_SHORT).show();\n return;\n }\n }\n\n //notify dropped chat attendees\n if (!dropAttendeeIdList.isEmpty()) {\n chatServerManager.dropConversationAttendees(myId, conversationId, dropAttendeeIdList, chatAttendeeIdList);\n }\n\n //notifiy existing chat attendees of new users and new users to start chat\n if (!addAttendeeIdList.isEmpty()) {\n List<String> recipients = new ArrayList<>();\n recipients.addAll(updateChatAttendeeIdList);\n recipients.removeAll(addAttendeeIdList);\n chatServerManager.addConversationAttendees(myId, conversationId, addAttendeeIdList, recipients);\n chatServerManager.startConversation(myId, conversationId, addAttendeeIdList);\n }\n }",
"protected void saveVote(Long voteForId) {\n if (mywebapp.getAuthenticatedUser() == null) {\n getMessagePanel().displayMessage(\"Please login before voting.\");\n return;\n }\n ContestRequest contestRequest = new ContestRequest();\n GWT.log(\"authToken=\" + mywebapp.getAuthToken());\n contestRequest.setAuthToken(mywebapp.getAuthToken());\n //we don't init the check boxes when it's location only\n for (Long contestId : ratingMap.keySet()) {\n Rating rating = ratingMap.get(contestId);\n //only register if there was a vote\n Integer val = rating.getValue();\n if (val > 0) {\n ContestEntryHolder ceh = new ContestEntryHolder();\n ceh.setContestId(contestId);\n ceh.setRating(val);\n ceh.setVoteForId(voteForId);\n contestRequest.getContestEntryHolders().add(ceh);\n }\n }\n ApiServiceAsync myService = mywebapp.getApiServiceAsync();\n myService.vote(contestRequest, new AsyncCallback() {\n public void onFailure(Throwable caught) {\n //postDialog.hide();\n getMessagePanel().displayError(caught.getMessage());\n }\n\n public void onSuccess(Object result) {\n MobileResponse mobileResponse = (MobileResponse) result;\n if (mobileResponse.getStatus() == 1) {\n getMessagePanel().displayMessage(\"Thanks for voting\");\n } else {\n //postDialog.hide();\n getMessagePanel().displayErrors(mobileResponse.getErrorMessages());\n }\n }\n });\n }",
"private void deductGamePoints(List<Integer> prevGamePoints) {\n for (int i = 0; i < numAlive; i++) {\n int playerTrickPoints = trickPoints.get(i);\n if (playerTrickPoints < 0) {\n int prevPoints = prevGamePoints.get(i);\n int newPoints = prevPoints + playerTrickPoints;\n \n if (newPoints < 0) {\n // Cannot have negative points\n gamePoints.set(i, 0);\n } else {\n gamePoints.set(i, newPoints);\n }\n }\n }\n }",
"private void handleRequestVote(RequestVote requestVote) {\n\n RequestVoteReply reply;\n\n do {\n\n try {\n reply = (RequestVoteReply) this.sendRPCHandler(() -> this.outbound.requestVote(this.targetServerName, requestVote));\n } catch (InterruptedException e) {\n return;\n }\n\n } while (reply == null);\n\n RequestVoteReply finalReply = reply;\n this.taskExecutor.execute(() -> this.consensusModule.requestVoteReply(finalReply));\n\n }",
"void handle(VoteMessage vote);",
"public void dealerTurn() {\n\t\tview.writeLog(\"All players pass, dealer's turn.\");\n\t\tdealer.send(new Package(\"MESSAGE\",\"Now is your turn.\"));\n\t\tdealer.send(new Package(\"ASK\",null));\n\t}",
"public ActionInterface evaluate(PlayerInfo playerInfo, Timestamp executionTime, double responseFactor, ResponseStat response) {\r\n\r\n Timestamp executionDay = getDay(executionTime);\r\n User user = playerInfo.getUser();\r\n\r\n // In reduced mode we only send to the most frequent group\r\n\r\n int activeMinSessionLimit = Min_Sessions;\r\n\r\n if(state == CampaignState.REDUCED)\r\n activeMinSessionLimit +=10;\r\n\r\n\r\n if(user.sessions < activeMinSessionLimit){\r\n\r\n System.out.println(\" -- Campaign \" + Name + \" not applicable. User is not frequent enough (\" + user.sessions + \" < \" +\r\n activeMinSessionLimit + \")\" );\r\n return null;\r\n\r\n }\r\n\r\n\r\n Timestamp lastSession = playerInfo.getLastSession();\r\n if(lastSession == null){\r\n\r\n System.out.println(\" -- Campaign \" + Name + \" not firing. No sessions for user\" );\r\n return null;\r\n\r\n }\r\n\r\n int idleDays = getDaysBetween(lastSession, executionDay);\r\n\r\n if(idleDays > MAX_IDLE){\r\n\r\n System.out.println(\" -- Campaign \" + Name + \" not applicable. User idle too long. (\" + idleDays + \" > \" + MAX_IDLE + \")\");\r\n return null;\r\n\r\n }\r\n\r\n\r\n\r\n if(idleDays == 3 || idleDays == 4){\r\n\r\n System.out.println(\" -- Sending a three day churn warning poke\" );\r\n\r\n if(playerInfo.getUsageProfile().hasTriedMobile()){\r\n\r\n System.out.println(\" -- Campaign \" + Name + \" not firing. Not mobile\");\r\n return null;\r\n\r\n }\r\n\r\n // Adding a time of day separation test\r\n\r\n if(playerInfo.getReceptivityForPlayer().getFavouriteTimeOfDay(ReceptivityProfile.SignificanceLevel.GENERAL) == ReceptivityProfile.DAY){\r\n\r\n if(randomize4(user, 0)|| randomize4(user, 1)){\r\n\r\n // Day players in the morning\r\n\r\n System.out.println(\" -- Campaign \" + Name + \" firing. Morning players in the morning\" );\r\n return new NotificationAction(\"Hello \"+ user.name+\", you now have new free coins to collect! Click here to claim it NOW!\",\r\n user, executionTime, getPriority(), getTag(), Name, 85, getState(), responseFactor);\r\n }\r\n }\r\n\r\n\r\n if(playerInfo.getReceptivityForPlayer().getFavouriteTimeOfDay(ReceptivityProfile.SignificanceLevel.GENERAL) == ReceptivityProfile.EVENING){\r\n\r\n if(randomize4(user, 0)|| randomize4(user, 1)){\r\n\r\n // Day players in the morning\r\n\r\n System.out.println(\" -- Campaign \" + Name + \" firing. Evening players in the morning\" );\r\n return new NotificationAction(\"Hello \"+ user.name+\", you now have new free coins to collect! Click here to claim it NOW!\",\r\n user, executionTime, getPriority(), getTag(), Name, 86, getState(), responseFactor);\r\n }\r\n }\r\n\r\n }\r\n\r\n System.out.println(\" -- Campaign \" + Name + \" not firing. Not three day churn warning (last:\" + lastSession.toString() );\r\n return null;\r\n\r\n }",
"public void setAllRequestForVotes(DownstreamMessage request) {\n\t\tfor (DownstreamPeerState peer : _downstreamPeerByNode.values()) {\n\t\t\tpeer.nextIntentionOffsetToSend = DownstreamPeerState.NO_NEXT_INTENTION;\n\t\t\tpeer.pendingVoteRequest = request;\n\t\t}\n\t}",
"public VideoRental saveRentalInfo(Integer userId, Integer videoId, String username, Double rentPrice, Integer numOfDays);",
"public void declineInvite(String player) {\r\n connection.declineInvite(player);\r\n }",
"protected void processPlayerArrived(String name) {\n Player player = tournamentService.findPlayer(name);\n if (player == null) {\n alertManagers(\"Arriving player {0} is on my notify list, but I don''t have him in the tournament roster.\", name);\n return;\n }\n player.setState(PlayerState.WAITING);\n Game game = tournamentService.findPlayerGame(player);\n if (game == null) return;\n if (game.status.isFinished()) return;\n if (loggingIn) {\n \tcommand.sendCommand(\"observe {0}\", name);\n } else {\n tellManagers(\"{0} arrived. Reserving board {1}.\", name, game.boardNumber);\n }\n command.sendAdminCommand(\"spoof {0} tell JudgeBot nowin\", game.whitePlayer);\n command.sendAdminCommand(\"spoof {0} tell JudgeBot nowin\", game.blackPlayer);\n command.sendAdminCommand(\"set-other {0} kib 0\", game.blackPlayer);\n command.sendAdminCommand(\"set-other {0} kib 0\", game.whitePlayer);\n command.sendAdminCommand(\"reserve-game {0} {1}\", game.whitePlayer, game.boardNumber);\n command.sendAdminCommand(\"reserve-game {0} {1}\", game.blackPlayer, game.boardNumber);\n if (game.status.isAdjourned()) {\n command.sendAdminCommand(\"spoof {0} match {1}\", game.whitePlayer, game.blackPlayer);\n command.sendAdminCommand(\"spoof {0} match {1}\", game.blackPlayer, game.whitePlayer);\n }\n }",
"private void playOneTurnWithPlayer(Player player, RolledDice rolledDice) throws NotEnoughMoneyException {\n int position = player.increasePosition(rolledDice.getValue() - 1, fields.size());\n Field field = fields.get(position);\n field.playerStepped(player);\n //System.out.println(player);\n }",
"@Override\n public void onWatchLaterClick(final ImageView imageView) {\n if (relatedVideosAdapter.isWatchLaterOn()) {\n AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(getActivity(), R.style.DialogTheme);\n alertDialogBuilder.setMessage(\"Are you sure you want to remove this video from your Watch Later collection?\");\n alertDialogBuilder.setPositiveButton(\"Yes\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int whichButton) {\n Call removeVideoFromWatchLaterCall = vimeoService.removeVideoFromWatchLater(String.valueOf(videoId));\n calls.add(removeVideoFromWatchLaterCall);\n removeVideoFromWatchLaterCall.enqueue(removeVideoFromWatchLaterCallback);\n }\n });\n alertDialogBuilder.setNegativeButton(\"No\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int whichButton) {\n // Canceled.\n }\n });\n alertDialogBuilder.show();\n } else {\n Call addVideoToWatchLaterCall = vimeoService.addVideoToWatchLater(String.valueOf(videoId));\n calls.add(addVideoToWatchLaterCall);\n addVideoToWatchLaterCall.enqueue(addVideoToWatchLaterCallback);\n }\n }",
"private void dealerTurns()\r\n\t{\r\n\t\t// loops until dealer stands or wins/loses\r\n\t\twhile ( !dealer.getStand() && !endGame )\r\n\t\t{\r\n\t\t\t// checks total score of dealer's hand\r\n\t\t\tif ( dealer.getTotal() < 17)\r\n\t\t\t{\r\n\t\t\t\t// adds card to dealer hand from cardDeck\r\n\t\t\t\tdealer.hit( cardDeck.draw() );\r\n\t\t\t\t\r\n\t\t\t\t// displays current dealer hand\r\n\t\t\t\tdisplayPlayerCards(DEALER_ID);\r\n\t\t\t\t\r\n\t\t\t\t// evaluates victory conditions\r\n\t\t\t\tevaluateWin(false);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t/* Dealer stands if they reach or already have 17 points in their hand.\r\n\t\t\t\tNo evaluation is called, because this will be handled by the final victory check. */\r\n\t\t\t\tdealer.stand();\r\n\t\t\t} // end if else\r\n\t\t} // end while\r\n\t}",
"@Override\n public void receiveMessage(AgentID sender, Action action)\n {\n super.receiveMessage(sender, action);\n\n // update the value of Care_Value、Reluctance、Agreement_Value every ten rounds\n if (getTimeLine() instanceof DiscreteTimeline) {\n DiscreteTimeline discreteTimeline = (DiscreteTimeline)getTimeLine();\n int cRound = discreteTimeline.getRound();\n if (cRound % 10 == 0) {\n\n // care_value increase 4% every ten rounds\n Care_Value = Care_Value * (1 + 0.04);\n if (Care_Value > 0.72) {\n Care_Value = 0.72;\n }\n\n // reluctance decrease 4% every ten rounds\n Reluctance = Reluctance * (1 - 0.06);\n if (timeline.getTime() < 7 && Reluctance < 0.9) {\n Reluctance = 0.9;\n }\n\n List<BidDetails> allBids = new ArrayList<>(feasibleBids);\n // find a common set for all opponent\n Set<BidDetails> commonBids = opponentModelInterface.queryCommonBestBidsSet(allBids, Number_of_Bids);\n List<BidDetails> commonBidsList = new ArrayList<>(commonBids);\n // sort the common set\n Collections.sort(commonBidsList);\n // AV = Utility(BidBest) * Reluctance\n Agreement_Value = (commonBidsList.get(commonBidsList.size() - 1).getMyUndiscountedUtil()) * Reluctance;\n if (Agreement_Value > 0.85) {\n Agreement_Value = 0.85;\n }\n\n if (Agreement_Value < Minimum_Offer_Threshold * (3 - Math.pow(2, timeline.getTime()))) {\n Agreement_Value = Minimum_Offer_Threshold * (3 - Math.pow(2, timeline.getTime()));\n }\n }\n }\n\n if (action instanceof Inform) {\n // receive message first time, update the number of opponent\n opponentModelInterface = new OpponentModelManager(getNumberOfParties());\n }else if (action instanceof Offer) {\n // save the last offer\n lastOffer = ((Offer) action).getBid();\n // update opponent model by new bid from opponent\n opponentModelInterface.handleBidFromSender(sender.toString(), lastOffer, getDomain());\n }\n }",
"public void downVoteCommentApplied(final ConsultComment consultComment) {\n ConsultDataManager.getInstance(this.mContext, (Activity) null).downVoteContent(consultComment.getContentId(), consultComment.getContentTypeId(), new ICommunityDataReceivedListener() {\n public void onCommunityDataReceived(JSONObject jSONObject) {\n ConsultCommentViewHolder.this.updateVoteVisibility(false, false);\n if (jSONObject != null) {\n consultComment.setIsDownVoted(true);\n ConsultComment consultComment = consultComment;\n consultComment.setDownVoteCount(consultComment.getDownVoteCount() + 1);\n ConsultCommentViewHolder.this.updateDownVoteView(consultComment);\n if (consultComment.isUpVoted()) {\n consultComment.setIsUpVoted(false);\n ConsultComment consultComment2 = consultComment;\n consultComment2.setUpVoteCount(consultComment2.getUpVoteCount() - 1);\n ConsultCommentViewHolder.this.updateUpVoteView(consultComment);\n return;\n }\n return;\n }\n onFailedToReceiveCommunityData(new MedscapeException(ConsultCommentViewHolder.this.mContext.getString(R.string.consult_error_message_title), ConsultCommentViewHolder.this.mContext.getString(R.string.consult_error_missing_contentId)));\n }\n\n public void onFailedToReceiveCommunityData(MedscapeException medscapeException) {\n ConsultCommentViewHolder.this.updateVoteVisibility(false, false);\n try {\n if (ConsultCommentViewHolder.this.mContext != null && (ConsultCommentViewHolder.this.mContext instanceof Activity)) {\n medscapeException.showAlert((Activity) ConsultCommentViewHolder.this.mContext, ConsultCommentViewHolder.this.mContext.getResources().getString(R.string.alert_dialog_confirmation_ok_button_text), new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialogInterface, int i) {\n dialogInterface.dismiss();\n }\n }, (String) null, (DialogInterface.OnClickListener) null);\n }\n } catch (Exception unused) {\n Trace.w(ConsultCommentViewHolder.TAG, \"Failed to show error downVoting comment\");\n }\n }\n });\n }",
"public void upVoteCommentRemoved(final ConsultComment consultComment) {\n ConsultDataManager.getInstance(this.mContext, (Activity) null).deleteUpVoteContent(consultComment.getContentId(), consultComment.getContentTypeId(), new ICommunityDataReceivedListener() {\n public void onCommunityDataReceived(JSONObject jSONObject) {\n ConsultCommentViewHolder.this.updateVoteVisibility(true, false);\n if (jSONObject == null || !jSONObject.optBoolean(\"data\")) {\n onFailedToReceiveCommunityData(new MedscapeException(ConsultCommentViewHolder.this.mContext.getString(R.string.consult_error_message_title), ConsultCommentViewHolder.this.mContext.getString(R.string.consult_error_missing_contentId)));\n return;\n }\n consultComment.setIsUpVoted(false);\n ConsultComment consultComment = consultComment;\n consultComment.setUpVoteCount(consultComment.getUpVoteCount() - 1);\n ConsultCommentViewHolder.this.updateUpVoteView(consultComment);\n }\n\n public void onFailedToReceiveCommunityData(MedscapeException medscapeException) {\n ConsultCommentViewHolder.this.updateVoteVisibility(true, false);\n try {\n if (ConsultCommentViewHolder.this.mContext != null && (ConsultCommentViewHolder.this.mContext instanceof Activity)) {\n medscapeException.showAlert((Activity) ConsultCommentViewHolder.this.mContext, ConsultCommentViewHolder.this.mContext.getResources().getString(R.string.alert_dialog_confirmation_ok_button_text), new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialogInterface, int i) {\n dialogInterface.dismiss();\n }\n }, (String) null, (DialogInterface.OnClickListener) null);\n }\n } catch (Exception unused) {\n Trace.w(ConsultCommentViewHolder.TAG, \"Failed to show error liking comment\");\n }\n }\n });\n }",
"private boolean eatPreservedFood(double eatingTime) {\n\t\tboolean result = true;\n\n\t\t// Proportion of food being eaten over this time period.\n\t\tdouble proportion = person.getEatingSpeed() * eatingTime;\n\n\t\tif (cumulativeProportion > foodConsumptionRate) {\n\t\t\tdouble excess = cumulativeProportion - foodConsumptionRate;\n\t\t\tcumulativeProportion = cumulativeProportion - excess;\n\t\t\tproportion = proportion - excess;\n\t\t}\n\t\t\n//\t\tlogger.info(person + \" proportion: \" + proportion);\n\t\tif (proportion > MIN) {\n\n\t\t\tUnit container = person.getContainerUnit();\n\t\t\tif (person.isInside()) {\n\t\t\t\tInventory inv = container.getInventory();\n\t\n\t\t\t\t// Take preserved food from inventory if it is available.\n\t\t\t\tboolean haveFood = Storage.retrieveAnResource(proportion, ResourceUtil.foodID, inv, true);\n\t\t\t\t\n\t\t\t\tif (haveFood) {\n\t\t\t\t\t// Add to cumulativeProportion\n\t\t\t\t\tcumulativeProportion += proportion;\n\t\t\t\t\t\n\t\t\t\t\tLogConsolidated.log(Level.INFO, 1000, sourceName,\n\t\t\t\t\t\t\t\"[\" + person.getLocationTag().getLocale() + \"] \" + person \n\t\t\t\t\t\t\t+ \" just ate \" + Math.round(proportion*1000.0)/1000.0 + \" kg of preserved food.\");\n\t\t\t\t\t\n\t\t\t\t\t// Food amount eaten over this period of time.\n\t\t\t\t\tdouble hungerRelieved = RATIO * proportion / foodConsumptionRate;\n//\t\t\t\t\tlogger.info(person + \"::eatPreservedFood()\"\n//\t\t\t\t\t\t\t+ \" currentHunger \" + Math.round(currentHunger*100.0)/100.0\n//\t\t\t\t\t\t\t+ \" hungerRelieved \" + Math.round(hungerRelieved*100.0)/100.0\n//\t\t\t\t\t\t\t+ \" proportion \" + Math.round(proportion*1000.0)/1000.0\n//\t\t\t\t\t\t\t+ \" EatingSpeed \" + Math.round(person.getEatingSpeed()*1000.0)/1000.0\n//\t\t\t\t\t\t\t+ \" foodConsumptionRate \" + Math.round(foodConsumptionRate*1000.0)/1000.0);\n\t\t\t\t\t\n\t\t\t\t\t// Consume preserved food after eating\n\t\t\t\t\treduceHunger(hungerRelieved);\n\t\n\t\t\t\t\t// Add caloric energy from the prserved food.\n\t\t\t\t\tdouble caloricEnergyFoodAmount = proportion / foodConsumptionRate * PhysicalCondition.FOOD_COMPOSITION_ENERGY_RATIO;\n\t\t\t\t\tcondition.addEnergy(caloricEnergyFoodAmount);\n\t\n\t\t\t\t} else {\n\t\t\t\t\t// Not enough food available to eat.\n\t\t\t\t\tresult = false;\n\t\t\t\t\t// Need endTask() below to quit EatDrink\n\t\t\t\t\tendTask();\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Person is not inside a container unit, so end task.\n\t\t\tresult = false;\n\t\t\t// Need endTask() below to quit EatDrink\n\t\t\tendTask();\n\t\t}\n\n\t\tif (totalEatingTime > getDuration())\n\t\t\tendTask();\n\t\t\n\t\treturn result;\n\t}",
"private void handleDecidedProxyEvent(DecidedProxyEvent event) throws AppiaEventException {\n \t\tevent.loadMessage();\n \t\tSystem.out.println(\"I have received the information that someone has decided of the nextClienViews\");\n \n \t\t// Get the arguments\n \t\tVsGroup decidedGroup = event.getDecidedVsGroup();\n \t\tString decidedGroupId = decidedGroup.getGroupId();\n \n \t\t//Update the present view\n \t\tVsClientManagement.replaceAGroup(decidedGroup);\n \n \t\t//Let's see what in our future's list can be removed\n \t\tVsClientManagement.updateFutureDeadClientsBasedOnCurrentView(decidedGroupId);\n \t\tVsClientManagement.updateFutureLiveClientsBasedOnCurrentView(decidedGroupId);\n \n \t\t//Clean VSControl for the group\n \t\tControlManager.removeControl(decidedGroupId);\n \n \t\t//Unmute all clients for the group\n \t\tVsClientManagement.unmuteAllClients(decidedGroupId);\n \n \t\tSystem.out.println(decidedGroup);\n \n \t\t//Release the clientViewUpdateLock\n \t\treleaseClientViewUpdate();\n \n \t\t//Only now I may deliver the view to my clients\n \t\tViewStubEvent newView = new ViewStubEvent(decidedGroup);\n \t\tsendStubEvent(newView, decidedGroup);\n \t}",
"public static void jouerAuJustePrix() {\n\t\tint nbVies=Tools.inputInt(\"Combien de tentatives voulez-vous ? \");\n\t\tint limite=Tools.inputInt(\"Quel est le nombre maximum à prendre en compte?\");\n\t\tint nbATrouver=Tools.randomint(limite);\n\t\tint nbPropose;\n\t\t\n\t\twhile (nbVies>0){\n\t\t\tnbPropose=Tools.inputInt(\"Saisissez un nombre : \");\n\t\t\tif (afficherResultatProposition(nbPropose, nbATrouver)) {\n\t\t\t\tbreak;\n\t\t\t};\n\t\t\tnbVies=nbVies-1;\n\t\t}\n\t\t\n\t\tif (nbVies==0) {\n\t\t\tSystem.out.println(\"Game Over\");\n\t\t}\n\t}",
"public void imminentAppointment(String username) throws SQLException {\n this.currentUser = username;\n ObservableList<Appointment> allAppointments = dbQuery.getAllAppointments();\n ObservableList<User> allUsers = dbQuery.getAllUsers();\n Appointment imminentAppointment = null;\n User user = null;\n //get username entered at login\n for(User u : allUsers){\n if(u.getUserName().equals(username)){\n user = u;\n }\n }\n //get possible appointment within 15 minutes\n for(Appointment a : allAppointments){\n long timeDifference = ChronoUnit.MINUTES.between(LocalDateTime.now(), a.getAppointmentStart());\n assert user != null;\n if(a.getUserID() == user.getUserID() && timeDifference > 0 && timeDifference <= 15) {\n imminentAppointment = a;\n }\n }\n\n //display message in dialog box if there is an imminent appointment.\n if(imminentAppointment != null){\n LocalDate appointmentDate = imminentAppointment.getAppointmentStart().toLocalDate();\n LocalTime appointmentTime = imminentAppointment.getAppointmentStart().toLocalTime();\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\n alert.setTitle(\"Upcoming Appointment\");\n alert.setHeaderText(\"You have an appointment within 15 minutes.\");\n alert.setContentText(\"Appointment ID: \" + imminentAppointment.getAppointmentID() + \"\\n\" +\n \" Date: \" + appointmentDate + \"\\n\" +\n \" Time: \" + appointmentTime);\n alert.showAndWait();\n }\n //if no appointment was found, display no upcoming appointment reminder\n else {\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\n alert.setTitle(\"Upcoming Appointment\");\n alert.setHeaderText(\"You have no upcoming appointments.\");\n alert.showAndWait();\n }\n\n }",
"public void tryRehearse() {\n if (currentPlayer.isEmployed() == true) {\n if(!currentPlayer.getHasPlayed()){\n currentPlayer.rehearse();\n }\n else{ \n view.showPopUp(currentPlayer.isComputer(), \"You've already moved, rehearsed or acted this turn. Try a different command or click `end turn` to end your turn.\");\n }\n }\n else {\n view.showPopUp(currentPlayer.isComputer(), \"You're not employed, so you need to take a role before you can rehearse.\");\n }\n view.updateSidePanel(playerArray);\n }",
"public void victory() {\n fieldInerface.setPleasedSmile();\n fieldInerface.timestop();\n int result = fieldInerface.timeGet();\n /*try {\n if (result < Integer.parseInt(best.getProperty(type))) {\n best.setProperty(type, Integer.toString(result));\n fieldInerface.makeChampionWindow(type);\n }\n } catch (NullPointerException e) {\n } catch (NumberFormatException e) {\n best.setProperty(type, Integer.toString(result));\n fieldInerface.makeChampionWindow(type);\n }*/\n\n gamestart = true; // new game isn't started yet!\n for (int j = 0; j < heightOfField; j++)\n for (int i = 0; i < widthOfField; i++)\n if (fieldManager.isCellMined(i, j))\n if (!fieldManager.isCellMarked(i, j)) {\n fieldInerface.putMarkToButton(i, j);\n fieldInerface.decrement();\n }\n gameover = true; // game is over!!\n }",
"public void endsGameAndSetsWinner(Player player) {\n this.winner = player.getId(); \n this.gameStarted = false; \n \n }"
] | [
"0.7121534",
"0.69938684",
"0.6870113",
"0.66820484",
"0.6518131",
"0.6412242",
"0.57271445",
"0.5095296",
"0.5051986",
"0.48272043",
"0.48155713",
"0.47280902",
"0.4709248",
"0.46927255",
"0.46689442",
"0.4658115",
"0.45813325",
"0.45591506",
"0.45417717",
"0.4526072",
"0.44751197",
"0.44508377",
"0.44180378",
"0.44131422",
"0.4409477",
"0.44082275",
"0.44049558",
"0.4396737",
"0.43849513",
"0.43767047",
"0.4363287",
"0.43399236",
"0.43380803",
"0.433543",
"0.4333051",
"0.4330822",
"0.43286544",
"0.4316689",
"0.43148175",
"0.43048686",
"0.43024346",
"0.4299651",
"0.4290976",
"0.42851275",
"0.42845565",
"0.42839468",
"0.42804706",
"0.42751217",
"0.42706448",
"0.4270377",
"0.42669314",
"0.42395467",
"0.42385635",
"0.42229202",
"0.42172617",
"0.42006502",
"0.41982538",
"0.41948238",
"0.419327",
"0.41931105",
"0.41920435",
"0.41917494",
"0.4183059",
"0.4175439",
"0.41608605",
"0.4157709",
"0.4157381",
"0.41546237",
"0.4153936",
"0.4149992",
"0.4146637",
"0.4127925",
"0.41223177",
"0.41193116",
"0.41177925",
"0.41132823",
"0.41091615",
"0.41032383",
"0.40998077",
"0.4094835",
"0.40931702",
"0.4090523",
"0.40897882",
"0.4088078",
"0.40859136",
"0.40857354",
"0.40855706",
"0.40838",
"0.4083085",
"0.4071654",
"0.40713194",
"0.4071212",
"0.40706718",
"0.40700135",
"0.40683314",
"0.40666637",
"0.40588847",
"0.40570837",
"0.40494606",
"0.40446314"
] | 0.80566037 | 0 |
not sure if this will work properly (method should continue without waiting for it to finish | @Override
public void run() {
dayElimVoteTimeout(); // this might need a catch
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public boolean waitToProceed() {\n return false;\n }",
"@Override\n protected boolean isFinished() {\n return true;\n }",
"@Override\n protected boolean isFinished() \n {\n return false;\n }",
"@Override\r\n\tpublic void done() {\n\t\t\r\n\t}",
"protected abstract long waitToTravel();",
"@Override\n public boolean isDone()\n {\n return false;\n }",
"@Override\n protected boolean isFinished() {\n return true;\n }",
"@Override\n public boolean isDone() {\n return false;\n }",
"@Override\n protected boolean isFinished() {\n return false;\n }",
"@Override\n protected boolean isFinished() {\n return false;\n }",
"@Override\n protected boolean isFinished() {\n return false;\n }",
"@Override\n protected boolean isFinished() {\n return false;\n }",
"@Override\n protected boolean isFinished() {\n return false;\n }",
"@Override\n protected boolean isFinished() {\n return false;\n }",
"@Override\n protected boolean isFinished() {\n return false;\n }",
"@Override\n protected boolean isFinished() {\n return false;\n }",
"@Override\n protected boolean isFinished() {\n return false;\n }",
"@Override\n protected boolean isFinished() {\n return false;\n }",
"@Override\n protected boolean isFinished() {\n return false;\n }",
"@Override\n protected boolean isFinished() {\n return false;\n }",
"@Override\n protected boolean isFinished() {\n return false;\n }",
"@Override\n protected boolean isFinished() {\n return false;\n }",
"@Override\n protected boolean isFinished() {\n return false;\n }",
"@Override\n boolean isFinished() {\n return false;\n }",
"@Override\n protected boolean isFinished()\n {\n return false;\n }",
"@Override\r\n\tprotected void processFinish() {\n\r\n\t}",
"@Override\r\n\tprotected void processFinish() {\n\r\n\t}",
"@Override\r\n\tprotected void processFinish() {\n\r\n\t}",
"@Override\r\n protected boolean isFinished() {\n return false;\r\n }",
"@Override\n protected boolean isFinished() {\n return false;\n }",
"@Override\n protected boolean isFinished() {\n return false;\n }",
"@Override\r\n\tprotected boolean isFinished() {\r\n\t\treturn false;\r\n\t}",
"@Override\r\n\tprotected boolean isFinished() {\r\n\t\treturn false;\r\n\t}",
"@Override\n\tpublic boolean done() {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean done() {\n\t\treturn false;\n\t}",
"protected void waitUntilCommandFinished() {\n }",
"@Override\n public void done() {\n }",
"@Override\n public void done() {\n }",
"@Override\n public boolean isFinished() {\n return true;\n }",
"@Override\n\tprotected boolean isFinished()\n\t{\n\t\treturn false;\n\t}",
"@Override\r\n\t\t\tpublic void run() {\n\t\t\t\t\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic void run() {\n\t\t\t\t\r\n\t\t\t}",
"@Override\n public boolean completed() {\n return false;\n }",
"@Override\r\n\tprotected boolean isFinished() {\n\t\treturn true;\r\n\t}",
"@Override\r\n\tprotected boolean isFinished() {\n\t\treturn true;\r\n\t}",
"@Override\n\tprotected boolean isFinished() {\n\t\treturn false;\t\t\n\t}",
"private static void askForContinue() {\n\t\t\t\n\t\t}",
"@Override\n\t\tpublic void done() {\n\n\t\t}",
"private synchronized boolean waitResume() {\n return true;\n }",
"@Override\r\n\tprotected boolean isFinished() {\n\t\treturn false;\r\n\t}",
"@Override\r\n\tprotected boolean isFinished() {\n\t\treturn false;\r\n\t}",
"@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}",
"public void waitToFinish()\n {\n while(!this.finished)\n {\n try\n {\n Thread.sleep(1);\n }\n catch (InterruptedException e)\n {\n e.printStackTrace();\n return;\n }\n }\n }",
"@Override\n public boolean isFinished() {\n return false;\n }",
"@Override\n public boolean isFinished() {\n return false;\n }",
"@Override\n public boolean isFinished() {\n return false;\n }",
"@Override\n public boolean isFinished() {\n return false;\n }",
"@Override\n public boolean isFinished() {\n return false;\n }",
"@Override\n public boolean isFinished() {\n return false;\n }",
"@Override\n public boolean isFinished() {\n return false;\n }",
"@Override\n public boolean isFinished() {\n return false;\n }",
"@Override\n public boolean isFinished() {\n return false;\n }",
"@Override\n public boolean isFinished() {\n return false;\n }",
"@Override\n public boolean isFinished() {\n return false;\n }",
"@Override\n public boolean isFinished() {\n return false;\n }",
"@Override\n public boolean isFinished() {\n return false;\n }",
"@Override\n public boolean isFinished() {\n return false;\n }",
"@Override\n public boolean isFinished() {\n return false;\n }",
"@Override\n public boolean isFinished() {\n return false;\n }",
"@Override\n public boolean isFinished() {\n return false;\n }",
"@Override\n public boolean isFinished() {\n return false;\n }",
"@Override\n public boolean isFinished() {\n return false;\n }",
"public void waitToFinish()\n/* */ {\n/* 473 */ synchronized (this) {\n/* 474 */ while (getIterationsToGo() > 0) {\n/* */ try {\n/* 476 */ wait();\n/* */ }\n/* */ catch (InterruptedException e) {\n/* 479 */ e.printStackTrace();\n/* */ }\n/* */ }\n/* */ }\n/* */ }",
"@Override\n public boolean isFinished() {\n return false;\n }",
"public boolean isDone() { return true; }",
"@Override\n\tpublic boolean done() {\n\t\treturn true;\n\t}",
"@Override\n public boolean isFinished() {\n return true;\n }",
"boolean completed();",
"@Override\n\tprotected boolean isFinished() {\n\t\treturn false;\n\t}",
"@Override\n\tprotected boolean isFinished() {\n\t\treturn false;\n\t}",
"@Override\n\tprotected boolean isFinished() {\n\t\treturn false;\n\t}",
"@Override\n\tprotected boolean isFinished() {\n\t\treturn false;\n\t}",
"@Override\n\tprotected boolean isFinished() {\n\t\treturn false;\n\t}",
"@Override\n\tprotected boolean isFinished() {\n\t\treturn false;\n\t}",
"@Override\n\tprotected boolean isFinished() {\n\t\treturn false;\n\t}",
"@Override\n\tprotected boolean isFinished() {\n\t\treturn false;\n\t}",
"@Override\n\tprotected boolean isFinished() {\n\t\treturn false;\n\t}",
"@Override\n \tpublic void finished()\n \t{\n \t}",
"protected boolean isFinished() {\r\n\treturn false;\r\n }",
"public void done() {\n \t\t\t\t\t\t}",
"@Override\n public boolean isFinished() {\n return false;\n }",
"@Override\n public boolean isFinished() {\n return false;\n }",
"@Override\n public boolean isFinished() {\n return false;\n }",
"@Override\n public boolean isFinished() {\n return false;\n }",
"@Override\n public boolean isFinished() {\n return false;\n }",
"protected void execute() {\n finished = true;\n }",
"public boolean isDone() { return false; }",
"protected boolean isFinished(){\r\n return true;\r\n }",
"public Status waitUntilFinished();",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t}"
] | [
"0.6772597",
"0.6393295",
"0.63385785",
"0.6313639",
"0.63075316",
"0.63059855",
"0.6280099",
"0.62652403",
"0.62097013",
"0.62097013",
"0.62097013",
"0.62097013",
"0.62097013",
"0.62097013",
"0.62097013",
"0.62097013",
"0.62097013",
"0.62097013",
"0.62097013",
"0.62097013",
"0.62097013",
"0.62097013",
"0.62097013",
"0.61991715",
"0.617333",
"0.6159354",
"0.6159354",
"0.6159354",
"0.6150572",
"0.6128168",
"0.6128168",
"0.61094457",
"0.61094457",
"0.6109438",
"0.6109438",
"0.60984284",
"0.60774475",
"0.60774475",
"0.6071315",
"0.6066946",
"0.6060639",
"0.6060639",
"0.60585654",
"0.6056675",
"0.6056675",
"0.60562974",
"0.60530573",
"0.6050636",
"0.6045697",
"0.60357773",
"0.60357773",
"0.6023514",
"0.6014878",
"0.6008844",
"0.6008844",
"0.6008844",
"0.6008844",
"0.6008844",
"0.6008844",
"0.6008844",
"0.6008844",
"0.6008844",
"0.6008844",
"0.6008844",
"0.6008844",
"0.6008844",
"0.6008844",
"0.6008844",
"0.6008844",
"0.6008844",
"0.6008844",
"0.6008844",
"0.5997999",
"0.5993018",
"0.59888864",
"0.5981423",
"0.5970617",
"0.5962443",
"0.5960954",
"0.5960954",
"0.5960954",
"0.5960954",
"0.5960954",
"0.5960954",
"0.5960954",
"0.5960954",
"0.5960954",
"0.5959731",
"0.5956959",
"0.5950085",
"0.5940853",
"0.5940853",
"0.5940853",
"0.5940853",
"0.5940853",
"0.59402484",
"0.59399134",
"0.5928397",
"0.5914533",
"0.59134686",
"0.59134686"
] | 0.0 | -1 |
The checkElim method checks to see if there are enough votes to eliminate the suscipiousPlayer. If the number of elim votes has passed half the number of players left, then the suscipiousPlayer is eliminated. If this is not the case then the method sends a public message stating who has voted for the suscipiousPlayer. | private void checkElim(int origin) {
// if (elimDay.size() > playerIDs.size() / 2) {
server.publicMessage(players.get(origin) + " has voted to eliminate " + server.getUsername(playerOnTrialID));
if (elimDay.size() > players.size() / 2) {
eliminateDay();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void elimDayVote(String player, int origin) {\r\n\r\n\t// int playerID = server.getUserID(player);\r\n\tif (players.containsValue(player)) {\r\n\t OrderedBidiMap<String, Integer> invPlayers = players.inverseBidiMap();\r\n\r\n\t int playerID = invPlayers.get(player);\r\n\r\n\t // if (nightVote.size() > 0) {\r\n\t if (nightVoteInProgress) {\r\n\t\tserver.privateMessage(\r\n\t\t\t\"cannot vote to eliminate a player while there is a vote to change the game to night\", origin);\r\n\r\n\t\t// } else if (!playerIDs.contains(playerID)) { // this is for\r\n\t\t// when\r\n\t\t// using ArrayList of playerIDs\r\n\t } else if (playerID == origin) {\r\n\t\tserver.privateMessage(\"you cannot vote for yourself\", origin);\r\n\r\n\t } else if (elimDay.contains(origin)) {\r\n\t\tserver.privateMessage(\"you have already voted to start\", origin);\r\n\r\n\t } else if (!players.containsKey(origin)) {\r\n\t\tserver.privateMessage(\"you are not in the game, so cannot participate\", origin);\r\n\r\n\t } else if (playerOnTrialID == null) {\r\n\t\telimDayVoteInProgress = true;\r\n\t\tplayerOnTrialID = playerID;\r\n\t\telimDay.add(origin);\r\n\r\n\t\tTimerTask dayElimVoteTimeout = new TimerTask() { // not sure if\r\n\t\t\t\t\t\t\t\t // this\r\n\t\t\t\t\t\t\t\t // will work\r\n\t\t\t\t\t\t\t\t // properly\r\n\t\t\t\t\t\t\t\t // (method\r\n\t\t\t\t\t\t\t\t // should\r\n\t\t\t\t\t\t\t\t // continue\r\n\t\t\t\t\t\t\t\t // without\r\n\t\t\t\t\t\t\t\t // waiting for\r\n\t\t\t\t\t\t\t\t // it\r\n\t\t\t\t\t\t\t\t // to finish\r\n\r\n\t\t @Override\r\n\t\t public void run() {\r\n\t\t\tdayElimVoteTimeout(); // this might need a catch\r\n\r\n\t\t }\r\n\t\t};\r\n\r\n\t\tdayElimTimer = new Timer();\r\n\r\n\t\tdayElimTimer.schedule(dayElimVoteTimeout, 20000);\r\n\r\n\t } else {\r\n\t\tif (playerOnTrialID != playerID) {\r\n\t\t server.privateMessage(\"cannot vote for \" + player + \" while the vote for \"\r\n\t\t\t + server.getUsername(playerOnTrialID) + \" is in progress\", origin);\r\n\t\t} else {\r\n\t\t if (save.contains(origin)) {\r\n\t\t\tint index = save.indexOf(origin);\r\n\t\t\tsave.remove(index);\r\n\t\t }\r\n\r\n\t\t elimDay.add(origin);\r\n\t\t checkElim(origin);\r\n\t\t}\r\n\t }\r\n\t} else if (!players.containsValue(player)) {\r\n\t server.privateMessage(player + \" is not in this game/has already been eliminated\", origin);\r\n\r\n\t}\r\n\r\n }",
"private void checkNight(int origin) {\r\n\tserver.publicMessage(players.get(origin) + \" has voted for it to remain night\");\r\n\r\n\t// if (nightVote.size() > playerIDs.size() / 2) {\r\n\tif (nightVote.size() > players.size() / 2) {\r\n\t night();\r\n\t}\r\n }",
"private void eliminateDay() {\r\n\tdayElimTimer.cancel();\r\n\tdayElimTimer.purge();\r\n\r\n\t// playerIDs.remove(playerOnTrialID);\r\n\tplayers.remove(playerOnTrialID);\r\n\r\n\tif (mafia.contains(playerOnTrialID)) {\r\n\t int index = mafia.indexOf(playerOnTrialID);\r\n\t mafia.remove(index);\r\n\r\n\t} else {\r\n\t int index = innocentIDs.indexOf(playerOnTrialID);\r\n\t innocentIDs.remove(index);\r\n\t}\r\n\r\n\tserver.setPlayerMuted(playerOnTrialID, true);\r\n\r\n\tserver.publicMessage(server.getUsername(playerOnTrialID) + \" has been eliminated\");\r\n\r\n\tplayerOnTrialID = null;\r\n\telimDay.clear();\r\n\tsave.clear();\r\n\telimDayVoteInProgress = false;\r\n\r\n\tcheckWin();\r\n }",
"@Test\n public void discardLessThan4() {\n gm.setPlayerInfo(clientPlayer4);\n gm.setThisPlayerIndex(clientPlayer4.getPlayerIndex());\n Player p = model.getPlayer(clientPlayer4.getPlayerIndex());\n ResourceSet discardSet = dc.getDiscardAmount();\n verify(robberFacade, atMost(3)).canDiscard(discardSet, p);\n verify(robberFacade, atMost(2)).discard(discardSet, p);\n }",
"private void eliminate() {\n\t\t// when the election is not closed,\n\t\ttry{\n\t\t\tMap<String,Integer> results = election.getResultsFromPolls();\n\t\t\tList<Map.Entry<String,Integer>> entryList = new ArrayList(results.entrySet());\n\n\t\t\tCollection<Integer> values = results.values();\n\t\t\tint totalVotes = 0;\n\n\t\t\tfor(Integer i:values){\n\t\t\t\ttotalVotes += i;\n\t\t\t}\n\n\t\t\tif(entryList.get(entryList.size()-1).getValue()/(double)totalVotes > 0.5) {\n\t\t\t\t// when the election already has a winner,\n\t\t\t\tSystem.out.println(\"A candidate already has a majority of the votes.\");\n\t\t\t\tSystem.out.println(\"You cannot remove any more candidates.\");\n\t\t\t}else {\n\n\t\t\t\t// when we can eliminate a candidate,\n\t\t\t\tSystem.out.println(\"Eliminating the lowest-ranked candidate.\");\n\t\t\t\tList lowestCans = new ArrayList();\n\t\t\t\tlowestCans.add(entryList.get(0).getKey());\n\t\t\t\tint i = 1;\n\t\t\t\twhile (i<entryList.size() && entryList.get(i).getValue() == entryList.get(0).getValue() ){\n\t\t\t\t\tlowestCans.add(entryList.get(i).getKey());\n\t\t\t\t\ti++;\n\t\t\t\t}\n\n\t\t\t\tif (lowestCans.size() >1) {\n\t\t\t\t\tCollections.sort(lowestCans);\n\t\t\t\t\tCollections.reverse(lowestCans);\n\t\t\t\t}\n\t\t\t\t\telection.eliminateCandidateWithName((String) lowestCans.get(0));\n\n\t\t\t\tSystem.out.println(\"Eliminated \"+lowestCans.get(0)+\".\");\n\t\t\t}\n\n\t\t}catch(UnsupportedOperationException uso){\n\t\t\tSystem.out.println(\"The election is still open for votes.\");\n\t\t\tSystem.out.println(\"You must close the election before eliminating candidates.\");\n\t\t}\n\n\t}",
"private void check4voteAndClean()\n\t{\n\t\tif( noBeepersPresent())\n\t\t{\tturnLeft();\n\t\t\tmove();\n\t\t\tpickAll();\n\t\t\tturnAround();\n\t\t\tmove();\n\t\t\tmove();\n\t\t\tpickAll();\n\t\t\tturnAround();\n\t\t\tmove();\n\t\t\tturnRight();\n\t\t}\n\t}",
"private void saveVote(String player, int origin) {// suspicious player do\r\n\t\t\t\t\t\t // need\r\n\t// to vote for themselves\r\n\r\n\tif (players.containsValue(player)) {\r\n\t OrderedBidiMap<String, Integer> invPlayers = players.inverseBidiMap();\r\n\t // int playerID = server.getUserID(player);\r\n\t int playerID = invPlayers.get(player);\r\n\r\n\t if (playerOnTrialID == null) {\r\n\t\tserver.privateMessage(\"you cannot vote to save someone when there is no-one on trial\", origin);\r\n\r\n\t\t// } else if (!playerIDs.contains(playerID)) {\r\n\t } else {\r\n\t\tif (playerOnTrialID != playerID) {\r\n\t\t server.privateMessage(\"cannot vote for \" + player + \" while the vote for \"\r\n\t\t\t + server.getUsername(playerOnTrialID) + \" is in progress\", origin);\r\n\r\n\t\t} else if (!players.containsKey(origin)) {\r\n\t\t server.privateMessage(\"you are not in the game, so cannot participate\", origin);\r\n\r\n\t\t} else {\r\n\t\t if (elimDay.contains(origin)) {\r\n\t\t\tint index = elimDay.indexOf(origin);\r\n\t\t\telimDay.remove(index);\r\n\t\t }\r\n\r\n\t\t save.add(origin);\r\n\t\t checkSave(origin);\r\n\t\t}\r\n\t }\r\n\t} else if (!players.containsValue(player)) {\r\n\t server.privateMessage(player + \" is not in this game/has already been eliminated\", origin);\r\n\r\n\t}\r\n\r\n }",
"protected boolean processPlayerDeclined(int gameNum, String playerName, String offer){\n return false;\n }",
"public void kickOut(){\n Iterator<Player> iter = players.iterator();\n while (iter.hasNext()){\n Player player = iter.next();\n if(player.isBankrupt(minBet)){\n iter.remove();\n System.out.println(player + \" runs out of cash!\");\n }\n }\n }",
"public boolean checkIfPlayerHoldsExplosive () { return noOfExplosives > 0; }",
"public void playerHasInvincibility() {\n\t\tthis.state = canBeKilled;\n\t}",
"public int checkNoOfExplosivesPlayerHolds () { return noOfExplosives; }",
"public ArrayList<Player> checkToEliminate() {\n ArrayList<Player> eliminated = new ArrayList<Player>();\n\n // Check which players are to be eliminated\n for (Player player : playersInGame) {\n if (player.peekCard() == null) {\n eliminated.add(player);\n }\n }\n\n // Eliminate players from model\n for (Player eliminatedPlayer : eliminated) {\n playersInGame.remove(eliminatedPlayer);\n }\n\n return eliminated;\n }",
"private void checkExplosionKill() {\n\t\t\n\t\texplosion.expand();\n\t\t\n\t\tfor (ArrayList<Invader> row : enemyArray) {\n\t\t\tfor (Invader a : row) {\n\t\t\t\tif (explosion.detectDownwardCollision(a.getX(), a.getY())) {\n\t\t\t\t\ta.setVisibility(false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public int isSafe(){\n int nbEnnemies = 0;\n List<Player> players = state.getPlayers();\n Player currentPlayer = state.getCurrentPlayer();\n for(Player p : players){\n if(!p.equals(currentPlayer)) {\n nbEnnemies += currentPlayerReachable(state.getCurrentPlayer(), p);\n //nbEnnemies += manhattan(currentPlayer, p); //naive version\n }\n }\n return nbEnnemies;\n }",
"private void botVoting(){\n int stockPos;\n int myStockPos = getMostShares(playerList.lastIndexOf(player));\n Collections.sort(playerList);\n if(playerList.get(0) == player){ //if i am the leader\n stockPos = getMostShares(1); //get the second players info\n }else{\n stockPos = getMostShares(0); //else get the first players info\n }\n\n //if my most shares are the same as other players most shares, don't vote.\n if(game.getStockByIndex(stockPos) != game.getStockByIndex(myStockPos)){\n //offensive play against leader\n if(game.isCardPositive(game.getStockByIndex(stockPos))){\n game.getStockByIndex(stockPos).vote(0);\n player.getVotedStocks().append(game.getStockByIndex(stockPos).getName().charAt(0));\n player.deductVotesLeft();\n System.out.println(\"bot voted NO for \" + game.getStockByIndex(stockPos).getName() );\n }else{\n game.getStockByIndex(stockPos).vote(1);\n player.getVotedStocks().append(game.getStockByIndex(stockPos).getName().charAt(0));\n player.deductVotesLeft();\n System.out.println(\"bot voted YES for \" + game.getStockByIndex(stockPos).getName());\n }\n //defensive play, votes that will benefit me\n if(game.isCardPositive(game.getStockByIndex(myStockPos))){\n game.getStockByIndex(myStockPos).vote(1);\n player.getVotedStocks().append(game.getStockByIndex(myStockPos).getName().charAt(0));\n player.deductVotesLeft();\n System.out.println(\"bot voted YES for \" + game.getStockByIndex(myStockPos).getName());\n }else{\n game.getStockByIndex(myStockPos).vote(0);\n player.getVotedStocks().append(game.getStockByIndex(myStockPos).getName().charAt(0));\n player.deductVotesLeft();\n System.out.println(\"bot voted NO for \" + game.getStockByIndex(myStockPos).getName());\n }\n }\n }",
"public void NPSShot()\n\t{\n\t\t//can only occur if a friendly missile and \n\t\t//a NPS are spawned\n\t\tif(gameObj[2].size() > 0 && gameObj[4].size() > 0)\n\t\t{\n\t\t\tint nps = new Random().nextInt(gameObj[2].size());\n\t\t\tint mis = new Random().nextInt(gameObj[4].size());\n\t\t\tgameObj[2].remove(nps);\n\t\t\tgameObj[4].remove(mis);\n\t\t\tscore += 500;\n\t\t\tSystem.out.println(\"A player misile has struck a NPS! +500 points\");\n\t\t}else\n\t\t\tSystem.out.println(\"An NPS and a friendly missile are not spawned\");\n\t}",
"private void voteNight(int origin) {\r\n\t// if (playerOnTrialID != null) {\r\n\tif (elimDayVoteInProgress) {\r\n\t server.privateMessage(\"you cannot start a vote for it to be night when there is a vote in progress \"\r\n\t\t + \"to eliminate a player\", origin);\r\n\r\n\t} else if (nightVote.contains(origin)) {\r\n\t server.privateMessage(\"you have already voted to change the game to night\", origin);\r\n\r\n\t} else if (!players.containsKey(origin)) {\r\n\t server.privateMessage(\"you are not in the game, so cannot participate\", origin);\r\n\r\n\t} else {\r\n\t nightVoteInProgress = true;\r\n\r\n\t if (dayVote.contains(origin)) {\r\n\t\tint index = dayVote.indexOf(origin);\r\n\t\tdayVote.remove(index);\r\n\t }\r\n\r\n\t nightVote.add(origin);\r\n\r\n\t if (nightVote.size() == 1) {\r\n\t\tTimerTask nightVoteTimeout = new TimerTask() {\r\n\r\n\t\t @Override\r\n\t\t public void run() {\r\n\t\t\tnightVoteTimeout(); // this might need a catch\r\n\r\n\t\t }\r\n\t\t};\r\n\r\n\t\tnightVoteTimer = new Timer();\r\n\r\n\t\tnightVoteTimer.schedule(nightVoteTimeout, 20000);\r\n\t } else {\r\n\t\tcheckNight(origin);\r\n\t }\r\n\r\n\t}\r\n }",
"public void rejectInvite(UserBean possibleOpponent)\n\t{\n\t\tSocket controlSocket;\n\t\ttry {\n\t\t\tcontrolSocket = new Socket(possibleOpponent.getIpAddress(), Model.controlDataSocketNumber);\n\t\t\tObjectOutputStream toPeer = new ObjectOutputStream(controlSocket.getOutputStream());\n\t\t\tClientMessage c = new ClientMessage();\n\t\t\tc.setCommand(\"REJECT\");\n\t\t\tc.setUser(new UserBean(this.hostName, this.userName, this.ipAddress));\n\t\t\tSystem.out.println(\"Rejecting invite\");\n\t\t\t\n\t\t\ttoPeer.writeObject(c);\n\t\t\n\t\t\tcontrolSocket.close();\n\t\t\t\n\t\t} catch (IOException e) \n\t\t{\n\t\t\te.printStackTrace();\n\t\t} \n\t}",
"public void announceElimination(String loserName){\n currentMessage = loserName;\n gameState = GameState.ELIMINATION;\n notifyObservers();\n currentMessage = \"\";\n }",
"public void surpriseAttack(DungeonCharacter opponent)\n\t{\n\t\tdouble surprise = Math.random();\n\t\t\n\t\tif (surprise <= .4)\n\t\t{\n\t\t\tSystem.out.println(\"You pet was successful in his attack!\\n\" +\n\t\t\t\t\tCharacterValues.getName() + \" gets an additional turn.\");\n\t\t\tnumTurns++;\n\t\t\tattack(opponent);\n\t\t\t\n\t\t}//end surprise\n\t\telse if (surprise >= .9)\n\t\t{\n\t\t\tSystem.out.println(\"Uh oh! \" + opponent.CharacterValues.getName() + \" saw you and\" +\n\t\t\t\t\t\t\t\t\" blocked your attack!\");\n\t\t}\n\t\t\n\t\telse\n\t\t attack(opponent);\n\n\t}",
"public void removeKickVote()\n\t{\n\t\tnumberOfKickVotes--;\n\t}",
"@Test\n void removePlayersFromScoreBoardDoesNothingIfNoPlayerMarkedForRemoval(){\n assertEquals(4, scoreboard.getScore().size());\n //do not add players to the list of players that should be removed\n List<String> usersToBeRemoved=new ArrayList<>();\n //remove players in list\n scoreboard.removePlayersFromScoreBoard(usersToBeRemoved);\n //check that players were removed\n assertEquals(4, scoreboard.getScore().size());\n assertEquals(4,scoreboard.getCorrectlyGuessedMysteryWordsPerPlayer().size());\n }",
"public boolean meWin(){\n return whitePieces.size() > blackPieces.size() && isWhitePlayer;\n }",
"boolean voteSpoiled(ParticipantUserData participant) {\n for (Entry e : participantsList) {\n if (e.userData == participant) {\n\treturn e.voteSpoiled();\n }\n }\n throw new ShouldNotHappenException(\"participant unknown.\");\n }",
"@Test\r\n\tpublic void testCoinRejected() {\r\n\t\tCoin coin = new Coin(7);\r\n\t\tTheCoinSlotListener csListener = new TheCoinSlotListener();\r\n\t\tcsListener.coinRejected(vend.getCoinSlot(), coin);\r\n\t\tassertEquals(csListener.getCurrentCredit(), 0);\t\t\t\r\n\t}",
"public static void checkWinner() {\n\t\tcontinueGame = false;\n\t\tfor (int k = 0; k < secretWordLength; k++) {\n\t\t\tif (!unseenBoard.get(k).equals(\"*\")) {\n\t\t\t\tcontinueGame = true;\n\t\t\t}\n\t\t}\n\t}",
"static void economy() throws GameActionException {\n\n\t\tcheckLumberjack();\n\n\t\tif (rc.canBuildRobot(RobotType.SCOUT, robotDirection)\n\t\t\t\t&& rc.readBroadcast(Channels.COUNT_SCOUT) < Constants.MAX_COUNT_SCOUT) {\n\t\t\trc.buildRobot(RobotType.SCOUT, robotDirection);\n\t\t\tCommunication.countMe(RobotType.SCOUT);\n\t\t\treturn;\n\t\t} else if (rc.canBuildRobot(RobotType.SOLDIER, robotDirection)\n\t\t\t\t&& rc.readBroadcast(Channels.COUNT_SOLDIER) < rc.readBroadcast(Channels.COUNT_GARDENER) ) {\n\t\t\trc.buildRobot(RobotType.SOLDIER, robotDirection);\n\t\t\tCommunication.countMe(RobotType.SOLDIER);\n\t\t\treturn;\n\t\t}\n\n\t}",
"@SuppressWarnings(\"unused\")\r\n\tpublic static void checkNumberOfCoffeeDispensers() {\r\n\t\tif (NUMBEROFCOFFEEDISPENSER > 5) {\r\n\t\t\tJOptionPane.showMessageDialog(null, \"Danger! A person who probably likes 42 has manipulated the interface above its limits.\\n\\nYou can get more rooms for money. ;-)\\n\\nprogram will terminate...\", \"Warning Number Of CoffeeDispensers\",\r\n\t\t\t\t\tJOptionPane.WARNING_MESSAGE, ICONWARNING);\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\t}",
"private void whichPlayerHasTurn() throws PlayerOutOfTurn {\n if (test.equals(lastPicked)) {\n throw (new PlayerOutOfTurn());\n }\n }",
"public List<Player> winnerWhenBlocked(Player p) {\r\n System.out.println(\"The game is blocked\");\r\n Map<Integer, Integer> aux = new HashMap<>();\r\n for (Player player : players) {\r\n if (p.getTeam() == player.getTeam()) {\r\n aux.put(player.getTeam(), aux.get(player.getTeam()) + player.getDominoPoints());\r\n } else {\r\n aux.put(player.getTeam(), aux.get(player.getTeam()) + player.getDominoPoints());\r\n }\r\n }\r\n int winnerkey = 0;\r\n int winnervalue = aux.get(winnerkey);\r\n int loserKey = 1;\r\n int loserValue = aux.get(loserKey);\r\n\r\n System.out.println(\"Winner is\" + aux.get(winnerkey));\r\n if (aux.get(winnerkey) > aux.get(loserKey)) {\r\n winnerkey = 1;\r\n winnervalue = aux.get(winnerkey);\r\n loserKey = 0;\r\n loserValue = aux.get(loserKey);\r\n System.out.println(\"Loser is\" + aux.get(loserKey));\r\n\r\n } else if (aux.size() > 2) {\r\n if (aux.get(winnerkey) > aux.get(2)) {\r\n winnerkey = 1;\r\n winnervalue = 0;\r\n }\r\n if (aux.get(2) < aux.get(loserKey)) {\r\n loserKey = 2;\r\n loserValue = aux.get(loserKey);\r\n }\r\n }\r\n\r\n //We sum the points for the winner\r\n List<Player> winners = new ArrayList<>();\r\n for (Player player : players) {\r\n if (p.getTeam() == winnerkey) {\r\n p.sumPoints(aux.get(loserKey));\r\n winners.add(p);\r\n }\r\n }\r\n return winners;\r\n }",
"public void tryRehearse() {\n if (currentPlayer.isEmployed() == true) {\n if(!currentPlayer.getHasPlayed()){\n currentPlayer.rehearse();\n }\n else{ \n view.showPopUp(currentPlayer.isComputer(), \"You've already moved, rehearsed or acted this turn. Try a different command or click `end turn` to end your turn.\");\n }\n }\n else {\n view.showPopUp(currentPlayer.isComputer(), \"You're not employed, so you need to take a role before you can rehearse.\");\n }\n view.updateSidePanel(playerArray);\n }",
"private boolean checkGreedyWinRate() {\r\n return myTotal.get(0) > enTotal.get(0)+2 && (myself.health > 50 || myself.health > opponent.health);\r\n }",
"protected boolean processPlayerOffered(int gameNum, String playerName, String offer){\n return false;\n }",
"public void removePlayer(String name) {\n\t\tUser user = users.get(userTurn);\n\t\tFootballPlayer player = market.findPlayer(name);\n\t\tdouble marketValue = player.getMarketValue();\n\t\t\n\t\tif (tmpTeam.size() > 0) {\n\t\t\tuser.updateBudget(marketValue, \"+\");\n\t\t\ttmpTeam.removePlayer(name);\n\t\t}\n\t\tSystem.out.println(\"budget after sell\" + user.getBudget());\n\t}",
"public void handleEvent(PlayerLeft event) {\r\n if( !isEnabled ) return;\r\n\r\n if( tasks.size() == 0 ) return;\r\n\r\n Player p = m_botAction.getPlayer(event.getPlayerID());\r\n\r\n if( p == null ) return;\r\n\r\n for( int i = 0; i < tasks.size(); i++ ) {\r\n AutoTask c = tasks.get( i );\r\n\r\n if( c != null )\r\n c.removeVote( p.getPlayerName() );\r\n }\r\n }",
"@Override\n public List<IEpisode> prune(List<IEpisode> candidates, IObserver observer, \n SessionInfo session)\n {\n if (DEBUG) { \n System.out.println(\"NegativeStrengthThreshold: pruning episodes base on individual predictions\");\n System.out.println(\"NegativeStrengthThreshold: start count ->\" + candidates.size());\n } \n observer.setExtent( candidates.size() );\n observer.startup();\n IEventDataStream sequence = session.getSequence();\n for (ListIterator<IEpisode> li = candidates.listIterator(); li.hasNext(); ) \n {\n IEpisode episode = li.next();\n if (episode.size() == 1) return candidates;\n \n if (DEBUG)\n {\n System.out.println(episode.toString(sequence.getEventFactor()) + \n \" : \" + episode.getVoteString() + \" < \" + episode.getRequiredVoteString());\n }\n \n boolean flag = false;\n for(int index = 0; index < session.getSegIndexLen(); index++)\n {\n if (episode.getVotes(index) > episode.getRequiredVotes(index))\n {\n flag = true;\n break;\n }\n }\n if (flag)\n {\n li.remove();\n }\n if (observer.update(li.nextIndex())) break;\n }\n observer.shutdown();\n if (DEBUG) System.out.println(\"NegativeStrengthThreshold: final count ->\" + candidates.size());\n return candidates;\n }",
"void losePoints() {\n if (currentPoints >= POINTSGIVEN) {\n currentPoints -= POINTSGIVEN;\n feedback = \"Your current rating is: \" + currentPoints + \"%\";\n }\n }",
"private void checkDay(int origin) {\r\n\tserver.publicMessage(players.get(origin) + \" has voted for it to remain day\");\r\n\r\n\t// if (dayVote.size() > playerIDs.size() / 2) {\r\n\tif (dayVote.size() > players.size() / 2) {\r\n\t day();\r\n\t} else if (dayVote.size() == players.size() / 2 && players.size() % 2 == 0) {\r\n\t day();\r\n\t}\r\n }",
"public boolean blockedGame() {\r\n int pointsperplayer = 0;\r\n if (playedDominoes.size() > 9) {\r\n if (end[0] == end[1]) {\r\n List<Domino> aux = new ArrayList();\r\n for (Domino d : playedDominoes) {\r\n if (d.getBothNumbers().contains(end[0])) {\r\n System.out.println(\"Adding domino\" + d.toString());\r\n aux.add(d);\r\n }\r\n }\r\n return aux.size() == 7;\r\n }\r\n }\r\n return false;\r\n }",
"protected boolean processPlayerWithdrew(int gameNum, String playerName, String offer){\n return false;\n }",
"void checkWinner() {\n\t}",
"private int evaluate(boolean maximizing) {\n int selfEval = getCountOfStonesFor(this);\n selfEval += countOfMills(this) * 5;\n selfEval += countOfPossibleMills(this) * 15;\n\n int opponentEval = getCountOfStonesFor(opponent);\n opponentEval += countOfMills(opponent) * 5;\n opponentEval += countOfPossibleMills(opponent) * 15;\n\n return (selfEval - opponentEval) * (maximizing ? 1 : -1);\n }",
"private void declareWinner(){\r\n System.out.println(\"All proposals received\");\r\n AID best = proposals.get(0).getSender();\r\n for(ACLMessage proposal: proposals){\r\n String time = proposal.getContent().replaceFirst(\"bid\\\\(\", \"\");\r\n time = time.replaceFirst(\" sec\\\\)\", \"\");\r\n String bestTimeString = \r\n proposal.getContent().\r\n replaceFirst(\"bid\\\\(\", \"\").\r\n replaceFirst(\" sec\\\\)\", \"\");\r\n int bestTime = Integer.parseInt(bestTimeString);\r\n int propTime = Integer.parseInt(time);\r\n if (bestTime > propTime) {\r\n best = proposal.getSender();\r\n }\r\n }\r\n sendMessage(best, \"\", ACLMessage.ACCEPT_PROPOSAL);\r\n Object[] ob = new Object[2];\r\n ob[0] = best;\r\n ob[1] = currentPartial;\r\n expectedReturn.add(ob);\r\n System.out.println(\"Accepting proposal from \" + best.getLocalName());\r\n for(ACLMessage proposal: proposals){\r\n if(!proposal.getSender().equals(best)){\r\n sendMessage(proposal.getSender(), \"\", ACLMessage.REJECT_PROPOSAL);\r\n }\r\n }\r\n proposals.clear();\r\n solvables.remove(0);\r\n if(!solvables.isEmpty()){\r\n \r\n auctionJob(solvables.get(0));\r\n }\r\n }",
"public void endRound() {\n if (!myTurn()) {\n return;\n }\n if (this.board.getWinners().size() > 0 && this.playerId == board.getPlayers().get(board.getPlayers().size() - 1).playerId) {\n this.board.setRunning(false);\n }\n // currentPlayerNumber = (currentPlayerNumber + 1) % players.size();\n // current = players.get(currentPlayerNumber);\n this.removableBlockades = new ArrayList<>();\n coins = (float) 0;\n bought = false;\n specialAction.setDraw(0);\n specialAction.setRemove(0);\n specialAction.setSteal(0);\n history = new ArrayList<>();\n //for (int i = tmpDiscardPile.size(); i > 0; i--){\n // discardPile.add(tmpDiscardPile.remove(0));\n //}\n discardPile.addAll(tmpDiscardPile);\n tmpDiscardPile = new ArrayList<Card>();\n draw();\n board.endRound();\n }",
"void concludeRound() {\n\n ArrayList<Card> currentTopCards = getCurrentTopCards();\n transferCards(roundWinner, currentTopCards);\n eliminatePlayers();\n\n logger.log(\"Communal Deck: \" + deck);\n logger.log(divider);\n for (Player player : players) {\n logger.log(\"Hand: \" + player);\n }\n\n logger.log(\"Round complete.\");\n\n setGameState(GameState.ROUND_COMPLETE);\n }",
"void skipNextPlayer() {\n endTurn();\n }",
"public void checkWin() {\n if (rockList.isEmpty() && trackerRockList.isEmpty() && bigRockList.isEmpty() && bossRockList.isEmpty()) {\n if (ship.lives < 5) {\n ship.lives++;\n }\n Level++;\n LevelIntermission = true;\n LevelIntermissionCount = 0;\n }\n }",
"private void eliminatePlayers() {\n \n Iterator<Player> iter = players.iterator();\n\n while (iter.hasNext()) {\n Player player = iter.next();\n\n if (player.getList().isEmpty()) {\n iter.remove();\n if (player.getIsHuman()) {\n setGameState(GameState.HUMAN_OUT);\n }\n // need to remember that due to successive draws, the active player could run\n // out of cards\n // select a new random player if player gets eliminated\n if (!players.contains(activePlayer)) {\n selectRandomPlayer();\n }\n }\n }\n }",
"private void checkForPlayerChance()\n\t\t\t{\n\t\t\t\tf = false;\n\t\t\t\tfor (j = 0; j < 8; ++j)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (win[j] == 2 && lose[j] == 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tf = true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\tif (f == false)\n\t\t\t\t\tj = 10;\n\n\t\t\t}",
"private void checkLoosePLayer(){\n if (hero.getHp()<=0){\n loose();\n }\n\n }",
"public boolean puissanceDeux (int listsize) throws NbOfCompetitorIncorrect {\r\n if (listsize%2 != 0) {\r\n throw new NbOfCompetitorIncorrect(\"You need a number power of two of competitors to start a tournament.\");\r\n }\r\n else if (listsize == 2){ \r\n return true;\r\n }\r\n else {\r\n return puissanceDeux(listsize/2);\r\n }\r\n }",
"public void dealerOut() {\n\t\tview.writeLog(\"Dealer: \"+PointCounter.countPoint(dealer.clientCards)+\", DEALER OUT!\");\n\t\tint dealerLosingStack = 0;\n\t\tfor(ClientThread player:players) {\n\t\t\tif(player != dealer) {\n\t\t\t\tplayer.send(new Package(\"MESSAGE\",\"The dealer's points is over 21. You win a stack!\"));\n\t\t\t\tplayer.send(new Package(\"END\",1));\n\t\t\t\tdealerLosingStack++;\n\t\t\t}\n\t\t}\n\t\tint dealerStackChange = losers - dealerLosingStack;\n\t\tdealer.send(new Package(\"MESSAGE\",\"Over 21! You lose \"+dealerLosingStack+\" stacks. \"));\t\n\t\tdealer.send(new Package(\"END\",dealerStackChange+1));\t\n\t\tendGame();\n\t}",
"private void sellPlayer(int num) {\n\t\tString playerName = playerNameArray[num].getText();\n\t\tgame.removePlayer(playerName);\n\t\tplayerNameArray[num].setText(\"\");\n\t\timageArray[num].setIcon(MainGui.getShirt(\"noTeam\"));\n\t\tbuttonArray[num].setText(\"+\");\n\t\tlblBudgetText.setText(game.getCurrentUser().getBudget() + \"kr\");\n\t}",
"public void PSShot()\n\t{\n\t\t//collision can only occur if an enemy missile and a PlayerShip are spawned\n\t\tif(gameObj[1].size() > 0 && gameObj[3].size() > 0)\n\t\t{\n\t\t\tint mis = new Random().nextInt(gameObj[3].size());\n\t\t\tgameObj[1].remove(0);\n\t\t\tgameObj[3].remove(mis);\n\t\t\tlives--;\n\t\t\tSystem.out.println(\"An enemy missile has struck a PS -1 life\");\n\t\t\tif(lives >0) \n\t\t\t\tSystem.out.println(\"you have \" + lives + \" left\");\n\t\t\telse\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Game over\");\n\t\t\t\tgameOver();\n\t\t\t}\n\t\t}else\n\t\t\tSystem.out.println(\"A player ship and an enemy missile are not spawned\");\t\t\n\t}",
"private void eliminatePlayer(Player loser){\n players.remove(loser);\n }",
"public void logEliminatedPlayer(Player p)\n\t{\n\t\tif(p instanceof HumanPlayer)\n\t\t\tlog += String.format(\"%nUSER ELIMINATED\");\n\t\telse\n\t\t{\n\t\t\tAIPlayer player = (AIPlayer) p;\n\t\t\tlog += String.format(\"%n%s ELIMINATED\", player.getName().toUpperCase());\n\t\t}\n\t\tlineBreak();\n\t}",
"public static void checkPlayer()\n\t{\n\t\ttry {\n\t\t\t\n\t\t\tscenarioResults = new String[127];\n\t\t\tArrayList<Integer> differences = new ArrayList<Integer>();\n\t\t\t//set scenarioResults to current result or player's bracket when not impossible\n\t\t\tfor(int i=0; i < 127; i++)\n\t\t\t{\n\t\t\t\tif(i < nextMatch){\n\t\t\t\t\tscenarioResults[i] = results[i];\n\t\t\t\t}else{\n\t\t\t\t\t//check if a pick has been disqualified by previous results. \n\t\t\t\t\t//If it is still possible, assume it happens, else add the match number to the list to iterate through.\n\t\t\t\t\tif(isValid(allPicks.get(checkIndex)[i],i)){\n\t\t\t\t\t\tscenarioResults[i] = allPicks.get(checkIndex)[i];\n\t\t\t\t\t}else{\n\t\t\t\t\t\tscenarioResults[i] = \"\";\n\t\t\t\t\t\tdifferences.add(i);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//if there aren't any matches to check specifically (i.e. no picked winners that lost in previous rounds)\n\t\t\t//\tjust check to see if they win if everything breaks right.\n\t\t\tif(differences.size() == 0)\n\t\t\t{\n\t\t\t\tif(outputScenarioWinner(\"any combination+\"))\n\t\t\t\t{\n\t\t\t\t\twriter.write(\"\\t\"+entrants[checkIndex]+\" is ALIVE\");\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.println(entrants[checkIndex]);\n\t\t\t\t\twriter.write(\"\\t\"+entrants[checkIndex]+\" is DEAD\");\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t//find later round matches to iterate through, where the player is already guaranteed to be wrong\n\t\t\t\twrongMatches = new int[differences.size()];\n\n\n\t\t\t\tfor(int i = 0; i < wrongMatches.length; i++)\n\t\t\t\t{\n\t\t\t\t\twrongMatches[i] = differences.get(i).intValue();\n\t\t\t\t}\n\n\t\t\t\t//recurse through results, checking from left-most first. When you reach the end of the list of matches, check scores\n\t\t\t\t//\tand print the winner for the given combination.\n\t\t\t\tboolean isAlive = checkPlayerHelper(0,\"\");\n\n\t\t\t\t//if player is the winner, end execution\n\t\t\t\tif(isAlive)\n\t\t\t\t{\n\t\t\t\t\twriter.write(\"\\t\"+entrants[checkIndex]+\" is ALIVE\");\n\t\t\t\t}else{\n\t\t\t\t\twriter.write(\"\\t\"+entrants[checkIndex]+\" is DEAD\");\n\t\t\t\t\tSystem.out.println(entrants[checkIndex]);\n\t\t\t\t}\n\t\t\t}\n\t\t\twriter.write(\"\\n\");\n\t\t\t\n\t\t}\t\n\t\tcatch (IOException e) {\n\t\t\tSystem.out.println(\"problem with output\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t}",
"public static void jouerAuJustePrix() {\n\t\tint nbVies=Tools.inputInt(\"Combien de tentatives voulez-vous ? \");\n\t\tint limite=Tools.inputInt(\"Quel est le nombre maximum à prendre en compte?\");\n\t\tint nbATrouver=Tools.randomint(limite);\n\t\tint nbPropose;\n\t\t\n\t\twhile (nbVies>0){\n\t\t\tnbPropose=Tools.inputInt(\"Saisissez un nombre : \");\n\t\t\tif (afficherResultatProposition(nbPropose, nbATrouver)) {\n\t\t\t\tbreak;\n\t\t\t};\n\t\t\tnbVies=nbVies-1;\n\t\t}\n\t\t\n\t\tif (nbVies==0) {\n\t\t\tSystem.out.println(\"Game Over\");\n\t\t}\n\t}",
"public void timeToCheckWorker() {\n notifyCanMove(this.getCurrentTurn().getCurrentPlayer());\n }",
"public void discard(int num) {\r\n\t\tfor (int i = 0; i < mustDiscard.size(); i++) {\r\n\t\t\tif (currentPlayer.discard(num)) {\r\n\t\t\t\tif (mustDiscard.get(i).contentEquals(\"Sleight of Hand\")) {\r\n\t\t\t\t\tmustDiscard.remove(i);\r\n\t\t\t\t\tcurrentPlayer.draw(2);\r\n\t\t\t\t\tupdatePlayArea(currentPlayer, false);\r\n\t\t\t\t} else if (mustDiscard.get(i).contentEquals(\"Apothecary\")) {\r\n\t\t\t\t\tmustDiscard.remove(i);\r\n\t\t\t\t\tmustChoose.add(\"Apothecary\");\r\n\t\t\t\t\tchoosePrompt();\r\n\t\t\t\t\tupdatePlayArea(currentPlayer, false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private void sendWinnerMessage(RaceTrackMessage playerDisconnectsMessage) {\n\t\tif(playerDisconnectsMessage != null)\n\t\t\ttry{\n\n\t\t\t\tint playerWhoWon = getPlayerWhoWonByPlayerID(((DisconnectMessage) playerDisconnectsMessage).getNextPlayerToMove()); \n\t\t\t\tint playerWhoWonID = getPlayerIDWhoWonByPlayerID(((DisconnectMessage) playerDisconnectsMessage).getNextPlayerToMove());\n\t\t\t\tif(playerWhoWon != -1){\n\t\t\t\t\tPoint2D lastVec = null;\n\t\t\t\t\tif(getPlayerMap().get(playerWhoWonID) != null)\n\t\t\t\t\t\tlastVec = getPlayerMap().get(playerWhoWonID).getCurrentPosition();\n\n\n\t\t\t\t\tPlayerWonMessage answer;\n\n\t\t\t\t\tanswer = VectorMessageServerHandler.generatePlayerWonMessage(playerWhoWon, playerWhoWon, lastVec);\n\n\t\t\t\t\tcloseGameByPlayerID(playerWhoWon);\n\n\t\t\t\t\tanswer.addClientID(playerWhoWonID);\n\n\t\t\t\t\tsendMessage(answer);\n\t\t\t\t\t\n\t\t\t\t\t//inform the AIs that game is over!!\n\n\t\t\t\t}\n\t\t\t}catch(ClassCastException e){\n\n\t\t\t}\n\t}",
"public int checkChasingPlayer()\n {\n if(stunCountdown > 0)\n {\n chasingPlayer = false;\n return stunCountdown;\n }\n if(Game.getInstance().getPlayer().getCurrentRoom().isControlRoom())\n {\n chasingPlayer = false;\n return(-1);\n }\n else\n {\n List<Exit> neighbors = getCurrentRoom().getCollectionOfExits();\n for(Exit neighbor : neighbors)\n {\n if(getCurrentRoom().getExit(neighbor).equals(Game.getInstance().getPlayer().getCurrentRoom()) && neighbor.isOperating())\n {\n chasingPlayer = true;\n return(5 + (int) Math.floor(Math.random() * 6));\n }\n }\n chasingPlayer = false;\n return(-1);\n }\n }",
"public int pideEspectadores (){\n connect();\n int espectadors = 0;\n\n try{\n doStream.writeUTF(\"GIVESPEC\");\n doStream.writeUTF(currentUser.getUserName());\n espectadors = diStream.readInt();\n } catch (IOException e){\n e.printStackTrace();\n }\n disconnect();\n return espectadors;\n }",
"private void checkIfWon() {\r\n\r\n Car temp;\r\n int carInList;\r\n input = new Scanner(System.in);\r\n\r\n System.out.println(\"Which vehicle did you bid on?\");\r\n cars.getListings();\r\n\r\n double winningBid = rng(1, 5000);\r\n\r\n carInList = input.nextInt();\r\n temp = cars.getCar(carInList);\r\n\r\n if (winningBid <= 1000) {\r\n System.out.println(\"You have won the bid! Congratulations!\");\r\n } else {\r\n System.out.println(\"I'm sorry, the selling price was $\" + (int) winningBid + \" above your bid\");\r\n }\r\n removeYourCar(temp);\r\n\r\n }",
"private UserToGame whoDiedFromKillers(UserToGame leader){\n System.out.println(\"Murderes are killing now\");\n if(userToGameService==null){\n return null;\n }\n List<UserToGame> users=userToGameService.getUsersAndMurderersVotes(leader.getGame_id());\n System.out.println(users.toString());\n Collections.sort(users,new Comparator<UserToGame>() {\n @Override\n public int compare(UserToGame o2, UserToGame o1) {\n return Integer.compare(o1.getVotesFromMurderers(), o2.getVotesFromMurderers());\n }\n });\n System.out.println(users.toString());\n if(users.get(0).getVotesFromMurderers()==0){\n return users.get(0);\n }\n users.get(0).setIs_dead(true);\n users.get(0).setIsDeadVisible(false);\n return userToGameService.update(users.get(0));\n }",
"private void endGame(){\n synchronized (lock){\n out.println(\"\\r\\n###GAME OVER###\\r\\n\");\n out.println(\"The winner(s) are:\");\n updatePlayersWorth();\n Collections.sort(playerList);\n out.println(playerList.get(0).getName() + \": £\" + playerList.get(0).getPlayerWorth());\n for (int i = 1; i < playerList.size(); i++) {\n if(playerList.get(0).getPlayerWorth() == playerList.get(i).getPlayerWorth()){\n out.println(playerList.get(i).getName() + \": £\" + playerList.get(i).getPlayerWorth());\n }\n }\n }\n }",
"public void notifyPlayerDefeat(Player p);",
"@Test\n public void downVotingQuestionsGetNoPoints() throws Exception {\n\n bob.upVote(question);\n charlie.downVote(question);\n\n assertEquals(5,alice.getReputation());\n }",
"public static void hitCorrect()\n\t{\n\t\tplayersCards.add(deck.deal());\n\t\tcurrentValue();\n\t\tuserCardImg[playersCards.size()-1].setIcon(new ImageIcon(Gameplay.class.getResource(getCard(playersCards.get(playersCards.size()-1)))));\n\t\tresume();\n\t\tif(calculateHand(playersCards)>21 || playersCards.size()==4 || calculateHand(playersCards)==0)\n\t\t{\n\t\t\troundEnd();\n\t\t}\n\t\t\n\t}",
"public void victory() {\n fieldInerface.setPleasedSmile();\n fieldInerface.timestop();\n int result = fieldInerface.timeGet();\n /*try {\n if (result < Integer.parseInt(best.getProperty(type))) {\n best.setProperty(type, Integer.toString(result));\n fieldInerface.makeChampionWindow(type);\n }\n } catch (NullPointerException e) {\n } catch (NumberFormatException e) {\n best.setProperty(type, Integer.toString(result));\n fieldInerface.makeChampionWindow(type);\n }*/\n\n gamestart = true; // new game isn't started yet!\n for (int j = 0; j < heightOfField; j++)\n for (int i = 0; i < widthOfField; i++)\n if (fieldManager.isCellMined(i, j))\n if (!fieldManager.isCellMarked(i, j)) {\n fieldInerface.putMarkToButton(i, j);\n fieldInerface.decrement();\n }\n gameover = true; // game is over!!\n }",
"public boolean testSouvislostiAStupneVrcholu(){\n\t\t\n\t\tif(!souvislost()){\n\t\t\tvys = \"Graf neni souvisly a proto nemuze byt ani Eulerovsky.\";\n\t\t\treturn false;\n\t\t}\n\t\tif(!muzeBytEuler()){\n\t\t\tvys = \"Stupne vrcholu nejsou bud sude nebo nebo si neodpovida jejich vstupni a vystupni stupen.\";\n\t\t\treturn false;\n\t\t}\n\t\tif(muzeBytEuler() && souvislost()){\n\t\t\tvys =\"Graf je souvisly a zaroven vsechny stupne jsou sude nebo jejich vstupni a vystupni stupen je roven.\";\n\t\t\treturn true;\n\t\t}\n\t\treturn true;\n\t}",
"private void loseCondition() {\n if (player.getHealth() <= 0) {\n lose();\n }\n }",
"@External\n\tpublic BigInteger record_excess() {\n\t\tAddress sender = Context.getCaller();\n\t\t\n\t\tif (!sender.equals( this.roulette_score.get()) ) {\n\t\t\tContext.revert(\"This method can only be called by Roulette score\");\n\t\t}\n\t\tBigInteger positive_excess = BigInteger.ZERO;\n\t\tBigInteger game_developers_amount = BigInteger.ZERO;\n\t\tBigInteger day = BigInteger.ZERO;\n\t\t\n\t\tBigInteger now = BigInteger.valueOf(Context.getBlockTimestamp());\t\t\n\t\tday = day.add(now.divide(U_SECONDS_DAY));\n\t\t\n\t\tfor (int i= 0; i< this.get_approved_games().size(); i++ ) {\n\t\t\tAddress game = this.get_approved_games().get(i);\n\t\t\tBigInteger game_excess = this.todays_games_excess.get(game);\n\t\t\tthis.games_excess_history.at(day.subtract(BigInteger.ONE)).set(game, game_excess);\n\t\t\tif (game_excess!= null &&\n\t\t\t\t\tgame_excess.compareTo(BigInteger.ZERO)>= 0) {\n\t\t\t\tpositive_excess = positive_excess.add(game_excess);\n\t\t\t\tthis.todays_games_excess.set(game, BigInteger.ZERO);\n\t\t\t}\n\t\t}\n\t\tgame_developers_amount = this.game_developers_share.get().multiply(positive_excess);\n\t\tgame_developers_amount = game_developers_amount.divide(BigInteger.valueOf(100L));\n\n\t\treturn game_developers_amount;\n\t}",
"private void removePlayerFromTheGame(){\n ServerConnection toRemove = currClient;\n\n currClient.send(\"You have been removed from the match!\");\n updateCurrClient();\n server.removePlayerFromMatch(gameID, toRemove);\n\n if ( toRemove == client1 ){\n this.client1 = null;\n }\n else if ( toRemove == client2 ){\n this.client2 = null;\n }\n else {\n client3 = null;\n }\n gameMessage.notify(gameMessage);\n\n if ( (client1 == null && client2 == null) || (client2 == null && client3 == null) || (client1 == null && client3 == null) ){\n gameMessage.notify(gameMessage);\n }\n if ( liteGame.isWinner() ) endOfTheGame = true;\n playerRemoved = true;\n }",
"private void discardPrompt() {\r\n\t\tfor (int i = 0; i < mustDiscard.size(); i++) {\r\n\t\t\tString prompt = \"**[Discard]** a card \";\r\n\t\t\tif (mustDiscard.get(i).contentEquals(\"Sleight of Hand\")) {\r\n\t\t\t\tprompt += \"to draw 2 cards\";\r\n\t\t\t} else if (mustDiscard.get(i).contentEquals(\"Apothecary\")) {\r\n\t\t\t\tprompt += \"to choose one: **3** :crossed_swords: **~OR~** **2** :moneybag: **~OR~** **1** :heart:\";\r\n\t\t\t}\r\n\t\t\tgameChannel.sendMessage(prompt).queue();\r\n\t\t}\r\n\t}",
"@Override\n public void run() {\n try {\n pendingConfirms.remove(target.getName(),sender.getName());\n } catch (Exception ignored) {/*player has already confirmed*/}\n }",
"public void clearingResult() {\n\t\tview.writeLog(\"----All players have stopped drawing cards.----\");\n\t\tcountAllPoints();\n\t\tint dealerPoints = dealer.points;\n\t\tview.writeLog(\"The dealer (\" + dealer.name +\") got \"+ dealerPoints+\" points.\");\n\t\tfor(ClientThread player: players) {\n\t\t\tif(player != dealer) {\n\t\t\t\tif(dealerPoints > player.points) {\t//Losers.\n\t\t\t\t\tplayer.send(new Package(\"MESSAGE\",\"Dealer: \"+dealerPoints +\", you: \"+player.points+\". You lose a stack.\"));\n\t\t\t\t\tplayer.send(new Package(\"END\",-1));\n\t\t\t\t\tlosers ++;\n\t\t\t\t}else if(dealerPoints < player.points){\t//Winners.\n\t\t\t\t\tplayer.send(new Package(\"MESSAGE\",\"Dealer: \"+dealerPoints +\", you: \"+player.points+\". You win a stack.\"));\n\t\t\t\t\tplayer.send(new Package(\"END\",1));\n\t\t\t\t\twinners ++;\n\t\t\t\t}else {\t//Those who have same points with dealer.\n\t\t\t\t\tplayer.send(new Package(\"MESSAGE\",\"Dealer: \"+dealerPoints +\", you: \"+player.points+\". Your stacks remains.\"));\n\t\t\t\t\tplayer.send(new Package(\"END\",0));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//Deal with the dealer.\n\t\tint dealerStackChange = losers - winners;\n\t\tview.writeLog(\"The dealer wins \"+ dealerStackChange +\"stack(s).\");\n\t\tdealer.send(new Package(\"MESSAGE\",winners +\" player defeat you, \"+losers+\" lose. Stack change: \"+dealerStackChange));\n\t\tdealer.send(new Package(\"END\", dealerStackChange));\n\t\tendGame();\n\t}",
"protected boolean checkWin(int pno) {\n\t\tint[] pos = playerPosition.get(pno);\n\t\tif (collectedGold.get(pno) >= map.getWin() && \n\t\t\t\tmap.lookAtTile(pos[0], pos[1]) == 'E') {\n\t\t\tremovePlayer(pno);\n\t\t\tSystem.out.println(\"Client \" + pno + \" has escaped!\");\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public boolean lose(){\n\t\tif(steps>limit)\n\t\t\treturn true;\n\t\treturn false;\n\t}",
"@Test\n void removePlayersFromScoreBoardWorksWhenAllPlayersAreRemovedAtOnce(){\n assertEquals(4, scoreboard.getScore().size());\n //add all players to the list of players that should be removed\n List<String> usersToBeRemoved=new ArrayList<>();\n usersToBeRemoved.add(\"A\");\n usersToBeRemoved.add(\"B\");\n usersToBeRemoved.add(\"C\");\n usersToBeRemoved.add(\"D\");\n //remove players\n scoreboard.removePlayersFromScoreBoard(usersToBeRemoved);\n //check that players were removed\n assertTrue(scoreboard.getScore().isEmpty());\n assertTrue(scoreboard.getCorrectlyGuessedMysteryWordsPerPlayer().isEmpty());\n }",
"public boolean gameOver(){\n\t\treturn this.lives < 1;\n\t}",
"private void checkLimit (Connection connection) throws SQLException {\n int checkValeu2 = 2;\n //int checkValeu3 = 3;\n try(ResultSet nrOfInstrumentsRented = checkLimitStmt.executeQuery()){\n while(nrOfInstrumentsRented.next()) {\n System.out.println(\"Count: \" + nrOfInstrumentsRented.getInt(1));\n\n /* //Endast Tester\n if (nrOfInstrumentsRented.getInt(1) == checkValeu2) {\n\n System.out.println(\"Test 1\");\n } else if (nrOfInstrumentsRented.getInt(1) <= checkValeu) {\n System.out.println(\"Test 2\");\n }\n\n */\n\n if(nrOfInstrumentsRented.getInt(1) < checkValeu2){\n System.out.println(\"You have rented \" +\n nrOfInstrumentsRented.getInt(1) + \" instrument(s)\");\n\n rentInstrumentStmt.executeUpdate();\n updateLeaseStmt.executeUpdate();\n System.out.println(\"Instrument has been rented\");\n connection.commit();\n\n } else{\n System.out.println(\"You have already rented 2 instruments\");\n }\n }\n }catch(SQLException e){\n e.printStackTrace();\n connection.rollback();\n }\n }",
"public boolean infect() {\n\t\t/* Remove all events related to this virus */\n\t\tfor (int i = 0; i < Sim.events.size(); i++)\n\t\t\tif (Sim.events.elementAt(i).org.equals(this))\n\t\t\t\tSim.events.elementAt(i).delete = true;\n\n\t\t/* Choose a bacteria to infect */\n\t\tBacterium chosen_bacterium = Sim.bas.get(Sim.randy.nextInt(Sim.bas\n\t\t\t\t.size()));\n\n\t\t/* check probability of successful infection */\n\t\tif ((((1 - chosen_bacterium.prob_surface) * this.prob_surface) >= Sim.randy\n\t\t\t\t.nextDouble())\n\t\t\t\t&& (((1 - chosen_bacterium.prob_enzymes) * this.prob_enzymes) >= Sim.randy\n\t\t\t\t\t\t.nextDouble()) && !chosen_bacterium.infected) {\n\n\t\t\t/* Update virus object */\n\t\t\tthis.current_ba = chosen_bacterium;\n\n\t\t\t/* Update bacteria object */\n\t\t\tchosen_bacterium.infected = true;\n\t\t\tchosen_bacterium.lp = this;\n\n\t\t\t/* Update bas_infected DataSeries in Sim */\n\t\t\tSim.bas_infected++;\n\n\t\t\t/* Create \"switch\" and \"secrete\" event */\n\t\t\tSim.events.add(new Event(this, rate_switch, EVENT_TYPE.SWITCHPHASE));\n\t\t\tSim.events.add(new Event(this, rate_secrete, EVENT_TYPE.SECRETE));\n\n\t\t\treturn true;\n\t\t\t\n\t\t} \n\t\t/* check to see if virus has failed to infect */\n\t\telse{ \n\t\t\n\t\t\t/* Remove this virus from lambda vector and update counters */\n\t\t\tfor (int i = 0; i < Sim.lps.size(); i++) {\n\t\t\t\tif (Sim.lps.elementAt(i).equals(this)) {\n\t\t\t\t\tSim.lps.remove(i);\n\t\t\t\t\tSim.lps_sum_sr -= this.prob_surface;\n\t\t\t\t\tSim.lps_sum_enz -= this.prob_enzymes;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false; \n\t\t}\n\n\t}",
"public void win(int player)\r\n\t{\r\n\t\taccountValue[player]+=pool;\r\n\t\tendRund();\r\n\t}",
"private void evaluateWin(boolean finalCheck)\r\n\t{\r\n\t\t// Stores player and dealer scores in local variables, rather than repeatedly call the get methods\r\n\t\tint scoreP = player1.getTotal();\r\n\t\tint scoreD = dealer.getTotal();\r\n\t\t\r\n\t\t// first check: is the game still going? If it has ended, then no evaluation needs to be made\r\n\t\tif ( !endGame )\r\n\t\t{\r\n\t\t\t/* second check: is this the final evaluation? if not, the first block of statements executes.\r\n\t\t\tIf Player == 21 and Dealer == 21, Tie\r\n\t\t\tIf Player == 21 and Dealer != 21, Player wins\r\n\t\t\tIf Player != 21 and Dealer == 21, Dealer wins\r\n\t\t\tIf Player > 21, Dealer wins at any number\r\n\t\t\tIf Player > Dealer at the end of the game and no one has busted or hit 21, Player wins\r\n\t\t\tThe last check is performed only if finalCheck is true.\r\n\t\t\t*/\r\n\t\t\tif ( !finalCheck )\r\n\t\t\t{\r\n\t\t\t\tif (scoreP > BUST_SCORE)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"You lose...\");\r\n\t\t\t\t\tendGame = true;\r\n\t\t\t\t}\r\n\t\t\t\telse if (scoreP == BUST_SCORE)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (scoreD == BUST_SCORE)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.println(\"It's a tie.\");\r\n\t\t\t\t\t\tendGame = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.println(\"You win!\");\r\n\t\t\t\t\t\tendGame = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t} // end scoreP > BUST_SCORE\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tif (scoreD == BUST_SCORE)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.println(\"You lose...\");\r\n\t\t\t\t\t\tendGame = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (scoreD > BUST_SCORE)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.println(\"You win!\");\r\n\t\t\t\t\t\tendGame = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t} // end ScoreP <= BUST SCORE\r\n\t\t\t} // end finalCheck = false\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// Final victory condition check\r\n\t\t\t\tif ( dealer.getTotal() < player1.getTotal() )\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"You win!\");\r\n\t\t\t\t}\r\n\t\t\t\telse if ( dealer.getTotal() == player1.getTotal() )\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"It's a tie.\");\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"You lose...1\");\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t} // end finalCheck = true\r\n\t\t\r\n\t\t} // end endGame = false if\r\n\t\r\n\t}",
"private void checkPlayersDoneEliminating(int nrDoneEliminating) {\n if (nrDoneEliminating == nrPlayers){\n database.getReference(gameCodeRef).child(\"AllDoneEliminating\").setValue(true);\n database.getReference(gameCodeRef).child(\"PlayersDoneBrainstorming\").setValue(0);\n database.getReference(gameCodeRef).child(\"AllDoneBrainstorming\").setValue(false);\n }\n }",
"public boolean checkWithFragmentingWarhead ()\n {\n List<Player> players = new ArrayList<>();\n\n for (Player playerIterate : player.playerThatSee(player.getSquare().getGameBoard()))\n {\n if (playerIterate.getSquare() != player.getSquare())\n players.add(playerIterate);\n }\n\n for (Player playerIterate : players)\n {\n if (playerIterate.getSquare().getPlayerList().size()>1)\n return true;\n }\n\n return false;\n }",
"public void checkWorkers() throws IOExceptionFromController {\n for (Player player : players) {\n if (!player.hasLost() && player.getWorkers().size() == 0) eliminatePlayer(player, \"outOfWorkers\");\n }\n }",
"public String removePlayer(int pno){\n\t\tplayerPosition.remove(pno);\n\t\tcollectedGold.remove(pno);\n\t\treturn \"You have left the game!\";\n\t}",
"public void playerHasNoSword() {\n\t\tthis.state = cannotBeKilled;\n\t}",
"public static void checkResult() {\n\t\tint sum = PlayerBean.PLAYERONE - PlayerBean.PLAYERTWO;\n\n\t\tif (sum == 1 || sum == -2) {\n\t\t\tScoreBean.addWin();\n\t\t\tresult = \"player one wins\";\n\t\t} else {\n\t\t\tScoreBean.addLoss();\n\t\t\tresult = \"player two wins\";\n\t\t}\n\t}",
"@SuppressWarnings(\"unused\")\n\tprivate synchronized void excludePlayer() throws RemoteException\n\t{\n\t\tPlayerInterface pi;\n\t\tData privateData;\n\t\tData data = this.toExecute.data;\n\t\tPlayerInterface playerToExclude = this.toExecute.player;\n\n\t\tplayerToExclude.excludePlayer();\n\t}",
"private boolean shouldHideInCorner(GameInfo intel) {\n return intel.getNumPlayers() > 2;\n }",
"public void trigger()\r\n\t{\r\n\t\tif(!this.inProgress && this.round >= Config.RoundLimit)\r\n\t\t{\r\n\t\t\tthis.sendMessages(new String[]{\"The game has already ended.\"});\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tint count = this.playerCount();\r\n\t\t\tif(count > 1 && count - this.readyCount() == 0)\r\n\t\t\t{\r\n\t\t\t\tList<String> messages = new LinkedList<>();\r\n\t\t\t\tif(this.inProgress)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(Config.Phases[this.phase].equals(Config.VotePhaseName))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmessages.add(\"Voting ended. Counting votes.\");\r\n\t\t\t\t\t\t// Sum all the votes from each player.\r\n\t\t\t\t\t\tint[] votes = new int[Config.TableCards];\r\n\t\t\t\t\t\tfor(Player player : this.players)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(player != null)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tint[] playerVotes = player.getVotes();\r\n\t\t\t\t\t\t\t\tint i = 0;\r\n\t\t\t\t\t\t\t\twhile(i < playerVotes.length)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tif(playerVotes[i] != 0)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tvotes[i] += playerVotes[i];\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t++i;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tplayer.resetVotes();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// Pick the cards with more yes votes than no votes.\r\n\t\t\t\t\t\tList<Card> picked = new LinkedList<>();\r\n\t\t\t\t\t\tint pos = 0;\r\n\t\t\t\t\t\twhile(pos < this.onTable.size())\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(votes[pos] > 0)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tCard card = this.onTable.get(pos);\r\n\t\t\t\t\t\t\t\tpicked.add(card);\r\n\t\t\t\t\t\t\t\tfor(Share price : this.prices)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tif(price.getStock().equals(card.stock))\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tprice.addShares(card.effect);\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t++pos;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// Prepare the output string for the picked cards.\r\n\t\t\t\t\t\tString message = \"\";\r\n\t\t\t\t\t\tboolean isNotFirst = false;\r\n\t\t\t\t\t\tfor(Card card : picked)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(isNotFirst)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tmessage += \", \";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tisNotFirst = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tmessage += card.stock;\r\n\t\t\t\t\t\t\tif(card.effect > 0)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tmessage += \"+\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tmessage += card.effect;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tthis.dealToTable();\r\n\t\t\t\t\t\tmessages.add(\"Picked influence cards: \" + message);\r\n\t\t\t\t\t\tmessages.add(\"\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t++this.phase;\r\n\t\t\t\t\tif(this.phase >= Config.Phases.length)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tthis.phase = 0;\r\n\t\t\t\t\t\t++this.round;\r\n\t\t\t\t\t\tif(this.round >= Config.RoundLimit)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tthis.stopGame();\r\n\t\t\t\t\t\t\tShare[] prices = this.prices.toArray(new Share[0]);\r\n\t\t\t\t\t\t\tfor(Player player : this.players)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif(player != null)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tplayer.sellAll(prices);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tmessages.add(\"Game over. Scores:\");\r\n\t\t\t\t\t\t\t// Copy and sort the players list by total money.\r\n\t\t\t\t\t\t\tPlayer[] winners = Arrays.copyOf(this.players, this.players.length);\r\n\t\t\t\t\t\t\tArrays.sort(winners, (Player o1, Player o2) -> {\r\n\t\t\t\t\t\t\t\tif(o1 == null && o2 == null)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\treturn 0;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if(o1 == null)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\treturn 1;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if(o2 == null)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\treturn -1;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\treturn o2.getMoney() - o1.getMoney();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\tint lastScore = winners[0].getMoney();\r\n\t\t\t\t\t\t\tint num = 0;\r\n\t\t\t\t\t\t\tint i = 0;\r\n\t\t\t\t\t\t\twhile(i < winners.length)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif(winners[i] == null)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tif(lastScore > winners[i].getMoney())\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tnum = i;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tmessages.add(Config.PlayerPositions[num] + \": Player \" + winners[i].getPlayerNumber() + \", \" + winners[i].getName() + \" - \" + Config.Currency + winners[i].getMoney());\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t++i;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tmessages.add(\"Round \" + (this.round + 1) + \" of \" + Config.RoundLimit + \".\");\r\n\t\t\t\t\t\t\tmessages.add(Config.Phases[this.phase] + \" phase started.\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmessages.add(Config.Phases[this.phase] + \" phase started.\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tthis.inProgress = true;\r\n\t\t\t\t\tmessages.add(\"Game started. Round \" + (this.round + 1) + \" of \" + Config.RoundLimit + \".\");\r\n\t\t\t\t\tmessages.add(Config.Phases[this.phase] + \" phase started.\");\r\n\t\t\t\t}\r\n\t\t\t\tthis.sendMessages(messages.toArray(new String[0]));\r\n\t\t\t\tfor(Player player : this.players)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(player != null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tplayer.setReady(false);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void playerHasSword() {\n\t\tthis.state = canBeKilled;\n\t}",
"public void dealPlayer() {\n //Deal two cards to the player\n playerStack.add(cards[talonStack]);\n playerScore += evaluateCardScore(playerScore, cards[talonStack].rank);\n talonStack++;\n\n playerStack.add(cards[talonStack]);\n playerScore += evaluateCardScore(playerScore, cards[talonStack].rank);\n talonStack++;\n }",
"@EventHandler\n public void onLog(PlayerQuitEvent e) {\n lastAttack.remove(e.getPlayer());\n }",
"@Override\n public boolean test(User user) {\n return user.getPoints() > 160;\n }",
"public boolean nearMaxRescue() {\n double water = this.waterLevel;\n double no = (this.configuration.getMaximalLimitLevel()\n - this.configuration.getMaximalNormalLevel()) / 2;\n if (water > this.configuration.getMaximalLimitLevel()\n || water > this.configuration.getMaximalLimitLevel() - no) {\n return true;\n } else if (water < this.configuration.getMinimalLimitLevel()\n || water < this.configuration.getMinimalLimitLevel() + no) {\n\n return true;\n }\n return false;\n }"
] | [
"0.5849808",
"0.5523759",
"0.5413133",
"0.5231059",
"0.5191919",
"0.5114452",
"0.5107237",
"0.5062321",
"0.49287063",
"0.49201384",
"0.49056268",
"0.48958045",
"0.48666972",
"0.48613563",
"0.4842172",
"0.48126578",
"0.478948",
"0.47637585",
"0.4736943",
"0.47301537",
"0.47237638",
"0.47223026",
"0.4714462",
"0.47085193",
"0.47071707",
"0.46921593",
"0.46888366",
"0.4684213",
"0.4675641",
"0.4668576",
"0.4657683",
"0.46568486",
"0.46521425",
"0.46425024",
"0.4636827",
"0.46366292",
"0.46341795",
"0.4631054",
"0.46303588",
"0.4625284",
"0.46194714",
"0.46133202",
"0.46111146",
"0.4610432",
"0.46032602",
"0.45976108",
"0.4594337",
"0.45715904",
"0.45648655",
"0.4563734",
"0.4560572",
"0.45485052",
"0.45475492",
"0.45271656",
"0.4525554",
"0.45253688",
"0.45227805",
"0.4517726",
"0.4513745",
"0.4505717",
"0.4502294",
"0.45020062",
"0.44937986",
"0.4493042",
"0.44917694",
"0.44807008",
"0.44689193",
"0.44672224",
"0.44650158",
"0.4456188",
"0.4455191",
"0.44532976",
"0.44440138",
"0.4443655",
"0.4419076",
"0.44158423",
"0.44054368",
"0.44020727",
"0.44001094",
"0.4399634",
"0.43880197",
"0.43832526",
"0.43791318",
"0.4376974",
"0.4374506",
"0.43693492",
"0.43687296",
"0.4367738",
"0.4362462",
"0.435888",
"0.43568316",
"0.43546844",
"0.43542698",
"0.4350956",
"0.43495488",
"0.43487483",
"0.43470785",
"0.43425703",
"0.43413806",
"0.43340605"
] | 0.72950363 | 0 |
The eliminate method removes the player whose username matches the suscipiousPlayer field variable from the game. This involves clearing the elim and save voting lists, removing the player from the list of active players,removing them from the list of innocent/mafia and muting the player in chat. | private void eliminateDay() {
dayElimTimer.cancel();
dayElimTimer.purge();
// playerIDs.remove(playerOnTrialID);
players.remove(playerOnTrialID);
if (mafia.contains(playerOnTrialID)) {
int index = mafia.indexOf(playerOnTrialID);
mafia.remove(index);
} else {
int index = innocentIDs.indexOf(playerOnTrialID);
innocentIDs.remove(index);
}
server.setPlayerMuted(playerOnTrialID, true);
server.publicMessage(server.getUsername(playerOnTrialID) + " has been eliminated");
playerOnTrialID = null;
elimDay.clear();
save.clear();
elimDayVoteInProgress = false;
checkWin();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void eliminatePlayer(Player loser){\n players.remove(loser);\n }",
"private void eliminatePlayers() {\n \n Iterator<Player> iter = players.iterator();\n\n while (iter.hasNext()) {\n Player player = iter.next();\n\n if (player.getList().isEmpty()) {\n iter.remove();\n if (player.getIsHuman()) {\n setGameState(GameState.HUMAN_OUT);\n }\n // need to remember that due to successive draws, the active player could run\n // out of cards\n // select a new random player if player gets eliminated\n if (!players.contains(activePlayer)) {\n selectRandomPlayer();\n }\n }\n }\n }",
"public void eliminatePlayer(Character player){\r\n\t\tplayer.setAsPlayer(false);\r\n\t\tSystem.err.println(player.getName() + \" was eliminated\");\r\n\t}",
"private void removePlayerFromTheGame(){\n ServerConnection toRemove = currClient;\n\n currClient.send(\"You have been removed from the match!\");\n updateCurrClient();\n server.removePlayerFromMatch(gameID, toRemove);\n\n if ( toRemove == client1 ){\n this.client1 = null;\n }\n else if ( toRemove == client2 ){\n this.client2 = null;\n }\n else {\n client3 = null;\n }\n gameMessage.notify(gameMessage);\n\n if ( (client1 == null && client2 == null) || (client2 == null && client3 == null) || (client1 == null && client3 == null) ){\n gameMessage.notify(gameMessage);\n }\n if ( liteGame.isWinner() ) endOfTheGame = true;\n playerRemoved = true;\n }",
"CratePrize removeEditingUser(Player player);",
"public void removePlayer(Player player){\n playerList.remove(player);\n }",
"public void delPlayer(final Integer user_id) {\n if (Objects.equals(user_id, current_id)) {\n playersOnGame.clear();\n\n }\n else {\n // Search and remove a player from list\n for ( Player p : playersOnGame) {\n if (p.getUserId() == user_id) {\n playersOnGame.remove(p);\n break;\n }\n }\n }\n\n // Check if the current client is deleted\n if (Objects.equals(user_id, current_id)) {\n playerListLay.removeAllViews();\n playerCards.clear();\n Log.v(\"Del\", String.valueOf(user_id));\n }\n else {\n // Search and remove a player from list\n for (LinearLayout lay : playerCards) {\n if (lay.getTag() == user_id) {\n playerListLay.removeView(lay);\n playerCards.remove(lay);\n break;\n }\n }\n }\n\n // Update number of players\n playerNum.setText(String.valueOf(playersOnGame.size()));\n }",
"private void removePlayerFromLobby() {\n\n //Added Firebase functionality assuming var player is the player who wants to leave the game.\n }",
"public void removePlayer(String name) {\n\t\tfor(Player p : playerList) {\n\t\t\tif(p.getName().equals(name)) {\n\t\t\t\toccupiedPositions.remove(p.getPosition());\n\t\t\t\tif(p.getType() == Player.PlayerType.Agent) {\n\t\t\t\t\treAssignRobots(p);\n\t\t\t\t\tthis.agents -= 1;\n\t\t\t\t}\n\t\t\t\tplayerList.remove(p);\n\t\t\t}\n\t\t}\n\t\tserver.broadcastToClient(name, SendSetting.RemovePlayer, null, null);\n\t\tserver.updateGameplane();\n\t}",
"public void removePlayerFromPlayerListForPlayerName(String playerName) {\n\n for (Player P : fliegeScore.getPlayers()) {\n if (P.getPlayerName().compareTo(playerName) == 0) {\n fliegeScore.getPlayers().remove(P);\n }\n }\n\n }",
"void removeFromGame() {\n\t\t// remove from game\n\t\t//only for multi-player\n\t}",
"public void removePlayer(Nimsys nimSys,ArrayList<Player> list,Scanner keyboard) {\r\n\t\tboolean flag = false;\r\n\t\tIterator<Player> aa = list.iterator();\r\n\t\t\r\n\t\tif(nimSys.commands.length==1){\r\n\t\t\tSystem.out.println(\"Are you sure you want to remove all players? (y/n)\");\r\n\t\t\tString next = keyboard.next();\r\n\t\t\tkeyboard.nextLine();\r\n\t\t\tif(next.equals(\"y\"))\r\n\t\t\t\tlist.clear();\t\r\n\t\t}\r\n\t\t\t\r\n\t\telse{\r\n\t\t\twhile (aa.hasNext()) {\r\n\t\t\t\tPlayer in = aa.next();\r\n\t\t\t\tif(in.getUserName().equals(nimSys.commands[1])){\r\n\t\t\t\t\tlist.remove(in);\r\n\t\t\t\t\tflag = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(flag == false)\r\n\t\t\t\tSystem.out.println(\"The player does not exist.\");\r\n\t\t}\r\n\t\t\r\n\t}",
"boolean removePlayer(String player);",
"public void removePlayer(String p) {\n this.playersNames.remove(p);\n }",
"public void removePlayer(int index) {\n trickPoints.remove(index);\n gamePoints.remove(index);\n lives.remove(index);\n }",
"public void removePlayerDuringGame(String playerName) {\n for (Player player : players) {\n if (player.getName().equals(playerName)) {\n players.remove(player);\n }\n }\n }",
"private void eliminatePlayer(Player player, String reason) throws IOExceptionFromController {\n player.setLost();\n ArrayList<Player> activePlayers = new ArrayList<Player>();\n for (Player activePlayer : players) {\n if (!activePlayer.hasLost()) activePlayers.add(activePlayer);\n }\n if (activePlayers.size() == 1) {\n setWinner(activePlayers.get(0), reason);\n return;\n }\n for (Card modifier : game.getActiveModifiers()) {\n if (modifier.getController().getPlayer().equals(player))\n game.removeModifier(modifier);\n }\n for (Worker worker : player.getWorkers()) {\n player.removeWorker(worker);\n }\n PlayerController controller = playerControllers.get(players.indexOf(player));\n if (controller != null) {\n try {\n playerControllers.get(players.indexOf(player)).getClient().notifyLoss(reason, null);\n } catch (IOException e) {\n checkDisconnection(e, controller);\n }\n }\n broadcastGameInfo(reason);\n }",
"@Override\n public void removePlayer(Player player){\n this.steadyPlayers.remove(player);\n }",
"public ArrayList<Player> checkToEliminate() {\n ArrayList<Player> eliminated = new ArrayList<Player>();\n\n // Check which players are to be eliminated\n for (Player player : playersInGame) {\n if (player.peekCard() == null) {\n eliminated.add(player);\n }\n }\n\n // Eliminate players from model\n for (Player eliminatedPlayer : eliminated) {\n playersInGame.remove(eliminatedPlayer);\n }\n\n return eliminated;\n }",
"public synchronized void delPlayer(@NotNull PlayerInterface player) {\n\n for(BoardCell boardCell[] : board.getGrid()) {\n for(BoardCell b : boardCell) {\n if(b.getWorker() != null) {\n if(b.getWorker().getPlayerWorker().getNickname().equals(player.getNickname())) {\n b.setWorker(null);\n }\n }\n }\n }\n player.getWorkerRef().clear();\n for (int i = 0; i < onlinePlayers.size(); i++) {\n if(onlinePlayers.get(i).getNickname().equals(player.getNickname())) {\n if(started) {\n stateList.remove(i);\n onlinePlayers.remove(i);\n nickNames.remove(player.getNickname());\n }\n break;\n }\n }\n }",
"public void removePlayer(String name) {\n for (Player player : players) {\n if (player.getName() != null && player.getName().equals(name)) {\n player.setState(false);\n for (Piece piece : player.getPieces()) {\n piece.setPosition(0);\n }\n\n // PLAYERLISTENER : Trigger playerEvent for player that LEFTGAME\n for (PlayerListener listener : playerListeners) {\n PlayerEvent event = new PlayerEvent(this, player.getColour(), PlayerEvent.LEFTGAME);\n listener.playerStateChanged(event);\n }\n\n if (player.getName().equals(players.get(activePlayer).getName())) {\n this.setNextActivePlayer();\n }\n }\n }\n }",
"public void removePlayer(String name) {\n\t\tUser user = users.get(userTurn);\n\t\tFootballPlayer player = market.findPlayer(name);\n\t\tdouble marketValue = player.getMarketValue();\n\t\t\n\t\tif (tmpTeam.size() > 0) {\n\t\t\tuser.updateBudget(marketValue, \"+\");\n\t\t\ttmpTeam.removePlayer(name);\n\t\t}\n\t\tSystem.out.println(\"budget after sell\" + user.getBudget());\n\t}",
"@Override\n public void unsuspendPlayer(String username) {\n if (match != null && username != null) {\n match.unsuspendPlayer(username);\n }\n }",
"@Override\n public void removePlayer(String nickname) throws IOException {\n try {\n String sql = \"DELETE FROM sep2database.player WHERE nickname =?;\";\n db.update(sql, nickname);\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }",
"public void removePlayer(Player player){\n for(int x = 0; x < players.size(); x++){\n if(players.get(x) == player){\n players.remove(x);\n }\n }\n }",
"public void removeGuestPlayerFromDB(String username) throws SQLException {\n PreparedStatement stm = T3DB.getConnection().prepareStatement(\n \"delete from GuestPlayer where displayname=?\");\n stm.setString(1, username);\n stm.executeUpdate();\n }",
"private void discardPlayer(Player p)\n {\n locations.remove(p);\n plugin.getAM().arenaMap.remove(p);\n clearPlayer(p);\n }",
"@Test\n void removePlayersFromScoreBoardDoesNothingIfNoPlayerMarkedForRemoval(){\n assertEquals(4, scoreboard.getScore().size());\n //do not add players to the list of players that should be removed\n List<String> usersToBeRemoved=new ArrayList<>();\n //remove players in list\n scoreboard.removePlayersFromScoreBoard(usersToBeRemoved);\n //check that players were removed\n assertEquals(4, scoreboard.getScore().size());\n assertEquals(4,scoreboard.getCorrectlyGuessedMysteryWordsPerPlayer().size());\n }",
"void clean(Player p);",
"public void removePlayer(EntityPlayerMP player)\r\n {\r\n int var2 = (int)player.managedPosX >> 4;\r\n int var3 = (int)player.managedPosZ >> 4;\r\n\r\n for (int var4 = var2 - this.playerViewRadius; var4 <= var2 + this.playerViewRadius; ++var4)\r\n {\r\n for (int var5 = var3 - this.playerViewRadius; var5 <= var3 + this.playerViewRadius; ++var5)\r\n {\r\n PlayerManager.PlayerInstance var6 = this.getPlayerInstance(var4, var5, false);\r\n\r\n if (var6 != null)\r\n {\r\n var6.removePlayer(player);\r\n }\r\n }\r\n }\r\n\r\n this.players.remove(player);\r\n }",
"public void removePlayer(String name) {\n\t\tcreateGameLobbyController.removePlayerFromList(name);\n\t}",
"public void removePlayer(int id) {\n\n Jogador j = this.listaJogadores.get(id);\n\n if(bankruptcy && j.temPropriedades() && j.isBankruptcy()){\n //System.out.println(\"vez: \" + vez + \"id: \" + id );\n jogoInterrompidoEm = vez = voltaVez(vez);\n j.addComandoGiveUp();\n j.removeComandoRoll();\n j.setBankruptcy(true);\n vez = voltaVez(id);\n if(build)\n j.removerComandoBuild();\n }else{\n falirJogador(id);\n }\n\n }",
"public String removePlayer(int pno){\n\t\tplayerPosition.remove(pno);\n\t\tcollectedGold.remove(pno);\n\t\treturn \"You have left the game!\";\n\t}",
"public void removePlayer(Player plr){\r\n\t\t\r\n\t\tlobby.removePlayerFromLobby(plr);\r\n\t\tlobby.updateNames();\r\n\t\tsendNameInfoToAll();\r\n\t\tremoveConnection(plr);\r\n\t}",
"public void remove(Player player) {\n\t\tgetPlayers().remove(player);\n\t\tif (getPlayers().size() < 2) {\n\n\t\t}\n\t}",
"public void RemovePlayer(int game_number, String user)\n\t{\n\t\tgametype[game_number].PlayerLeavesGame(user);\n\t}",
"public void removePlayer(Player player) {\r\n players.remove(player);\r\n player.damage(Double.MAX_VALUE);\r\n }",
"public void removeFromQueue(Player player) {\n }",
"public void removePlayer(String player)\n {\n if (listeners.containsKey(player.toLowerCase())) {\n listeners.remove(player.toLowerCase());\n }\n }",
"public void removePlayerFromTable(Player player){\n\t\tgamePlayers.remove(player);\n\t}",
"public void killPlayer() {\n \tdungeon.removeentity(getX(), getY(), name);\n \t\tdungeon.deleteentity(getX(),getY(),name);\n \t\t//System.out.println(\"YOU LOSE MAMA\");\n \t\t//System.exit(0);\n \t\t\n }",
"@EventHandler\n public void onLog(PlayerQuitEvent e) {\n lastAttack.remove(e.getPlayer());\n }",
"public void removePlayer(Person user) {\r\n\t\trooms[user.getY()][user.getX()].removeOccupant(user);\r\n\t}",
"public void removeUserFromChat(String otherUsername){\n String guiTitle = gui.getTitle();\n guiTitle = guiTitle.replace(\" \" + otherUsername + \" \", \"\");\n gui.setTitle(guiTitle);\n availableUsers.add(username);\n gui.addUserToDropDown(otherUsername);\n userStatuses.remove(otherUsername);\n refreshTypingStatuses(otherUsername);\n gui.addUserExitedMessage(otherUsername);\n }",
"public void RemovePlayerFromList(ClientThread client){\n this.client_List.remove(client);\n if (this.GetPlayerCount() <= 0){\n \tserv.DeleteLobby(this.name);\n }\n }",
"public void removePlayerFromCurrentLobby(LobbyPlayer player) {\n DocumentReference doc = Firebase.docRefFromPath(\"lobbies/\" + player.getLobbyCode());\n doc.update(FieldPath.of(\"players\", player.getUsername()), FieldValue.delete());\n removeListener();\n GameService.removeListener();\n cache = null;\n }",
"@Test\n void removePlayersFromScoreBoardWorksWhenAllPlayersAreRemovedAtOnce(){\n assertEquals(4, scoreboard.getScore().size());\n //add all players to the list of players that should be removed\n List<String> usersToBeRemoved=new ArrayList<>();\n usersToBeRemoved.add(\"A\");\n usersToBeRemoved.add(\"B\");\n usersToBeRemoved.add(\"C\");\n usersToBeRemoved.add(\"D\");\n //remove players\n scoreboard.removePlayersFromScoreBoard(usersToBeRemoved);\n //check that players were removed\n assertTrue(scoreboard.getScore().isEmpty());\n assertTrue(scoreboard.getCorrectlyGuessedMysteryWordsPerPlayer().isEmpty());\n }",
"public void logEliminatedPlayer(Player p)\n\t{\n\t\tif(p instanceof HumanPlayer)\n\t\t\tlog += String.format(\"%nUSER ELIMINATED\");\n\t\telse\n\t\t{\n\t\t\tAIPlayer player = (AIPlayer) p;\n\t\t\tlog += String.format(\"%n%s ELIMINATED\", player.getName().toUpperCase());\n\t\t}\n\t\tlineBreak();\n\t}",
"public static void deletePlayers() throws Exception {\n String id = executeQuery(\"SELECT * FROM players WHERE us_login LIKE '\" + \"PLogin\" + \"%';\", \"us_person_id\");\n while (!id.equals(\"\")) {\n\n executeQuery(\"DELETE FROM transactions WHERE debit_account_id in (select account_id FROM accounts WHERE person_id =\"\n + id + \" )\" + \"OR credit_account_id in (select account_id from accounts where person_id =\" + id + \" );\", \"\");\n\n executeQuery(\"DELETE FROM accounts WHERE person_id = \" + id + \";\", \"\");\n\n executeQuery(\"DELETE FROM persons WHERE person_id = \" + id + \";\", \"\");\n executeQuery(\"DELETE FROM players WHERE us_person_id = \" + id + \";\", \"\");\n\n id = executeQuery(\"SELECT * FROM players WHERE us_login LIKE '\" + \"PLogin\" + \"%';\", \"us_person_id\");\n }\n executeQuery(\"DELETE FROM audit_events WHERE object_name LIKE '\" + \"PLogin\" + \"%';\", \"\");\n }",
"public void remove() {\n\t\tstopFloating();\t\n\t\tPacketHandler.toggleRedTint(player, false);\n\t\tplayer.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 30, 1));\n\t\tplayer.stopSound(Sound.MUSIC_DISC_CHIRP);\n\t\tcleanTasks();\n\t\tactiveScenarios.remove(player.getUniqueId());\n\t}",
"@Override\n\tpublic void deletePlayer(Joueur joueur) {\n\t\t\n\t}",
"public void removePlayer(int a_playerNum)\n {\n //get the player to be removed\n Player playerRemoved = m_currentPlayers.get(a_playerNum - 1);\n //increment the number bankrupt players and set the removed player bankrupt\n m_numOfBankruptPlayers++;\n playerRemoved.setBankrupt();\n //mark the player removed and add it to the finished players list\n m_currentPlayers.set(a_playerNum - 1, playerRemoved);\n m_finishedPlayers.add(playerRemoved);\n }",
"public void removePlayer(Player player) {\n String entry = player.getName();\n Team currentTeam = null;\n\n // Find player team.\n for (Team team : scoreboard.getTeams()) if (team.hasEntry(entry)) currentTeam = team;\n\n // If no team is found, do not continue.\n if (currentTeam == null) return;\n\n // Remove player from the team.\n currentTeam.removeEntry(entry);\n\n ////////////////////////////////////////////////\n // Begin checking to see if we can remove this\n // team from the scoreboard.\n ////////////////////////////////////////////////\n\n // Check if the team has players.\n if (currentTeam.getSize() >= 1) return;\n\n // Check if the team is a default preset.\n for (UserGroup userGroup : UserGroup.values()) {\n if (userGroup.getTeamName().equals(currentTeam.getName())) return;\n }\n\n // If the team has no players and is not a default\n // preset, then lets remove the team from the\n // scoreboard.\n removeTeam(currentTeam.getName());\n }",
"public void nationAssistantsRemove(Player player, String[] names, boolean matchOnline) {\n\t\tResident resident;\n\t\tNation nation;\n\t\ttry {\n\t\t\tresident = plugin.getTownyUniverse().getResident(player.getName());\n\t\t\tnation = resident.getTown().getNation();\n\t\t\tif (!resident.isKing())\n\t\t\t\tthrow new TownyException(\"You are not the king.\");\n\t\t} catch (TownyException x) {\n\t\t\tplugin.sendErrorMsg(player, x.getError());\n\t\t\treturn;\n\t\t}\n\n\t\tnationAssistantsRemove(player, resident, nation, (matchOnline ? plugin.getTownyUniverse().getOnlineResidents(player, names) : getResidents(player, names)));\n\t}",
"void killPlayerByPlayerMove()\n {\n movePlayerToCell(getMonsterCell());\n }",
"public void cmdRemovePlayer(User teller, Player player) {\n boolean removed = tournamentService.removePlayer(player);\n tournamentService.flush();\n if (!removed) {\n command.tell(teller, \"I''m not able to find {0} in the tournament.\", player);\n } else {\n command.tell(teller, \"Done. Player {0} is no longer in the tournament.\", player);\n }\n }",
"public void remove(Player p) {\r\n\t\tAsyncCatcher.enabled = false;\r\n\t\tsboard.remove(p.getUniqueId());\r\n\t\tp.setScoreboard(Bukkit.getScoreboardManager().getNewScoreboard());\r\n\t\tAsyncCatcher.enabled = true;\r\n\t}",
"public static void removePlayers(List<ClientInfo> players) {\n\t\tfor (ClientInfo player : players ) {\n\t\t\tplayersInGame.remove(player);\n\t\t}\n\t}",
"public static void clearPlayerNames() {\r\n\t\tif (GameSetup.choiceBoxPlayer1.isEnabled()) {\r\n\t\t\tGameSetup.choiceBoxPlayer1.select(0);\r\n\t\t\tMain.player1 = \"\";\r\n\t\t}\r\n\r\n\t\tif (GameSetup.choiceBoxPlayer2.isEnabled()) {\r\n\t\t\tGameSetup.choiceBoxPlayer2.select(0);\r\n\t\t\tMain.player2 = \"\";\r\n\t\t}\r\n\r\n\t\tif (GameSetup.choiceBoxPlayer3.isEnabled()) {\r\n\t\t\tGameSetup.choiceBoxPlayer3.select(0);\r\n\t\t\tMain.player3 = \"\";\r\n\t\t}\r\n\t\t\r\n\t\t//Don't show fourth player if playing 3 handed game.\r\n\t\tif (!Main.isThreeHanded) {\r\n\t\t\tif (GameSetup.choiceBoxPlayer4.isEnabled()) {\r\n\t\t\t\tGameSetup.choiceBoxPlayer4.select(0);\r\n\t\t\t\tMain.player4 = \"\";\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public synchronized void removeUser(String username) {\n \n if(this.capacity > 0) {\n \n /* Rimuovo utente dalla HashMap */\n usersList.remove(username);\n \n /* Utente rimosso */\n capacity--;\n \n System.out.println(\"GOSSIP System: \"+username+\" removed from Proxy \"+\n id+\"@\"+address+\":\"+port+\" [Capacity: \"+max_capacity+\n \"][Available: \"+(max_capacity-capacity)+\"]\");\n }\n }",
"public abstract BossBar removePlayer(UUID uuid);",
"public void erasePlayer(Player player) {\n if(player.equals(occupant)) {\n // System.out.println(\"killedToo\");\n revertBlock(player);\n getAdjacent(GameEngine.UP).erasePlayer(player);\n getAdjacent(GameEngine.DOWN).erasePlayer(player);\n getAdjacent(GameEngine.LEFT).erasePlayer(player);\n getAdjacent(GameEngine.RIGHT).erasePlayer(player);\n }\n }",
"@Test\n void removePlayersFromScoreBoardWhenRemovingSinglePlayer(){\n //make sure map is not empty at beginning of game\n assertEquals(4, scoreboard.getScore().size());\n //add player to the list of players that should be removed\n List<String> usersToBeRemoved=new ArrayList<>();\n usersToBeRemoved.add(\"A\");\n //remove players in list\n scoreboard.removePlayersFromScoreBoard(usersToBeRemoved);\n //check that players were removed\n assertEquals(3, scoreboard.getScore().size());\n assertEquals(3,scoreboard.getCorrectlyGuessedMysteryWordsPerPlayer().size());\n assertFalse(scoreboard.getScore().containsKey(\"A\"));\n assertFalse(scoreboard.getCorrectlyGuessedMysteryWordsPerPlayer().containsKey(\"A\"));\n\n }",
"public void del(String nickname) {\r\n // loop through all users\r\n for (int i = this.UserList.size(); i > 0; i--) {\r\n // check if the user matches\r\n User user = (User) this.UserList.get(i - 1);\r\n if (user.nick().equalsIgnoreCase(nickname)) {\r\n this.UserList.remove(i - 1);\r\n }\r\n }\r\n }",
"public void PlayerLeavesGame(String user)\n\t\t{\n\t\t\tplayer_queue.remove(user);\n\t\t}",
"private void deletePlayer(Player p) \r\n\t{\n\t\tlogger.info(\"Deleting player ; '\" + p.getName() +\"'\");\r\n\t\tplayerDao.remove(p);\r\n\t}",
"private void removeFigureFromPlayerCollection(Figure figure, Player player) {\n player.removeFigure(figure);\n }",
"public synchronized void RemovePlayerToGame(String playerName, String IPAddress, Integer portAddress) {\n inGamePlayers.remove(playerName);\n inGamePlayersIP.remove(IPAddress);\n inGamePlayersPort.remove(portAddress);\n }",
"public void removeFromGame(){\n this.isInGame = false;\n }",
"public void removePlayer(UUID id) {\r\n for (Iterator<Player> plIterator = players.iterator(); plIterator.hasNext(); ) {\r\n Player player = plIterator.next();\r\n if (player.getId().equals(id)) {\r\n plIterator.remove();\r\n ((DefaultListModel) playerListGui.getModel()).removeElement(player);\r\n }\r\n }\r\n }",
"@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)\n public void onPlayerQuit(PlayerQuitEvent event)\n {\n Player player = event.getPlayer();\n EMIPlayer playerToRemove = new EMIPlayer();\n for (EMIPlayer ep : RP.getOnlinePlayers())\n {\n if(ep.getUniqueId().equals(player.getUniqueId().toString()))\n playerToRemove = ep;\n }\n RP.getOnlinePlayers().remove(playerToRemove);\n }",
"public void deleteCharFromName() {\n \t\tif (playerName.length() > 0 && state == 4) {\n \t\t\tplayerName = playerName.substring(0, playerName.length() - 1);\n \t\t}\n \t}",
"public void townAssistantsRemove(Player player, String[] names, boolean matchOnline) {\n\t\tResident resident;\n\t\tTown town;\n\t\ttry {\n\t\t\tresident = plugin.getTownyUniverse().getResident(player.getName());\n\t\t\ttown = resident.getTown();\n\t\t\tif (!resident.isMayor())\n\t\t\t\tthrow new TownyException(\"You are not the mayor.\");\n\t\t} catch (TownyException x) {\n\t\t\tplugin.sendErrorMsg(player, x.getError());\n\t\t\treturn;\n\t\t}\n\n\t\ttownAssistantsRemove(player, resident, town, (matchOnline ? plugin.getTownyUniverse().getOnlineResidents(player, names) : getResidents(player, names)));\n\t}",
"public void removePlayer(Player player) {\n\n\t\tplayers.remove(player);\n\t}",
"public void removePlayer(int playerIndex) {\n playersIndicators.remove(playerIndex);\n }",
"public void removeUserFromRoom(String username)\r\n\t{\r\n\t\ttheGridView.removeCharacterFromRoom(username);\r\n\t}",
"@Override\n public void suspendPlayer(String username) {\n if (match != null && username != null) {\n match.suspendPlayer(username);\n }\n }",
"public void unregisterPlayer(final Player p) {\n\t\ttry {\n\t\n\t\n\t\tserver.getLoginConnector().getActionSender().playerLogout(p.getUsernameHash());\n\n\t\t\n\t\tp.setLoggedIn(false);\n\t\tp.resetAll();\n\t\tp.save();\n\t\tMob opponent = p.getOpponent();\n\t\tif (opponent != null) {\n\t\t\tp.resetCombat(CombatState.ERROR);\n\t\t\topponent.resetCombat(CombatState.ERROR);\n\t\t}\n\t\t\n\t\tdelayedEventHandler.removePlayersEvents(p);\n\t\tplayers.remove(p);\n\t\tsetLocation(p, p.getLocation(), null);\n\t\t} catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}",
"public String removePlayer(SocketThread _st) {\n try {\n Element root = docPlayer.getRootElement();\n Element node;\n String xmlId;\n\n for (int i = 0; i < root.getChildren(\"char\").size(); i++) {\n node = (Element) (root.getChildren(\"char\").get(i));\n xmlId = node.getAttributeValue(\"id\");\n if (_st.id.equals(xmlId)) {\n docPlayer.getRootElement().getChildren().remove(i);\n }\n }\n } catch (Exception e) {\n System.out.println(\"Probleme dans Isoplayer : removePlayer\");\n System.out.println(e);\n }\n return null;\n }",
"public static void signOut(String name, Session user) {\n playerList.remove(name);\n user.removeAttribute(\"player\");\n }",
"@SuppressWarnings(\"unused\")\n\tprivate synchronized void excludePlayer() throws RemoteException\n\t{\n\t\tPlayerInterface pi;\n\t\tData privateData;\n\t\tData data = this.toExecute.data;\n\t\tPlayerInterface playerToExclude = this.toExecute.player;\n\n\t\tplayerToExclude.excludePlayer();\n\t}",
"public void removeUser(String username);",
"public void removeUser(String username){\n \t\tString id = username;\n \t\tString query = \"DELETE FROM users WHERE id = '\"+ id + \"';\";\n \t\tsqlUpdate(query);\n \t\tquery = \"DELETE FROM friends WHERE id1 = id OR id2 = '\" + id + \"';\";\n \t\tsqlUpdate(query);\n \t\tquery = \"DELETE FROM achievements WHERE user = id;\";\n \t\tsqlUpdate(query);\n \t\t\n \t\tquery = \"DELETE FROM notes WHERE source = '\" + id + \"' OR dest = '\" + id + \"';\";\n \t\tsqlUpdate(query);\n \t\tquery = \"DELETE FROM challenges WHERE source = '\" + id + \"' OR dest = '\" + id + \"';\";\n \t\tsqlUpdate(query);\n \t\tquery = \"DELETE FROM requests WHERE source = '\" + id + \"' OR dest = '\" + id + \"';\";\n \t\tsqlUpdate(query);\n \t}",
"@EventHandler\n public void onPlayerQuitEvent(PlayerQuitEvent e)\n {\n String playerName = e.getPlayer().getName();\n \n this.afkPlayers.remove(playerName);\n this.afkPlayersAuto.remove(playerName);\n this.afkLastSeen.remove(playerName);\n }",
"private void remove(String name) {\n if (team.getPokemon(name) != null) {\n System.out.println(\"You are going to remove \" + name);\n System.out.println(\"This process is inrevertable, are you sure? [y/n]\");\n String command = input.next();\n if (command.equals(\"y\") || command.equals(\"yes\")) {\n team.remove(name);\n System.out.println(name + \" has been removed form your team\");\n System.out.println(\"You currently have \" + team.count() + \" pokemons in your team\");\n }\n } else {\n System.out.println(name + \" is not found within your team\");\n }\n }",
"@EventHandler(priority = EventPriority.MONITOR)\n public void PlayerQuit(PlayerQuitEvent e){\n plugin.playerIslands.remove(e.getPlayer().getName());\n }",
"public void removePlayer(int playerObjId)\n\t{\n\t\t_floodClient.remove(playerObjId);\n\t}",
"static void removeClient(String username) {\n\t\tif (ConnectedClients.containsKey(username)) {\n\t\t\tConnectedClients.remove(username);\n\t\t\tActiveClients.remove(username);\n\t\t\tSystem.out.println(\"Active clients after removal\"+ActiveClients);\n\t\t\tDML0=new DefaultListModel();\n\t\t\tCurrentClients.setModel(DML0);\n\t\t\tDML0.addAll(ActiveClients);\n\t\t\tCurrentClients.setModel(DML0);\n\t\t}\n\t}",
"public void removeLine(Player p, String objectiveName, String lineName) {\r\n\t\tif(getSB(p).getTeam(lineName) != null) {\r\n\t\t\tfor(String en : getSB(p).getTeam(lineName).getEntries()) {\r\n\t\t\t\tif(getSB(p).getTeam(lineName) != null && getSB(p).getTeam(lineName).hasEntry(en)) {\r\n\t\t\t\t\tgetSB(p).getTeam(lineName).removeEntry(en);\r\n\t\t\t\t\tgetSB(p).resetScores(en);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}",
"public boolean removePlayer(String user){ \r\n\t\t//TODO //What does this mean in the context of the game? do we stop the game? do we check if \r\n\t\t//there is the right number of players...\r\n\t\tif(userToRole.containsKey(user)){\r\n\t\t\tString rid = userToRole.get(user);\r\n\t\t\troleToUser.remove(rid,user);\r\n\t\t\tlog.info(\"removed \" + user + \" from roleToUser\");\r\n\t\t\tInteger x = roleCount.get(rid);\r\n\t\t\troleCount.put(rid,x - 1);\r\n\t\t\tlog.info(\"removed \" + user + \" from roleCount\");\r\n\t\t\tuserReady.remove(user);\r\n\t\t\tlog.info (\"removed \" + user + \" from userReady\");\r\n\t\t\t//Do we want to stop the game, pause the game...\t\r\n\t\t\tsetGameState(GAMESTATE.STOP);\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public void removePlayer(GamePlayer player) {\n\t\tplayer.setCurrentGame(null);\n\t\tplayer.setJoinLocation(null);\n\t\tif (monster != null && monster.equals(player))\n\t\t\tmonster = null;\n\t\tplayers.remove(player);\n\t}",
"public void removeXPlayers(int playerIndex) {\n this.xPlayers.remove(this.xPlayers.indexOf(playerIndex));\n }",
"public void eliminarVentanChat(String usuario) {\n\t\tif (chatPrivados.containsKey(usuario)) {\n\t\t\tMenuVentanaChat uiChat = chatPrivados.get(usuario);\n\t\t\tchatPrivados.remove(usuario);\n\t\t\tuiChat.dispose();\n\t\t} else if (usuario.equals(\"Sala\"))\n\t\t\tchatPublico.dispose();\n\t}",
"public void remove(String playerId) {\n\t Player player = this.getPlayer(playerId);\n\t LOG.info(\"Removing player\" + player);\n\t\t// Step 2 delete it.\n\t\t// Remove it from players in DB\n\t this.playersInDB.remove(player);\n\t}",
"private static void removeUserFromViewerList(String nick) {\r\n synchronized (CURRENT_VIEWERS) {\r\n if (CURRENT_VIEWERS.contains(nick)) {\r\n CURRENT_VIEWERS.remove(nick);\r\n }\r\n }\r\n }",
"public void removePlayer(String color){\n this.getPlayer(color).setActive(false);\n removeXPlayers(this.getPlayer(color).getPIndex());\n turn = this.xPlayers.indexOf(currentPlayer);\n }",
"@Override\n\tpublic void onUnmute(String clientName) {\n\t\t// TODO Auto-generated method stub\n\t\tlog.log(Level.INFO, \"Tiggered sendUnmute()\");\n\t\tIterator<User> iter = users.iterator();\n\t\twhile (iter.hasNext()) {\n\t\t\t// try {\n\t\t\tString name = \"<font color=silver>\" + clientName + \"</font>\";\n\t\t\tUser client = iter.next();\n\t\t\tif (name.equals(client.getName())) {\n\t\t\t\tunmuteName = clientName;\n\t\t\t\tunmuteClient = client;\n\t\t\t\tlog.log(Level.INFO, \"Passed name check\");\n\t\t\t}\n\t\t\t// } catch (ConcurrentModificationException e) {\n\t\t\t// log.log(Level.INFO, \"Caught ConcurrentModification\");\n\t\t\t// }\n\t\t}\n\t\treplaceClient(unmuteName, unmuteClient);\n\t\tlog.log(Level.INFO, \"Reached replaceClient with \" + unmuteName + \" and \" + unmuteClient.getName());\n\t}",
"public void kill()\r\n {\n if(isTouching(TopDownPlayer.class))\r\n {\r\n health(1);\r\n\r\n getWorld().removeObject(player);\r\n //getWorld().addObject (new Test(), 20, 20);\r\n\r\n }\r\n // if(healthCount >= 1)\r\n // {\r\n // World world;\r\n // world = getWorld();\r\n // getWorld().removeObject(player);\r\n // \r\n // getWorld().addObject (new Test(), 20, 20);\r\n // }\r\n }",
"private void removeGuess() {\n\t\tguessList[this.getLastPlayIndex()] = null;\n\t\tif (this.getLastPlayIndex() > 0)\n\t\t\tlastMoveID--;\n\t}",
"public void removePawn() {\n lives = 0;\n }"
] | [
"0.6946225",
"0.6898461",
"0.67437947",
"0.6733237",
"0.6607885",
"0.6412194",
"0.63793993",
"0.63731354",
"0.6329799",
"0.6323359",
"0.63175696",
"0.6309831",
"0.62518144",
"0.6249274",
"0.61808366",
"0.61713904",
"0.6158307",
"0.6137078",
"0.61324763",
"0.613195",
"0.61123776",
"0.60936964",
"0.605848",
"0.6056632",
"0.60508394",
"0.6038334",
"0.6035403",
"0.59976983",
"0.5960622",
"0.59592265",
"0.59354186",
"0.592576",
"0.5852689",
"0.58508426",
"0.58304346",
"0.5827935",
"0.58159614",
"0.57863533",
"0.5762818",
"0.57486296",
"0.57418567",
"0.5740951",
"0.57384384",
"0.57277143",
"0.5714837",
"0.5705195",
"0.5686818",
"0.56651247",
"0.5661089",
"0.56530553",
"0.56457835",
"0.5634197",
"0.5617914",
"0.5609565",
"0.5608347",
"0.56081635",
"0.5598319",
"0.5586658",
"0.5584794",
"0.55674666",
"0.5561851",
"0.55343527",
"0.5526528",
"0.55146515",
"0.55061513",
"0.5505507",
"0.5497679",
"0.54901224",
"0.5485348",
"0.54847103",
"0.54695976",
"0.54661465",
"0.5457511",
"0.5453054",
"0.5442166",
"0.5438333",
"0.543645",
"0.5431861",
"0.54190415",
"0.54187274",
"0.5418096",
"0.54155904",
"0.5411494",
"0.54069036",
"0.5393654",
"0.5382076",
"0.53749526",
"0.5371009",
"0.5370462",
"0.53508425",
"0.53279644",
"0.5316992",
"0.5310158",
"0.5303539",
"0.52959335",
"0.5292246",
"0.5267209",
"0.52610123",
"0.5257653",
"0.525591"
] | 0.65242606 | 5 |
The save method is used to vote against eliminating the current player on trial. The method takes the origin of the message and checks whether the player it corresponds to has already voted (in which case doesn't add their vote) and checks if they had previously voted to eliminate said player (in which case it removes their vote to eliminate the player and adds their vote to save the player). | private void saveVote(String player, int origin) {// suspicious player do
// need
// to vote for themselves
if (players.containsValue(player)) {
OrderedBidiMap<String, Integer> invPlayers = players.inverseBidiMap();
// int playerID = server.getUserID(player);
int playerID = invPlayers.get(player);
if (playerOnTrialID == null) {
server.privateMessage("you cannot vote to save someone when there is no-one on trial", origin);
// } else if (!playerIDs.contains(playerID)) {
} else {
if (playerOnTrialID != playerID) {
server.privateMessage("cannot vote for " + player + " while the vote for "
+ server.getUsername(playerOnTrialID) + " is in progress", origin);
} else if (!players.containsKey(origin)) {
server.privateMessage("you are not in the game, so cannot participate", origin);
} else {
if (elimDay.contains(origin)) {
int index = elimDay.indexOf(origin);
elimDay.remove(index);
}
save.add(origin);
checkSave(origin);
}
}
} else if (!players.containsValue(player)) {
server.privateMessage(player + " is not in this game/has already been eliminated", origin);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void elimDayVote(String player, int origin) {\r\n\r\n\t// int playerID = server.getUserID(player);\r\n\tif (players.containsValue(player)) {\r\n\t OrderedBidiMap<String, Integer> invPlayers = players.inverseBidiMap();\r\n\r\n\t int playerID = invPlayers.get(player);\r\n\r\n\t // if (nightVote.size() > 0) {\r\n\t if (nightVoteInProgress) {\r\n\t\tserver.privateMessage(\r\n\t\t\t\"cannot vote to eliminate a player while there is a vote to change the game to night\", origin);\r\n\r\n\t\t// } else if (!playerIDs.contains(playerID)) { // this is for\r\n\t\t// when\r\n\t\t// using ArrayList of playerIDs\r\n\t } else if (playerID == origin) {\r\n\t\tserver.privateMessage(\"you cannot vote for yourself\", origin);\r\n\r\n\t } else if (elimDay.contains(origin)) {\r\n\t\tserver.privateMessage(\"you have already voted to start\", origin);\r\n\r\n\t } else if (!players.containsKey(origin)) {\r\n\t\tserver.privateMessage(\"you are not in the game, so cannot participate\", origin);\r\n\r\n\t } else if (playerOnTrialID == null) {\r\n\t\telimDayVoteInProgress = true;\r\n\t\tplayerOnTrialID = playerID;\r\n\t\telimDay.add(origin);\r\n\r\n\t\tTimerTask dayElimVoteTimeout = new TimerTask() { // not sure if\r\n\t\t\t\t\t\t\t\t // this\r\n\t\t\t\t\t\t\t\t // will work\r\n\t\t\t\t\t\t\t\t // properly\r\n\t\t\t\t\t\t\t\t // (method\r\n\t\t\t\t\t\t\t\t // should\r\n\t\t\t\t\t\t\t\t // continue\r\n\t\t\t\t\t\t\t\t // without\r\n\t\t\t\t\t\t\t\t // waiting for\r\n\t\t\t\t\t\t\t\t // it\r\n\t\t\t\t\t\t\t\t // to finish\r\n\r\n\t\t @Override\r\n\t\t public void run() {\r\n\t\t\tdayElimVoteTimeout(); // this might need a catch\r\n\r\n\t\t }\r\n\t\t};\r\n\r\n\t\tdayElimTimer = new Timer();\r\n\r\n\t\tdayElimTimer.schedule(dayElimVoteTimeout, 20000);\r\n\r\n\t } else {\r\n\t\tif (playerOnTrialID != playerID) {\r\n\t\t server.privateMessage(\"cannot vote for \" + player + \" while the vote for \"\r\n\t\t\t + server.getUsername(playerOnTrialID) + \" is in progress\", origin);\r\n\t\t} else {\r\n\t\t if (save.contains(origin)) {\r\n\t\t\tint index = save.indexOf(origin);\r\n\t\t\tsave.remove(index);\r\n\t\t }\r\n\r\n\t\t elimDay.add(origin);\r\n\t\t checkElim(origin);\r\n\t\t}\r\n\t }\r\n\t} else if (!players.containsValue(player)) {\r\n\t server.privateMessage(player + \" is not in this game/has already been eliminated\", origin);\r\n\r\n\t}\r\n\r\n }",
"private void savePlayers() {\r\n this.passive_players.stream()\r\n .filter(E -> E.isChanged())\r\n .forEach(e -> {\r\n e.save();\r\n });\r\n }",
"private void botVoting(){\n int stockPos;\n int myStockPos = getMostShares(playerList.lastIndexOf(player));\n Collections.sort(playerList);\n if(playerList.get(0) == player){ //if i am the leader\n stockPos = getMostShares(1); //get the second players info\n }else{\n stockPos = getMostShares(0); //else get the first players info\n }\n\n //if my most shares are the same as other players most shares, don't vote.\n if(game.getStockByIndex(stockPos) != game.getStockByIndex(myStockPos)){\n //offensive play against leader\n if(game.isCardPositive(game.getStockByIndex(stockPos))){\n game.getStockByIndex(stockPos).vote(0);\n player.getVotedStocks().append(game.getStockByIndex(stockPos).getName().charAt(0));\n player.deductVotesLeft();\n System.out.println(\"bot voted NO for \" + game.getStockByIndex(stockPos).getName() );\n }else{\n game.getStockByIndex(stockPos).vote(1);\n player.getVotedStocks().append(game.getStockByIndex(stockPos).getName().charAt(0));\n player.deductVotesLeft();\n System.out.println(\"bot voted YES for \" + game.getStockByIndex(stockPos).getName());\n }\n //defensive play, votes that will benefit me\n if(game.isCardPositive(game.getStockByIndex(myStockPos))){\n game.getStockByIndex(myStockPos).vote(1);\n player.getVotedStocks().append(game.getStockByIndex(myStockPos).getName().charAt(0));\n player.deductVotesLeft();\n System.out.println(\"bot voted YES for \" + game.getStockByIndex(myStockPos).getName());\n }else{\n game.getStockByIndex(myStockPos).vote(0);\n player.getVotedStocks().append(game.getStockByIndex(myStockPos).getName().charAt(0));\n player.deductVotesLeft();\n System.out.println(\"bot voted NO for \" + game.getStockByIndex(myStockPos).getName());\n }\n }\n }",
"public void saveCurrentPlayer() {\n\t\tBashCmdUtil.bashCmdNoOutput(\"touch data/current_player\");\n\t\tBashCmdUtil.bashCmdNoOutput(String.format(\"echo \\\"%s\\\" >> data/current_player\",_currentPlayer));\n\t}",
"private void removePlayerFromLobby() {\n\n //Added Firebase functionality assuming var player is the player who wants to leave the game.\n }",
"@Override\n public void setPlayerDoneEliminating(Player player, boolean value) {\n DatabaseReference currentRef = database.getReference(gameCodeRef).child(\"Players\").child(player.getUsername());\n currentRef.child(\"DoneEliminating\").setValue(value);\n if(value){\n updateNrPlayerValues(\"PlayersDoneEliminating\");\n }\n\n }",
"CratePrize removeEditingUser(Player player);",
"public void endsGameAndSetsWinner(Player player) {\n this.winner = player.getId(); \n this.gameStarted = false; \n \n }",
"void save(int Wave, Set<UUID> players);",
"@Override\r\n\tpublic void save(WechatMember member) {\n\t\t\r\n\t}",
"public static void saveTricksTakenData() {\r\n\t\tMain.player1TricksTaken = FrameUtils.player1TricksTaken.getSelectedItem();\r\n\t\tMain.player2TricksTaken = FrameUtils.player2TricksTaken.getSelectedItem();\r\n\t\tMain.player3TricksTaken = FrameUtils.player3TricksTaken.getSelectedItem();\r\n\t\t\r\n\t\t//Saves the tricks taken if playing with four players.\r\n\t\tif (!Main.isThreeHanded) {\r\n\t\t\tMain.player4TricksTaken = FrameUtils.player4TricksTaken.getSelectedItem();\r\n\t\t}\r\n\t}",
"@EventHandler\r\n\tpublic void onPlayerQuit(PlayerQuitEvent event) {\r\n\t\tUUID uuid = event.getPlayer().getUniqueId();\r\n\t\tmain.getPlayers().get(uuid).saveTask.cancel();\r\n\t\tmain.getPlayers().get(uuid).savePlayer();\r\n\t\tmain.getPlayers().remove(uuid);\r\n\t\t\r\n\t}",
"public String save(){\r\n StringBuilder saveString = new StringBuilder(\"\");\r\n //currentPlayer, numPlayer, players[], \r\n saveString.append(currentPlayer + \" \");\r\n saveString.append(numPlayers + \" \");\r\n \r\n int i = 0;\r\n while(i < numPlayers){\r\n saveString.append(playerToString(players[i]) + \" \");\r\n i = i + 1;\r\n }\r\n\t\t\r\n\t\t//encrypt saveString\r\n\t\tString result = encryptSave(saveString.toString());\r\n \r\n return result;\r\n }",
"@Override\n public void antidote(Player p) {\n LOG.wtf(this.getClass().getSimpleName(), \"ANTIDOTE SET TO \" + p.toString());\n }",
"private void saveUserPlayerId(UserPlayerId userPlayerId) {\n new SaveUserPlayerId(userPlayerId, new SaveUserPlayerId.InvokeOnCompleteAsync() {\n @Override\n public void onComplete(List<UserPlayerId> userPlayerIds) {\n LoggerHelper.showDebugLog(\"===> Save user player id successfully\" + userPlayerId.toString());\n }\n\n @Override\n public void onError(Throwable e) {\n LoggerHelper.showErrorLog(\"Error 329: \", e);\n }\n });\n }",
"void savePlayer(String playerIdentifier, int score, int popID) {\n //save the players top score and its population id\n Table playerStats = new Table();\n playerStats.addColumn(\"Top Score\");\n playerStats.addColumn(\"PopulationID\");\n TableRow tr = playerStats.addRow();\n tr.setFloat(0, score);\n tr.setInt(1, popID);\n\n Constants.processing.saveTable(playerStats, \"data/playerStats\" + playerIdentifier + \".csv\");\n\n //save players brain\n Constants.processing.saveTable(brain.NetToTable(), \"data/player\" + playerIdentifier + \".csv\");\n }",
"@Override\n public void run() {\n try {\n pendingConfirms.remove(target.getName(),sender.getName());\n } catch (Exception ignored) {/*player has already confirmed*/}\n }",
"public void savePlayer(String username, String password, String path, Boolean changed) throws IOException {\r\n ctrlDomain.savePlayer(username, password, path, changed);\r\n }",
"void deleteSlot() {\n String[] scores = readFromFile().split(\"\\n\");\n scores[currPlayer] = defaultScore;\n writeToFile(String.join(\"\\n\", scores));\n currPlayer = -1;\n }",
"public void savePlayers()\r\n {\r\n for(User p : players.values())\r\n {\r\n \r\n }\r\n }",
"@Override\n public void removePlayer(String nickname) throws IOException {\n try {\n String sql = \"DELETE FROM sep2database.player WHERE nickname =?;\";\n db.update(sql, nickname);\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }",
"public void resign(){\n\t\tint turn = DBCommunicator.requestInt(\"SELECT id FROM beurt WHERE spel_id = \" + id + \" AND account_naam = '\" + app.getCurrentAccount().getUsername() + \"' ORDER BY id DESC\");\n\t\tturn += 2;\n\t\tint totalScore = DBCommunicator.requestInt(\"SELECT totaalscore FROM score WHERE spel_id = \" + id + \" AND account_naam = '\" + app.getCurrentAccount().getUsername() + \"'\");\n\t\ttotalScore = totalScore * -1;\n\t\tDBCommunicator.writeData(\"INSERT INTO beurt (id, spel_id, account_naam, score, aktie_type) VALUES(\" + turn + \", \" + id + \", '\" + app.getCurrentAccount().getUsername() + \"', \" + totalScore +\", 'Resign')\");\n\t\tfor(int e : gameStones){\n\t\t\tDBCommunicator.writeData(\"INSERT INTO letterbakjeletter (spel_id, letter_id, beurt_id) VALUES (\" + id + \", \" + e + \", \" + turn + \")\");\n\t\t}\n\t\tDBCommunicator.writeData(\"UPDATE spel SET toestand_type = 'Resigned' WHERE id = \" + id );\n\t\t\n\t\tint opTurn = turn + 1;\n\t\tint myTurn = opTurn + 1;\n\t\tDBCommunicator.writeData(\"INSERT INTO beurt (id, spel_id, account_naam, score, aktie_type) VALUES \"\n\t\t\t\t+ \"(\" + opTurn + \", \" + id + \", '\" + opponent + \"', 0, 'End'),\"\n\t\t\t\t+ \"(\" + myTurn + \", \" + id + \", '\" + app.getCurrentAccount().getUsername() + \"', 0, 'End')\");\n\t}",
"public void cmdRemovePlayer(User teller, Player player) {\n boolean removed = tournamentService.removePlayer(player);\n tournamentService.flush();\n if (!removed) {\n command.tell(teller, \"I''m not able to find {0} in the tournament.\", player);\n } else {\n command.tell(teller, \"Done. Player {0} is no longer in the tournament.\", player);\n }\n }",
"public static void saveSlot(User user, String message) {\n if (!isLoggedIn(user)) {\n return;\n }\n String words[] = message.split(\" \",3);\n if (words.length > 2) {\n String hostmessage = words[2];\n if ((words.length > 2) && (Functions.isNumeric(words[1]))) {\n bot.sendMessageToChannel(\"Saving host command: \" + hostmessage);\n int slot = Integer.parseInt(words[1]);\n if (slot > 0 && slot < 11) {\n try (Connection con = getConnection()) {\n String username = Bot.getUserName(user);\n String query = \"SELECT `slot` FROM \" + mysql_db + \".`save` WHERE `slot` = ? && `username` = ?\";\n PreparedStatement pst = con.prepareStatement(query);\n pst.setInt(1, slot);\n pst.setString(2, username);\n try (ResultSet rs = pst.executeQuery()) {\n boolean empty = true;\n while (rs.next()) {\n empty = false;\n }\n if (empty) {\n query = \"INSERT INTO \" + mysql_db + \".`save` (`serverstring`, `slot`, `username`) VALUES (?, ?, ?)\";\n } else {\n query = \"UPDATE \" + mysql_db + \".`save` SET `serverstring` = ? WHERE `slot` = ? && `username` = ?\";\n }\n pst = con.prepareStatement(query);\n pst.setString(1, hostmessage);\n pst.setInt(2, slot);\n pst.setString(3, username);\n pst.executeUpdate();\n }\n bot.sendMessageToChannel(\"Successfully updated save list.\");\n } catch (SQLException e) {\n logMessage(LOGLEVEL_IMPORTANT, \"SQL Error in 'saveSlot()'\");\n\n }\n } else {\n bot.sendMessageToChannel(\"You may only specify slot 1 to 10.\");\n }\n }\n } else {\n bot.sendMessageToChannel(\"Incorrect syntax! Correct usage is .save 1-10 <host_message>\");\n }\n }",
"private String saveToken(Player player) {\n String token = RandomString.make(10);\n player.setToken(token);\n playerRepository.save(player);\n return token;\n }",
"@Override\r\n public void handleMessage (Message inputMessage) {\n OnUpdatePlayerSubscription.OnUpdatePlayer updatePlayer = response.data().onUpdatePlayer();\r\n\r\n Log.i(TAG, \"updated user is \" + updatePlayer.toString() + \" session id is \" + sessionId);\r\n //checking if the updated player is in this session\r\n if(updatePlayer.session().id().equals(sessionId)){\r\n boolean contains = false;\r\n\r\n //checking if the updated player is in the current player list\r\n for(Player player : players){\r\n\r\n // if we have a match update players lat/long\r\n if(updatePlayer.id().equals(player.getId())){\r\n List<LatLng> bananasList = new LinkedList<>();\r\n bananasList.add(new LatLng(response.data().onUpdatePlayer().lat(),\r\n response.data().onUpdatePlayer().lon()));\r\n player.setLocations(bananasList); // sets location for the player\r\n player.setIt(updatePlayer.isIt());\r\n contains = true;\r\n }\r\n }\r\n\r\n //if the player is in the session, but not in the player list, then make a new player and add them to the players list and add a marker\r\n if(contains == false){\r\n Marker marker = mMap.addMarker(new MarkerOptions()\r\n .position(new LatLng(updatePlayer.lat(), updatePlayer.lon()))\r\n .title(updatePlayer.username()));\r\n Circle circle = mMap.addCircle(new CircleOptions()\r\n .center(new LatLng(updatePlayer.lat(), updatePlayer.lon()))\r\n .radius(tagDistance)\r\n .fillColor(Color.TRANSPARENT)\r\n .strokeWidth(3));\r\n\r\n marker.setIcon(playerpin);\r\n circle.setStrokeColor(notItColor);\r\n\r\n Player newPlayer = new Player();\r\n newPlayer.setId(updatePlayer.id());\r\n newPlayer.setIt(false);\r\n newPlayer.setMarker(marker);\r\n newPlayer.setCircle(circle);\r\n newPlayer.setUsername(updatePlayer.username());\r\n List<LatLng> potatoes = new LinkedList<>();\r\n potatoes.add(new LatLng(updatePlayer.lat(), updatePlayer.lon()));\r\n newPlayer.setLocations(potatoes);\r\n\r\n //adding player to the list of players in the game\r\n players.add(newPlayer);\r\n }\r\n }\r\n// for(Player player : players) {\r\n// if(response.data().onUpdatePlayer().id().equals(player.getId())) {\r\n// // if true (we have a match) update players lat/long\r\n// List<LatLng> bananasList = new LinkedList<>();\r\n// bananasList.add(new LatLng(response.data().onUpdatePlayer().lat(),\r\n// response.data().onUpdatePlayer().lon()));\r\n// player.setLocations(bananasList); // sets location for the player\r\n// //Might have been causing the starting point to move\r\n//// player.getCircle().setCenter(player.getLastLocation());\r\n//// player.getMarker().setPosition(player.getLastLocation());\r\n// }\r\n// }\r\n }",
"private void voteNight(int origin) {\r\n\t// if (playerOnTrialID != null) {\r\n\tif (elimDayVoteInProgress) {\r\n\t server.privateMessage(\"you cannot start a vote for it to be night when there is a vote in progress \"\r\n\t\t + \"to eliminate a player\", origin);\r\n\r\n\t} else if (nightVote.contains(origin)) {\r\n\t server.privateMessage(\"you have already voted to change the game to night\", origin);\r\n\r\n\t} else if (!players.containsKey(origin)) {\r\n\t server.privateMessage(\"you are not in the game, so cannot participate\", origin);\r\n\r\n\t} else {\r\n\t nightVoteInProgress = true;\r\n\r\n\t if (dayVote.contains(origin)) {\r\n\t\tint index = dayVote.indexOf(origin);\r\n\t\tdayVote.remove(index);\r\n\t }\r\n\r\n\t nightVote.add(origin);\r\n\r\n\t if (nightVote.size() == 1) {\r\n\t\tTimerTask nightVoteTimeout = new TimerTask() {\r\n\r\n\t\t @Override\r\n\t\t public void run() {\r\n\t\t\tnightVoteTimeout(); // this might need a catch\r\n\r\n\t\t }\r\n\t\t};\r\n\r\n\t\tnightVoteTimer = new Timer();\r\n\r\n\t\tnightVoteTimer.schedule(nightVoteTimeout, 20000);\r\n\t } else {\r\n\t\tcheckNight(origin);\r\n\t }\r\n\r\n\t}\r\n }",
"@Override\n protected void onSaveInstanceState(Bundle savedInstanceState) {\n savedInstanceState.putInt(\"scorePlayerA\", scorePlayerA);\n savedInstanceState.putInt(\"scorePlayerB\", scorePlayerB);\n savedInstanceState.putInt(\"triesPlayerA\", triesPlayerA);\n savedInstanceState.putInt(\"triesPlayerB\", triesPlayerB);\n super.onSaveInstanceState(savedInstanceState);\n }",
"@Override\n public MessageWrapper[] onMsgReceive(MSGGameVote msg, Player sender) {\n Lobby lobby = playerLobbyMap.get(sender);\n lobby.getGameSession().addVote(msg.isAccepted(), msg.getOrient());\n\n if (lobby.getGameSession().allVoted()) {\n // all players voted, move onto next player\n Player prevPlayer = lobby.getGameSession().getCurrentTurn();\n lobby.getGameSession().nextTurn(false);\n\n Message msgNextTurn = new MSGNewTurn(\n prevPlayer,\n lobby.getGameSession().getCurrentTurn(),\n lobby.getGameSession().getScores().get(prevPlayer),\n false);\n\n // if board is full, end the game\n if (lobby.getGameSession().isBoardFull()) {\n Message msgEndGame = new MSGGameStatus(MSGGameStatus.GameStatus.ENDED, null);\n\n // TODO: Better structure protocol\n // send additional message to end game\n return MessageWrapper.prepWraps(\n new MessageWrapper(msgNextTurn, lobby.getPlayers()),\n new MessageWrapper(msgEndGame, lobby.getPlayers()));\n } else {\n return MessageWrapper.prepWraps(\n new MessageWrapper(msgNextTurn, lobby.getPlayers()));\n }\n }\n\n return null;\n }",
"protected void savePlayers(Context context) {\n\t\tif (context == null) return;\n\n\t\t//Create json\n\t\tJSONObject JSON = new JSONObject();\n\t\ttry {\n\t\t\t//Save\n\t\t\tJSON.put(JSON_ID, m_ID);\n\t\t\tJSON.put(JSON_EMAIL, m_Email);\n\t\t} catch (JSONException e) {}\n\n\t\t//Get access to preference\n\t\t/*SharedPreferences Preference \t= context.getSharedPreferences(PREFERENCE_NAME, Context.MODE_PRIVATE);\n\t\tSharedPreferences.Editor Editor\t= Preference.edit();\n\n\t\t//Save\n\t\tEditor.putString(KEY_PLAYERS, JSON.toString());\n\t\tEditor.commit();*/\n\t}",
"private void removePlayerFromTheGame(){\n ServerConnection toRemove = currClient;\n\n currClient.send(\"You have been removed from the match!\");\n updateCurrClient();\n server.removePlayerFromMatch(gameID, toRemove);\n\n if ( toRemove == client1 ){\n this.client1 = null;\n }\n else if ( toRemove == client2 ){\n this.client2 = null;\n }\n else {\n client3 = null;\n }\n gameMessage.notify(gameMessage);\n\n if ( (client1 == null && client2 == null) || (client2 == null && client3 == null) || (client1 == null && client3 == null) ){\n gameMessage.notify(gameMessage);\n }\n if ( liteGame.isWinner() ) endOfTheGame = true;\n playerRemoved = true;\n }",
"void notifyPlayerHasAnotherTurn();",
"public abstract void sendConfirmationMessage(Player player);",
"public boolean savePlayer(P player){\n String uuid = player.getUniqueId().toString();\n\n if(playerMap.containsKey(player)){\n //Player is safe to save\n List<String> playerAttributes = new ArrayList<String>(getPlayer(player).getPlayerAttributes());\n\n System.out.println(player.getName() + \" has \" + playerAttributes.size() + \" attributes to save.\");\n\n for(int i = 0; playerAttributes.size() > i; i++){\n data.getConfig().set(uuid + \".\" + playerAttributes.get(i), playerMap.get(player).getPlayerAttribute(playerAttributes.get(i)));\n }\n\n data.saveData();\n\n for(int i = 0; playerAttributes.size() > i; i++){\n System.out.println(\"Saved \" + uuid + \".\" + playerAttributes.get(i) + \" as \" + playerMap.get(player).getPlayerAttribute(playerAttributes.get(i)));\n }\n\n return true;\n } else {\n //Player isn't safe to save\n System.out.println(\"Tried to save player \" + player.getName() + \"'s data, but it's not available\");\n return false;\n }\n }",
"@Override\r\n\tpublic void SavePlayerData() {\r\n\r\n Player player = (Player)Player.getPlayerInstance();\r\n\t\t\r\n\t\tString file = \"PlayerInfo.txt\";\r\n\t\tString playerlifepoint = \"\"+player.getLifePoints();\r\n\t\tString playerArmore = player.getArmorDescription();\r\n\t\ttry{\r\n\t\t\tPrintWriter print = new PrintWriter(file);\r\n\t\t\tprint.println(playerlifepoint);\r\n\t\t\tprint.println(playerArmore);\r\n\t\t\t\r\n\t\t}\r\n\t\tcatch(FileNotFoundException e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}",
"public void scoringTrick(){\n wizardRule();\n winner.tricksWon++;\n winner = new Player();\n }",
"@Override\n public void removePlayer(Player player){\n this.steadyPlayers.remove(player);\n }",
"public static void savePlayer(Player player){\n if (player != null){\n try {\n mapper.writeValue(new File(\"Data\\\\PlayerData\\\\\" + getFileName(player) + \".json\"), player);\n } catch ( Exception e ) {\n e.printStackTrace();\n }\n }\n }",
"@Override\n\tpublic void savePlayerData(OutputStream os) {\n\n\t}",
"@Override\n\tpublic void savePlayerData(OutputStream os) {\n\t\t\n\t}",
"@Override\n\tpublic void deletePlayer(Joueur joueur) {\n\t\t\n\t}",
"public boolean applyWinner(UUID winner) {\r\n\t\tPennyGame plugin = PennyGame.getPlugin(PennyGame.class);\r\n\t\tRegisteredServiceProvider<Economy> rsp = plugin.getServer().getServicesManager().getRegistration(Economy.class);\r\n\t\tEconomy econ = rsp.getProvider();\r\n\t\tOfflinePlayer player = Bukkit.getOfflinePlayer(winner);\r\n\t\t\r\n\t\tif(econ.depositPlayer(player, jackpot).transactionSuccess()) {\r\n\t\t\tthis.tickets.clear();\r\n\t\t\tplugin.getSettings().set(\"jackpot\", startingPot);\r\n\t\t\tplugin.getSettings().set(\"last-winner\", player.getName());\r\n\t\t\tplugin.getSettings().set(\"last-winner-sum\", jackpot);\r\n\t\t\tplugin.saveSettings();\r\n\t\t\tjackpot = startingPot;\r\n\t\t\t\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public synchronized void reportVotes() {\n StringBuilder voteReport = new StringBuilder(\"\");\n for (Player player : playerVotes.keySet()) {\n voteReport.append(player.getUserName()).append(\": \").append(\n playerVotes.get(player) ? \"yes\\n\" : \"no\\n\");\n }\n sendPublicMessage(\"The votes were:\\n\" + voteReport.toString());\n }",
"@Override\r\n public void handleMessage(Message message, int origin) {\r\n\r\n\tString text = message.messageText;\r\n\tString remText = \"\";\r\n\tString command = \"\";\r\n\r\n\tif (text.indexOf(' ') < 0) {\r\n\t remText = \"\";\r\n\t command = message.messageText;\r\n\t} else {\r\n\t command = message.messageText.substring(0, text.indexOf(' '));\r\n\t remText = text.substring(text.indexOf(' ') + 1);\r\n\t}\r\n\r\n\tif (!gameInProgress) {\r\n\r\n\t if (command.equals(\"/ready\")) { // no trailing text after /ready\r\n\t\tif (!remText.isEmpty()) {\r\n\t\t server.privateMessage(\"The command \\\"/ready\\\" cannnot have characters after it\", origin);\r\n\t\t} else {\r\n\t\t ready(origin);\r\n\t\t}\r\n\r\n\t } else if (command.equals(\"/unready\")) {\r\n\t\tif (!remText.isEmpty()) {\r\n\t\t server.privateMessage(\"The command \\\"/unready\\\" cannnot have characters after it\", origin);\r\n\t\t} else {\r\n\t\t unready(origin);\r\n\t\t}\r\n\r\n\t } else if (command.equals(\"/start\")) {// no trailing text after\r\n\t\t\t\t\t\t // /start\r\n\r\n\t\tif (!remText.isEmpty()) {\r\n\t\t server.privateMessage(\"The command \\\"/start\\\" cannnot have characters after it\", origin);\r\n\t\t} else {\r\n\t\t voteStart(origin);\r\n\t\t}\r\n\t } else {\r\n\t\tserver.privateMessage(message.messageText + \" does not contain a valid command\", origin);\r\n\t }\r\n\r\n\t} else {\r\n\t if (day == true) {\r\n\r\n\t\tif (command.equals(\"/elim\")) { // space between /elim and player\r\n\t\t // name, no trailing text after\r\n\t\t // player name\r\n\t\t if (remText.isEmpty() || remText.contains(\" \")) {\r\n\t\t\tserver.privateMessage(\r\n\t\t\t\t\"The command \\\"/elim\\\" needs to be followed by a player's name with no spaces/characters thereafter\",\r\n\t\t\t\torigin);\r\n\t\t } else {\r\n\t\t\telimDayVote(remText, origin);\r\n\t\t }\r\n\r\n\t\t} else if (command.equals(\"/save\")) {\r\n\t\t if (remText.isEmpty() || remText.contains(\" \")) {\r\n\t\t\tserver.privateMessage(\r\n\t\t\t\t\"The command \\\"/save\\\" needs to be followed by a player's name with no spaces/characters thereafter\",\r\n\t\t\t\torigin);\r\n\t\t } else {\r\n\t\t\tsaveVote(remText, origin);\r\n\t\t }\r\n\r\n\t\t} else if (command.equals(\"/night\")) {\r\n\t\t if (!remText.isEmpty()) {\r\n\t\t\tserver.privateMessage(\"The command \\\"/night\\\" cannnot have characters after it\", origin);\r\n\t\t } else {\r\n\t\t\tvoteNight(origin);\r\n\t\t }\r\n\r\n\t\t} else if (command.equals(\"/day\")) {\r\n\t\t if (!remText.isEmpty()) {\r\n\t\t\tserver.privateMessage(\"The command \\\"/day\\\" cannnot have characters after it\", origin);\r\n\t\t } else {\r\n\t\t\tvoteDay(origin);\r\n\t\t }\r\n\r\n\t\t} else {\r\n\t\t server.privateMessage(message.messageText + \" does not contain a valid command\", origin);\r\n\t\t}\r\n\r\n\t } else {\r\n\r\n\t\tif (command.equals(\"/elim\")) {\r\n\t\t if (remText.isEmpty() || remText.contains(\" \")) {\r\n\t\t\tserver.privateMessage(\r\n\t\t\t\t\"The command \\\"/elim\\\" needs to be followed by a player's name with no spaces/characters thereafter\",\r\n\t\t\t\torigin);\r\n\t\t } else {\r\n\t\t\telimNightVote(remText, origin);\r\n\t\t }\r\n\t\t} else {\r\n\t\t server.privateMessage(\r\n\t\t\t \"The only valid command during the night is \\\"/elim\\\" followed a player's name (separated by a space)\",\r\n\t\t\t origin);\r\n\t\t}\r\n\t }\r\n\t}\r\n\r\n }",
"void castVote(Peer candidate) {\n votedFor = candidate;\n }",
"public void requestMovePoseUp()\r\n {\r\n \tAnimatedSpriteEditor singleton = AnimatedSpriteEditor.getEditor();\r\n \tAnimatedSpriteEditorGUI gui = singleton.getGUI(); \r\n \t \r\n boolean continueToMove = true;\r\n if (!saved)\r\n {\r\n // THE USER CAN OPT OUT HERE\r\n continueToMove = promptToSave();\r\n }\r\n if(continueToMove)\r\n {\r\n \tposeIO.movePose(poseID, 0);\r\n \tsingleton.getFileManager().reloadSpriteType();\r\n \tsingleton.getGUI().updatePoseList();\r\n \tJOptionPane.showMessageDialog(\r\n gui,\r\n POSE_MOVED_TEXT,\r\n POSE_MOVED_TITLE_TEXT,\r\n JOptionPane.INFORMATION_MESSAGE);\r\n } \r\n }",
"boolean removePlayer(String player);",
"private void voteDay(int origin) {\r\n\tif (!nightVoteInProgress) {\r\n\t server.privateMessage(\"cannot use this command when there isn't a vote to change to night\", origin);\r\n\r\n\t} else if (dayVote.contains(origin)) {\r\n\t server.privateMessage(\"you have already voted to keep the game in the day phase\", origin);\r\n\r\n\t} else if (!players.containsKey(origin)) {\r\n\t server.privateMessage(\"you are not in the game, so cannot participate\", origin);\r\n\r\n\t} else {\r\n\t if (nightVote.contains(origin)) {\r\n\t\tint index = nightVote.indexOf(origin);\r\n\t\tnightVote.remove(index);\r\n\t }\r\n\r\n\t dayVote.add(origin);\r\n\t checkDay(origin);\r\n\t}\r\n }",
"public void requestSavePose() \r\n {\r\n \r\n \t// DON'T ASK, JUST SAVE\r\n boolean savedSuccessfully = poseIO.savePose(currentFile, false);\r\n if (savedSuccessfully)\r\n {\r\n \tposeIO.savePoseImage(currentPoseName, poseID);\r\n // MARK IT AS SAVED\r\n saved = true;\r\n \r\n // AND REFRESH THE GUI\r\n AnimatedSpriteEditor singleton = AnimatedSpriteEditor.getEditor(); \r\n \r\n PoseurStateManager poseurStateManager = singleton.getStateManager().getPoseurStateManager();\r\n poseurStateManager.clearSelectShape();\r\n poseurStateManager.setState(PoseurState.SELECT_SHAPE_STATE);\r\n \r\n }\r\n }",
"@Override\r\n\tpublic void SavePlayerName() {\r\n\t\tPlayer player = (Player)Player.getPlayerInstance();\r\n\t\t\r\n\t\tString file = \"PlayerName.txt\";\r\n\t\tString playerName = player.getName();\r\n\t\ttry{\r\n\t\t\tPrintWriter print = new PrintWriter(file);\r\n\t\t\tprint.println(playerName);\r\n\t\t}\r\n\t\tcatch(FileNotFoundException e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}",
"public void save()\n\t{\n\t\tif(entity != null)\n\t\t\t((SaveHandler)DimensionManager.getWorld(0).getSaveHandler()).writePlayerData(entity);\n\t}",
"public void saveGame(){\n \tsaveOriginator.writeMap(this.map, this.getObjectives(), this.gameState);\n \tsaveGame.saveGame(saveOriginator);\n }",
"private void whichPlayerHasTurn() throws PlayerOutOfTurn {\n if (test.equals(lastPicked)) {\n throw (new PlayerOutOfTurn());\n }\n }",
"public void win(int player)\r\n\t{\r\n\t\taccountValue[player]+=pool;\r\n\t\tendRund();\r\n\t}",
"private void checkElim(int origin) {\r\n\r\n\t// if (elimDay.size() > playerIDs.size() / 2) {\r\n\tserver.publicMessage(players.get(origin) + \" has voted to eliminate \" + server.getUsername(playerOnTrialID));\r\n\r\n\tif (elimDay.size() > players.size() / 2) {\r\n\t eliminateDay();\r\n\t}\r\n\r\n }",
"public void updateWithPointWonBy(Player player) {\n if(managerTennisMatch.statusTennisMatch == \"ClassicalGame\") {\n if (player == player1) {\n managerTennisMatch.checkScoreAndUpdateGame(player, player2);\n } else {\n managerTennisMatch.checkScoreAndUpdateGame(player, player1);\n }\n } else if(managerTennisMatch.statusTennisMatch == \"TieBreakInProgress\") {\n player.setScore(player.getScore() + 1);\n if((player1.getScore() >= 7 && player1.getScore() - player2.getScore() >= 2) || (player2.getScore() >= 7 && player2.getScore() - player1.getScore() >= 2)) {\n tennisSetList.get(tennisSetList.size() - 1).getBaseGameList().add(new TieBreakGame(player));\n player1.setScore(0);\n player2.setScore(0);\n }\n } else {\n return;\n }\n }",
"@Override\n public void writeNewPlayer(Player player){\n if (gameCodeRef == null){\n throw new IllegalStateException(\"GameRoom is not set\");\n }\n DatabaseReference currentRef = database.getReference(gameCodeRef);\n currentRef.child(\"Players\").child(player.getUsername()).setValue(player.getUsername());\n updateNrPlayerValues(\"NumberOfPlayers\");\n }",
"private void check4voteAndClean()\n\t{\n\t\tif( noBeepersPresent())\n\t\t{\tturnLeft();\n\t\t\tmove();\n\t\t\tpickAll();\n\t\t\tturnAround();\n\t\t\tmove();\n\t\t\tmove();\n\t\t\tpickAll();\n\t\t\tturnAround();\n\t\t\tmove();\n\t\t\tturnRight();\n\t\t}\n\t}",
"public boolean promptToSave()\r\n {\r\n // PROMPT THE USER TO SAVE UNSAVED WORK\r\n AnimatedSpriteEditorGUI gui = AnimatedSpriteEditor.getEditor().getGUI();\r\n int selection =JOptionPane.showOptionDialog(gui, \r\n PROMPT_TO_SAVE_TEXT, PROMPT_TO_SAVE_TITLE_TEXT, \r\n JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, \r\n null, null, null);\r\n \r\n // IF THE USER SAID YES, THEN SAVE BEFORE MOVING ON\r\n if (selection == JOptionPane.YES_OPTION)\r\n {\r\n poseIO.savePose(currentFile, false);\r\n poseIO.savePoseImage(currentPoseName, poseID);\r\n saved = true;\r\n }\r\n \r\n // IF THE USER SAID CANCEL, THEN WE'LL TELL WHOEVER\r\n // CALLED THIS THAT THE USER IS NOT INTERESTED ANYMORE\r\n else if (selection == JOptionPane.CANCEL_OPTION)\r\n {\r\n return false;\r\n }\r\n\r\n // IF THE USER SAID NO, WE JUST GO ON WITHOUT SAVING\r\n // BUT FOR BOTH YES AND NO WE DO WHATEVER THE USER\r\n // HAD IN MIND IN THE FIRST PLACE\r\n return true;\r\n }",
"private void saveGame(UserThread user)\n {\n\n\n if (user.getClientID().equals(users[0].getClientID()))\n {\n server.save(GameID, users[0].getClientID(), users[1].getClientID(),\n userBoards[0], userBoards[1], enemyBoards[0], enemyBoards[1]);\n users[0].write(new Msg(MsgType.SAVE_SUCCESS, users[0].getClientID()));\n }\n else\n {\n server.save(GameID, users[1].getClientID(), users[0].getClientID(),\n userBoards[1], userBoards[0], enemyBoards[1], enemyBoards[0]);\n users[1].write(new Msg(MsgType.SAVE_SUCCESS, users[1].getClientID()));\n }\n\n }",
"public void saveHumanMove(String s, int m, int numPlayer){}",
"private void sendWinnerMessage(RaceTrackMessage playerDisconnectsMessage) {\n\t\tif(playerDisconnectsMessage != null)\n\t\t\ttry{\n\n\t\t\t\tint playerWhoWon = getPlayerWhoWonByPlayerID(((DisconnectMessage) playerDisconnectsMessage).getNextPlayerToMove()); \n\t\t\t\tint playerWhoWonID = getPlayerIDWhoWonByPlayerID(((DisconnectMessage) playerDisconnectsMessage).getNextPlayerToMove());\n\t\t\t\tif(playerWhoWon != -1){\n\t\t\t\t\tPoint2D lastVec = null;\n\t\t\t\t\tif(getPlayerMap().get(playerWhoWonID) != null)\n\t\t\t\t\t\tlastVec = getPlayerMap().get(playerWhoWonID).getCurrentPosition();\n\n\n\t\t\t\t\tPlayerWonMessage answer;\n\n\t\t\t\t\tanswer = VectorMessageServerHandler.generatePlayerWonMessage(playerWhoWon, playerWhoWon, lastVec);\n\n\t\t\t\t\tcloseGameByPlayerID(playerWhoWon);\n\n\t\t\t\t\tanswer.addClientID(playerWhoWonID);\n\n\t\t\t\t\tsendMessage(answer);\n\t\t\t\t\t\n\t\t\t\t\t//inform the AIs that game is over!!\n\n\t\t\t\t}\n\t\t\t}catch(ClassCastException e){\n\n\t\t\t}\n\t}",
"void otherPlayerMoved()\r\n {\r\n socketWriter.println(\"OPPONENT_MOVED ,\" + getCurrentBoard());\r\n }",
"public void takeOut(final StandardPlayer p) {\n if (p == firstPlayerOnPos[p.getPosR()][p.getPosC()]) {\n firstPlayerOnPos[p.getPosR()][p.getPosC()]\n = secondPlayerOnPos[p.getPosR()][p.getPosC()];\n }\n secondPlayerOnPos[p.getPosR()][p.getPosC()] = null;\n deadPlayers[p.getPosR()][p.getPosC()].add(p);\n }",
"@EventHandler\n public void onLog(PlayerQuitEvent e) {\n lastAttack.remove(e.getPlayer());\n }",
"public static boolean DeleteOtherPlayer(Context context) {\n SharedPreferences prefs = context.getSharedPreferences(PREF, Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = prefs.edit();\n prefs.edit().remove(\"OtherPlayer\");\n //prefs.edit().commit();\n prefs.edit().apply();\n return true;\n }",
"private void receiveVote() {\n\t\t//Se la postazione termina la connessione informiamo lo staff con un messaggio di errore\n\t\tif(!link.hasNextLine()) {\n\t\t\tcontroller.printError(\"Errore di Comunicazione\", \"La postazione \"+ ip.getHostAddress() + \" non ha inviato i pacchetti di voto.\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//Vengono recuperati i voti cifrati\n\t\tMessage request;\n\t\tWrittenBallot[] encryptedBallots;\n\t\ttry {\n\t\t\trequest = (Message) Message.fromB64(link.read(), \"postazione \" + ip.getHostAddress());\n\t\t\tString[] required = {\"encryptedBallots\"};\n\t\t\tClass<?>[] types = {WrittenBallot[].class};\n\t\t\t\n\t\t\trequest.verifyMessage(Protocol.sendVoteToStation, required, types, \"postazione \" + ip.getHostAddress());\n\t\t\tencryptedBallots = request.getElement(\"encryptedBallots\");\n\t\t\t\n\t\t\t//I voti vengono memorizzati nel seggio in attesa dell'invio all'urna\n\t\t\tif(((Controller) controller).storeVoteLocally(encryptedBallots, ip))\n\t\t\t\tlink.write(Protocol.votesReceivedAck);\n\t\t\telse\n\t\t\t\tlink.write(Protocol.votesReceivedNack);\n\t\t\t\n\t\t} catch (PEException e) {\n\t\t\tlink.write(Protocol.votesReceivedNack);\n\t\t\tcontroller.printError(e);\n\t\t}\n\t}",
"public void saveAllPlayers() {\n for (Player player : bukkitService.getOnlinePlayers()) {\n savePlayer(player);\n }\n }",
"public void onSaveListen() {\n _gamesList.get(_gamePos).getPlayers().add(playerName);\n // Increment the number of players that have joined the game\n _gamesList.get(_gamePos).setNumPlayers(_gamesList.get(_gamePos).getNumPlayers() + 1);\n\n TextView playersBlock = (TextView) findViewById(R.id.playersBlock);\n playersBlock.setText(\"\");\n List<String> players = _gamesList.get(_gamePos).getPlayers();\n for(int i = 0; i < players.size(); i++) {\n Log.d(\"GamePlayerSize\", Integer.toString(_gamesList.get(_gamePos).getPlayers().size()));\n if (i < players.size() - 1) {\n playersBlock.append(players.get(i) + \", \");\n }\n else {\n // Don't put a comma after the last one\n playersBlock.append(players.get(i));\n }\n }\n\n // Update the shared preferences with the edited game\n SharedPreferences gamesPref = this.getSharedPreferences(GAMES_FILE, MODE_PRIVATE);\n Gson gson = new Gson();\n\n SharedPreferences.Editor prefsEditor = gamesPref.edit();\n\n // Convert the games list into a json string\n String json = gson.toJson(_gamesList);\n Log.d(\"MainActivity\", json);\n\n // Update the _gamesMasterList with the modified _game\n prefsEditor.putString(GAME_KEY, json);\n prefsEditor.commit();\n\n Context context = getApplicationContext();\n CharSequence text = \"You have joined the game!\";\n int duration = Toast.LENGTH_SHORT;\n\n Toast toast = Toast.makeText(context, text, duration);\n toast.show();\n }",
"public void resign(PlayerController player)\n {\n if(player instanceof GameController){\n winSend.sendWin(opponent);\n setWinSent(false);\n }\n if (player1 == player) {\n win(PLAYER_2_FLAG);\n } else if (player2 == player) {\n win(PLAYER_1_FLAG);\n }\n }",
"private void Lose(Player player){\n player.setBalance(player.getBalance() - player.getWager());\n System.out.println();\n System.out.println(player.getName() + \" lost :/\");\n System.out.println(player.getName() + \"'s\" + \" balance is now \" + player.getBalance());\n }",
"@Override\n\tpublic void savePlayerData(OutputStream arg0) {\n\n\t}",
"private void eliminatePlayer(Player loser){\n players.remove(loser);\n }",
"@Override\n public void setWinner(Player winner)\n {\n for(int i = 0; i < gc.getF().size(); i++)\n {\n if(gc.getF().get(i).readyStart() == 0 || gc.getF().get(i).readyStart() == 1)\n {\n gc.getF().get(gc.getF().size() -1).addPlayer(this.winner);\n sl.save(\"The winner of QuarterFinal ID: \" + this.getGameID() + \" is: \"\n + winner.getName(), \"qfwinners.txt\");\n gc.getGameHistory().add(this); \n System.out.println(winner.getName() + \" has won the round! Player added to the Final!\");\n return;\n }\n }\n //If there are no available spots, make a new game\n Final f = new Final();\n System.out.println(\"created a new Final!\");\n f.addPlayer(winner);\n //Save winner details\n sl.save(\"The winner of QuarterFinal ID: \" + this.getGameID() + \" is: \"\n + winner.getName(), \"qfwinners.txt\");\n \n gc.getF().add(f);\n //Move game to history \n gc.getGameHistory().add(this); \n System.out.println(winner.getName() + \" has won the round! Player added to the Final!\");\n \n }",
"private void updateTokens(ArrayList<Player> winners) {\r\n // le joueur courant a-t-il été traité ? (gagné ou perdu)\r\n boolean done;\r\n for(Player player : players) {\r\n if( ! player.isDealer()) {\r\n done = false;\r\n for(Player winner : winners) {\r\n if(winner == player) {\r\n done = true;\r\n int gain = player.getStake();\r\n String txt = \"\";\r\n if(total(player).max() == 32) {\r\n gain = (int) (gain * 1.5);\r\n txt = \"avec un blackjack\";\r\n }\r\n player.addTokens(gain);\r\n Logger.write(player.getName() + \" a gagné \" + txt + \", il reçoit \" + gain + \" jetons [\" + player.getTokens() + \"]\");\r\n }\r\n }\r\n if(! done) {\r\n player.removeTokens(player.getStake());\r\n Logger.write(player.getName() + \" a perdu, il donne \" + player.getStake() + \" au croupier. [\" + player.getTokens() + \"]\");\r\n // si le joueur n'a plus de jetons, il quitte la partie.\r\n if(player.getTokens() <= 0) {\r\n players.remove(player);\r\n Logger.write(player.getName() + \" n'a plus de jetons, il quitte la partie.\");\r\n }\r\n }\r\n }\r\n }\r\n }",
"@Override\r\n\tpublic void delete(Player t) {\n\r\n\t}",
"public void voteEnd(String playerID) {\r\n\t\tfor (int i = 0; i < players.size(); i++) {\r\n\t\t\tPlayer p = players.get(i);\r\n\t\t\tif (p.getPlayerID().contentEquals(playerID) && !p.votedForEnd()) {\r\n\t\t\t\tp.setVotedForEnd(true);\r\n\t\t\t\tvotedForEnd++;\r\n\t\t\t\tgameChannel.sendMessage(\"**\"+Utils.getName(playerID, guild)+\"** voted to end the game prematurely\").queue();\r\n\t\t\t\t// Needs one less than playerCount\r\n\t\t\t\tif (votedForEnd >= (playerCount-1)) gameOver();\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private void saveScore() {\n try {\n PrintWriter writer = new PrintWriter(new FileOutputStream(new File(Const.SCORE_FILE), true));\n writer.println(this.player.getName() + \":\" + this.player.getGold() + \":\" + this.player.getStrength());\n writer.close();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n }",
"public void removeFromQueue(Player player) {\n }",
"@Override\n\tpublic void savePlayerData(OutputStream arg0)\n\t{\n\n\t}",
"public void save() {\n settingService.saveMaxScore(score);\r\n// powerUpCount = 0;\r\n// powerDownCount = 0;\r\n// purplePowerCount = 0;\r\n// yellowMadnessCount = 0;\r\n// shapeCount = 0;\r\n }",
"@Override\n public void submitAnswer(PlayerAnswer playerAnswer) {\n\n\n }",
"private void wins(Player player){\n int win = 1;\n player.setWins(win);\n }",
"public void sendOpponents(ArrayList<Player> plist, Player sentTo) {\n try {\n // Send the number of players being sent\n sendNumOpponents(plist.size()-1);\n for (Player p : plist) {\n if (p != sentTo) { // Do not send player self data as opponent\n dOut.writeObject(p);\n dOut.flush();\n }\n }\n } catch (IOException e) {\n System.out.println(\"Could not send player objects\");\n e.printStackTrace();\n }\n }",
"@Override\n public void onClick(DialogInterface dialog, int which) {\n\n for (int i = 0; i < p.length; i++) {\n if (pChecked[i]) { // if a name is selected\n\n selectedPlayers.remove(p[i]); // remove the player from the list of selected players\n players.remove(p[i]); // remove it from the list of names to save\n savedNames = players.toString(); // convert the list of names to a single string that will be saved later\n savedNames = savedNames.replaceAll(\"\\\\[\", \"\").replaceAll(\"\\\\]\", \"\"); // the new string will include the list's square brackets. This removes them.\n SharedPreferences.Editor editor = prefs.edit();\n editor.putString(\"savedNames\", savedNames); // save the new list of players' names\n editor.commit();\n pChecked[i] = false; // untick the name\n }\n }\n }",
"public Player updatePlayer(Player player);",
"void handle(VoteMessage vote);",
"void endGame(String message, int player) {\n //changes the colour of the buttons back to the winner's colour (red or blue)\n if (player == 0) {\n changeColourButton(new Color(255, 0, 0));\n } else {\n changeColourButton(new Color(0, 0, 255));\n }\n //stops the game from continuing\n disableButtons();\n //saves the winner to the leaderboards\n saveGame(message, player);\n //Determmines if the message is \"It's a Tie!\". If it is the pop up has the \n //message \"It's a Tie!\". Otherwise the pop up has the message \"The winner is: \" \n //plus the winner.\n if (message.equals(\"It's a Tie!\")) {\n EndPopUp.showMessageDialog(this, message);\n } else {\n EndPopUp.showMessageDialog(this, \"The winner is: \" + message);\n }\n\n //updates leaderboard (garbage String argument)\n changeTopScores.setName(\"asdf\");\n }",
"private void save() {\n Saver.saveTeam(team);\n }",
"public void submitSaveRequest(GameSession session, Player player) {\n\t\texecutor.submit(() -> {\n\t\t\ttry {\n\t\t\t\tserializer.savePlayer(player);\n\t\t\t} catch (Exception e) {\n\t\t\t\tlogger.error(\"Unable to save players game.\", e);\n\t\t\t} finally {\n\t\t\t\tsession.handlePlayerSaverResponse();\n\t\t\t}\n\t\t});\n\t}",
"public void onUndo() {\n game.undoLastTurn(player1);\n game.undoLastTurn(computer);\n if (player1.getRollCount() == 0 && computer.getRollCount() == 0) {\n setDefault(\"player\");\n setDefault(\"computer\");\n undoButton.setDisable(true);\n resetButton.setDisable(true);\n } else {\n updateFields(\"player\");\n updateFields(\"computer\");\n }\n }",
"void gameTurn(int move){\n int gameWon = -1;\n boolean gameTie = false;\n //set the board to a move and print it\n if (loggedInUser.myGame.currentLetter.equals(\"X\")){\n gameBoard [move] = 1;\n printMove(move,\"X\");\n }\n else{\n gameBoard[move] = 2;\n printMove(move,\"O\");\n }\n //Update the status of the buttons graying out the ones that were played\n updateButtons();\n\n //checks if the game has been won or not\n gameWon = checkGameWon();\n\n //check of the game has been tied\n gameTie = checkTie();\n\n Game game = new Game(loggedInUser.opponentId);\n game.currentMove = move;\n\n if (loggedInUser.myGame.currentLetter.equals(\"X\")){\n game.currentLetter = \"O\";\n }else {\n game.currentLetter = \"X\";\n }\n\n //if the game hasn't been won and the game hasnt been tied the other playesr turn is made\n if(gameWon != 0 && !gameTie){\n game.gameInProgress = true;\n }\n //if game won\n else if (gameWon != 0){\n //remove all of the buttons\n removeAllButtons();\n game.gameInProgress = false;\n }\n else{\n playerText.setText(\"The game is tie\");\n turn.setText(\"No one wins\");\n game.gameInProgress = false;\n }\n\n //set data\n mDatabaseRef.child(loggedInUser.myId).child(\"myGame\").setValue(game);\n mDatabaseRef.child(loggedInUser.opponentId).child(\"myGame\").setValue(game);\n }",
"public void setOppositePlayer(Player P){\n this.oppositePlayer = P;\n }",
"@Override\n public void setPlayerDoneBrainstorming(Player player, boolean value){\n DatabaseReference currentRef = database.getReference(gameCodeRef).child(\"Players\").child(player.getUsername());\n currentRef.child(\"DoneBrainstorming\").setValue(value);\n if(value){\n updateNrPlayerValues(\"PlayersDoneBrainstorming\");\n }\n }",
"private void saveUnsyncedDonor() {\n LocalDonor ldonor = LocalDonor.convert(donor,realm);\n realm.beginTransaction();\n realm.copyToRealmOrUpdate(ldonor);\n realm.commitTransaction();\n Toast.makeText(this, \"Donor record save.\", Toast.LENGTH_LONG).show();\n finish();\n }",
"public void setWinner(Player winner) {\n this.winner = winner;\n }",
"@EventHandler\n public void OnPlayerInteractEvent(PlayerInteractEvent e)\n {\n this.setLastSeen(e.getPlayer());\n }",
"@Override\n public int save( Mention obj ) {\n return 0;\n }",
"public ScoreboardSign(Player player, String objectiveName) {\n this.player = player;\n this.objectiveName = objectiveName;\n }",
"private void saveGame(){\n\t\t\n\t}"
] | [
"0.57768923",
"0.5517959",
"0.55023736",
"0.5431684",
"0.5266996",
"0.5247911",
"0.5187668",
"0.5141809",
"0.5133842",
"0.5132507",
"0.51284164",
"0.51078767",
"0.5105188",
"0.509159",
"0.5044511",
"0.50381064",
"0.50144523",
"0.50117123",
"0.49788782",
"0.49732694",
"0.49700075",
"0.4959017",
"0.4957681",
"0.49539977",
"0.49381694",
"0.4920245",
"0.4920219",
"0.4910063",
"0.49079758",
"0.49074706",
"0.49057972",
"0.49008095",
"0.4899967",
"0.48924664",
"0.4883186",
"0.48769766",
"0.48692593",
"0.48611227",
"0.48605284",
"0.48588386",
"0.4857542",
"0.4856505",
"0.48476854",
"0.48462617",
"0.4841903",
"0.48392984",
"0.4837229",
"0.4836201",
"0.48268676",
"0.48207715",
"0.48104534",
"0.4804931",
"0.47973302",
"0.47816944",
"0.47697893",
"0.4768163",
"0.47615302",
"0.4757794",
"0.47540206",
"0.47526047",
"0.47503272",
"0.4745359",
"0.47432333",
"0.47406155",
"0.47384346",
"0.47349975",
"0.47284457",
"0.47218958",
"0.47095287",
"0.47019324",
"0.46869797",
"0.46853614",
"0.4682179",
"0.46817642",
"0.4678267",
"0.46747425",
"0.46716818",
"0.46668682",
"0.4663059",
"0.46604893",
"0.46596104",
"0.46585518",
"0.46495622",
"0.46444356",
"0.4640186",
"0.46393412",
"0.46354824",
"0.46243697",
"0.46222422",
"0.46217987",
"0.4614187",
"0.46100938",
"0.46077308",
"0.46035677",
"0.4600209",
"0.45981318",
"0.45926014",
"0.45896122",
"0.4582949",
"0.45812723"
] | 0.7939487 | 0 |
The voteNight method either starts the vote to change the game to night or adds subsequent votes to the total number of night votes. It also takes the origin of the message and checks whether the player it corresponds to has already voted to change to night (in which case doesn't add their vote) and checks if they have already voted for day (in which case it removes their vote from night and adds their vote to night). | private void voteNight(int origin) {
// if (playerOnTrialID != null) {
if (elimDayVoteInProgress) {
server.privateMessage("you cannot start a vote for it to be night when there is a vote in progress "
+ "to eliminate a player", origin);
} else if (nightVote.contains(origin)) {
server.privateMessage("you have already voted to change the game to night", origin);
} else if (!players.containsKey(origin)) {
server.privateMessage("you are not in the game, so cannot participate", origin);
} else {
nightVoteInProgress = true;
if (dayVote.contains(origin)) {
int index = dayVote.indexOf(origin);
dayVote.remove(index);
}
nightVote.add(origin);
if (nightVote.size() == 1) {
TimerTask nightVoteTimeout = new TimerTask() {
@Override
public void run() {
nightVoteTimeout(); // this might need a catch
}
};
nightVoteTimer = new Timer();
nightVoteTimer.schedule(nightVoteTimeout, 20000);
} else {
checkNight(origin);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void voteDay(int origin) {\r\n\tif (!nightVoteInProgress) {\r\n\t server.privateMessage(\"cannot use this command when there isn't a vote to change to night\", origin);\r\n\r\n\t} else if (dayVote.contains(origin)) {\r\n\t server.privateMessage(\"you have already voted to keep the game in the day phase\", origin);\r\n\r\n\t} else if (!players.containsKey(origin)) {\r\n\t server.privateMessage(\"you are not in the game, so cannot participate\", origin);\r\n\r\n\t} else {\r\n\t if (nightVote.contains(origin)) {\r\n\t\tint index = nightVote.indexOf(origin);\r\n\t\tnightVote.remove(index);\r\n\t }\r\n\r\n\t dayVote.add(origin);\r\n\t checkDay(origin);\r\n\t}\r\n }",
"private void checkNight(int origin) {\r\n\tserver.publicMessage(players.get(origin) + \" has voted for it to remain night\");\r\n\r\n\t// if (nightVote.size() > playerIDs.size() / 2) {\r\n\tif (nightVote.size() > players.size() / 2) {\r\n\t night();\r\n\t}\r\n }",
"private void elimDayVote(String player, int origin) {\r\n\r\n\t// int playerID = server.getUserID(player);\r\n\tif (players.containsValue(player)) {\r\n\t OrderedBidiMap<String, Integer> invPlayers = players.inverseBidiMap();\r\n\r\n\t int playerID = invPlayers.get(player);\r\n\r\n\t // if (nightVote.size() > 0) {\r\n\t if (nightVoteInProgress) {\r\n\t\tserver.privateMessage(\r\n\t\t\t\"cannot vote to eliminate a player while there is a vote to change the game to night\", origin);\r\n\r\n\t\t// } else if (!playerIDs.contains(playerID)) { // this is for\r\n\t\t// when\r\n\t\t// using ArrayList of playerIDs\r\n\t } else if (playerID == origin) {\r\n\t\tserver.privateMessage(\"you cannot vote for yourself\", origin);\r\n\r\n\t } else if (elimDay.contains(origin)) {\r\n\t\tserver.privateMessage(\"you have already voted to start\", origin);\r\n\r\n\t } else if (!players.containsKey(origin)) {\r\n\t\tserver.privateMessage(\"you are not in the game, so cannot participate\", origin);\r\n\r\n\t } else if (playerOnTrialID == null) {\r\n\t\telimDayVoteInProgress = true;\r\n\t\tplayerOnTrialID = playerID;\r\n\t\telimDay.add(origin);\r\n\r\n\t\tTimerTask dayElimVoteTimeout = new TimerTask() { // not sure if\r\n\t\t\t\t\t\t\t\t // this\r\n\t\t\t\t\t\t\t\t // will work\r\n\t\t\t\t\t\t\t\t // properly\r\n\t\t\t\t\t\t\t\t // (method\r\n\t\t\t\t\t\t\t\t // should\r\n\t\t\t\t\t\t\t\t // continue\r\n\t\t\t\t\t\t\t\t // without\r\n\t\t\t\t\t\t\t\t // waiting for\r\n\t\t\t\t\t\t\t\t // it\r\n\t\t\t\t\t\t\t\t // to finish\r\n\r\n\t\t @Override\r\n\t\t public void run() {\r\n\t\t\tdayElimVoteTimeout(); // this might need a catch\r\n\r\n\t\t }\r\n\t\t};\r\n\r\n\t\tdayElimTimer = new Timer();\r\n\r\n\t\tdayElimTimer.schedule(dayElimVoteTimeout, 20000);\r\n\r\n\t } else {\r\n\t\tif (playerOnTrialID != playerID) {\r\n\t\t server.privateMessage(\"cannot vote for \" + player + \" while the vote for \"\r\n\t\t\t + server.getUsername(playerOnTrialID) + \" is in progress\", origin);\r\n\t\t} else {\r\n\t\t if (save.contains(origin)) {\r\n\t\t\tint index = save.indexOf(origin);\r\n\t\t\tsave.remove(index);\r\n\t\t }\r\n\r\n\t\t elimDay.add(origin);\r\n\t\t checkElim(origin);\r\n\t\t}\r\n\t }\r\n\t} else if (!players.containsValue(player)) {\r\n\t server.privateMessage(player + \" is not in this game/has already been eliminated\", origin);\r\n\r\n\t}\r\n\r\n }",
"private void checkDay(int origin) {\r\n\tserver.publicMessage(players.get(origin) + \" has voted for it to remain day\");\r\n\r\n\t// if (dayVote.size() > playerIDs.size() / 2) {\r\n\tif (dayVote.size() > players.size() / 2) {\r\n\t day();\r\n\t} else if (dayVote.size() == players.size() / 2 && players.size() % 2 == 0) {\r\n\t day();\r\n\t}\r\n }",
"public Component canOnlyVoteAtNight() {\n return MiniMessage.get().parse(canOnlyVoteAtNight);\n }",
"public static int snail(int column, int day, int night) {\n\n int count = 0;\n int d = 0;\n while (d < column) {\n d += day;\n count++;\n if (d < column) {\n d -= night;\n }\n }\n\n return count;\n }",
"public void announceWinner() {\r\n Piece winer;\r\n if (_board.piecesContiguous(_board.turn().opposite())) {\r\n winer = _board.turn().opposite();\r\n } else {\r\n winer = _board.turn();\r\n }\r\n if (winer == WP) {\r\n _command.announce(\"White wins.\", \"Game Over\");\r\n System.out.println(\"White wins.\");\r\n } else {\r\n _command.announce(\"Black wins.\", \"Game Over\");\r\n System.out.println(\"Black wins.\");\r\n }\r\n }",
"void setDayOrNight(int day) {\n setStat(day, dayOrNight);\n }",
"public void updateWithPointWonBy(Player player) {\n if(managerTennisMatch.statusTennisMatch == \"ClassicalGame\") {\n if (player == player1) {\n managerTennisMatch.checkScoreAndUpdateGame(player, player2);\n } else {\n managerTennisMatch.checkScoreAndUpdateGame(player, player1);\n }\n } else if(managerTennisMatch.statusTennisMatch == \"TieBreakInProgress\") {\n player.setScore(player.getScore() + 1);\n if((player1.getScore() >= 7 && player1.getScore() - player2.getScore() >= 2) || (player2.getScore() >= 7 && player2.getScore() - player1.getScore() >= 2)) {\n tennisSetList.get(tennisSetList.size() - 1).getBaseGameList().add(new TieBreakGame(player));\n player1.setScore(0);\n player2.setScore(0);\n }\n } else {\n return;\n }\n }",
"protected void winning(WinningMessage message) {\n \t\tthis.getNodeInstanceMediatorService().setState(\n \t\t\t\tmessage.getProcessInstanceId(), NodeInstaceStates.PASSED_STATE);\n \t\t\n \t\tthis.getNodeInstanceMediatorService().persistChanges();\n \t\t\n \t\tthis.sendMessageToNodeActors(\n \t\t\t\tnew ActivationMessage(message.getProcessInstanceId()),\n \t\t\t\tthis.getOutgoingNodes());\n \t}",
"public void updatePossibleMovesKnights(){}",
"private void announceWinner() {\n // FIXME\n if (_board.turn() == Piece.WP) {\n System.out.println(\"Black wins.\");\n } else {\n System.out.println(\"White wins.\");\n }\n }",
"public boolean isNight() {\r\n return hours < 6 || hours >= 20;\r\n }",
"private void sendWinnerMessage(RaceTrackMessage playerDisconnectsMessage) {\n\t\tif(playerDisconnectsMessage != null)\n\t\t\ttry{\n\n\t\t\t\tint playerWhoWon = getPlayerWhoWonByPlayerID(((DisconnectMessage) playerDisconnectsMessage).getNextPlayerToMove()); \n\t\t\t\tint playerWhoWonID = getPlayerIDWhoWonByPlayerID(((DisconnectMessage) playerDisconnectsMessage).getNextPlayerToMove());\n\t\t\t\tif(playerWhoWon != -1){\n\t\t\t\t\tPoint2D lastVec = null;\n\t\t\t\t\tif(getPlayerMap().get(playerWhoWonID) != null)\n\t\t\t\t\t\tlastVec = getPlayerMap().get(playerWhoWonID).getCurrentPosition();\n\n\n\t\t\t\t\tPlayerWonMessage answer;\n\n\t\t\t\t\tanswer = VectorMessageServerHandler.generatePlayerWonMessage(playerWhoWon, playerWhoWon, lastVec);\n\n\t\t\t\t\tcloseGameByPlayerID(playerWhoWon);\n\n\t\t\t\t\tanswer.addClientID(playerWhoWonID);\n\n\t\t\t\t\tsendMessage(answer);\n\t\t\t\t\t\n\t\t\t\t\t//inform the AIs that game is over!!\n\n\t\t\t\t}\n\t\t\t}catch(ClassCastException e){\n\n\t\t\t}\n\t}",
"private void saveVote(String player, int origin) {// suspicious player do\r\n\t\t\t\t\t\t // need\r\n\t// to vote for themselves\r\n\r\n\tif (players.containsValue(player)) {\r\n\t OrderedBidiMap<String, Integer> invPlayers = players.inverseBidiMap();\r\n\t // int playerID = server.getUserID(player);\r\n\t int playerID = invPlayers.get(player);\r\n\r\n\t if (playerOnTrialID == null) {\r\n\t\tserver.privateMessage(\"you cannot vote to save someone when there is no-one on trial\", origin);\r\n\r\n\t\t// } else if (!playerIDs.contains(playerID)) {\r\n\t } else {\r\n\t\tif (playerOnTrialID != playerID) {\r\n\t\t server.privateMessage(\"cannot vote for \" + player + \" while the vote for \"\r\n\t\t\t + server.getUsername(playerOnTrialID) + \" is in progress\", origin);\r\n\r\n\t\t} else if (!players.containsKey(origin)) {\r\n\t\t server.privateMessage(\"you are not in the game, so cannot participate\", origin);\r\n\r\n\t\t} else {\r\n\t\t if (elimDay.contains(origin)) {\r\n\t\t\tint index = elimDay.indexOf(origin);\r\n\t\t\telimDay.remove(index);\r\n\t\t }\r\n\r\n\t\t save.add(origin);\r\n\t\t checkSave(origin);\r\n\t\t}\r\n\t }\r\n\t} else if (!players.containsValue(player)) {\r\n\t server.privateMessage(player + \" is not in this game/has already been eliminated\", origin);\r\n\r\n\t}\r\n\r\n }",
"@RequestMapping(value=\"/players/killLastNight\", method=RequestMethod.POST)\n\t\t@ResponseBody\n\t\tpublic void switchKillLastNight(String id) {\n\t\t\tSystem.out.println(\"in place vote \");\n\t\t\tPlayer thePlayer = playerService.getPlayerById(id);\n\t\t\tthePlayer.switchKilledLastNight();\n\t\t\tplayerService.switchKilledLastNight(thePlayer);\n\t\t}",
"void gameTurn(int move){\n int gameWon = -1;\n boolean gameTie = false;\n //set the board to a move and print it\n if (loggedInUser.myGame.currentLetter.equals(\"X\")){\n gameBoard [move] = 1;\n printMove(move,\"X\");\n }\n else{\n gameBoard[move] = 2;\n printMove(move,\"O\");\n }\n //Update the status of the buttons graying out the ones that were played\n updateButtons();\n\n //checks if the game has been won or not\n gameWon = checkGameWon();\n\n //check of the game has been tied\n gameTie = checkTie();\n\n Game game = new Game(loggedInUser.opponentId);\n game.currentMove = move;\n\n if (loggedInUser.myGame.currentLetter.equals(\"X\")){\n game.currentLetter = \"O\";\n }else {\n game.currentLetter = \"X\";\n }\n\n //if the game hasn't been won and the game hasnt been tied the other playesr turn is made\n if(gameWon != 0 && !gameTie){\n game.gameInProgress = true;\n }\n //if game won\n else if (gameWon != 0){\n //remove all of the buttons\n removeAllButtons();\n game.gameInProgress = false;\n }\n else{\n playerText.setText(\"The game is tie\");\n turn.setText(\"No one wins\");\n game.gameInProgress = false;\n }\n\n //set data\n mDatabaseRef.child(loggedInUser.myId).child(\"myGame\").setValue(game);\n mDatabaseRef.child(loggedInUser.opponentId).child(\"myGame\").setValue(game);\n }",
"public void voteWord(ArrayList<String> voteWord) {\n\n\t\tJsonArray voteword = new JsonArray();\n\t\tJsonObject tmp = new JsonObject();\n\n\t\tfor (String s : voteWord) {\n\t\t\ttmp = new JsonObject();\n\t\t\ttmp.addProperty(\"Word\", s);\n\t\t\tint isAccept = JOptionPane.showConfirmDialog(null, \"Is \" + \"\\\"\" + s + \"\\\"\" + \" a word?\",\n\t\t\t\t\t\"Vote\", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);\n\t\t\tif (isAccept == JOptionPane.YES_OPTION) {\n\t\t\t\ttmp.addProperty(\"IsAWord\", \"Yes\");\n\t\t\t} else {\n\t\t\t\ttmp.addProperty(\"IsAWord\", \"No\");\n\t\t\t}\n\t\t\tvoteword.add(tmp);\n\t\t}\n\n\t\tmessage.add(\"VoteWord\", voteword);\n\n\t\tjsonString = message.toString();\n\n\t\ttry {\n\t\t\twriter.write(jsonString + \"\\n\");\n\t\t\twriter.flush();\n\t\t} catch (IOException e) {\n\t\t\tJOptionPane.showMessageDialog(null, \"Fail to connect Server\", \"Error\",\n\t\t\t\t\tJOptionPane.ERROR_MESSAGE);\n\t\t\tSystem.exit(0);\n\t\t}\n\t\tfor (int i = 0; i < ROW; i++) {\n\t\t\tfor (int j = 0; j < COLUME; j++) {\n\t\t\t\tboard[i][j].setBackground(Color.WHITE);\n\t\t\t}\n\t\t}\n\t}",
"public void vote(JsonObject inputMsg) {\n\t\tmessage = new JsonObject();\n\t\tmessage.addProperty(\"Direction\", \"ClientToServer\");\n\t\tmessage.addProperty(\"Function\", \"InGame\");\n\t\tmessage.addProperty(\"Operation\", \"VoteResult\");\n\t\tmessage.addProperty(\"RoomNumber\", roomNumber);\n\t\tmessage.addProperty(\"ScoredPlayer\", format(inputMsg.get(\"ScoredPlayer\").toString()));\n\n\t\tint r = Integer.parseInt(format(inputMsg.get(\"Row\").toString()));\n\t\tint c = Integer.parseInt(format(inputMsg.get(\"Column\").toString()));\n\t\tArrayList<String> voteWord = new ArrayList<String>();\n\n\t\tString word[] = new String[2];\n\n\t\tboard[r][c].setText(format(inputMsg.get(\"Letter\").toString()));\n\n\t\tword[0] = board[r][c].getText();\n\t\tword[1] = board[r][c].getText();\n\t\tboard[r][c].setBackground(Color.YELLOW);\n\n\t\t// Connect letters into a word\n\t\tfor (int i = 1; r + i < board.length; i++) {\n\t\t\tif (board[r + i][c].getText().equals(\"\")) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tword[0] = word[0] + board[r + i][c].getText();\n\t\t\tboard[r + i][c].setBackground(Color.YELLOW);\n\t\t}\n\n\t\tfor (int i = 1; r - i >= 0; i++) {\n\t\t\tif (board[r - i][c].getText().equals(\"\")) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tword[0] = board[r - i][c].getText() + word[0];\n\t\t\tboard[r - i][c].setBackground(Color.YELLOW);\n\t\t}\n\n\t\tfor (int i = 1; c + i < board.length; i++) {\n\t\t\tif (board[r][c + i].getText().equals(\"\")) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tword[1] = word[1] + board[r][c + i].getText();\n\t\t\tboard[r][c + i].setBackground(Color.YELLOW);\n\t\t}\n\t\tfor (int i = 1; c - i >= 0; i++) {\n\t\t\tif (board[r][c - i].getText().equals(\"\")) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tword[1] = board[r][c - i].getText() + word[1];\n\t\t\tboard[r][c - i].setBackground(Color.YELLOW);\n\t\t}\n\n\t\tif (word[0].length() + word[1].length() == 2) {\n\t\t\tvoteWord.add(word[0]);\n\t\t} else {\n\t\t\tvoteWord.add(word[0]);\n\t\t\tvoteWord.add(word[1]);\n\t\t}\n\t\tvoteWord(voteWord);\n\t}",
"public void fight(Knight otherKnight){\n System.out.println(\"Starting the great fight: \" + this.name + \" VS \" + otherKnight.name);\n if (this.sumEquipmentWeight() + this.weight < otherKnight.sumEquipmentWeight() + otherKnight.weight)\n System.out.println(\"Winner is \" + otherKnight.name);\n else if (this.sumEquipmentWeight() + this.weight > otherKnight.sumEquipmentWeight() + otherKnight.weight)\n System.out.println(\"Winner is \" + this.name);\n else if (this.sumEquipmentPrice() < otherKnight.sumEquipmentPrice())\n System.out.println(\"Winner is \" + otherKnight.name);\n else if (this.sumEquipmentPrice() > otherKnight.sumEquipmentPrice())\n System.out.println(\"Winner is \" + this.name);\n else System.out.println(\"We have no winner.\");\n }",
"@Override\n public MessageWrapper[] onMsgReceive(MSGGameVote msg, Player sender) {\n Lobby lobby = playerLobbyMap.get(sender);\n lobby.getGameSession().addVote(msg.isAccepted(), msg.getOrient());\n\n if (lobby.getGameSession().allVoted()) {\n // all players voted, move onto next player\n Player prevPlayer = lobby.getGameSession().getCurrentTurn();\n lobby.getGameSession().nextTurn(false);\n\n Message msgNextTurn = new MSGNewTurn(\n prevPlayer,\n lobby.getGameSession().getCurrentTurn(),\n lobby.getGameSession().getScores().get(prevPlayer),\n false);\n\n // if board is full, end the game\n if (lobby.getGameSession().isBoardFull()) {\n Message msgEndGame = new MSGGameStatus(MSGGameStatus.GameStatus.ENDED, null);\n\n // TODO: Better structure protocol\n // send additional message to end game\n return MessageWrapper.prepWraps(\n new MessageWrapper(msgNextTurn, lobby.getPlayers()),\n new MessageWrapper(msgEndGame, lobby.getPlayers()));\n } else {\n return MessageWrapper.prepWraps(\n new MessageWrapper(msgNextTurn, lobby.getPlayers()));\n }\n }\n\n return null;\n }",
"private void updateGame(int roundWinner) {\n\n\t\t// War cards get face down\n\t\tif (game.getWarring() == 2) {\n\t\t\tcpuStack.setIcon(new ImageIcon(Card.CARD_DOWN));\n\t\t\tplayerStack.setIcon(new ImageIcon(Card.CARD_DOWN));\n\t\t\tgame.clearWar();\n\t\t} else if (game.getWarring() == 1)\n\t\t\tgame.nextDown(); // next one is down, current battle triggered a war\n\t\telse {\n\n\t\t\tcpuStack.setIcon(new ImageIcon(game.getCardImage(War.CPU)));\n\t\t\tplayerStack.setIcon(new ImageIcon(game.getCardImage(War.PLAYER)));\n\t\t}\n\t\tif (roundWinner == War.TIE_FLAG) {\n\t\t\tstatus.setText(\"Tie Game!\");\n\t\t\tplayerDeck.setEnabled(false);\n\t\t} else if (roundWinner == War.WAR_FLAG)\n\t\t\tstatus.setText(\"War!\");\n\t\telse if (game.gameWinner() != null) {\n\t\t\tif (game.cpuScore() > game.playerScore())\n\t\t\t\tstatus.setText(\"CPU Wins!\");\n\t\t\telse\n\t\t\t\tstatus.setText(\"You Win!\");\n\t\t\tplayerDeck.setEnabled(false);\n\t\t} else {\n\t\t\tif (roundWinner == War.CPU)\n\t\t\t\tstatus.setText(\"CPU \" + \"wins the round!\");\n\t\t\telse\n\t\t\t\tstatus.setText(\"Player \" + \"wins the round!\");\n\n\t\t}\n\t\tcpuScore.setText(game.getCPUScore());\n\t\tplayerScore.setText(game.getPlayerScore());\n\t\tupdateDecks();\n\t}",
"private void gameWon() {\n\n stopTime();\n //reveal all mines and mark them\n for (int i = 0; i < minefield.getRows(); i++) {\n for (int j = 0; j < minefield.getCols(); j++) {\n if (minefield.getMinefield()[i][j].isMined()) {\n tileLabel[i][j].setIcon(flagIcon);\n tile[i][j].setBackground(Color.green);\n }\n }\n }\n\n JFrame winframe = new JFrame(\"Winner!\");\n JPanel winpanel = new JPanel();\n JLabel label = new JLabel(\"Well done, you beat the game!\");\n JLabel label2 = new JLabel(\" Time taken: \" + time + \" \");\n JButton close = new JButton(\"Close\");\n JButton restart = new JButton(\"Restart\");\n\n close.addActionListener((ActionEvent e) -> {\n winframe.dispose();\n });\n\n restart.addActionListener((ActionEvent e) -> {\n frame.dispose();\n winframe.dispose();\n createNewGame(minefield.getRows(), minefield.getCols(), minefield.getMaxMines());\n });\n\n winpanel.add(label);\n winpanel.add(label2);\n winpanel.add(close);\n winpanel.add(restart);\n winframe.add(winpanel);\n winframe.setLocationRelativeTo(null);\n winframe.setSize(220, 110);\n winframe.setResizable(false);\n winframe.setVisible(true);\n }",
"public void checkVotes() {\r\n\t\tnew Timer().scheduleAtFixedRate(new TimerTask() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void run() {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tURLConnection connection = new URL(\"https://glowning.dev/discordminer/webhook/votes.txt\").openConnection();\r\n\t\t\t\t\tconnection.setRequestProperty(\"User-Agent\", \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11\");\r\n\t\t\t\t\tconnection.connect();\r\n\r\n\t\t\t\t\tBufferedReader r = new BufferedReader(new InputStreamReader(connection.getInputStream(), Charset.forName(\"UTF-8\")));\r\n\r\n\t\t\t\t\tString line = \"\";\r\n\t\t\t\t\twhile ((line = r.readLine()) != null) {\r\n\t\t\t\t\t\tSystem.out.println(line);\r\n\t\t\t\t\t\tUser u = getShards().getUserById(line);\r\n\t\t\t\t\t\tif (u != null) {\r\n\t\t\t\t\t\t\tint crate;\r\n\r\n\t\t\t\t\t\t\tCalendar cal = Calendar.getInstance();\r\n\t\t\t\t\t\t\tcal.setTimeInMillis(System.currentTimeMillis());\r\n\t\t\t\t\t\t\tcal.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\r\n\r\n\t\t\t\t\t\t\tif (cal.get(Calendar.DAY_OF_WEEK) == Calendar.FRIDAY || cal.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY || cal.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) {\r\n\t\t\t\t\t\t\t\tcrate = 2;\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tcrate = 1;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tMiner miner = new Miner(u.getIdLong());\r\n\t\t\t\t\t\t\tif (miner.exists()) {\r\n\t\t\t\t\t\t\t\tSystem.out.println(\"Crates given to \" + u.getName() + \" (\" + u.getIdLong() + \")\");\r\n\t\t\t\t\t\t\t\tu.openPrivateChannel().complete().sendMessage(\"Hey! Thank you for your vote.\\nAs a reward, I give you **\" + crate + \" crate\" + (crate == 2 ? \"s\" : \"\") + \"**.\").queue();\r\n\r\n\t\t\t\t\t\t\t\tminer.addCrates(\"vote\", crate);\r\n\t\t\t\t\t\t\t\tminer.getStats().put(\"votes\", miner.getStats().getInt(\"votes\") + 1);\r\n\t\t\t\t\t\t\t\tminer.update();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tHttpClient httpclient = HttpClients.createDefault();\r\n\t\t\t\t\t\tHttpPost httppost = new HttpPost(\"https://glowning.dev/discordminer/webhook/discordbots.php\");\r\n\t\t\t\t\t\tList<NameValuePair> params = new ArrayList<NameValuePair>(2);\r\n\t\t\t\t\t\tparams.add(new BasicNameValuePair(\"Authorization\", \"DiscordMiner\"));\r\n\t\t\t\t\t\tparams.add(new BasicNameValuePair(\"user\", line));\r\n\t\t\t\t\t\thttppost.setEntity(new UrlEncodedFormEntity(params, \"UTF-8\"));\r\n\t\t\t\t\t\thttpclient.execute(httppost);\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}, 0, 1000);\r\n\t}",
"public void sendVoteNotification() {\n\t\t\t\t\tWorld.sendWorldMessage(\"<img=5>[Vote Feed]: colorhere\" + getDisplayName() + \" </col>voted for\" + \n\t\t\t\t\t\t\t\t\t\t\t\"colorhere \"+ voteDisplayAmount +\" Vote Tickets!</col> \"\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"World votes are now at colorhere\"+ WorldVote.getVotes()+\"</col>.\", false);\t\n\t}",
"void setWinningTeam(TeamId winner) {\n winningTeam.set(winner);\n }",
"public void gameWon()\n {\n ScoreBoard endGame = new ScoreBoard(\"You Win!\", scoreCounter.getValue());\n addObject(endGame, getWidth()/2, getHeight()/2);\n }",
"public void runOff(int round) {\n\t\tfor (int i = 0; i < voteOrder.size(); i++) {\n\n\t\t\t// Depending on the round, get the number voted\n\t\t\tint count = voteOrder.elementAt(i).elementAt(round) - 1;\n\n\t\t\tCandidat candidat = Candidats.elementAt(count);\n\n\t\t\tif (candidat.getId() == count && !candidat.isEliminated) {\n\t\t\t\tint vow = candidat.getVows() + 1;\n\t\t\t\tcandidat.setVows(vow);\n\n\t\t\t\t// candidat.calculatePercentage(voteOrder.size());\n\t\t\t}\n\n\t\t}\n\n\t}",
"public void winGame() {\n this.isWinner = true;\n }",
"private void drawWinner() {\n boolean allowMultiWinnings = ApplicationDomain.getInstance().getActiveLottery().isTicketMultiWinEnabled();\n\n // Get all lottery numbers without a prize\n ArrayList<LotteryNumber> numbersEligibleForWin = new ArrayList<>();\n TreeMap<Object, Ticket> tickets = ApplicationDomain.getInstance().getActiveLottery().getTickets();\n for (Object ticketId : tickets.keySet()) {\n Ticket ticket = tickets.get(ticketId);\n\n ArrayList<LotteryNumber> availableFromTicket = new ArrayList<>();\n for (LotteryNumber number : ticket.getLotteryNumbers()) {\n if (number.getWinningPrize() == null) {\n availableFromTicket.add(number);\n } else {\n if (!allowMultiWinnings) {\n // Stop looking through the ticket since it already has a winner and\n // multiply winnings are disallowed. And prevent the already-looked-through\n // numbers of the ticket to be added.\n availableFromTicket.clear();\n break;\n }\n }\n }\n numbersEligibleForWin.addAll(availableFromTicket);\n }\n\n // Check for all numbers having won\n if (numbersEligibleForWin.isEmpty()) {\n Toast.makeText(getContext(), R.string.no_winless_numbers, Toast.LENGTH_LONG).show();\n return;\n }\n\n // Draw random number and save the ID in the prize\n int numberSelector = (int) (Math.random() * numbersEligibleForWin.size());\n Prize prizeToBeWon = ApplicationDomain.getInstance().getPrizeToBeWon();\n prizeToBeWon.setNumberId(numbersEligibleForWin.get(numberSelector).getId());\n\n ApplicationDomain.getInstance().prizeRepository.savePrize(prizeToBeWon);\n ApplicationDomain.getInstance().setPrizeToBeWon(null);\n }",
"private void win(int winner)\n {\n switch (winner) {\n case PLAYER_1_FLAG:\n player1.gameOver(RESULT_WIN);\n player2.gameOver(RESULT_LOSS);\n winSend.close();\n break;\n case PLAYER_2_FLAG:\n player1.gameOver(RESULT_LOSS);\n player2.gameOver(RESULT_WIN);\n \n winSend.close();\n break;\n }\n }",
"public void increaseWins(){\n this.numberOfWins=this.numberOfWins+1;\n }",
"public static void decidedWinner(){\n if(playerOneWon == true ){\n//\n// win.Fill(\"Player One Has Won !\");\n// new WinnerWindow().setVisible(true);\n }\n else if (playerTwoWon == true){\n// win.Fill(\"Player Two Has Won !\");\n// new WinnerWindow().setVisible(true);\n }\n else\n {\n// win.Fill(\"Match Has been Tied !\");\n// new WinnerWindow().setVisible(true);\n }\n }",
"@Override\n\tpublic void win() {\n\t\t\n\t\tfround[fighter1]++;\n\t fplatz[fighter1]=Math.round((float)fplatz[fighter1]/2); \n\t \n\t\tnextRound();\n\t}",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\tfor (int i = 0; i < 2 /* rounds */; i++) {\n\t\t\t\t\tfor (Delegate delegate : votes.keySet()) {\n\t\t\t\t\t\tif (votes.get(delegate) != null) {\n\t\t\t\t\t\t\t// Already voted.\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcurrentlyVoting = delegate;\n\t\t\t\t\t\tlblCurrentVoter.setText(delegate.getName());\n\t\t\t\t\t\tlblCurrentVoter.setIcon(delegate.getSmallIcon());\n\n\t\t\t\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\t\t\t\tfinal List<Map<Vote, JButton>> maplist = Arrays.asList(\n\t\t\t\t\t\t\t\tbuttons_roundOne, buttons_roundTwo);\n\t\t\t\t\t\tfor (Map<Vote, JButton> map : maplist) {\n\t\t\t\t\t\t\tfor (Vote vote : map.keySet()) {\n\t\t\t\t\t\t\t\tmap.get(vote)\n\t\t\t\t\t\t\t\t\t\t.setText(\n\t\t\t\t\t\t\t\t\t\t\t\tdelegate.getStatus().hasVetoPower ? vote.vetoText\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: vote.normalText);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tsynchronized (votingThread) {\n\t\t\t\t\t\t\t\tvotingThread.wait();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfinal Vote cast = votes.get(delegate);\n\t\t\t\t\t\tif (cast == Vote.PASS) {\n\t\t\t\t\t\t\tvotes.put(delegate, null);\n\t\t\t\t\t\t\t// So he goes again.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (JButton button : votingButtons) {\n\t\t\t\t\t\t\tbutton.setEnabled(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tlayout.show(pnlVoting, pnlSecondRound.getName());\n\t\t\t\t}\n\t\t\t\t// When done, disable again.\n\t\t\t\tfor (JButton button : votingButtons) {\n\t\t\t\t\tbutton.setEnabled(false);\n\t\t\t\t}\n\t\t\t\tcurrentlyVoting = null;\n\t\t\t\tlblCurrentVoter.setText(null);\n\t\t\t\tlblCurrentVoter.setIcon(null);\n\t\t\t\tpnlVoting.setVisible(false);\n\t\t\t}",
"public static int checkForWin(BitSet state, BitSet theirBoard) {\n \n BitSet[] myWins = Shifts.doShifts(state, 5, true);\n BitSet[] theirWins = Shifts.doShifts(theirBoard, 5, true);\n\n\n boolean iWon = !myWins[0].isEmpty() || !myWins[1].isEmpty() || !myWins[2].isEmpty() || !myWins[3].isEmpty();\n boolean theyWon = !theirWins[0].isEmpty() || !theirWins[1].isEmpty() || !theirWins[2].isEmpty() || !theirWins[3].isEmpty();\n \n if (iWon && theyWon) {\n //draw, we both have a win\n return 0;\n }\n else if (iWon) {\n return 3000; \n }\n else if (theyWon){\n return -3000;\n }\n else {\n return 13;\n }\n }",
"public void setWinner(String winner) {\n this.winner = winner;\n }",
"public static void checkWinner() {\n\t\tcontinueGame = false;\n\t\tfor (int k = 0; k < secretWordLength; k++) {\n\t\t\tif (!unseenBoard.get(k).equals(\"*\")) {\n\t\t\t\tcontinueGame = true;\n\t\t\t}\n\t\t}\n\t}",
"public void logRoundWinner(Player player, int round){\n\t\tif(player instanceof HumanPlayer)\n\t\t\tlog += String.format(\"%nUSER WINS ROUND %d\", round);\n\t\telse\n\t\t{\n\t\t\tAIPlayer ai = (AIPlayer) player;\n\t\t\tlog += String.format(\"%n%s WINS ROUND %d\", ai.getName().toUpperCase(), round);\n\t\t\tString win = ai.getName();\n\t\t\tif(win.equals(\"ai player1\"))\n\t\t\t{\n\t\t\t\troundWins[1]=roundWins[1]+1;\n\t\t\t}\n\t\t\telse if(win.equals(\"ai player2\"))\n\t\t\t{\n\t\t\t\troundWins[2]=roundWins[2]+1;\n\t\t\t}\n\t\t\telse if(win.equals(\"ai player3\"))\n\t\t\t{\n\t\t\t\troundWins[3]=roundWins[3]+1;\n\t\t\t}\n\t\t\telse if(win.equals(\"ai player4\"))\n\t\t\t{\n\t\t\t\troundWins[4]=roundWins[4]+1;\n\t\t\t}\n\t\t\t/*switch(win)\n\t\t\t{\n\t\t\tcase \"ai player1\":{\n\t\t\t\troundWins[1]=roundWins[1]+1;\n\t\t\t}\n\t\t\tcase \"ai player2\":{\n\t\t\t\troundWins[2]=roundWins[2]+1;\n\t\t\t}\n\t\t\tcase \"ai player3\":{\n\t\t\t\troundWins[3]=roundWins[3]+1;\n\t\t\t}\n\t\t\tcase \"ai player4\":{\n\t\t\t\troundWins[4]=roundWins[4]+1;\n\t\t\t}\n\t\t\t}*/\n\t\t}\n\t\tlineBreak();\n\t}",
"private Boolean win(int counter) {\n \n winner = false;\n //if the counter is greater than 8, recognizes that it is a draw\n if (counter >= 8) {\n announce.setText(\"Draw\");\n turn.setText(\"\"); //game ends and is no ones turn\n }\n //list of all of the winning options\n if ((tBoard[0] == tBoard[1] && tBoard[1] == tBoard[2] && tBoard[0] != 2)\n || (tBoard[0] == tBoard[3] && tBoard[3] == tBoard[6] && tBoard[0] != 2)\n || (tBoard[3] == tBoard[4] && tBoard[4] == tBoard[5] && tBoard[3] != 2)\n || (tBoard[6] == tBoard[7] && tBoard[7] == tBoard[8] && tBoard[6] != 2)\n || (tBoard[1] == tBoard[4] && tBoard[4] == tBoard[7] && tBoard[1] != 2)\n || (tBoard[2] == tBoard[5] && tBoard[5] == tBoard[8] && tBoard[2] != 2)\n || (tBoard[0] == tBoard[4] && tBoard[4] == tBoard[8] && tBoard[0] != 2)\n || (tBoard[2] == tBoard[4] && tBoard[4] == tBoard[6] && tBoard[2] != 2)) {\n //if counter is even then recognizes that it is the person who has the X symbol and knows that X won \n if (counter % 2 == 0) {\n announce.setText(\"X is the Winner\"); //announces that X has won\n turn.setText(\"\"); //no ones turn anymore\n } //if it is not X, O has won the game and recognizes\n else {\n announce.setText(\"O is the Winner\"); //announces that O has won\n turn.setText(\"\"); //no ones turn anymore\n\n }\n //winner is set to true and stops allowing user to press other squares through pressed method\n winner = true;\n\n }\n //returns winner\n return winner;\n\n }",
"private static void winnerOrTie()\n\t{\n\t\t//Check each row for winning or tie condition.\n\t\tif(tictactoeBoard[0] == tictactoeBoard[1] && tictactoeBoard[1] == tictactoeBoard[2] && tictactoeBoard[0] != 1)\n\t\t{\n\t\t\tSystem.out.println(\"Winner\");\n\t\t}\n\t\tif(tictactoeBoard[3] == tictactoeBoard[4] && tictactoeBoard[4] == tictactoeBoard[5] && tictactoeBoard[3] != 4)\n\t\t{\n\t\t\tSystem.out.println(\"Winner\");\n\t\t}\n\t\tif(tictactoeBoard[6] == tictactoeBoard[7] && tictactoeBoard[7] == tictactoeBoard[8] && tictactoeBoard[6] != 7)\n\t\t{\n\t\t\tSystem.out.println(\"Winner\");\n\t\t}\n\t\t//Check diagonally for winning or tie condition.\n\t\tif(tictactoeBoard[0] == tictactoeBoard[4] && tictactoeBoard[4] == tictactoeBoard[8] && tictactoeBoard[0] != 1)\n\t\t{\n\t\t\tSystem.out.println(\"Winner\");\n\t\t}\n\t\tif(tictactoeBoard[6] == tictactoeBoard[4] && tictactoeBoard[4] == tictactoeBoard[2] && tictactoeBoard[6] != 7)\n\t\t{\n\t\t\tSystem.out.println(\"Winner\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//nobody has won yet.\n\t\t\t//changeTurn();\n\t\t}\n\t}",
"public void countVotes() {\n int[] voteResponses = RaftResponses.getVotes(mConfig.getCurrentTerm());\n int numVotes = 0;\n if(voteResponses == null) {\n //System.out.println(mID + \" voteResponses null\");\n //System.out.println(\"cur \" + mConfig.getCurrentTerm() + \" RR: \" + RaftResponses.getTerm());\n }\n else {\n for(int i = 1; i <= mConfig.getNumServers(); i++) {\n //If vote has not been received yet, resend request\n //if(voteResponses[i] == -1)\n //this.remoteRequestVote(i, mConfig.getCurrentTerm(), mID, mLog.getLastIndex(), mLog.getLastTerm());\n if(voteResponses[i] == 0)\n numVotes++;\n }\n }\n //If election is won, change to leader\n if(numVotes >= (mConfig.getNumServers()/2.0)) {\n electionTimer.cancel();\n voteCountTimer.cancel();\n RaftServerImpl.setMode(new LeaderMode());\n }\n else {\n voteCountTimer = scheduleTimer((long) 5, 2);\n }\n }",
"private void DeclareWinner(){\n\t\tTextView tvStatus = (TextView) findViewById(R.id.tvStatus);\n\t\tTextView tvP1Score = (TextView) findViewById(R.id.tvP1Score);\n\t\tTextView tvP2SCore = (TextView) findViewById(R.id.tvP2Score);\n\t\tTextView tvTieScore = (TextView) findViewById(R.id.tvTieScore);\n\t\tswitch(winner){\n\t\t\tcase CAT:\n\t\t\t\ttieScore = tieScore + 1;\n\t\t\t\ttvStatus.setText(\"Tie Cat Wins!\");\n\t\t\t\ttvTieScore.setText(String.valueOf(tieScore));\n\t\t\t\tbreak;\n\t\t\tcase P1_WINNER:\n\t\t\t\tp1Score = p1Score + 1;\n\t\t\t\ttvStatus.setText(\"Player 1 Wins!\");\n\t\t\t\ttvP1Score.setText(String.valueOf(p1Score));\n\t\t\t\tbreak;\n\t\t\tcase P2_WINNER:\n\t\t\t\tp2Score = p2Score + 1;\n\t\t\t\ttvStatus.setText(\"Player 2 Wins!\");\n\t\t\t\ttvP2SCore.setText(String.valueOf(p2Score));\n\t\t\t\tbreak;\n\t\t}\n\t}",
"public void announceWinner(){\n gameState = GameState.HASWINNER;\n notifyObservers();\n }",
"private void eliminateDay() {\r\n\tdayElimTimer.cancel();\r\n\tdayElimTimer.purge();\r\n\r\n\t// playerIDs.remove(playerOnTrialID);\r\n\tplayers.remove(playerOnTrialID);\r\n\r\n\tif (mafia.contains(playerOnTrialID)) {\r\n\t int index = mafia.indexOf(playerOnTrialID);\r\n\t mafia.remove(index);\r\n\r\n\t} else {\r\n\t int index = innocentIDs.indexOf(playerOnTrialID);\r\n\t innocentIDs.remove(index);\r\n\t}\r\n\r\n\tserver.setPlayerMuted(playerOnTrialID, true);\r\n\r\n\tserver.publicMessage(server.getUsername(playerOnTrialID) + \" has been eliminated\");\r\n\r\n\tplayerOnTrialID = null;\r\n\telimDay.clear();\r\n\tsave.clear();\r\n\telimDayVoteInProgress = false;\r\n\r\n\tcheckWin();\r\n }",
"public NatsMinesweeper(int height, int width, int numMines)\n {\n //Create and set up the window.\n super(\"Nat's Minesweeper\");\n setSize(2*MARGIN_SIZE + width*SQUARE_SIZE, \n \tTITLE_BAR_HEIGHT + 3*MARGIN_SIZE + H + height*SQUARE_SIZE);\n setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);\n setResizable(false);\n gameWon = false;\n gameLost = false;\n \t\n \t//Create and set up a blank panel to fill the window, on which all other panels will be placed.\n JPanel panel = new JPanel();\n panel.setSize(getWidth(), getHeight());\n panel.setBackground(Color.WHITE);\n panel.setLayout(null);\n add(panel);\n \n \t//Create and set up a MineCounter in the top left of the window to keep track of the mines left.\n this.numMines = numMines;\n minesFound = 0;\n mineCounter = new MineCounter(numMines);\n panel.add(mineCounter);\n mineCounter.setLocation(MARGIN_SIZE, MARGIN_SIZE);\n \n \t//Create and set up a TimerDisplay in the top right of the window to display the elapsed time.\n timerDisplay = new TimerDisplay();\n panel.add(timerDisplay);\n timerDisplay.setLocation(panel.getWidth() - MARGIN_SIZE - W, MARGIN_SIZE);\n \n \t//Create and set up a ResetButton to reset the game.\n resetButton = new ResetButton();\n panel.add(resetButton);\n resetButton.setLocation(panel.getWidth()/2 - H/2, MARGIN_SIZE);\n \n \t//Create a board panel to hold all the game squares in a grid pattern, \n \t//then fill the board (and grid) with GameSquares.\n JPanel board = new JPanel(new GridLayout(height, width));\n board.setSize(width*SQUARE_SIZE, height*SQUARE_SIZE);\n panel.add(board);\n board.setLocation(MARGIN_SIZE, H + 2*MARGIN_SIZE);\n grid = new GameSquare[height][width];\n for (int r = 0; r < height; r++)\n {\n for (int c = 0; c < width; c++)\n {\n grid[r][c] = new GameSquare(r, c);\n board.add(grid[r][c]);\n }\n }\n \n setVisible(true); //Finally, display the window, allowing the game to begin.\n }",
"private void checkElim(int origin) {\r\n\r\n\t// if (elimDay.size() > playerIDs.size() / 2) {\r\n\tserver.publicMessage(players.get(origin) + \" has voted to eliminate \" + server.getUsername(playerOnTrialID));\r\n\r\n\tif (elimDay.size() > players.size() / 2) {\r\n\t eliminateDay();\r\n\t}\r\n\r\n }",
"public void vote(int rating) {\n\t\tnew WebTraceTask(this, String.valueOf(rating)).execute(WebTraceTask.VOTE);\n\t}",
"@Override\n public void run() {\n\n try {\n LocalDateTime now = LocalDateTime.now();\n voda bot = new voda();\n\n List<Integer> notifyTime = Arrays.asList(7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23);\n int currentHour = now.getHour();\n\n ArrayList<Integer> consulted = dbmodel.MysqlCon.getFollowers();\n\n for (Integer ntime : notifyTime) {\n if (ntime == currentHour) {\n for (Integer consultedUser : consulted) {\n bot.sendTextToIdMessage(consultedUser, dbmodel.MysqlCon.getEveryDayWaterUserWaterCountView(consultedUser));\n }\n }\n }\n\n\n } catch (Exception e) {\n System.out.println();\n }\n }",
"void update(boolean winner);",
"public void setWinner(boolean winner) {\n\t\tthis.winner = winner;\n\t}",
"public void winGame() {\r\n if (data.gameState == 3) \r\n data.winner = 1;\r\n else if (data.gameState == 4) \r\n data.winner = 2;\r\n data.victoryFlag = true;\r\n data.gameState = 5;\r\n }",
"public void updateIsWinning() {\n if(!isOpponentDone && !isUserDone) {\n TextView opponentPosition = (TextView) findViewById(R.id.position_indicator_receiver);\n TextView userPosition = (TextView) findViewById(R.id.position_indicator_sender);\n\n Run opponentRun = ((ChallengeReceiverFragment) receiverFragment).getRun();\n Run userRun = ((ChallengeSenderFragment) senderFragment).getRun();\n\n float opponentDistance = opponentRun.getTrack().getDistance();\n float userDistance = userRun.getTrack().getDistance();\n\n if (opponentDistance == userDistance) {\n opponentPosition.setText(R.string.dash);\n userPosition.setText(R.string.dash);\n } else if (opponentDistance > userDistance) {\n opponentPosition.setText(R.string.first_position);\n userPosition.setText(R.string.second_position);\n } else {\n opponentPosition.setText(R.string.second_position);\n userPosition.setText(R.string.first_position);\n }\n System.out.println(opponentDistance + \" \" + userDistance);\n }\n }",
"public void setWins() {\r\n this.wins++;\r\n }",
"@Override\n public void updateScore(int winner)\n {\n if (winner == 0)\n {\n playerOneScore++;\n }\n else\n {\n playerTwoScore++;\n }\n }",
"public void setWinner(Player winner) {\n this.winner = winner;\n }",
"public static void turnOfEven(String player) {\n int row, col, num;\n\n System.out.print(\"\\n\" + player + \"'s turn.\"\n + \"\\nChoose a row: \");\n row = getCell();\n System.out.print(\"Choose a column: \");\n col = getCell();\n while (isTakenCell(row, col)) {\n System.out.print(\"Invalid cell. Please choose another one.\"\n + \"\\nChoose a row: \");\n row = getCell();\n System.out.print(\"Choose a column: \");\n col = getCell();\n }\n\n System.out.print(player + \" enter a number: \");\n num = getEven(); // getEven is called to check if num is even\n while (isUsedNumber(num)) {\n System.out.print(\"Invalid number. Please enter another one: \");\n num = getEven();\n }\n\n board[row - 1][col - 1] = num;\n printBoard();\n }",
"public void otherChess()\n {\n // Receive the column from the other player\n int col = theClient.recvInt();\n int row;\n // Find the unoccupied row from bottom to up to put the chess on\n for (row = ROWS - 1; row >= 0; row-- )\n {\n if (chessBoard[row][col] == 0)\n {\n break;\n }\n }\n // Put the chess from the other player on the board\n chessBoard[row][col] = other;\n grid[row][col].setIcon(new ImageIcon(otherURL));\n // If the column is full, disable the corresponding button\n if (row == 0)\n {\n drop[col].setEnabled(false);\n }\n // Check whether the other player wins.\n // If the other player wins, show the message dialog and tell the player\n // \"You lose\".\n // Then exit the system, terminate the game.\n if (win(row, col, other))\n {\n out.println(\"Lose.\");\n JOptionPane.showMessageDialog(null, \"You lose.\");\n System.exit(0);\n }\n // Else if the chess board is full, tie\n // Show the message dialog and tell the player \"Tie\".\n // Then exit the system, terminate the game.\n else if (full())\n {\n out.println(\"Tie.\");\n JOptionPane.showMessageDialog(null, \"Tie.\");\n System.exit(0);\n }\n }",
"private static boolean placeKnights(boolean[][] board, int row, int column, String answer) {\n if (row == board.length) {\n\n //Print the solution\n System.out.println(answer);\n\n //Since we reached here a solution is possible\n return true;\n }\n\n //Reached the last column\n if (column == board[0].length) {\n\n //move to next row\n return placeKnights(board, row + 1, 0, answer);\n\n }\n\n //Traverse all columns\n for (int i = column; i < board[row].length; i++) {\n //Place knight at the spot\n board[row][column] = true;\n //run with the knight at this place\n placeKnights(board, row, column + 1, \"(\" + row + \",\" + column + \")\");\n //remove the knight\n board[row][column] = false;\n }\n\n return false;\n }",
"public synchronized void announceWinner(Team team) {\n\n String[] gameStats = new String[players.length];\n for(int i = 0; i < players.length; i++){\n\n String s = players[i].getName() + \": \" + players[i].getCorrectAnswers();\n gameStats[i] = s;\n System.err.println(s);\n }\n\n for (PlayerHandler playerHandler : players) {\n\n if (playerHandler.getTeam() == team) {\n playerHandler.getOutputStream().println(\n GFXGenerator.drawYouWon(playerHandler.getTeam().getColor(), score, teams[0], teams[1]) +\n \"\\n\" + GFXGenerator.drawTable(gameStats, 4, \"GAME STATS (CORRECT ANSWERS)\"));\n\n continue;\n }\n\n playerHandler.getOutputStream().println(\n GFXGenerator.drawGameOver(playerHandler.getTeam().getColor(), score, teams[0], teams[1])+\n \"\\n\" + GFXGenerator.drawTable(gameStats, 4, \"GAME STATS (CORRECT ANSWERS)\"));\n }\n\n }",
"public void setWins(int wins) {\n if (wins > 0) {\n this.wins = wins;\n }\n }",
"protected void saveVote(Long voteForId) {\n if (mywebapp.getAuthenticatedUser() == null) {\n getMessagePanel().displayMessage(\"Please login before voting.\");\n return;\n }\n ContestRequest contestRequest = new ContestRequest();\n GWT.log(\"authToken=\" + mywebapp.getAuthToken());\n contestRequest.setAuthToken(mywebapp.getAuthToken());\n //we don't init the check boxes when it's location only\n for (Long contestId : ratingMap.keySet()) {\n Rating rating = ratingMap.get(contestId);\n //only register if there was a vote\n Integer val = rating.getValue();\n if (val > 0) {\n ContestEntryHolder ceh = new ContestEntryHolder();\n ceh.setContestId(contestId);\n ceh.setRating(val);\n ceh.setVoteForId(voteForId);\n contestRequest.getContestEntryHolders().add(ceh);\n }\n }\n ApiServiceAsync myService = mywebapp.getApiServiceAsync();\n myService.vote(contestRequest, new AsyncCallback() {\n public void onFailure(Throwable caught) {\n //postDialog.hide();\n getMessagePanel().displayError(caught.getMessage());\n }\n\n public void onSuccess(Object result) {\n MobileResponse mobileResponse = (MobileResponse) result;\n if (mobileResponse.getStatus() == 1) {\n getMessagePanel().displayMessage(\"Thanks for voting\");\n } else {\n //postDialog.hide();\n getMessagePanel().displayErrors(mobileResponse.getErrorMessages());\n }\n }\n });\n }",
"public synchronized void updateBotTrafficOverOneNeighbor(int neighbor, double amountOfTraffic) {\n this.botTraffic.put(neighbor, this.botTraffic.get(neighbor) + amountOfTraffic);\n }",
"public boolean isNightTime() {\n\t\tint hour24 = this.total % 24;\n\t\tif (hour24 < 7 || hour24 > 18) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"private void wins(Player player){\n int win = 1;\n player.setWins(win);\n }",
"public static void win()\n\t{\n\t\tGame.setMoney(Game.getMoney()+bet);\n\t\tremainingMoneyN.setText(String.valueOf(Game.getMoney()));\n\t\tbet=0;\n\t\ttfBet.setText(\"0\");\n\t\tif(Game.getMoney()>Game.getHighScore())\n\t\t{\n\t\t\tGame.setHighScore(Game.getMoney());\n\t\t\tlblHighScore.setText(String.valueOf(Game.getHighScore()));\n\t\t}\n\t\tlblUpdate.setText(\"You win!\");\n\n\t}",
"public void gameSet(final String userid, final Boolean end, final Boolean survivorZero,final Boolean press) {\n findSurvivor(userid,end,survivorZero,press);\n\n if (!userid.equals(userId)){\n if (end|survivorZero) {\n questionCard.setVisibility(View.GONE);\n gamesetView.setVisibility(View.VISIBLE);\n //check if the current user is winner\n db.child(\"Games\").child(userid).child(\"Redblue\").child(\"Winner\").addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n\n\n if (dataSnapshot.hasChild(userId)) {\n winMsg.setText(\"Congrat! you win!\");\n } else {\n winMsg.setText(\"Game end\");\n\n }\n\n\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n\n }\n });\n db.child(\"Games\").child(userid).child(\"Redblue\").child(\"Loser\").addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n if (dataSnapshot.hasChild(userId)) {\n winMsg.setText(\"Congrat!, you lose!\");\n } else {\n winMsg.setText(\"Game end\");\n\n }\n\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n\n }\n });\n }else{\n db.child(\"Games\").child(userid).child(\"Redblue\").child(\"Loser\").addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n if (dataSnapshot.hasChild(userId)) {\n winMsg.setText(\"Congrat!, you lose!\");\n questionCard.setVisibility(View.GONE);\n gamesetView.setVisibility(View.VISIBLE);\n } else {\n winMsg.setText(\"Game end\");\n\n }\n\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n\n }\n });\n }\n\n }else{\n //couple case\n if(end||survivorZero){\n questionCard.setVisibility(View.GONE);\n gamesetView.setVisibility(View.VISIBLE);\n db.child(\"Games\").child(userid).child(\"Redblue\").child(\"Winner\").addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n if (dataSnapshot.hasChild(userId)) {\n winMsg.setText(\"Congrat!, you win!\");\n } else {\n winMsg.setText(\"Game end\");\n\n }\n\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n\n }\n });\n db.child(\"Games\").child(userid).child(\"Redblue\").child(\"Loser\").addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n if (dataSnapshot.hasChild(userId)) {\n winMsg.setText(\"Congrat!, you lose!\");\n } else {\n winMsg.setText(\"Game end\");\n\n }\n\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n\n }\n });\n }\n }\n\n\n\n\n\n\n cddMsg = new CustomDialogClassMsgWin(GameRB.this,end);\n// if (!isFinishing()|!cddMsg.isShowing())\n// cddMsg.show();\n\n\n// db.child(\"Games\").child(userid).child(\"Redblue\").child(\"AnswerGuest\").addListenerForSingleValueEvent(new ValueEventListener() {\n//\n// @Override\n// public void onDataChange(DataSnapshot dataSnapshot) {\n// final String correct;\n// int correntNum = 0;\n// for (DataSnapshot child : dataSnapshot.getChildren()) {\n// for (DataSnapshot userAns : child.getChildren()) {\n// if (userAns.getKey().equals(userId) && userAns.getValue().equals(true)) {\n// correntNum++;\n// }\n// }\n// }\n// String correctNumber = String.valueOf(correntNum);\n// correct = correctNumber;\n// runOnUiThread(new Runnable() {\n// @Override\n// public void run() {\n// if (!GameRB.this.isFinishing()){\n//\n//// new SweetAlertDialog(GameRB.this)\n//// .setTitleText(\"Game Set!\")\n//// .setContentText(\"You have \" + correct + \" questions right!\")\n//// .setConfirmText(\"OK\")\n//// .setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {\n//// @Override\n//// public void onClick(SweetAlertDialog sDialog) {\n//// Intent pIntent = new Intent(GameRB.this, MainActivity.class);\n//// pIntent.putExtra(\"Game\", \"Redblue\");\n//// startActivity(pIntent);\n//// sDialog.dismissWithAnimation();\n//// finish();\n//// }\n//// })\n//// .show();\n//\n//\n// }\n// }\n// });\n//\n// }\n//\n// @Override\n// public void onCancelled(DatabaseError databaseError) {\n//\n// }\n// });\n }",
"public void rePointFromServer(int winnerid,int money) {\n\t\tint winner = winnerid;\n\t\tString winName = \"您\" ;\n\t\tif(winner == left_gamerID) {\n\t\t\twinName = left_name;\n\t\t\tleft_coin+=money;\n\t\t}else if(winner == right_gamerID) {\n\t\t\twinName = right_name;\n\t\t\tright_coin+=money;\n\t\t}else {\n\t\t\tme_coin+=money;\n\t\t}\n\t\trefreshCoins();\n\t\t\n\t\t\n\t\tif(round<7) {\n\t\t\topeLabel.setText(winName+\"获得了本轮游戏的胜利,准备进行下一回合\");\n\t\t\ttextHistory.append(winName+\"获得了本轮游戏的胜利,准备进行下一回合\");\n\t\t}else {\n\t\t\tString str = \"\";\n\t\t\tif(left_coin>right_coin) {\n\t\t\t\t//找出最大值\n\t\t\t\tif(left_coin>me_coin) {\n\t\t\t\t\tstr=left_name+\"玩家拥有最多的硬币,获得了整局比赛的胜利!\";\n\t\t\t\t}else {\n\t\t\t\t\tstr=\"您拥有最多的硬币,获得了整局比赛的胜利!\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else {\n\t\t\t\t\n\t\t\t\tif(right_coin>me_coin) {\n\t\t\t\t\tstr=right_name+\"玩家拥有最多的硬币,获得了整局比赛的胜利!\";\n\t\t\t\t}else {\n\t\t\t\t\tstr=\"您拥有最多的硬币,获得了整局比赛的胜利!\";\n\t\t\t\t}\n\t\t\t}\n\t\t\ttextHistory.append(str+\"\\n\");\n\t\t}\n\t\t\n\t\tleft_ready = 0;\n\t\tright_ready = 0;\n\t\tme_ready = 0;\n\n\t\t\n\t\t\n\t\tbtnReadyCancel.setVisible(true);\n\t\tbtnReadyCancel.setEnabled(false);\n\t\tbtnReady.setVisible(true);\n\t\tbtnReady.setEnabled(true);\n\t\t\n\t\t\n\t\t\n\t}",
"public void gameOfLife_v4(int[][] board) {\n\t\tint[][] directions = { { -1, -1 }, { -1, 0 }, { 0, -1 }, { -1, 1 }, { 1, -1 }, { 1, 0 }, { 0, 1 }, { 1, 1 } };\n\t\tint ALIVE_TO_DEAD = 2;\n\t\tint DEAD_TO_ALIVE = 3;\n\n\t\tfor (int i = 0; i < board.length; i++) {\n\t\t\tfor (int j = 0; j < board[i].length; j++) {\n\t\t\t\tint liveNeighbors = 0;\n\t\t\t\tfor (int[] dir : directions) {\n\t\t\t\t\tint r = i + dir[0];\n\t\t\t\t\tint c = j + dir[1];\n\t\t\t\t\tif (r >= 0 && r < board.length && c >= 0 && c < board[r].length) {\n\t\t\t\t\t\tif (board[r][c] == 1 || board[r][c] == ALIVE_TO_DEAD) {\n\t\t\t\t\t\t\tliveNeighbors++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (board[i][j] == 1) {\n\t\t\t\t\tif (liveNeighbors < 2 || liveNeighbors > 3) {\n\t\t\t\t\t\tboard[i][j] = ALIVE_TO_DEAD;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (liveNeighbors == 3) {\n\t\t\t\t\t\tboard[i][j] = DEAD_TO_ALIVE;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < board.length; i++) {\n\t\t\tfor (int j = 0; j < board[i].length; j++) {\n\t\t\t\tboard[i][j] = board[i][j] % 2; // 0, 1 will remain the same and\n\t\t\t\t\t\t\t\t\t\t\t\t// 2, 3 will become 0 and 1\n\t\t\t\t\t\t\t\t\t\t\t\t// respectively as expected\n\t\t\t}\n\t\t}\n\t}",
"private void checkWinningMove(TicTacToeElement element,int x,int y) {\n int logicalSize = boardProperties.getBoardLength()-1;\r\n // Check column (only the one we just played)\r\n for(int i=0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[x][i] != element.getValue()){\r\n break;\r\n }\r\n // Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n\r\n }\r\n // Check row (only the one we just played)\r\n for(int i=0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[i][y] != element.getValue()){\r\n break;\r\n }\r\n // Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n }\r\n // Check diagonal\r\n // normal diagonal\r\n for(int i= 0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[i][i] != element.getValue()){\r\n break;\r\n }\r\n // Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n }\r\n // anti diagonal\r\n for(int i= 0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[i][logicalSize-i] != element.getValue()){\r\n break;\r\n }\r\n //Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n }\r\n // check draw\r\n if(gameState.getMoveCount() == Math.pow(logicalSize,2)-1){\r\n gameState.setDraw(true);\r\n }\r\n\r\n }",
"public static void doVote() {\n }",
"public void win() {\n if (turn == 1) {\n p1.incrementLegs();\n if (p1.getLegs() == 5) {\n p1.incrementSets();\n p1.setLegs(0);\n p2.setSets(0);\n\n }\n if (p1LastScore > p1.getHighout()) {\n p1.setHighout(p1LastScore);\n\n }\n\n if (p1.getHighout() > OVERALL_HIGH_OUT) {\n OVERALL_HIGH_OUT = p1.getHighout();\n }\n } else if (turn == 2) {\n p2.incrementLegs();\n if (p2.getLegs() == 5) {\n p2.incrementSets();\n p2.setLegs(0);\n p1.setSets(0);\n\n }\n if (p2LastScore > p2.getHighout()) {\n p2.setHighout(p2LastScore);\n }\n\n if (p2.getHighout() > OVERALL_HIGH_OUT) {\n OVERALL_HIGH_OUT = p2.getHighout();\n }\n\n\n\n }\n changeFirstTurn();\n win = true;\n\n\n\n }",
"public synchronized boolean voteTeam() {\n //tally the votes\n int yes = 0, no = 0;\n for (boolean vote : playerVotes.values()) {\n if (vote) {\n yes++;\n } else {\n no++;\n }\n }\n\n if (yes > no) {\n doMissionState = voteTeamState.acceptTeam();\n state = State.DO_MISSION;\n successiveRejections = 0;\n teamMemberChoices = new HashMap<>();\n return true;\n } else {\n pickTeamState = voteTeamState.rejectTeam();\n state = State.PICK_TEAM;\n successiveRejections++;\n teamSelection = new HashSet<>();\n return false;\n }\n }",
"public void winner(int nTS, int nPlayers, int nRobots)\n {\n this.mapFrame.winner(nTS, nPlayers, nRobots);\n }",
"public static void gameOfLife(int[][] board) {\n int[] neighbors = {0, 1, -1};\n\n int rows = board.length;\n int cols = board[0].length;\n\n // Iterate through board cell by cell.\n for (int row = 0; row < rows; row++) {\n for (int col = 0; col < cols; col++) {\n\n // For each cell, count the number of live neighbors.\n int liveNeighbors = 0;\n\n for (int i = 0; i < 3; i++) {\n for (int j = 0; j < 3; j++) {\n\n if (!(neighbors[i] == 0 && neighbors[j] == 0)) {\n int r = (row + neighbors[i]);\n int c = (col + neighbors[j]);\n\n // Check the validity of the neighboring cell.\n // and whether it was originally a live cell.\n if ((r < rows && r >= 0) && (c < cols && c >= 0) && (Math.abs(board[r][c]) == 1)) {\n liveNeighbors += 1;\n }\n }\n }\n }\n\n // Rule 1 or Rule 3\n if ((board[row][col] == 1) && (liveNeighbors < 2 || liveNeighbors > 3)) {\n // -1 signifies the cell is now dead but originally was live.\n board[row][col] = -1;\n }\n // Rule 4\n if (board[row][col] == 0 && liveNeighbors == 3) {\n // 2 signifies the cell is now live but was originally dead.\n board[row][col] = 2;\n }\n }\n }\n\n // Get the final representation for the newly updated board.\n for (int row = 0; row < rows; row++) {\n for (int col = 0; col < cols; col++) {\n if (board[row][col] > 0) {\n board[row][col] = 1;\n } else {\n board[row][col] = 0;\n }\n }\n }\n }",
"void setUserVoteSalaryWeeklyDayOfWeek(DayOfWeek voteSalaryDayOfWeek);",
"@Override\r\n public void handleMessage(Message message, int origin) {\r\n\r\n\tString text = message.messageText;\r\n\tString remText = \"\";\r\n\tString command = \"\";\r\n\r\n\tif (text.indexOf(' ') < 0) {\r\n\t remText = \"\";\r\n\t command = message.messageText;\r\n\t} else {\r\n\t command = message.messageText.substring(0, text.indexOf(' '));\r\n\t remText = text.substring(text.indexOf(' ') + 1);\r\n\t}\r\n\r\n\tif (!gameInProgress) {\r\n\r\n\t if (command.equals(\"/ready\")) { // no trailing text after /ready\r\n\t\tif (!remText.isEmpty()) {\r\n\t\t server.privateMessage(\"The command \\\"/ready\\\" cannnot have characters after it\", origin);\r\n\t\t} else {\r\n\t\t ready(origin);\r\n\t\t}\r\n\r\n\t } else if (command.equals(\"/unready\")) {\r\n\t\tif (!remText.isEmpty()) {\r\n\t\t server.privateMessage(\"The command \\\"/unready\\\" cannnot have characters after it\", origin);\r\n\t\t} else {\r\n\t\t unready(origin);\r\n\t\t}\r\n\r\n\t } else if (command.equals(\"/start\")) {// no trailing text after\r\n\t\t\t\t\t\t // /start\r\n\r\n\t\tif (!remText.isEmpty()) {\r\n\t\t server.privateMessage(\"The command \\\"/start\\\" cannnot have characters after it\", origin);\r\n\t\t} else {\r\n\t\t voteStart(origin);\r\n\t\t}\r\n\t } else {\r\n\t\tserver.privateMessage(message.messageText + \" does not contain a valid command\", origin);\r\n\t }\r\n\r\n\t} else {\r\n\t if (day == true) {\r\n\r\n\t\tif (command.equals(\"/elim\")) { // space between /elim and player\r\n\t\t // name, no trailing text after\r\n\t\t // player name\r\n\t\t if (remText.isEmpty() || remText.contains(\" \")) {\r\n\t\t\tserver.privateMessage(\r\n\t\t\t\t\"The command \\\"/elim\\\" needs to be followed by a player's name with no spaces/characters thereafter\",\r\n\t\t\t\torigin);\r\n\t\t } else {\r\n\t\t\telimDayVote(remText, origin);\r\n\t\t }\r\n\r\n\t\t} else if (command.equals(\"/save\")) {\r\n\t\t if (remText.isEmpty() || remText.contains(\" \")) {\r\n\t\t\tserver.privateMessage(\r\n\t\t\t\t\"The command \\\"/save\\\" needs to be followed by a player's name with no spaces/characters thereafter\",\r\n\t\t\t\torigin);\r\n\t\t } else {\r\n\t\t\tsaveVote(remText, origin);\r\n\t\t }\r\n\r\n\t\t} else if (command.equals(\"/night\")) {\r\n\t\t if (!remText.isEmpty()) {\r\n\t\t\tserver.privateMessage(\"The command \\\"/night\\\" cannnot have characters after it\", origin);\r\n\t\t } else {\r\n\t\t\tvoteNight(origin);\r\n\t\t }\r\n\r\n\t\t} else if (command.equals(\"/day\")) {\r\n\t\t if (!remText.isEmpty()) {\r\n\t\t\tserver.privateMessage(\"The command \\\"/day\\\" cannnot have characters after it\", origin);\r\n\t\t } else {\r\n\t\t\tvoteDay(origin);\r\n\t\t }\r\n\r\n\t\t} else {\r\n\t\t server.privateMessage(message.messageText + \" does not contain a valid command\", origin);\r\n\t\t}\r\n\r\n\t } else {\r\n\r\n\t\tif (command.equals(\"/elim\")) {\r\n\t\t if (remText.isEmpty() || remText.contains(\" \")) {\r\n\t\t\tserver.privateMessage(\r\n\t\t\t\t\"The command \\\"/elim\\\" needs to be followed by a player's name with no spaces/characters thereafter\",\r\n\t\t\t\torigin);\r\n\t\t } else {\r\n\t\t\telimNightVote(remText, origin);\r\n\t\t }\r\n\t\t} else {\r\n\t\t server.privateMessage(\r\n\t\t\t \"The only valid command during the night is \\\"/elim\\\" followed a player's name (separated by a space)\",\r\n\t\t\t origin);\r\n\t\t}\r\n\t }\r\n\t}\r\n\r\n }",
"public void vaccinate(int day){\r\n\t\tfor(int i = 0; i < this.getnVillages(); i++){\r\n\t\t\tvVillages[i].resetNVaccinated();\r\n\t\t\tif(vVillages[i].getVaccDay() == day){\r\n\t\t\t\tvVillages[i].vaccinate();\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private void vote(Vote whichVoteButton, MenuItem item, PostData p) {\n if (!RedditLoginInformation.isLoggedIn()) {\n Toast.makeText(this, R.string.you_must_be_logged_in_to_vote, Toast.LENGTH_SHORT).show();\n return;\n }\n\n Intent intent = new Intent(Consts.BROADCAST_UPDATE_SCORE);\n intent.putExtra(Consts.EXTRA_PERMALINK, p.getPermalink());\n\n switch (whichVoteButton) {\n case DOWN:\n switch (p.getVote()) {\n case DOWN:\n RedditService.vote(this, p.getName(), Vote.NEUTRAL);\n item.setIcon(R.drawable.ic_action_downvote);\n p.setVote(Vote.NEUTRAL);\n p.setScore(p.getScore() + 1);\n break;\n\n case NEUTRAL:\n case UP:\n RedditService.vote(this, p.getName(), Vote.DOWN);\n item.setIcon(R.drawable.ic_action_downvote_highlighted);\n p.setVote(Vote.DOWN);\n mUpvoteMenuItem.setIcon(R.drawable.ic_action_upvote);\n p.setScore(p.getScore() - 1);\n break;\n }\n break;\n\n case UP:\n switch (p.getVote()) {\n case NEUTRAL:\n case DOWN:\n RedditService.vote(this, p.getName(), Vote.UP);\n item.setIcon(R.drawable.ic_action_upvote_highlighted);\n p.setVote(Vote.UP);\n p.setScore(p.getScore() + 1);\n mDownvoteMenuItem.setIcon(R.drawable.ic_action_downvote);\n break;\n\n case UP:\n RedditService.vote(this, p.getName(), Vote.NEUTRAL);\n item.setIcon(R.drawable.ic_action_upvote);\n p.setVote(Vote.NEUTRAL);\n p.setScore(p.getScore() - 1);\n break;\n }\n\n break;\n\n default:\n break;\n }\n\n // Broadcast the intent to update the score in the ImageDetailFragment\n intent.putExtra(Consts.EXTRA_SCORE, p.getScore());\n LocalBroadcastManager.getInstance(this).sendBroadcast(intent);\n }",
"public void updateGame(Seed theSeed, int rowSelected, int columnSelected) {\n \n if (hasWon(theSeed, rowSelected, columnSelected)) { // check for win\n currentState = (theSeed == Seed.CROSS) ? GameState.CROSS_WIN : GameState.NOUGHT_WIN;\n \n } else if (isDraw()) { // checks for draw\n currentState = GameState.DRAW;\n }\n // Otherwise, no change to current state (still GameState.PLAYING).\n }",
"public void gameOfLife(int[][] board) {\n\n for(int i = 0; i < board.length; i++) {\n for (int j = 0; j < board[i].length; j++) {\n int liveCount = countLiveNeighbor(board, i ,j);\n if (board[i][j] == 0) {\n /* dead cell reproduction*/\n board[i][j] = liveCount == 3? 11 : 0;\n } else {\n if (liveCount < 2 || liveCount > 3) {\n /* livecell under-population or over-population */\n board[i][j] = 10;\n }\n }\n }\n }\n for(int i = 0; i < board.length; i++) {\n for (int j = 0; j < board[i].length; j++) {\n if (board[i][j] >= 10) {\n board[i][j] -= 10;\n }\n }\n }\n }",
"private Management castVote(Management mgmt, boolean isNew) {\n\t\tif (!mgmt.hasElection())\n\t\t\treturn null;\n\n\t\tLeaderElection req = mgmt.getElection();\n\t\tif (req.getExpires() <= System.currentTimeMillis()) {\n\t\t\tlogger.info(\"Node \" + this.nodeId + \" says election expired - not voting\");\n\t\t\treturn null;\n\t\t}\n\n\t\t// DANGER! If we return because this node ID is in the list, we have a\n\t\t// high chance an election will not converge as the maxHops determines\n\t\t// if the graph has been traversed!\n\t\tboolean allowCycles = true;\n\n\t\tif (!allowCycles) {\n\t\t\tList<RoutingPath> rtes = mgmt.getHeader().getPathList();\n\t\t\tfor (RoutingPath rp : rtes) {\n\t\t\t\tif (rp.getNodeId() == this.nodeId) {\n\t\t\t\t\t// logger.info(\"Node \" + this.nodeId +\n\t\t\t\t\t// \" already in the routing path - not voting\");\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// okay, the message is new (to me) so I want to determine if I should\n\t\t// nominate\n\t\t// myself\n\n\t\tLeaderElection.Builder elb = LeaderElection.newBuilder();\n\t\tMgmtHeader.Builder mhb = MgmtHeader.newBuilder();\n\t\tmhb.setTime(System.currentTimeMillis());\n\n\t\t// reversing path. If I'm the farthest a message can travel, reverse the\n\t\t// sending\n\t\tif (elb.getHops() == 0)\n\t\t\tmhb.clearPath();\n\t\telse\n\t\t\tmhb.addAllPath(mgmt.getHeader().getPathList());\n\n\t\tmhb.setOriginator(mgmt.getHeader().getOriginator());\n\n\t\telb.setElectId(req.getElectId());\n\t\telb.setAction(ElectAction.NOMINATE);\n\t\telb.setDesc(req.getDesc());\n\t\telb.setExpires(req.getExpires());\n\t\telb.setCandidateId(req.getCandidateId());\n\n\t\t// my vote\n\t\tif (req.getCandidateId() == this.nodeId) {\n\t\t\t// if I am not in the list and the candidate is myself, I can\n\t\t\t// declare myself to be the leader.\n\t\t\t//\n\t\t\t// this is non-deterministic as it assumes the message has\n\t\t\t// reached all nodes in the network (because we know the\n\t\t\t// diameter or the number of nodes).\n\t\t\t//\n\t\t\t// can end up with a partitioned graph of leaders if hops <\n\t\t\t// diameter!\n\n\t\t\tnotify(true, this.nodeId);\n\t\t\telb.setAction(ElectAction.DECLAREWINNER);\n\t\t\telb.setHops(mgmt.getHeader().getPathCount());\n\t\t\tlogger.info(\"Node \" + this.nodeId + \" is declaring itself the leader\");\n\t\t} else {\n\t\t\tif (req.getCandidateId() < this.nodeId)\n\t\t\t\telb.setCandidateId(this.nodeId);\n\t\t\t\n\t\t\tif (req.getHops() == -1)\n\t\t\t\telb.setHops(-1);\n\t\t\telse\n\t\t\t\telb.setHops(req.getHops() - 1);\n\n\t\t\tif (elb.getHops() == 0) {\n\t\t\t\t// reverse travel of the message to ensure it gets back to\n\t\t\t\t// the originator\n\t\t\t\telb.setHops(mgmt.getHeader().getPathCount());\n\n\t\t\t\t// no clear winner, send back the candidate with the highest\n\t\t\t\t// known ID. So, if a candidate sees itself, it will\n\t\t\t\t// declare itself to be the winner (see above).\n\t\t\t} else {\n\t\t\t\t// forwarding the message on so, keep the history where the\n\t\t\t\t// message has been\n\t\t\t\tmhb.addAllPath(mgmt.getHeader().getPathList());\n\t\t\t}\n\t\t}\n\n\t\t// add myself (may allow duplicate entries, if cycling is allowed)\n\t\tRoutingPath.Builder rpb = RoutingPath.newBuilder();\n\t\trpb.setNodeId(this.nodeId);\n\t\trpb.setTime(System.currentTimeMillis());\n\t\tmhb.addPath(rpb);\n\n\t\tManagement.Builder mb = Management.newBuilder();\n\t\tmb.setHeader(mhb.build());\n\t\tmb.setElection(elb.build());\n\n\t\treturn mb.build();\n\t}",
"public void setWins(int value) {\n this.wins = value;\n }",
"private void computeWinLose() {\n\n if (!id11.getText().isEmpty()) {\n if ((id11.getText().equals(id00.getText()) && id11.getText().equals(id22.getText())) ||\n (id11.getText().equals(id02.getText()) && id11.getText().equals(id20.getText())) ||\n (id11.getText().equals(id10.getText()) && id11.getText().equals(id12.getText())) ||\n (id11.getText().equals(id01.getText()) && id11.getText().equals(id21.getText()))) {\n winner = id11.getText();\n }\n }\n\n if (!id00.getText().isEmpty()) {\n if ((id00.getText().equals(id01.getText()) && id00.getText().equals(id02.getText())) ||\n id00.getText().equals(id10.getText()) && id00.getText().equals(id20.getText())) {\n winner = id00.getText();\n }\n }\n\n if (!id22.getText().isEmpty()) {\n if ((id22.getText().equals(id21.getText()) && id22.getText().equals(id20.getText())) ||\n id22.getText().equals(id12.getText()) && id22.getText().equals(id02.getText())) {\n winner = id22.getText();\n }\n }\n\n // If all the grid entries are filled, it is a draw\n if (!id00.getText().isEmpty() && !id01.getText().isEmpty() && !id02.getText().isEmpty() && !id10.getText().isEmpty() && !id11.getText().isEmpty() && !id12.getText().isEmpty() && !id20.getText().isEmpty() && !id21.getText().isEmpty() && !id22.getText().isEmpty()) {\n winner = \"Draw\";\n }\n\n if (winner != null) {\n if (\"X\".equals(winner)) {\n winner = playerX;\n } else if (\"O\".equals(winner)) {\n winner = playerO;\n } else {\n winner = \"Draw\";\n }\n showWindow(winner);\n }\n }",
"private void goKnight(Board B, Graph G) {\n\n int start = B.knight;\n int end = B.gold;\n\n Queue<Integer> q = new Queue<Integer>();\n for (int v = 0; v < G.V(); v++)\n distTo[v] = INFINITY;\n\n int v = -1;\n distTo[start] = 0;\n marked[start] = true;\n q.enqueue(start);\n\n while (!q.isEmpty() && end != v) {\n v = q.dequeue();\n\n\n int tl_dest_R = (v / B.width);\n int tl_dest_C = (v % B.width);\n\n ArrayList<Integer> destinations = new ArrayList<Integer>();\n\n for (Move M : G.moves) {\n\n\n if (validateMove(M, v, G, B)) {\n\n if (true) {\n\n //System.out.println(thereispath(M, B.a.get(tl_dest_R).get(tl_dest_C), newDestination(M, v, G, B), G, B));\n\n if (!marked[newDestination(M, v, G, B)]) {\n\n\n q.enqueue(newDestination(M, v, G, B));\n marked[newDestination(M, v, G, B)] = true;\n edgeTo[newDestination(M, v, G, B)] = v;\n distTo[newDestination(M, v, G, B)] = distTo[v] + 1;\n\n // System.out.println(newDestination(M, v, G, B) + \" \" + edgeTo[newDestination(M, v, G, B)]);\n\n }\n\n\n }\n\n // System.out.println();\n\n }\n\n }\n\n\n //break;\n }\n\n System.out.println();\n\n Stack<Integer> reverse = new Stack<Integer>();\n\n\n int temp = end;\n reverse.push(temp);\n\n while (true) {\n\n\n temp = edgeTo[temp];\n reverse.push(temp);\n\n if (temp == start)\n break;\n }\n\n int last = 0;\n\n int temp_row = 0, temp_column = 0;\n\n String te = \"\";\n\n while (!reverse.isEmpty()) {\n\n if (last != 0) {\n te += \" -> \";\n }\n\n\n last = reverse.pop();\n\n\n temp_row = last / B.width;\n temp_column = last % B.width;\n\n\n te += B.a.get(temp_row).get(temp_column).toT();\n\n\n }\n\n if (distTo[last] == INFINITY) {\n System.out.println(\"No path to the target.\");\n } else {\n\n int a = 0, b = 0;\n\n a = B.gold / B.width;\n b = B.gold % B.width;\n int c = 0, d = 0;\n\n c = B.knight / B.width;\n d = B.knight % B.width;\n\n System.out.println(distTo[last] + \" steps\");\n System.out.println(B.a.get(c).get(d).toT() + \" to \" + B.a.get(a).get(b).toT() + \": \" + te);\n\n }\n\n\n }",
"boolean checkDayNight(boolean daytime);",
"public abstract boolean isRolling(int turnTotal, int opponentScore);",
"public void cmdScheduleGame(User teller, int eventSlot, int boardNum, Player white, Player black) throws IOException {\n tournamentService.scheduleGame(boardNum, eventSlot, white, black);\n tournamentService.flush();\n command.sendCommand(\"+notify {0}\", white);\n command.sendCommand(\"+notify {0}\", black);\n command.sendAdminCommand(\"spoof {0} +notify {1}\", teller, white);\n command.sendAdminCommand(\"spoof {0} +notify {1}\", teller, black);\n command.sendAdminCommand(\"reserve-game {0} {1}\", white, boardNum);\n command.sendAdminCommand(\"reserve-game {0} {1}\", black, boardNum);\n command.tell(teller, \"Okay, I''ve reserved board \\\"{0}\\\" for players \\\"{1}\\\" and \\\"{2}\\\".\", boardNum, white, black);\n }",
"public void clickNightHandler(View v) {\n SharedPreferences.Editor editor = preferences.edit();\n editor.putBoolean(night_key, !this.isNightModeEnabled);\n editor.apply();\n\n this.isNightModeEnabled = !this.isNightModeEnabled;\n\n Intent i = getBaseContext().getPackageManager()\n .getLaunchIntentForPackage( getBaseContext().getPackageName() );\n i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n startActivity(i);\n\n this.recreate();\n }",
"private int liveNeighbours(int i,int j) {\n\t\tint count = 0;\n\t\tif (button[i - 1][j - 1].getBackground() == Color.yellow) {\n\t\t\tcount++;\n\t\t}\n\t\tif (button[i - 1][j].getBackground() == Color.yellow) {\n\t\t\tcount++;\n\t\t}\n\t\tif (button[i - 1][j + 1].getBackground() == Color.yellow) {\n\t\t\tcount++;\n\t\t}\n\t\tif (button[i][j - 1].getBackground() == Color.yellow) {\n\t\t\tcount++;\n\t\t}\n\t\tif (button[i][j + 1].getBackground() == Color.yellow){\n\t\t\tcount++;\n\t\t}\n\t\tif (button[i + 1][ j - 1].getBackground() == Color.yellow){\n\t\t\tcount++;\n\t\t}\n\t\tif (button[i + 1][j].getBackground() == Color.yellow) {\n\t\t\tcount++;\n\t\t}\n\t\tif (button[i + 1][j + 1].getBackground() == Color.yellow) {\n\t\t\tcount++;\n\t\t}\n\t\treturn count;\n\t}",
"void win() {\n String name = score.getName();\n if (Time.getSecondsPassed() < 1) {\n calculateMissionScore();\n setHighscoreName(name);\n int totalSum = score.getCurrentScore() + (10000 / 1);\n System.out.println(\"You have won the game!\" + \"\\n\" + \"You spend: \" + 1 + \" seconds playing the game!\");\n System.out.println(\"Your score is: \" + totalSum);\n System.out.println(\"your score has been added to highscore\");\n data.addHighscore(score.getName(), totalSum);\n System.out.println(\"\");\n System.out.println(\"Current highscore list is: \");\n System.out.println(data.printHighscore());\n } else {\n calculateMissionScore();\n setHighscoreName(name);\n int totalSum = score.getCurrentScore() + (10000 / Time.getSecondsPassed());\n System.out.println(\"You have won the game!\" + \"\\n\" + \"You spend: \" + Time.getSecondsPassed() + \" seconds playing the game!\");\n System.out.println(\"Your score is: \" + totalSum);\n System.out.println(\"your score has been added to highscore\");\n data.addHighscore(score.getName(), totalSum);\n System.out.println(\"\");\n System.out.println(\"Current highscore list is: \");\n System.out.println(data.printHighscore());\n }\n }",
"public void onNightModeChanged(int i) {\n }",
"public static void nightMode(NetSocket socket) {\n String data = \"CS01*868807049006736*0046*NIGHTMODE,20200423142625I0445,1,1,1,22:00,07:00\";\n String deviceId = \"868807049006736\";\n send(socket, data, deviceId);\n }",
"public void sendWinner(Winner winner) {\n try {\n getGlueObject().handleSend(new Envelope()\n .setMessageType(MessageType.FINISH_RACE)\n .setWinner(winner)\n );\n } catch (NoSuchActionException | ActionFailedException e) {\n AlertMessage.alertMsg(null, e.getMessage(), AlertType.ERROR);\n }\n }",
"static void yellow_fight () {\n monsterchoices_y_r = arenafight_y.nextInt(4);\n if (monsterchoices_y_r == 0) {//if integer is zero, you will fight a spider\n System.out.println(\"You encountered a giant spider.\");//#enemyobject-enemy that player tries to defeat\n spider_fight();\n }else if(monsterchoices_y_r == 1) {//if integer is 1 you would fight a goblin\n System.out.println(\"You encountered a goblin.\");//#enemyobject-enemy that player tries to defeat\n goblin_fights(); \n }else if(monsterchoices_y_r == 2) { //if integer is 2, you would fight a golbat\n System.out.println(\"You encountered a golbat.\");//#enemyobject-enemy that player tries to defeat\n golbat_fights();\n }else if(monsterchoices_y_r == 3) { //if the integer is 3, you would fight a witch\n System.out.println(\"You encountered a witch.\");//#enemyobject-enemy that player tries to defeat\n witch_fights();\n }\n \n }",
"@Override\n public int getWinner() {\n return this.board.getWinner();\n }",
"public void getLuckyUnluckyDay() {\n\t\tfor (int day = 0; day < NO_OF_DAYS; day++) {\n\t\t\tint winCount = 0;\n\t\t\tint lostCount = 0;\n\t\t\tint result = STAKE;\n\t\t\twhile ((result != WINING_CASH) && (result != LOOSING_CASH)) {\n\t\t\t\tint randomCheck = (int) Math.floor(Math.random() * 10) % 2;\n\t\t\t\tif (randomCheck == 1) {\n\t\t\t\t\tresult = result + BET;\n\t\t\t\t\twinCount++;\n\t\t\t\t} else {\n\t\t\t\t\tresult = result - BET;\n\t\t\t\t\tlostCount++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (result == WINING_CASH) {\n\t\t\t\tSystem.out.println(\"you won the game\");\n\t\t\t\twinArr[day] = winCount;\n\t\t\t\tSystem.out.println(\"total Amount won :\" + winCount + \"in day: \" + (day + 1));\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"you lost the game\");\n\t\t\t\tlostArr[day] = lostCount;\n\t\t\t\tSystem.out.println(\"total Amount lost: \" + lostCount + \"in day: \" + (day + 1));\n\t\t\t}\n\t\t}\n\t\tint maxWin = 0;\n\t\tint luckyDay = 0;\n\t\tfor (int day = 0; day < NO_OF_DAYS; day++) {\n\t\t\tif (winArr[day] > maxWin && winArr[day] != 0) {\n\t\t\t\tmaxWin = winArr[day];\n\t\t\t\tluckyDay = day;\n\t\t\t\tsumOfWinCount = sumOfWinCount + winArr[day];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"your luckiest day:\" + (luckyDay + 1));\n\t\tint maxLost = 0;\n\t\tint unLuckyDay = 0;\n\t\tfor (int day = 0; day < NO_OF_DAYS; day++) {\n\t\t\tif (lostArr[day] > maxLost && lostArr[day] != 0) {\n\t\t\t\tmaxLost = lostArr[day];\n\t\t\t\tunLuckyDay = day;\n\t\t\t\tsumOfLostCount = sumOfLostCount + lostArr[day];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"your unluchiest day:\" + (unLuckyDay + 1));\n\t\tSystem.out.println();\n\t\ttotalAmount = sumOfWinCount - sumOfLostCount;\n\t\tif (totalAmount > 0) {\n\t\t\tSystem.out.println(\"you won the total amount \" + totalAmount);\n\t\t} else {\n\t\t\tSystem.out.println(\"you lost total amount: \" + totalAmount);\n\t\t}\n\t}",
"public static void announceWinner() {\n\t\tArrayList<String> data = new ArrayList<String>();\n\n\t\tfor (int index = 0; index < LotteryDatabase.lotteryDatabase.size(); index++) {\n\t\t\tLotteryDatabase lotteryData = LotteryDatabase.lotteryDatabase.get(index);\n\t\t\tfor (int i = 0; i < lotteryData.getTicketsPurchased(); i++) {\n\t\t\t\tdata.add(lotteryData.getPlayerName());\n\t\t\t}\n\t\t}\n\t\tif (data.isEmpty()) {\n\t\t\tAnnouncement.announce(\"No one has entered the lottery.\", ServerConstants.RED_COL);\n\t\t\treturn;\n\t\t}\n\t\tString lotteryWinnerName = data.get(Misc.random(data.size() - 1));\n\t\tAnnouncement.announce(\"<img=27><col=a36718> \" + lotteryWinnerName + \" has won the lottery worth \" + getTotalPotString() + \" with \" + getWinningPercentage(lotteryWinnerName)\n\t\t + \"% chance of winning!\");\n\t\tPlayer winner = Misc.getPlayerByName(lotteryWinnerName);\n\t\tif (winner != null) {\n\t\t\twinner.getPA().sendScreenshot(\"Lottery \" + getTotalPotString(), 2);\n\t\t}\n\t\tNpc npc = NpcHandler.npcs[lotteryNpcIndex];\n\t\tnpc.forceChat(\"Congratulations \" + lotteryWinnerName + \" has won the lottery worth \" + getTotalPotString() + \"!\");\n\t\tItemAssistant.addItemReward(null, lotteryWinnerName, ServerConstants.getMainCurrencyId(), getTotalPotNumber(), false, -1);\n\t\tint moneySink = getTotalPotNumber() / 85;\n\t\tmoneySink *= COMMISION_PERCENTAGE;\n\t\tCoinEconomyTracker.addSinkList(null, \"LOTTERY \" + moneySink);\n\t\ttotalTicketsPurchased = 0;\n\t\tLotteryDatabase.lotteryDatabase.clear();\n\t}",
"public void win() {\n JOptionPane.showConfirmDialog(null, \"You won! You got out with \" + this.player.getGold() + \" gold!\", \"VICTORY!\", JOptionPane.OK_OPTION);\n this.saveScore();\n this.updateScores();\n this.showTitleScreen();\n }",
"public void trigger()\r\n\t{\r\n\t\tif(!this.inProgress && this.round >= Config.RoundLimit)\r\n\t\t{\r\n\t\t\tthis.sendMessages(new String[]{\"The game has already ended.\"});\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tint count = this.playerCount();\r\n\t\t\tif(count > 1 && count - this.readyCount() == 0)\r\n\t\t\t{\r\n\t\t\t\tList<String> messages = new LinkedList<>();\r\n\t\t\t\tif(this.inProgress)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(Config.Phases[this.phase].equals(Config.VotePhaseName))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmessages.add(\"Voting ended. Counting votes.\");\r\n\t\t\t\t\t\t// Sum all the votes from each player.\r\n\t\t\t\t\t\tint[] votes = new int[Config.TableCards];\r\n\t\t\t\t\t\tfor(Player player : this.players)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(player != null)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tint[] playerVotes = player.getVotes();\r\n\t\t\t\t\t\t\t\tint i = 0;\r\n\t\t\t\t\t\t\t\twhile(i < playerVotes.length)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tif(playerVotes[i] != 0)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tvotes[i] += playerVotes[i];\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t++i;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tplayer.resetVotes();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// Pick the cards with more yes votes than no votes.\r\n\t\t\t\t\t\tList<Card> picked = new LinkedList<>();\r\n\t\t\t\t\t\tint pos = 0;\r\n\t\t\t\t\t\twhile(pos < this.onTable.size())\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(votes[pos] > 0)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tCard card = this.onTable.get(pos);\r\n\t\t\t\t\t\t\t\tpicked.add(card);\r\n\t\t\t\t\t\t\t\tfor(Share price : this.prices)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tif(price.getStock().equals(card.stock))\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tprice.addShares(card.effect);\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t++pos;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// Prepare the output string for the picked cards.\r\n\t\t\t\t\t\tString message = \"\";\r\n\t\t\t\t\t\tboolean isNotFirst = false;\r\n\t\t\t\t\t\tfor(Card card : picked)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(isNotFirst)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tmessage += \", \";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tisNotFirst = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tmessage += card.stock;\r\n\t\t\t\t\t\t\tif(card.effect > 0)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tmessage += \"+\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tmessage += card.effect;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tthis.dealToTable();\r\n\t\t\t\t\t\tmessages.add(\"Picked influence cards: \" + message);\r\n\t\t\t\t\t\tmessages.add(\"\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t++this.phase;\r\n\t\t\t\t\tif(this.phase >= Config.Phases.length)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tthis.phase = 0;\r\n\t\t\t\t\t\t++this.round;\r\n\t\t\t\t\t\tif(this.round >= Config.RoundLimit)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tthis.stopGame();\r\n\t\t\t\t\t\t\tShare[] prices = this.prices.toArray(new Share[0]);\r\n\t\t\t\t\t\t\tfor(Player player : this.players)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif(player != null)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tplayer.sellAll(prices);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tmessages.add(\"Game over. Scores:\");\r\n\t\t\t\t\t\t\t// Copy and sort the players list by total money.\r\n\t\t\t\t\t\t\tPlayer[] winners = Arrays.copyOf(this.players, this.players.length);\r\n\t\t\t\t\t\t\tArrays.sort(winners, (Player o1, Player o2) -> {\r\n\t\t\t\t\t\t\t\tif(o1 == null && o2 == null)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\treturn 0;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if(o1 == null)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\treturn 1;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if(o2 == null)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\treturn -1;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\treturn o2.getMoney() - o1.getMoney();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\tint lastScore = winners[0].getMoney();\r\n\t\t\t\t\t\t\tint num = 0;\r\n\t\t\t\t\t\t\tint i = 0;\r\n\t\t\t\t\t\t\twhile(i < winners.length)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif(winners[i] == null)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tif(lastScore > winners[i].getMoney())\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tnum = i;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tmessages.add(Config.PlayerPositions[num] + \": Player \" + winners[i].getPlayerNumber() + \", \" + winners[i].getName() + \" - \" + Config.Currency + winners[i].getMoney());\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t++i;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tmessages.add(\"Round \" + (this.round + 1) + \" of \" + Config.RoundLimit + \".\");\r\n\t\t\t\t\t\t\tmessages.add(Config.Phases[this.phase] + \" phase started.\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmessages.add(Config.Phases[this.phase] + \" phase started.\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tthis.inProgress = true;\r\n\t\t\t\t\tmessages.add(\"Game started. Round \" + (this.round + 1) + \" of \" + Config.RoundLimit + \".\");\r\n\t\t\t\t\tmessages.add(Config.Phases[this.phase] + \" phase started.\");\r\n\t\t\t\t}\r\n\t\t\t\tthis.sendMessages(messages.toArray(new String[0]));\r\n\t\t\t\tfor(Player player : this.players)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(player != null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tplayer.setReady(false);\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}"
] | [
"0.71044135",
"0.7103168",
"0.63611203",
"0.5590847",
"0.5243205",
"0.5177686",
"0.4953025",
"0.4795664",
"0.47905076",
"0.47620767",
"0.47497547",
"0.4733068",
"0.47033054",
"0.46626353",
"0.46589062",
"0.465473",
"0.46534377",
"0.46030506",
"0.4570109",
"0.4565553",
"0.45303807",
"0.45210373",
"0.44984356",
"0.4491135",
"0.44893306",
"0.4481721",
"0.44662777",
"0.44435787",
"0.44353607",
"0.44007483",
"0.43989152",
"0.43969122",
"0.4388562",
"0.43856895",
"0.4384275",
"0.437659",
"0.437615",
"0.43615472",
"0.4351296",
"0.43427062",
"0.43307772",
"0.43302876",
"0.43144995",
"0.43014207",
"0.42983198",
"0.42842215",
"0.42823339",
"0.42784238",
"0.42718336",
"0.42602345",
"0.4253965",
"0.42487562",
"0.4240406",
"0.42298362",
"0.42270407",
"0.4214398",
"0.4211803",
"0.41970372",
"0.4188393",
"0.4176616",
"0.41741502",
"0.41732877",
"0.41676348",
"0.41588962",
"0.41551685",
"0.41531515",
"0.41437042",
"0.4143378",
"0.41396075",
"0.41358912",
"0.4135051",
"0.41348818",
"0.41340554",
"0.41331372",
"0.41308698",
"0.41296104",
"0.4127269",
"0.41230503",
"0.4100701",
"0.41003016",
"0.40987617",
"0.40936974",
"0.40924603",
"0.40908054",
"0.40900868",
"0.4088473",
"0.40850335",
"0.40829659",
"0.40793908",
"0.40752223",
"0.40664244",
"0.4065872",
"0.4065725",
"0.40639684",
"0.4062968",
"0.40597",
"0.40570134",
"0.40541795",
"0.40515742",
"0.40499443"
] | 0.7912831 | 0 |
The voteDay method is used to vote against the vote to change the game to night. The method takes the origin of the message and checks whether the player it corresponds to has already voted to keep it day (in which case doesn't add their vote) and checks if they have already voted for night (in which case it removes their vote from night and adds their vote to day). | private void voteDay(int origin) {
if (!nightVoteInProgress) {
server.privateMessage("cannot use this command when there isn't a vote to change to night", origin);
} else if (dayVote.contains(origin)) {
server.privateMessage("you have already voted to keep the game in the day phase", origin);
} else if (!players.containsKey(origin)) {
server.privateMessage("you are not in the game, so cannot participate", origin);
} else {
if (nightVote.contains(origin)) {
int index = nightVote.indexOf(origin);
nightVote.remove(index);
}
dayVote.add(origin);
checkDay(origin);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void elimDayVote(String player, int origin) {\r\n\r\n\t// int playerID = server.getUserID(player);\r\n\tif (players.containsValue(player)) {\r\n\t OrderedBidiMap<String, Integer> invPlayers = players.inverseBidiMap();\r\n\r\n\t int playerID = invPlayers.get(player);\r\n\r\n\t // if (nightVote.size() > 0) {\r\n\t if (nightVoteInProgress) {\r\n\t\tserver.privateMessage(\r\n\t\t\t\"cannot vote to eliminate a player while there is a vote to change the game to night\", origin);\r\n\r\n\t\t// } else if (!playerIDs.contains(playerID)) { // this is for\r\n\t\t// when\r\n\t\t// using ArrayList of playerIDs\r\n\t } else if (playerID == origin) {\r\n\t\tserver.privateMessage(\"you cannot vote for yourself\", origin);\r\n\r\n\t } else if (elimDay.contains(origin)) {\r\n\t\tserver.privateMessage(\"you have already voted to start\", origin);\r\n\r\n\t } else if (!players.containsKey(origin)) {\r\n\t\tserver.privateMessage(\"you are not in the game, so cannot participate\", origin);\r\n\r\n\t } else if (playerOnTrialID == null) {\r\n\t\telimDayVoteInProgress = true;\r\n\t\tplayerOnTrialID = playerID;\r\n\t\telimDay.add(origin);\r\n\r\n\t\tTimerTask dayElimVoteTimeout = new TimerTask() { // not sure if\r\n\t\t\t\t\t\t\t\t // this\r\n\t\t\t\t\t\t\t\t // will work\r\n\t\t\t\t\t\t\t\t // properly\r\n\t\t\t\t\t\t\t\t // (method\r\n\t\t\t\t\t\t\t\t // should\r\n\t\t\t\t\t\t\t\t // continue\r\n\t\t\t\t\t\t\t\t // without\r\n\t\t\t\t\t\t\t\t // waiting for\r\n\t\t\t\t\t\t\t\t // it\r\n\t\t\t\t\t\t\t\t // to finish\r\n\r\n\t\t @Override\r\n\t\t public void run() {\r\n\t\t\tdayElimVoteTimeout(); // this might need a catch\r\n\r\n\t\t }\r\n\t\t};\r\n\r\n\t\tdayElimTimer = new Timer();\r\n\r\n\t\tdayElimTimer.schedule(dayElimVoteTimeout, 20000);\r\n\r\n\t } else {\r\n\t\tif (playerOnTrialID != playerID) {\r\n\t\t server.privateMessage(\"cannot vote for \" + player + \" while the vote for \"\r\n\t\t\t + server.getUsername(playerOnTrialID) + \" is in progress\", origin);\r\n\t\t} else {\r\n\t\t if (save.contains(origin)) {\r\n\t\t\tint index = save.indexOf(origin);\r\n\t\t\tsave.remove(index);\r\n\t\t }\r\n\r\n\t\t elimDay.add(origin);\r\n\t\t checkElim(origin);\r\n\t\t}\r\n\t }\r\n\t} else if (!players.containsValue(player)) {\r\n\t server.privateMessage(player + \" is not in this game/has already been eliminated\", origin);\r\n\r\n\t}\r\n\r\n }",
"private void voteNight(int origin) {\r\n\t// if (playerOnTrialID != null) {\r\n\tif (elimDayVoteInProgress) {\r\n\t server.privateMessage(\"you cannot start a vote for it to be night when there is a vote in progress \"\r\n\t\t + \"to eliminate a player\", origin);\r\n\r\n\t} else if (nightVote.contains(origin)) {\r\n\t server.privateMessage(\"you have already voted to change the game to night\", origin);\r\n\r\n\t} else if (!players.containsKey(origin)) {\r\n\t server.privateMessage(\"you are not in the game, so cannot participate\", origin);\r\n\r\n\t} else {\r\n\t nightVoteInProgress = true;\r\n\r\n\t if (dayVote.contains(origin)) {\r\n\t\tint index = dayVote.indexOf(origin);\r\n\t\tdayVote.remove(index);\r\n\t }\r\n\r\n\t nightVote.add(origin);\r\n\r\n\t if (nightVote.size() == 1) {\r\n\t\tTimerTask nightVoteTimeout = new TimerTask() {\r\n\r\n\t\t @Override\r\n\t\t public void run() {\r\n\t\t\tnightVoteTimeout(); // this might need a catch\r\n\r\n\t\t }\r\n\t\t};\r\n\r\n\t\tnightVoteTimer = new Timer();\r\n\r\n\t\tnightVoteTimer.schedule(nightVoteTimeout, 20000);\r\n\t } else {\r\n\t\tcheckNight(origin);\r\n\t }\r\n\r\n\t}\r\n }",
"private void checkDay(int origin) {\r\n\tserver.publicMessage(players.get(origin) + \" has voted for it to remain day\");\r\n\r\n\t// if (dayVote.size() > playerIDs.size() / 2) {\r\n\tif (dayVote.size() > players.size() / 2) {\r\n\t day();\r\n\t} else if (dayVote.size() == players.size() / 2 && players.size() % 2 == 0) {\r\n\t day();\r\n\t}\r\n }",
"private void checkNight(int origin) {\r\n\tserver.publicMessage(players.get(origin) + \" has voted for it to remain night\");\r\n\r\n\t// if (nightVote.size() > playerIDs.size() / 2) {\r\n\tif (nightVote.size() > players.size() / 2) {\r\n\t night();\r\n\t}\r\n }",
"private void eliminateDay() {\r\n\tdayElimTimer.cancel();\r\n\tdayElimTimer.purge();\r\n\r\n\t// playerIDs.remove(playerOnTrialID);\r\n\tplayers.remove(playerOnTrialID);\r\n\r\n\tif (mafia.contains(playerOnTrialID)) {\r\n\t int index = mafia.indexOf(playerOnTrialID);\r\n\t mafia.remove(index);\r\n\r\n\t} else {\r\n\t int index = innocentIDs.indexOf(playerOnTrialID);\r\n\t innocentIDs.remove(index);\r\n\t}\r\n\r\n\tserver.setPlayerMuted(playerOnTrialID, true);\r\n\r\n\tserver.publicMessage(server.getUsername(playerOnTrialID) + \" has been eliminated\");\r\n\r\n\tplayerOnTrialID = null;\r\n\telimDay.clear();\r\n\tsave.clear();\r\n\telimDayVoteInProgress = false;\r\n\r\n\tcheckWin();\r\n }",
"public void vaccinate(int day){\r\n\t\tfor(int i = 0; i < this.getnVillages(); i++){\r\n\t\t\tvVillages[i].resetNVaccinated();\r\n\t\t\tif(vVillages[i].getVaccDay() == day){\r\n\t\t\t\tvVillages[i].vaccinate();\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"void setDayOrNight(int day) {\n setStat(day, dayOrNight);\n }",
"public void setDay(Date day) {\n this.day = day;\n }",
"public void setDay(Date day) {\r\n this.day = day;\r\n }",
"public void setDay(Date day) {\r\n this.day = day;\r\n }",
"public void setDay(Date day) {\r\n this.day = day;\r\n }",
"public void setDay(Date day) {\r\n this.day = day;\r\n }",
"public void setDay(Date day) {\r\n this.day = day;\r\n }",
"public void dayIsLike() \r\n\t{ \r\n\t\tswitch (day) \r\n\t\t{ \r\n\t\tcase MONDAY: \r\n\t\t\tSystem.out.println(\"Mondays are bad.\"); \r\n\t\t\tbreak; \r\n\t\tcase FRIDAY: \r\n\t\t\tSystem.out.println(\"Fridays are better.\"); \r\n\t\t\tbreak; \r\n\t\tcase SATURDAY: \r\n\t\t\tSystem.out.println(\"Saturdays are better.\"); \r\n\t\t\tbreak;\r\n\t\tcase SUNDAY: \r\n\t\t\tSystem.out.println(\"Weekends are best.\"); \r\n\t\t\tbreak; \r\n\t\tdefault: \r\n\t\t\tSystem.out.println(\"Midweek days are so-so.\"); \r\n\t\t\tbreak; \r\n\t\t} \r\n\t}",
"public void setDay(String day) {\n\n\t\tthis.day = day;\n\t}",
"String updateDay(String userName, Day day);",
"public void setDay(int day) {\n\t\tthis.day = day;\n\t}",
"public void setDay(int day) {\n\t\tthis.day = day;\n\t}",
"public void setDay(int day)\n {\n this.day = day;\n }",
"public void setDay(int day) {\r\n this.day = day;\r\n }",
"public void setDay(final int day) {\n\t\tthis.day = day;\n\t}",
"public void onDayClick(EventDay eventDay) {\n if (_currentNote.getText() != null) {\n if (_currentNote.getText().length()>0) {\n _dailyNotes.put(currDate.toString(), _currentNote.getText().toString());\n }\n }\n _currentNote.clearFocus();\n\n //update current data\n currCal = eventDay.getCalendar();\n currDate = currCal.getTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();\n _readingSwitch.setChecked(_savedDates.contains(currDate));\n _currentNote.setText(_dailyNotes.get(currDate.toString()));\n currNote = _dailyNotes.get(currDate.toString());\n\n// Log.i(\"DailyLogFragment\", \"After click event Day clicked is: \" + eventDay);\n// Log.i(\"DailyLogFragment\", \"After clicked _daysRead has: \" + _daysRead.size());\n// Log.i(\"DailyLogFragment\", \"After clicked currDay is: \" + currDate);\n// Log.i(\"DailyLogFragment\", \"_daysRead = \" + _daysRead);\n// Log.i(\"DailyLogFragment\", \"_savedDates = \" + _savedDates);\n// Log.i(\"DailyLogFragment\", \"after current Note is: \" + currNote);\n }",
"public Component canOnlyVoteAtDay() {\n return MiniMessage.get().parse(canOnlyVoteAtDay);\n }",
"public static int snail(int column, int day, int night) {\n\n int count = 0;\n int d = 0;\n while (d < column) {\n d += day;\n count++;\n if (d < column) {\n d -= night;\n }\n }\n\n return count;\n }",
"private void saveVote(String player, int origin) {// suspicious player do\r\n\t\t\t\t\t\t // need\r\n\t// to vote for themselves\r\n\r\n\tif (players.containsValue(player)) {\r\n\t OrderedBidiMap<String, Integer> invPlayers = players.inverseBidiMap();\r\n\t // int playerID = server.getUserID(player);\r\n\t int playerID = invPlayers.get(player);\r\n\r\n\t if (playerOnTrialID == null) {\r\n\t\tserver.privateMessage(\"you cannot vote to save someone when there is no-one on trial\", origin);\r\n\r\n\t\t// } else if (!playerIDs.contains(playerID)) {\r\n\t } else {\r\n\t\tif (playerOnTrialID != playerID) {\r\n\t\t server.privateMessage(\"cannot vote for \" + player + \" while the vote for \"\r\n\t\t\t + server.getUsername(playerOnTrialID) + \" is in progress\", origin);\r\n\r\n\t\t} else if (!players.containsKey(origin)) {\r\n\t\t server.privateMessage(\"you are not in the game, so cannot participate\", origin);\r\n\r\n\t\t} else {\r\n\t\t if (elimDay.contains(origin)) {\r\n\t\t\tint index = elimDay.indexOf(origin);\r\n\t\t\telimDay.remove(index);\r\n\t\t }\r\n\r\n\t\t save.add(origin);\r\n\t\t checkSave(origin);\r\n\t\t}\r\n\t }\r\n\t} else if (!players.containsValue(player)) {\r\n\t server.privateMessage(player + \" is not in this game/has already been eliminated\", origin);\r\n\r\n\t}\r\n\r\n }",
"void setUserVoteSalaryWeeklyDayOfWeek(DayOfWeek voteSalaryDayOfWeek);",
"public io.dstore.values.TimestampValueOrBuilder getDayOrBuilder() {\n if (dayBuilder_ != null) {\n return dayBuilder_.getMessageOrBuilder();\n } else {\n return day_ == null ?\n io.dstore.values.TimestampValue.getDefaultInstance() : day_;\n }\n }",
"private void checkElim(int origin) {\r\n\r\n\t// if (elimDay.size() > playerIDs.size() / 2) {\r\n\tserver.publicMessage(players.get(origin) + \" has voted to eliminate \" + server.getUsername(playerOnTrialID));\r\n\r\n\tif (elimDay.size() > players.size() / 2) {\r\n\t eliminateDay();\r\n\t}\r\n\r\n }",
"public void setDayId(String dayId) {\r\n this.dayId = dayId;\r\n }",
"public void cycleDay() {\r\n player.gametick();\r\n }",
"public Component canOnlyVoteAtNight() {\n return MiniMessage.get().parse(canOnlyVoteAtNight);\n }",
"private void dayLoop(Player p){\r\n\t\t//Loop for every day.\r\n\t\tSystem.out.println(\"*******************\");\r\n\t\tSystem.out.println(\"It is now \" + p.getName() + \"'s turn on this day.\");\r\n\t\twhile(p.getActions() > 0){\r\n\t\t\tSystem.out.println(\"Choose what you're going to do with the day.\");\r\n\t\t\tSystem.out.println(p.getName() + \" has \" + p.getActions() + \" actions left for the day.\");\r\n\t\t\tSystem.out.println(\"1. Play with a pet.\");\r\n\t\t\tSystem.out.println(\"2. Feed a pet.\");\r\n\t\t\tSystem.out.println(\"3. Go to the store.\");\r\n\t\t\tSystem.out.println(\"4. Print out pet status.\");\r\n\t\t\tSystem.out.println(\"5. End the day early.\");\r\n\t\t\tint selected = getNumber(1,5);\r\n\t\t\tswitch(selected){\r\n\t\t\t//Playing with a pet.\r\n\t\t\tcase 1:\r\n\t\t\t\tplay(p);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\t//Feeding a pet.\r\n\t\t\tcase 2:\r\n\t\t\t\tfeed(p);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\t//Code for the store.\r\n\t\t\tcase 3:\r\n\t\t\t\tstoreTrip(p);\r\n\t\t\t\tbreak;\r\n\t\t\t\t//Print Pet Status\r\n\t\t\tcase 4:\r\n\t\t\t\tfor(Pet pet : p.getPets()){\r\n\t\t\t\t\tSystem.out.println(pet.printStatus());\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\t//Print Player inventory.\r\n\t\t\tcase 5:\r\n\t\t\t\tp.printInventory();\r\n\t\t\t\t//Finish the day early.\r\n\t\t\tcase 6:\r\n\t\t\t\tp.setActions(0);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tSystem.out.println(\"Fatal Error.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tendDay(p);\r\n\t}",
"@Override\n public MessageWrapper[] onMsgReceive(MSGGameVote msg, Player sender) {\n Lobby lobby = playerLobbyMap.get(sender);\n lobby.getGameSession().addVote(msg.isAccepted(), msg.getOrient());\n\n if (lobby.getGameSession().allVoted()) {\n // all players voted, move onto next player\n Player prevPlayer = lobby.getGameSession().getCurrentTurn();\n lobby.getGameSession().nextTurn(false);\n\n Message msgNextTurn = new MSGNewTurn(\n prevPlayer,\n lobby.getGameSession().getCurrentTurn(),\n lobby.getGameSession().getScores().get(prevPlayer),\n false);\n\n // if board is full, end the game\n if (lobby.getGameSession().isBoardFull()) {\n Message msgEndGame = new MSGGameStatus(MSGGameStatus.GameStatus.ENDED, null);\n\n // TODO: Better structure protocol\n // send additional message to end game\n return MessageWrapper.prepWraps(\n new MessageWrapper(msgNextTurn, lobby.getPlayers()),\n new MessageWrapper(msgEndGame, lobby.getPlayers()));\n } else {\n return MessageWrapper.prepWraps(\n new MessageWrapper(msgNextTurn, lobby.getPlayers()));\n }\n }\n\n return null;\n }",
"@Override\r\n\t\t public void run() {\r\n\t\t\tdayElimVoteTimeout(); // this might need a catch\r\n\r\n\t\t }",
"public void setDay(final short day) {\r\n\t\tthis.day = day;\r\n\t}",
"@Override\n\tpublic void proceedNewDay(int p_date) \n\t\t\tthrows RemoteException \n\t{\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}",
"@Override\r\n public void handleMessage(Message message, int origin) {\r\n\r\n\tString text = message.messageText;\r\n\tString remText = \"\";\r\n\tString command = \"\";\r\n\r\n\tif (text.indexOf(' ') < 0) {\r\n\t remText = \"\";\r\n\t command = message.messageText;\r\n\t} else {\r\n\t command = message.messageText.substring(0, text.indexOf(' '));\r\n\t remText = text.substring(text.indexOf(' ') + 1);\r\n\t}\r\n\r\n\tif (!gameInProgress) {\r\n\r\n\t if (command.equals(\"/ready\")) { // no trailing text after /ready\r\n\t\tif (!remText.isEmpty()) {\r\n\t\t server.privateMessage(\"The command \\\"/ready\\\" cannnot have characters after it\", origin);\r\n\t\t} else {\r\n\t\t ready(origin);\r\n\t\t}\r\n\r\n\t } else if (command.equals(\"/unready\")) {\r\n\t\tif (!remText.isEmpty()) {\r\n\t\t server.privateMessage(\"The command \\\"/unready\\\" cannnot have characters after it\", origin);\r\n\t\t} else {\r\n\t\t unready(origin);\r\n\t\t}\r\n\r\n\t } else if (command.equals(\"/start\")) {// no trailing text after\r\n\t\t\t\t\t\t // /start\r\n\r\n\t\tif (!remText.isEmpty()) {\r\n\t\t server.privateMessage(\"The command \\\"/start\\\" cannnot have characters after it\", origin);\r\n\t\t} else {\r\n\t\t voteStart(origin);\r\n\t\t}\r\n\t } else {\r\n\t\tserver.privateMessage(message.messageText + \" does not contain a valid command\", origin);\r\n\t }\r\n\r\n\t} else {\r\n\t if (day == true) {\r\n\r\n\t\tif (command.equals(\"/elim\")) { // space between /elim and player\r\n\t\t // name, no trailing text after\r\n\t\t // player name\r\n\t\t if (remText.isEmpty() || remText.contains(\" \")) {\r\n\t\t\tserver.privateMessage(\r\n\t\t\t\t\"The command \\\"/elim\\\" needs to be followed by a player's name with no spaces/characters thereafter\",\r\n\t\t\t\torigin);\r\n\t\t } else {\r\n\t\t\telimDayVote(remText, origin);\r\n\t\t }\r\n\r\n\t\t} else if (command.equals(\"/save\")) {\r\n\t\t if (remText.isEmpty() || remText.contains(\" \")) {\r\n\t\t\tserver.privateMessage(\r\n\t\t\t\t\"The command \\\"/save\\\" needs to be followed by a player's name with no spaces/characters thereafter\",\r\n\t\t\t\torigin);\r\n\t\t } else {\r\n\t\t\tsaveVote(remText, origin);\r\n\t\t }\r\n\r\n\t\t} else if (command.equals(\"/night\")) {\r\n\t\t if (!remText.isEmpty()) {\r\n\t\t\tserver.privateMessage(\"The command \\\"/night\\\" cannnot have characters after it\", origin);\r\n\t\t } else {\r\n\t\t\tvoteNight(origin);\r\n\t\t }\r\n\r\n\t\t} else if (command.equals(\"/day\")) {\r\n\t\t if (!remText.isEmpty()) {\r\n\t\t\tserver.privateMessage(\"The command \\\"/day\\\" cannnot have characters after it\", origin);\r\n\t\t } else {\r\n\t\t\tvoteDay(origin);\r\n\t\t }\r\n\r\n\t\t} else {\r\n\t\t server.privateMessage(message.messageText + \" does not contain a valid command\", origin);\r\n\t\t}\r\n\r\n\t } else {\r\n\r\n\t\tif (command.equals(\"/elim\")) {\r\n\t\t if (remText.isEmpty() || remText.contains(\" \")) {\r\n\t\t\tserver.privateMessage(\r\n\t\t\t\t\"The command \\\"/elim\\\" needs to be followed by a player's name with no spaces/characters thereafter\",\r\n\t\t\t\torigin);\r\n\t\t } else {\r\n\t\t\telimNightVote(remText, origin);\r\n\t\t }\r\n\t\t} else {\r\n\t\t server.privateMessage(\r\n\t\t\t \"The only valid command during the night is \\\"/elim\\\" followed a player's name (separated by a space)\",\r\n\t\t\t origin);\r\n\t\t}\r\n\t }\r\n\t}\r\n\r\n }",
"boolean checkDayNight(boolean daytime);",
"public void vote(JsonObject inputMsg) {\n\t\tmessage = new JsonObject();\n\t\tmessage.addProperty(\"Direction\", \"ClientToServer\");\n\t\tmessage.addProperty(\"Function\", \"InGame\");\n\t\tmessage.addProperty(\"Operation\", \"VoteResult\");\n\t\tmessage.addProperty(\"RoomNumber\", roomNumber);\n\t\tmessage.addProperty(\"ScoredPlayer\", format(inputMsg.get(\"ScoredPlayer\").toString()));\n\n\t\tint r = Integer.parseInt(format(inputMsg.get(\"Row\").toString()));\n\t\tint c = Integer.parseInt(format(inputMsg.get(\"Column\").toString()));\n\t\tArrayList<String> voteWord = new ArrayList<String>();\n\n\t\tString word[] = new String[2];\n\n\t\tboard[r][c].setText(format(inputMsg.get(\"Letter\").toString()));\n\n\t\tword[0] = board[r][c].getText();\n\t\tword[1] = board[r][c].getText();\n\t\tboard[r][c].setBackground(Color.YELLOW);\n\n\t\t// Connect letters into a word\n\t\tfor (int i = 1; r + i < board.length; i++) {\n\t\t\tif (board[r + i][c].getText().equals(\"\")) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tword[0] = word[0] + board[r + i][c].getText();\n\t\t\tboard[r + i][c].setBackground(Color.YELLOW);\n\t\t}\n\n\t\tfor (int i = 1; r - i >= 0; i++) {\n\t\t\tif (board[r - i][c].getText().equals(\"\")) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tword[0] = board[r - i][c].getText() + word[0];\n\t\t\tboard[r - i][c].setBackground(Color.YELLOW);\n\t\t}\n\n\t\tfor (int i = 1; c + i < board.length; i++) {\n\t\t\tif (board[r][c + i].getText().equals(\"\")) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tword[1] = word[1] + board[r][c + i].getText();\n\t\t\tboard[r][c + i].setBackground(Color.YELLOW);\n\t\t}\n\t\tfor (int i = 1; c - i >= 0; i++) {\n\t\t\tif (board[r][c - i].getText().equals(\"\")) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tword[1] = board[r][c - i].getText() + word[1];\n\t\t\tboard[r][c - i].setBackground(Color.YELLOW);\n\t\t}\n\n\t\tif (word[0].length() + word[1].length() == 2) {\n\t\t\tvoteWord.add(word[0]);\n\t\t} else {\n\t\t\tvoteWord.add(word[0]);\n\t\t\tvoteWord.add(word[1]);\n\t\t}\n\t\tvoteWord(voteWord);\n\t}",
"public void voteWord(ArrayList<String> voteWord) {\n\n\t\tJsonArray voteword = new JsonArray();\n\t\tJsonObject tmp = new JsonObject();\n\n\t\tfor (String s : voteWord) {\n\t\t\ttmp = new JsonObject();\n\t\t\ttmp.addProperty(\"Word\", s);\n\t\t\tint isAccept = JOptionPane.showConfirmDialog(null, \"Is \" + \"\\\"\" + s + \"\\\"\" + \" a word?\",\n\t\t\t\t\t\"Vote\", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);\n\t\t\tif (isAccept == JOptionPane.YES_OPTION) {\n\t\t\t\ttmp.addProperty(\"IsAWord\", \"Yes\");\n\t\t\t} else {\n\t\t\t\ttmp.addProperty(\"IsAWord\", \"No\");\n\t\t\t}\n\t\t\tvoteword.add(tmp);\n\t\t}\n\n\t\tmessage.add(\"VoteWord\", voteword);\n\n\t\tjsonString = message.toString();\n\n\t\ttry {\n\t\t\twriter.write(jsonString + \"\\n\");\n\t\t\twriter.flush();\n\t\t} catch (IOException e) {\n\t\t\tJOptionPane.showMessageDialog(null, \"Fail to connect Server\", \"Error\",\n\t\t\t\t\tJOptionPane.ERROR_MESSAGE);\n\t\t\tSystem.exit(0);\n\t\t}\n\t\tfor (int i = 0; i < ROW; i++) {\n\t\t\tfor (int j = 0; j < COLUME; j++) {\n\t\t\t\tboard[i][j].setBackground(Color.WHITE);\n\t\t\t}\n\t\t}\n\t}",
"public void getLuckyUnluckyDay() {\n\t\tfor (int day = 0; day < NO_OF_DAYS; day++) {\n\t\t\tint winCount = 0;\n\t\t\tint lostCount = 0;\n\t\t\tint result = STAKE;\n\t\t\twhile ((result != WINING_CASH) && (result != LOOSING_CASH)) {\n\t\t\t\tint randomCheck = (int) Math.floor(Math.random() * 10) % 2;\n\t\t\t\tif (randomCheck == 1) {\n\t\t\t\t\tresult = result + BET;\n\t\t\t\t\twinCount++;\n\t\t\t\t} else {\n\t\t\t\t\tresult = result - BET;\n\t\t\t\t\tlostCount++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (result == WINING_CASH) {\n\t\t\t\tSystem.out.println(\"you won the game\");\n\t\t\t\twinArr[day] = winCount;\n\t\t\t\tSystem.out.println(\"total Amount won :\" + winCount + \"in day: \" + (day + 1));\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"you lost the game\");\n\t\t\t\tlostArr[day] = lostCount;\n\t\t\t\tSystem.out.println(\"total Amount lost: \" + lostCount + \"in day: \" + (day + 1));\n\t\t\t}\n\t\t}\n\t\tint maxWin = 0;\n\t\tint luckyDay = 0;\n\t\tfor (int day = 0; day < NO_OF_DAYS; day++) {\n\t\t\tif (winArr[day] > maxWin && winArr[day] != 0) {\n\t\t\t\tmaxWin = winArr[day];\n\t\t\t\tluckyDay = day;\n\t\t\t\tsumOfWinCount = sumOfWinCount + winArr[day];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"your luckiest day:\" + (luckyDay + 1));\n\t\tint maxLost = 0;\n\t\tint unLuckyDay = 0;\n\t\tfor (int day = 0; day < NO_OF_DAYS; day++) {\n\t\t\tif (lostArr[day] > maxLost && lostArr[day] != 0) {\n\t\t\t\tmaxLost = lostArr[day];\n\t\t\t\tunLuckyDay = day;\n\t\t\t\tsumOfLostCount = sumOfLostCount + lostArr[day];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"your unluchiest day:\" + (unLuckyDay + 1));\n\t\tSystem.out.println();\n\t\ttotalAmount = sumOfWinCount - sumOfLostCount;\n\t\tif (totalAmount > 0) {\n\t\t\tSystem.out.println(\"you won the total amount \" + totalAmount);\n\t\t} else {\n\t\t\tSystem.out.println(\"you lost total amount: \" + totalAmount);\n\t\t}\n\t}",
"protected abstract void updateDayTime(fr.inria.phoenix.diasuite.framework.datatype.daytime.DayTime currentTime) throws Exception;",
"@Override\n\tpublic void msgUpdateTime(int time, int day) {\n\t\tlog.add(new LoggedEvent(\"Recieved Time \" + time));\n\t}",
"@Override\n public void run() {\n\n try {\n LocalDateTime now = LocalDateTime.now();\n voda bot = new voda();\n\n List<Integer> notifyTime = Arrays.asList(7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23);\n int currentHour = now.getHour();\n\n ArrayList<Integer> consulted = dbmodel.MysqlCon.getFollowers();\n\n for (Integer ntime : notifyTime) {\n if (ntime == currentHour) {\n for (Integer consultedUser : consulted) {\n bot.sendTextToIdMessage(consultedUser, dbmodel.MysqlCon.getEveryDayWaterUserWaterCountView(consultedUser));\n }\n }\n }\n\n\n } catch (Exception e) {\n System.out.println();\n }\n }",
"public io.dstore.values.TimestampValue getDay() {\n if (dayBuilder_ == null) {\n return day_ == null ? io.dstore.values.TimestampValue.getDefaultInstance() : day_;\n } else {\n return dayBuilder_.getMessage();\n }\n }",
"public io.dstore.values.StringValueOrBuilder getDayOrBuilder() {\n if (dayBuilder_ != null) {\n return dayBuilder_.getMessageOrBuilder();\n } else {\n return day_ == null ?\n io.dstore.values.StringValue.getDefaultInstance() : day_;\n }\n }",
"protected void saveVote(Long voteForId) {\n if (mywebapp.getAuthenticatedUser() == null) {\n getMessagePanel().displayMessage(\"Please login before voting.\");\n return;\n }\n ContestRequest contestRequest = new ContestRequest();\n GWT.log(\"authToken=\" + mywebapp.getAuthToken());\n contestRequest.setAuthToken(mywebapp.getAuthToken());\n //we don't init the check boxes when it's location only\n for (Long contestId : ratingMap.keySet()) {\n Rating rating = ratingMap.get(contestId);\n //only register if there was a vote\n Integer val = rating.getValue();\n if (val > 0) {\n ContestEntryHolder ceh = new ContestEntryHolder();\n ceh.setContestId(contestId);\n ceh.setRating(val);\n ceh.setVoteForId(voteForId);\n contestRequest.getContestEntryHolders().add(ceh);\n }\n }\n ApiServiceAsync myService = mywebapp.getApiServiceAsync();\n myService.vote(contestRequest, new AsyncCallback() {\n public void onFailure(Throwable caught) {\n //postDialog.hide();\n getMessagePanel().displayError(caught.getMessage());\n }\n\n public void onSuccess(Object result) {\n MobileResponse mobileResponse = (MobileResponse) result;\n if (mobileResponse.getStatus() == 1) {\n getMessagePanel().displayMessage(\"Thanks for voting\");\n } else {\n //postDialog.hide();\n getMessagePanel().displayErrors(mobileResponse.getErrorMessages());\n }\n }\n });\n }",
"public void sendVoteNotification() {\n\t\t\t\t\tWorld.sendWorldMessage(\"<img=5>[Vote Feed]: colorhere\" + getDisplayName() + \" </col>voted for\" + \n\t\t\t\t\t\t\t\t\t\t\t\"colorhere \"+ voteDisplayAmount +\" Vote Tickets!</col> \"\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"World votes are now at colorhere\"+ WorldVote.getVotes()+\"</col>.\", false);\t\n\t}",
"public void setDay(byte value) {\n this.day = value;\n }",
"public void setDay(byte value) {\n this.day = value;\n }",
"public void setDay(byte value) {\n this.day = value;\n }",
"public void setDay(byte value) {\n this.day = value;\n }",
"public static void doVote() {\n }",
"public void setMatchesForDay(int day, Match m){\n\t\tfor (int i = 0; i < this.matches.size(); i++) {\n\t\t\tMatch matchSchedule = this.matches.get(i);\n\t\t\tif(m.getTeamHome().getNm().equals(matchSchedule.getTeamHome().getNm()) & m.getTeamAway().getNm().equals(matchSchedule.getTeamAway().getNm())){\n\t\t\t\tmatchSchedule.setGoalsHome(m.getGoalsHome());\n\t\t\t\tmatchSchedule.setGoalsAway(m.getGoalsAway());\n\t\t\t}\n\t\t}\n\t}",
"public int daysBetween(Day day)\n\t{\n\t\tlong millisBetween = Math.abs(this.getDayStart(TimeZoneEx.GMT).getTime() - day.getDayStart(TimeZoneEx.GMT).getTime());\n\t\treturn (int) Math.round((float) millisBetween / (1000F * 60F * 60F * 24F));\n\t}",
"private void endDay(Player p){\r\n\t\tp.setActions(2);\r\n\t\tArrayList<Pet> pets = p.getPets();\r\n\t\tfor(Pet pet : pets){\r\n\t\t\tpet.nextDay();\r\n\t\t}\r\n\t\tstore.nextDay();\r\n\t}",
"public void removeDay(int day){ // verilen gundeki tum experimentlar silinir.\r\n Node last = head;\r\n if( last.data.day == day ){ // ilk gun serisinden istenirse direk next day e atla.\r\n head = last.nextDay;\r\n }\r\n else{\r\n while( last.next != null ){ // gunun basini bul\r\n if( last.next.data.day == day ){ // removeExp ile sil.\r\n removeExp(day, 0);\r\n }\r\n else\r\n last = last.next; // ilerle.\r\n }\r\n }\r\n }",
"private String checkIfToday(String day) {\n GregorianCalendar cal = new GregorianCalendar();\n switch(cal.get(Calendar.DAY_OF_WEEK)) {\n case Calendar.MONDAY:\n if (day.equals(\"Mo.\") || day.equals(\"Mon\")) {\n return International.getString(\"heute\");\n }\n case Calendar.TUESDAY:\n if (day.equals(\"Di.\") || day.equals(\"Tue\")) {\n return International.getString(\"heute\");\n }\n case Calendar.WEDNESDAY:\n if (day.equals(\"Mi.\") || day.equals(\"Wed\")) {\n return International.getString(\"heute\");\n }\n case Calendar.THURSDAY:\n if (day.equals(\"Do.\") || day.equals(\"Thu\")) {\n return International.getString(\"heute\");\n }\n case Calendar.FRIDAY:\n if (day.equals(\"Fr.\") || day.equals(\"Fri\")) {\n return International.getString(\"heute\");\n }\n case Calendar.SATURDAY:\n if (day.equals(\"Sa.\") || day.equals(\"Sat\")) {\n return International.getString(\"heute\");\n }\n case Calendar.SUNDAY:\n if (day.equals(\"So.\") || day.equals(\"Sun\")) {\n return International.getString(\"heute\");\n }\n }\n return day;\n }",
"public io.dstore.values.TimestampValueOrBuilder getDayOrBuilder() {\n return getDay();\n }",
"public void setDay(byte value) {\n this.day = value;\n }",
"public Date getDay() {\r\n return day;\r\n }",
"public Date getDay() {\r\n return day;\r\n }",
"public Date getDay() {\r\n return day;\r\n }",
"public Date getDay() {\r\n return day;\r\n }",
"public Date getDay() {\r\n return day;\r\n }",
"public void iltaKuvat() {\n day = findViewById(R.id.imageMaIlta); // find Monday night ImageView // checks every night value and sets image based off that value\n if(getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Night1\", 0) == 1) { // has brushed in time\n day.setImageResource(R.drawable.checkok);\n } else if (getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Night1\", 0) == 2) { // didn't brush in time\n day.setImageResource(R.drawable.checkfail);\n } else { // brushing alarm hasn't triggered yet\n day.setImageResource(R.drawable.thinking);\n }\n day = findViewById(R.id.imageTiIlta); // find Tuesday night ImageView\n if(getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Night2\", 0) == 1) {\n day.setImageResource(R.drawable.checkok);\n } else if (getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Night2\", 0) == 2) {\n day.setImageResource(R.drawable.checkfail);\n } else {\n day.setImageResource(R.drawable.thinking);\n }\n day = findViewById(R.id.imageKeIlta); // find Wednesday night ImageView\n if(getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Night3\", 0) == 1) {\n day.setImageResource(R.drawable.checkok);\n } else if (getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Night3\", 0) == 2) {\n day.setImageResource(R.drawable.checkfail);\n } else {\n day.setImageResource(R.drawable.thinking);\n }\n day = findViewById(R.id.imageToIlta); // find Thursday night ImageView\n if(getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Night4\", 0) == 1) {\n day.setImageResource(R.drawable.checkok);\n } else if (getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Night4\", 0) == 2) {\n day.setImageResource(R.drawable.checkfail);\n } else {\n day.setImageResource(R.drawable.thinking);\n }\n day = findViewById(R.id.imagePeIlta); // find Friday night ImageView\n if(getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Night5\", 0) == 1) {\n day.setImageResource(R.drawable.checkok);\n } else if (getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Night5\", 0) == 2) {\n day.setImageResource(R.drawable.checkfail);\n } else {\n day.setImageResource(R.drawable.thinking);\n }\n day = findViewById(R.id.imageLaIlta); // find Saturday night ImageView\n if(getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Night6\", 0) == 1) {\n day.setImageResource(R.drawable.checkok);\n } else if (getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Night6\", 0) == 2) {\n day.setImageResource(R.drawable.checkfail);\n } else {\n day.setImageResource(R.drawable.thinking);\n }\n day = findViewById(R.id.imageSuIlta); // find Sunday night ImageView\n if(getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Night7\", 0) == 1) {\n day.setImageResource(R.drawable.checkok);\n } else if (getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Night7\", 0) == 2) {\n day.setImageResource(R.drawable.checkfail);\n } else {\n day.setImageResource(R.drawable.thinking);\n }\n }",
"DayOfWeek getUserVoteSalaryWeeklyDayOfWeek();",
"@java.lang.Override public int getDayValue() {\n return day_;\n }",
"private void receiveVote() {\n\t\t//Se la postazione termina la connessione informiamo lo staff con un messaggio di errore\n\t\tif(!link.hasNextLine()) {\n\t\t\tcontroller.printError(\"Errore di Comunicazione\", \"La postazione \"+ ip.getHostAddress() + \" non ha inviato i pacchetti di voto.\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//Vengono recuperati i voti cifrati\n\t\tMessage request;\n\t\tWrittenBallot[] encryptedBallots;\n\t\ttry {\n\t\t\trequest = (Message) Message.fromB64(link.read(), \"postazione \" + ip.getHostAddress());\n\t\t\tString[] required = {\"encryptedBallots\"};\n\t\t\tClass<?>[] types = {WrittenBallot[].class};\n\t\t\t\n\t\t\trequest.verifyMessage(Protocol.sendVoteToStation, required, types, \"postazione \" + ip.getHostAddress());\n\t\t\tencryptedBallots = request.getElement(\"encryptedBallots\");\n\t\t\t\n\t\t\t//I voti vengono memorizzati nel seggio in attesa dell'invio all'urna\n\t\t\tif(((Controller) controller).storeVoteLocally(encryptedBallots, ip))\n\t\t\t\tlink.write(Protocol.votesReceivedAck);\n\t\t\telse\n\t\t\t\tlink.write(Protocol.votesReceivedNack);\n\t\t\t\n\t\t} catch (PEException e) {\n\t\t\tlink.write(Protocol.votesReceivedNack);\n\t\t\tcontroller.printError(e);\n\t\t}\n\t}",
"public void setDay(byte value) {\r\n this.day = value;\r\n }",
"@java.lang.Override public int getDayValue() {\n return day_;\n }",
"void addDay(final Day day) {\n days.add(day);\n }",
"public void setDay(java.lang.String param) {\r\n localDayTracker = param != null;\r\n\r\n this.localDay = param;\r\n }",
"public void setDay(java.lang.String param) {\r\n localDayTracker = param != null;\r\n\r\n this.localDay = param;\r\n }",
"public Date getDay() {\n return day;\n }",
"@Override\n\tpublic int widgetDday(WidgetCheck wc, String[] dlist) {\n\t\treturn dDao.widgetDday(sqlSession, wc, dlist);\n\t}",
"public int newDay() {\r\n\t\tfor (CrewMember crewMember : this.crewMembers) {\r\n\t\t\tcrewMember.modifyHunger(20);\r\n\t\t\tif (crewMember.hasPlague()) {\r\n\t\t\t\tcrewMember.modifyHealth(-20);\r\n\t\t\t}\r\n\t\t\tif (crewMember.getHunger() >= crewMember.getMaxHunger()) {\r\n\t\t\t\tcrewMember.modifyHealth(-20);\r\n\t\t\t}\r\n\t\t\tcrewMember.setActions(crewMember.getTiredness() < crewMember.getMaxTiredness() ? 2 : 1);\r\n\t\t}\r\n\t\treturn pruneCrewMembers();\r\n\t}",
"@Override\r\n\tpublic int selectMessageYesterDay() {\n\t\treturn messageMapper.selectMessageYesterDay();\r\n\t}",
"io.dstore.values.TimestampValueOrBuilder getFromDayOrBuilder();",
"public io.dstore.values.TimestampValue getDay() {\n return day_ == null ? io.dstore.values.TimestampValue.getDefaultInstance() : day_;\n }",
"@Override\n\tpublic int updateDday(Dday d) {\n\t\treturn dDao.updateDday(sqlSession, d);\n\t}",
"public void setDishOfTheDay(String _dishOfTheDay){\n dishOfTheDay = _dishOfTheDay;\n }",
"@java.lang.Override public app.onepass.apis.DayOfWeek getDay() {\n @SuppressWarnings(\"deprecation\")\n app.onepass.apis.DayOfWeek result = app.onepass.apis.DayOfWeek.valueOf(day_);\n return result == null ? app.onepass.apis.DayOfWeek.UNRECOGNIZED : result;\n }",
"public int getDayOrNight() {\n return getStat(dayOrNight);\n }",
"public boolean modifyVacationDay(GregorianCalendar date, int morningDrs, int eveningDrs, int nightDrs, String especialDate) throws IOException{\r\n\t\t// checking input data\r\n\t\tif (!calendar.existsVacationDay(date)) throw new IOException(\"La fecha no corresponde a ningun dia vacacional \");\r\n\t\telse if (morningDrs < 0) throw new IOException(\"El numero de doctores del turno de manana no es correcto \");\r\n\t\telse if (eveningDrs < 0) throw new IOException(\"El numero de doctores del turno de tarde no es correcto \");\r\n\t\telse if (nightDrs < 0) throw new IOException(\"El numero de doctores del turno de noche no es correcto \");\r\n\t\t// making changes\r\n\t\telse {\r\n\t\t\tcalendar.getShift(date, shiftTypes[0]).setNumberOfDoctors(morningDrs);\r\n\t\t\tcalendar.getShift(date, shiftTypes[1]).setNumberOfDoctors(eveningDrs);\r\n\t\t\tcalendar.getShift(date, shiftTypes[2]).setNumberOfDoctors(nightDrs);\r\n\t\t\tcalendar.getShift(date, shiftTypes[0]).setSpecialDate(especialDate);\r\n\t\t\tcalendar.getShift(date, shiftTypes[1]).setSpecialDate(especialDate);\r\n\t\t\tcalendar.getShift(date, shiftTypes[2]).setSpecialDate(especialDate);\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"@java.lang.Override\n public app.onepass.apis.DayOfWeek getDay() {\n @SuppressWarnings(\"deprecation\")\n app.onepass.apis.DayOfWeek result = app.onepass.apis.DayOfWeek.valueOf(day_);\n return result == null ? app.onepass.apis.DayOfWeek.UNRECOGNIZED : result;\n }",
"public void aamuKuvat() {\n day = findViewById(R.id.imageMaAamu); // find Monday morning ImageView // checks every night value and sets image based off that value\n if(getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Day1\", 0) == 1) { // has brushed in time\n day.setImageResource(R.drawable.checkok);\n } else if (getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Day1\", 0) == 2) { // didn't brush in time\n day.setImageResource(R.drawable.checkfail);\n } else { // brushing alarm hasn't triggered yet\n day.setImageResource(R.drawable.thinking);\n }\n day = findViewById(R.id.imageTiAamu); // find Tuesday morning ImageView\n if(getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Day2\", 0) == 1) {\n day.setImageResource(R.drawable.checkok);\n } else if (getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Day2\", 0) == 2) {\n day.setImageResource(R.drawable.checkfail);\n } else {\n day.setImageResource(R.drawable.thinking);\n }\n day = findViewById(R.id.imageKeAamu); // find Wednesday morning ImageView\n if(getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Day3\", 0) == 1) {\n day.setImageResource(R.drawable.checkok);\n } else if (getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Day3\", 0) == 2) {\n day.setImageResource(R.drawable.checkfail);\n } else {\n day.setImageResource(R.drawable.thinking);\n }\n day = findViewById(R.id.imageToAamu); // find Thursday morning ImageView\n if(getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Day4\", 0) == 1) {\n day.setImageResource(R.drawable.checkok);\n } else if (getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Day4\", 0) == 2) {\n day.setImageResource(R.drawable.checkfail);\n } else {\n day.setImageResource(R.drawable.thinking);\n }\n day = findViewById(R.id.imagePeAamu); // find Friday morning ImageView\n if(getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Day5\", 0) == 1) {\n day.setImageResource(R.drawable.checkok);\n } else if (getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Day5\", 0) == 2) {\n day.setImageResource(R.drawable.checkfail);\n } else {\n day.setImageResource(R.drawable.thinking);\n }\n day = findViewById(R.id.imageLaAamu); // find Saturday morning ImageView\n if(getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Day6\", 0) == 1) {\n day.setImageResource(R.drawable.checkok);\n } else if (getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Day6\", 0) == 2) {\n day.setImageResource(R.drawable.checkfail);\n } else {\n day.setImageResource(R.drawable.thinking);\n }\n day = findViewById(R.id.imageSuAamu); // find Sunday morning ImageView\n if(getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Day7\", 0) == 1) {\n day.setImageResource(R.drawable.checkok);\n } else if (getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Day7\", 0) == 2) {\n day.setImageResource(R.drawable.checkfail);\n } else {\n day.setImageResource(R.drawable.thinking);\n }\n }",
"io.dstore.values.TimestampValueOrBuilder getDayOrBuilder();",
"@RequestMapping(value=\"/players/killLastNight\", method=RequestMethod.POST)\n\t\t@ResponseBody\n\t\tpublic void switchKillLastNight(String id) {\n\t\t\tSystem.out.println(\"in place vote \");\n\t\t\tPlayer thePlayer = playerService.getPlayerById(id);\n\t\t\tthePlayer.switchKilledLastNight();\n\t\t\tplayerService.switchKilledLastNight(thePlayer);\n\t\t}",
"public final void setMonday(final TimeSlot monday) {\n this.monday = monday;\n log.info(this.monday.toString());\n }",
"private Management castVote(Management mgmt, boolean isNew) {\n\t\tif (!mgmt.hasElection())\n\t\t\treturn null;\n\n\t\tLeaderElection req = mgmt.getElection();\n\t\tif (req.getExpires() <= System.currentTimeMillis()) {\n\t\t\tlogger.info(\"Node \" + this.nodeId + \" says election expired - not voting\");\n\t\t\treturn null;\n\t\t}\n\n\t\t// DANGER! If we return because this node ID is in the list, we have a\n\t\t// high chance an election will not converge as the maxHops determines\n\t\t// if the graph has been traversed!\n\t\tboolean allowCycles = true;\n\n\t\tif (!allowCycles) {\n\t\t\tList<RoutingPath> rtes = mgmt.getHeader().getPathList();\n\t\t\tfor (RoutingPath rp : rtes) {\n\t\t\t\tif (rp.getNodeId() == this.nodeId) {\n\t\t\t\t\t// logger.info(\"Node \" + this.nodeId +\n\t\t\t\t\t// \" already in the routing path - not voting\");\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// okay, the message is new (to me) so I want to determine if I should\n\t\t// nominate\n\t\t// myself\n\n\t\tLeaderElection.Builder elb = LeaderElection.newBuilder();\n\t\tMgmtHeader.Builder mhb = MgmtHeader.newBuilder();\n\t\tmhb.setTime(System.currentTimeMillis());\n\n\t\t// reversing path. If I'm the farthest a message can travel, reverse the\n\t\t// sending\n\t\tif (elb.getHops() == 0)\n\t\t\tmhb.clearPath();\n\t\telse\n\t\t\tmhb.addAllPath(mgmt.getHeader().getPathList());\n\n\t\tmhb.setOriginator(mgmt.getHeader().getOriginator());\n\n\t\telb.setElectId(req.getElectId());\n\t\telb.setAction(ElectAction.NOMINATE);\n\t\telb.setDesc(req.getDesc());\n\t\telb.setExpires(req.getExpires());\n\t\telb.setCandidateId(req.getCandidateId());\n\n\t\t// my vote\n\t\tif (req.getCandidateId() == this.nodeId) {\n\t\t\t// if I am not in the list and the candidate is myself, I can\n\t\t\t// declare myself to be the leader.\n\t\t\t//\n\t\t\t// this is non-deterministic as it assumes the message has\n\t\t\t// reached all nodes in the network (because we know the\n\t\t\t// diameter or the number of nodes).\n\t\t\t//\n\t\t\t// can end up with a partitioned graph of leaders if hops <\n\t\t\t// diameter!\n\n\t\t\tnotify(true, this.nodeId);\n\t\t\telb.setAction(ElectAction.DECLAREWINNER);\n\t\t\telb.setHops(mgmt.getHeader().getPathCount());\n\t\t\tlogger.info(\"Node \" + this.nodeId + \" is declaring itself the leader\");\n\t\t} else {\n\t\t\tif (req.getCandidateId() < this.nodeId)\n\t\t\t\telb.setCandidateId(this.nodeId);\n\t\t\t\n\t\t\tif (req.getHops() == -1)\n\t\t\t\telb.setHops(-1);\n\t\t\telse\n\t\t\t\telb.setHops(req.getHops() - 1);\n\n\t\t\tif (elb.getHops() == 0) {\n\t\t\t\t// reverse travel of the message to ensure it gets back to\n\t\t\t\t// the originator\n\t\t\t\telb.setHops(mgmt.getHeader().getPathCount());\n\n\t\t\t\t// no clear winner, send back the candidate with the highest\n\t\t\t\t// known ID. So, if a candidate sees itself, it will\n\t\t\t\t// declare itself to be the winner (see above).\n\t\t\t} else {\n\t\t\t\t// forwarding the message on so, keep the history where the\n\t\t\t\t// message has been\n\t\t\t\tmhb.addAllPath(mgmt.getHeader().getPathList());\n\t\t\t}\n\t\t}\n\n\t\t// add myself (may allow duplicate entries, if cycling is allowed)\n\t\tRoutingPath.Builder rpb = RoutingPath.newBuilder();\n\t\trpb.setNodeId(this.nodeId);\n\t\trpb.setTime(System.currentTimeMillis());\n\t\tmhb.addPath(rpb);\n\n\t\tManagement.Builder mb = Management.newBuilder();\n\t\tmb.setHeader(mhb.build());\n\t\tmb.setElection(elb.build());\n\n\t\treturn mb.build();\n\t}",
"private void sendWinnerMessage(RaceTrackMessage playerDisconnectsMessage) {\n\t\tif(playerDisconnectsMessage != null)\n\t\t\ttry{\n\n\t\t\t\tint playerWhoWon = getPlayerWhoWonByPlayerID(((DisconnectMessage) playerDisconnectsMessage).getNextPlayerToMove()); \n\t\t\t\tint playerWhoWonID = getPlayerIDWhoWonByPlayerID(((DisconnectMessage) playerDisconnectsMessage).getNextPlayerToMove());\n\t\t\t\tif(playerWhoWon != -1){\n\t\t\t\t\tPoint2D lastVec = null;\n\t\t\t\t\tif(getPlayerMap().get(playerWhoWonID) != null)\n\t\t\t\t\t\tlastVec = getPlayerMap().get(playerWhoWonID).getCurrentPosition();\n\n\n\t\t\t\t\tPlayerWonMessage answer;\n\n\t\t\t\t\tanswer = VectorMessageServerHandler.generatePlayerWonMessage(playerWhoWon, playerWhoWon, lastVec);\n\n\t\t\t\t\tcloseGameByPlayerID(playerWhoWon);\n\n\t\t\t\t\tanswer.addClientID(playerWhoWonID);\n\n\t\t\t\t\tsendMessage(answer);\n\t\t\t\t\t\n\t\t\t\t\t//inform the AIs that game is over!!\n\n\t\t\t\t}\n\t\t\t}catch(ClassCastException e){\n\n\t\t\t}\n\t}",
"public void setDay(int day)\r\n {\n \tif (!(day <= daysInMonth(month) || (day < 1)))\r\n\t\t{\r\n \t\tthrow new IllegalArgumentException(\"Bad day: \" + day);\r\n\t\t}\r\n this.day = day;\r\n }",
"public DayNightClock getDayNightClock() {\n return this.dayNightClock;\n }",
"public void voteIdea(String username, Long ideaId, boolean vote) throws VotingException, DataAccessException {\n try {\n MyUser user = myUserFacade.getUser(username);\n Idea idea = this.find(ideaId);\n Boolean previousVote = user.getVotes().get(idea);\n if (previousVote == null) {\n // If the user never voted for this idea, then create a new Vote:\n user.addVote(idea, vote);\n if (vote) {\n idea.upvote();\n } else {\n idea.downvote();\n }\n } else {\n // The user had previously voted for this idea.\n // Case 1: trying to upvote twice the idea:\n if (previousVote && vote) {\n throw new VotingException((null), \"Cannot upvote twice the same post\");\n } // Case 2: trying to downvote twice the idea:\n else if (!previousVote && !vote) {\n throw new VotingException((null), \"Cannot downvote twice the same post\");\n } // Case 3: one is upvote and the other downvote. Vote is removed\n else {\n user.removeVote(idea);\n if (vote) {\n idea.setUpvotes(idea.getUpvotes() - 1);\n } else {\n idea.setDownvotes(idea.getDownvotes() - 1);\n }\n }\n }\n myUserFacade.edit(user);\n this.edit(idea);\n } catch (PersistenceException | EJBException pe) {\n throw new DataAccessException(pe, \"Error while voting post\");\n }\n }",
"public void setParticipantsToday (byte p) {\n\t\tParticipantsToday = p;\n\t}",
"public void commonTask(String day){\r\n String openingTime = restaurantProperties.getOpeningTime();\r\n String closingTime = restaurantProperties.getClosingTime();\r\n restaurantProperties.setNewDay(day.concat(\": \").concat(openingTime).concat(\" - \").concat(closingTime));\r\n //Adding the values into the ArrayList\r\n openingHoursList = new HashMap<String, String>();\r\n openingHoursList.put(\"status\", restaurantProperties.getNewDay());\r\n openingHoursArrayList.add(openingHoursList);\r\n\r\n }",
"public byte getDay() {\n return day;\n }",
"public byte getDay() {\n return day;\n }",
"public byte getDay() {\n return day;\n }"
] | [
"0.7019773",
"0.6958009",
"0.681003",
"0.5887646",
"0.5523012",
"0.5181774",
"0.51642555",
"0.50088614",
"0.50052357",
"0.50052357",
"0.50052357",
"0.50052357",
"0.50052357",
"0.49652782",
"0.49550644",
"0.4899019",
"0.4882739",
"0.4882739",
"0.4880311",
"0.4844544",
"0.48262787",
"0.47897008",
"0.47795904",
"0.47765222",
"0.47165018",
"0.4677857",
"0.46540225",
"0.4632943",
"0.45950514",
"0.45558417",
"0.4551525",
"0.45460823",
"0.4521497",
"0.4519012",
"0.45027",
"0.45001015",
"0.449766",
"0.44911736",
"0.44777983",
"0.44514203",
"0.44480494",
"0.44418085",
"0.44274446",
"0.44222233",
"0.4402972",
"0.43630585",
"0.43571243",
"0.4330458",
"0.43283287",
"0.43189013",
"0.43189013",
"0.43189013",
"0.43185738",
"0.43182483",
"0.43159893",
"0.42974988",
"0.427243",
"0.4262928",
"0.42599958",
"0.42306706",
"0.42297783",
"0.42297783",
"0.42297783",
"0.42297783",
"0.42297783",
"0.42064095",
"0.4180572",
"0.41791987",
"0.41774684",
"0.41769126",
"0.41754678",
"0.41749835",
"0.41626036",
"0.41626036",
"0.4152676",
"0.41523325",
"0.41484788",
"0.413978",
"0.41330945",
"0.4123122",
"0.41207916",
"0.41129005",
"0.4107271",
"0.40981087",
"0.409793",
"0.4072095",
"0.40693337",
"0.40598074",
"0.40561765",
"0.40550554",
"0.40444276",
"0.40374056",
"0.4035361",
"0.40320385",
"0.40256363",
"0.40119466",
"0.40101737",
"0.40099746",
"0.40065756",
"0.40065756"
] | 0.7927731 | 0 |
The checkDay method checks if the votes for to keep the game as day, are in the majority. If so then the vote for night is unsuccessful and the votes cleared. | private void checkDay(int origin) {
server.publicMessage(players.get(origin) + " has voted for it to remain day");
// if (dayVote.size() > playerIDs.size() / 2) {
if (dayVote.size() > players.size() / 2) {
day();
} else if (dayVote.size() == players.size() / 2 && players.size() % 2 == 0) {
day();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void voteDay(int origin) {\r\n\tif (!nightVoteInProgress) {\r\n\t server.privateMessage(\"cannot use this command when there isn't a vote to change to night\", origin);\r\n\r\n\t} else if (dayVote.contains(origin)) {\r\n\t server.privateMessage(\"you have already voted to keep the game in the day phase\", origin);\r\n\r\n\t} else if (!players.containsKey(origin)) {\r\n\t server.privateMessage(\"you are not in the game, so cannot participate\", origin);\r\n\r\n\t} else {\r\n\t if (nightVote.contains(origin)) {\r\n\t\tint index = nightVote.indexOf(origin);\r\n\t\tnightVote.remove(index);\r\n\t }\r\n\r\n\t dayVote.add(origin);\r\n\t checkDay(origin);\r\n\t}\r\n }",
"boolean checkDayNight(boolean daytime);",
"public void dayIsLike() \r\n\t{ \r\n\t\tswitch (day) \r\n\t\t{ \r\n\t\tcase MONDAY: \r\n\t\t\tSystem.out.println(\"Mondays are bad.\"); \r\n\t\t\tbreak; \r\n\t\tcase FRIDAY: \r\n\t\t\tSystem.out.println(\"Fridays are better.\"); \r\n\t\t\tbreak; \r\n\t\tcase SATURDAY: \r\n\t\t\tSystem.out.println(\"Saturdays are better.\"); \r\n\t\t\tbreak;\r\n\t\tcase SUNDAY: \r\n\t\t\tSystem.out.println(\"Weekends are best.\"); \r\n\t\t\tbreak; \r\n\t\tdefault: \r\n\t\t\tSystem.out.println(\"Midweek days are so-so.\"); \r\n\t\t\tbreak; \r\n\t\t} \r\n\t}",
"private void elimDayVote(String player, int origin) {\r\n\r\n\t// int playerID = server.getUserID(player);\r\n\tif (players.containsValue(player)) {\r\n\t OrderedBidiMap<String, Integer> invPlayers = players.inverseBidiMap();\r\n\r\n\t int playerID = invPlayers.get(player);\r\n\r\n\t // if (nightVote.size() > 0) {\r\n\t if (nightVoteInProgress) {\r\n\t\tserver.privateMessage(\r\n\t\t\t\"cannot vote to eliminate a player while there is a vote to change the game to night\", origin);\r\n\r\n\t\t// } else if (!playerIDs.contains(playerID)) { // this is for\r\n\t\t// when\r\n\t\t// using ArrayList of playerIDs\r\n\t } else if (playerID == origin) {\r\n\t\tserver.privateMessage(\"you cannot vote for yourself\", origin);\r\n\r\n\t } else if (elimDay.contains(origin)) {\r\n\t\tserver.privateMessage(\"you have already voted to start\", origin);\r\n\r\n\t } else if (!players.containsKey(origin)) {\r\n\t\tserver.privateMessage(\"you are not in the game, so cannot participate\", origin);\r\n\r\n\t } else if (playerOnTrialID == null) {\r\n\t\telimDayVoteInProgress = true;\r\n\t\tplayerOnTrialID = playerID;\r\n\t\telimDay.add(origin);\r\n\r\n\t\tTimerTask dayElimVoteTimeout = new TimerTask() { // not sure if\r\n\t\t\t\t\t\t\t\t // this\r\n\t\t\t\t\t\t\t\t // will work\r\n\t\t\t\t\t\t\t\t // properly\r\n\t\t\t\t\t\t\t\t // (method\r\n\t\t\t\t\t\t\t\t // should\r\n\t\t\t\t\t\t\t\t // continue\r\n\t\t\t\t\t\t\t\t // without\r\n\t\t\t\t\t\t\t\t // waiting for\r\n\t\t\t\t\t\t\t\t // it\r\n\t\t\t\t\t\t\t\t // to finish\r\n\r\n\t\t @Override\r\n\t\t public void run() {\r\n\t\t\tdayElimVoteTimeout(); // this might need a catch\r\n\r\n\t\t }\r\n\t\t};\r\n\r\n\t\tdayElimTimer = new Timer();\r\n\r\n\t\tdayElimTimer.schedule(dayElimVoteTimeout, 20000);\r\n\r\n\t } else {\r\n\t\tif (playerOnTrialID != playerID) {\r\n\t\t server.privateMessage(\"cannot vote for \" + player + \" while the vote for \"\r\n\t\t\t + server.getUsername(playerOnTrialID) + \" is in progress\", origin);\r\n\t\t} else {\r\n\t\t if (save.contains(origin)) {\r\n\t\t\tint index = save.indexOf(origin);\r\n\t\t\tsave.remove(index);\r\n\t\t }\r\n\r\n\t\t elimDay.add(origin);\r\n\t\t checkElim(origin);\r\n\t\t}\r\n\t }\r\n\t} else if (!players.containsValue(player)) {\r\n\t server.privateMessage(player + \" is not in this game/has already been eliminated\", origin);\r\n\r\n\t}\r\n\r\n }",
"private void checkNight(int origin) {\r\n\tserver.publicMessage(players.get(origin) + \" has voted for it to remain night\");\r\n\r\n\t// if (nightVote.size() > playerIDs.size() / 2) {\r\n\tif (nightVote.size() > players.size() / 2) {\r\n\t night();\r\n\t}\r\n }",
"private void voteNight(int origin) {\r\n\t// if (playerOnTrialID != null) {\r\n\tif (elimDayVoteInProgress) {\r\n\t server.privateMessage(\"you cannot start a vote for it to be night when there is a vote in progress \"\r\n\t\t + \"to eliminate a player\", origin);\r\n\r\n\t} else if (nightVote.contains(origin)) {\r\n\t server.privateMessage(\"you have already voted to change the game to night\", origin);\r\n\r\n\t} else if (!players.containsKey(origin)) {\r\n\t server.privateMessage(\"you are not in the game, so cannot participate\", origin);\r\n\r\n\t} else {\r\n\t nightVoteInProgress = true;\r\n\r\n\t if (dayVote.contains(origin)) {\r\n\t\tint index = dayVote.indexOf(origin);\r\n\t\tdayVote.remove(index);\r\n\t }\r\n\r\n\t nightVote.add(origin);\r\n\r\n\t if (nightVote.size() == 1) {\r\n\t\tTimerTask nightVoteTimeout = new TimerTask() {\r\n\r\n\t\t @Override\r\n\t\t public void run() {\r\n\t\t\tnightVoteTimeout(); // this might need a catch\r\n\r\n\t\t }\r\n\t\t};\r\n\r\n\t\tnightVoteTimer = new Timer();\r\n\r\n\t\tnightVoteTimer.schedule(nightVoteTimeout, 20000);\r\n\t } else {\r\n\t\tcheckNight(origin);\r\n\t }\r\n\r\n\t}\r\n }",
"public void setCheckDay(BigDecimal checkDay) {\n this.checkDay = checkDay;\n }",
"boolean hasDayNight();",
"private void eliminateDay() {\r\n\tdayElimTimer.cancel();\r\n\tdayElimTimer.purge();\r\n\r\n\t// playerIDs.remove(playerOnTrialID);\r\n\tplayers.remove(playerOnTrialID);\r\n\r\n\tif (mafia.contains(playerOnTrialID)) {\r\n\t int index = mafia.indexOf(playerOnTrialID);\r\n\t mafia.remove(index);\r\n\r\n\t} else {\r\n\t int index = innocentIDs.indexOf(playerOnTrialID);\r\n\t innocentIDs.remove(index);\r\n\t}\r\n\r\n\tserver.setPlayerMuted(playerOnTrialID, true);\r\n\r\n\tserver.publicMessage(server.getUsername(playerOnTrialID) + \" has been eliminated\");\r\n\r\n\tplayerOnTrialID = null;\r\n\telimDay.clear();\r\n\tsave.clear();\r\n\telimDayVoteInProgress = false;\r\n\r\n\tcheckWin();\r\n }",
"void setDayOrNight(int day) {\n setStat(day, dayOrNight);\n }",
"void aDayPasses(){\n\t\t\n\t\t/**\n\t\t * Modify wait time if still exists\n\t\t */\n\t\tif(!daysUntilStarts.equals(0)){\n\t\t\tdaysUntilStarts--;\n\t\t\tif((!hasInstructor() || getSize() == 0) && daysUntilStarts.equals(0)){\n\t\t\t\tif(hasInstructor())\n\t\t\t\t\tinstructor.unassignCourse();\n\t\t\t\tfor(Student student : enrolled){\n\t\t\t\t\tstudent.dropCourse();\n\t\t\t\t}\n\t\t\t\tsubject.unassign();\n\t\t\t\tinstructor = null;\n\t\t\t\tenrolled = new ArrayList<Student>();\n\t\t\t\tcancelled = true;\n\t\t\t} else if (daysUntilStarts.equals(0)) {\n\t\t\t\tsubject.unassign();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * Modify run time if still exists\n\t\t */\n\t\tif(!daysToRun.equals(0)){\n\t\t\tdaysToRun--;\n\t\t}\n\t\t/**\n\t\t * If couse finished un-assigned people from it\n\t\t */\n\t\tif(daysToRun.equals(0) && !finished){\n\t\t\tfor(Student student : enrolled){\n\t\t\t\tstudent.graduate(subject);\n\n\t\t\t}\n\t\t\tinstructor.unassignCourse();\n\t\t\tinstructor = null;\n\t\t\tfinished = true;\n\t\t}\n\t}",
"public void getLuckyUnluckyDay() {\n\t\tfor (int day = 0; day < NO_OF_DAYS; day++) {\n\t\t\tint winCount = 0;\n\t\t\tint lostCount = 0;\n\t\t\tint result = STAKE;\n\t\t\twhile ((result != WINING_CASH) && (result != LOOSING_CASH)) {\n\t\t\t\tint randomCheck = (int) Math.floor(Math.random() * 10) % 2;\n\t\t\t\tif (randomCheck == 1) {\n\t\t\t\t\tresult = result + BET;\n\t\t\t\t\twinCount++;\n\t\t\t\t} else {\n\t\t\t\t\tresult = result - BET;\n\t\t\t\t\tlostCount++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (result == WINING_CASH) {\n\t\t\t\tSystem.out.println(\"you won the game\");\n\t\t\t\twinArr[day] = winCount;\n\t\t\t\tSystem.out.println(\"total Amount won :\" + winCount + \"in day: \" + (day + 1));\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"you lost the game\");\n\t\t\t\tlostArr[day] = lostCount;\n\t\t\t\tSystem.out.println(\"total Amount lost: \" + lostCount + \"in day: \" + (day + 1));\n\t\t\t}\n\t\t}\n\t\tint maxWin = 0;\n\t\tint luckyDay = 0;\n\t\tfor (int day = 0; day < NO_OF_DAYS; day++) {\n\t\t\tif (winArr[day] > maxWin && winArr[day] != 0) {\n\t\t\t\tmaxWin = winArr[day];\n\t\t\t\tluckyDay = day;\n\t\t\t\tsumOfWinCount = sumOfWinCount + winArr[day];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"your luckiest day:\" + (luckyDay + 1));\n\t\tint maxLost = 0;\n\t\tint unLuckyDay = 0;\n\t\tfor (int day = 0; day < NO_OF_DAYS; day++) {\n\t\t\tif (lostArr[day] > maxLost && lostArr[day] != 0) {\n\t\t\t\tmaxLost = lostArr[day];\n\t\t\t\tunLuckyDay = day;\n\t\t\t\tsumOfLostCount = sumOfLostCount + lostArr[day];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"your unluchiest day:\" + (unLuckyDay + 1));\n\t\tSystem.out.println();\n\t\ttotalAmount = sumOfWinCount - sumOfLostCount;\n\t\tif (totalAmount > 0) {\n\t\t\tSystem.out.println(\"you won the total amount \" + totalAmount);\n\t\t} else {\n\t\t\tSystem.out.println(\"you lost total amount: \" + totalAmount);\n\t\t}\n\t}",
"boolean hasDay();",
"boolean hasDay();",
"private void setDayCountDown() {\n dayCountDown = getMaxHunger();\n }",
"private boolean checkValidDay() {\n return numDays >= 0 && numDays <= 7;\n }",
"public void vaccinate(int day){\r\n\t\tfor(int i = 0; i < this.getnVillages(); i++){\r\n\t\t\tvVillages[i].resetNVaccinated();\r\n\t\t\tif(vVillages[i].getVaccDay() == day){\r\n\t\t\t\tvVillages[i].vaccinate();\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void aamuKuvat() {\n day = findViewById(R.id.imageMaAamu); // find Monday morning ImageView // checks every night value and sets image based off that value\n if(getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Day1\", 0) == 1) { // has brushed in time\n day.setImageResource(R.drawable.checkok);\n } else if (getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Day1\", 0) == 2) { // didn't brush in time\n day.setImageResource(R.drawable.checkfail);\n } else { // brushing alarm hasn't triggered yet\n day.setImageResource(R.drawable.thinking);\n }\n day = findViewById(R.id.imageTiAamu); // find Tuesday morning ImageView\n if(getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Day2\", 0) == 1) {\n day.setImageResource(R.drawable.checkok);\n } else if (getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Day2\", 0) == 2) {\n day.setImageResource(R.drawable.checkfail);\n } else {\n day.setImageResource(R.drawable.thinking);\n }\n day = findViewById(R.id.imageKeAamu); // find Wednesday morning ImageView\n if(getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Day3\", 0) == 1) {\n day.setImageResource(R.drawable.checkok);\n } else if (getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Day3\", 0) == 2) {\n day.setImageResource(R.drawable.checkfail);\n } else {\n day.setImageResource(R.drawable.thinking);\n }\n day = findViewById(R.id.imageToAamu); // find Thursday morning ImageView\n if(getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Day4\", 0) == 1) {\n day.setImageResource(R.drawable.checkok);\n } else if (getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Day4\", 0) == 2) {\n day.setImageResource(R.drawable.checkfail);\n } else {\n day.setImageResource(R.drawable.thinking);\n }\n day = findViewById(R.id.imagePeAamu); // find Friday morning ImageView\n if(getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Day5\", 0) == 1) {\n day.setImageResource(R.drawable.checkok);\n } else if (getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Day5\", 0) == 2) {\n day.setImageResource(R.drawable.checkfail);\n } else {\n day.setImageResource(R.drawable.thinking);\n }\n day = findViewById(R.id.imageLaAamu); // find Saturday morning ImageView\n if(getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Day6\", 0) == 1) {\n day.setImageResource(R.drawable.checkok);\n } else if (getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Day6\", 0) == 2) {\n day.setImageResource(R.drawable.checkfail);\n } else {\n day.setImageResource(R.drawable.thinking);\n }\n day = findViewById(R.id.imageSuAamu); // find Sunday morning ImageView\n if(getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Day7\", 0) == 1) {\n day.setImageResource(R.drawable.checkok);\n } else if (getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Day7\", 0) == 2) {\n day.setImageResource(R.drawable.checkfail);\n } else {\n day.setImageResource(R.drawable.thinking);\n }\n }",
"public static void checkSemester() {\r\n\t\tObject[] a = ReadingAndWritingInFile.read(\"Days.txt\");\r\n\t\tLong days = (Long) a[0]; // days of currents semester.\r\n\t\tLocalDate lastdate = (LocalDate) a[1]; // date of last connection to program.\r\n\t\tif (!(LocalDate.now().equals(lastdate))) {\r\n\t\t\tdays = days + ChronoUnit.DAYS.between(lastdate, LocalDate.now());\r\n\t\t\tif (days > 182) {\r\n\t\t\t\tsetSemester();\r\n\t\t\t\tdays = days - 182;\r\n\t\t\t}\r\n\t\t\tlastdate = LocalDate.now();\r\n\t\t\tReadingAndWritingInFile.write(\"Days.txt\", days, lastdate);\r\n\t\t}\r\n\t}",
"public void iltaKuvat() {\n day = findViewById(R.id.imageMaIlta); // find Monday night ImageView // checks every night value and sets image based off that value\n if(getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Night1\", 0) == 1) { // has brushed in time\n day.setImageResource(R.drawable.checkok);\n } else if (getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Night1\", 0) == 2) { // didn't brush in time\n day.setImageResource(R.drawable.checkfail);\n } else { // brushing alarm hasn't triggered yet\n day.setImageResource(R.drawable.thinking);\n }\n day = findViewById(R.id.imageTiIlta); // find Tuesday night ImageView\n if(getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Night2\", 0) == 1) {\n day.setImageResource(R.drawable.checkok);\n } else if (getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Night2\", 0) == 2) {\n day.setImageResource(R.drawable.checkfail);\n } else {\n day.setImageResource(R.drawable.thinking);\n }\n day = findViewById(R.id.imageKeIlta); // find Wednesday night ImageView\n if(getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Night3\", 0) == 1) {\n day.setImageResource(R.drawable.checkok);\n } else if (getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Night3\", 0) == 2) {\n day.setImageResource(R.drawable.checkfail);\n } else {\n day.setImageResource(R.drawable.thinking);\n }\n day = findViewById(R.id.imageToIlta); // find Thursday night ImageView\n if(getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Night4\", 0) == 1) {\n day.setImageResource(R.drawable.checkok);\n } else if (getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Night4\", 0) == 2) {\n day.setImageResource(R.drawable.checkfail);\n } else {\n day.setImageResource(R.drawable.thinking);\n }\n day = findViewById(R.id.imagePeIlta); // find Friday night ImageView\n if(getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Night5\", 0) == 1) {\n day.setImageResource(R.drawable.checkok);\n } else if (getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Night5\", 0) == 2) {\n day.setImageResource(R.drawable.checkfail);\n } else {\n day.setImageResource(R.drawable.thinking);\n }\n day = findViewById(R.id.imageLaIlta); // find Saturday night ImageView\n if(getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Night6\", 0) == 1) {\n day.setImageResource(R.drawable.checkok);\n } else if (getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Night6\", 0) == 2) {\n day.setImageResource(R.drawable.checkfail);\n } else {\n day.setImageResource(R.drawable.thinking);\n }\n day = findViewById(R.id.imageSuIlta); // find Sunday night ImageView\n if(getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Night7\", 0) == 1) {\n day.setImageResource(R.drawable.checkok);\n } else if (getSharedPreferences(KEY, Context.MODE_PRIVATE).getInt(\"Night7\", 0) == 2) {\n day.setImageResource(R.drawable.checkfail);\n } else {\n day.setImageResource(R.drawable.thinking);\n }\n }",
"public boolean DoesLessonConflict(LessonClass t, int day)\r\n {\r\n for (int j = 0; j < totalSlots; j++)\r\n {\r\n LessonClass a = weekArray[(weekNo -1)].dayArray[day].dayMap.get(roomNtime[j]);\r\n if (a != null)\r\n {\r\n if (a.isUserBooked(userLoggedIn))\r\n {\r\n if (t.time == a.time)\r\n { \r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n return false;\r\n }",
"public void checkAddTrackDay() {\n int hour = this.timeTrankiManager.getHour();\n int minute = this.timeTrankiManager.getMinute();\n\n if (hour == 9 && minute == 00) {\n this.trackListFinal.addTrackDay(1);\n }\n }",
"public void verifyDate(){\n\n // currentDateandTime dataSingleton.getDay().getDate();\n\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 }",
"public void setDay(Date day) {\r\n this.day = day;\r\n }",
"public void setDay(Date day) {\r\n this.day = day;\r\n }",
"public void setDay(Date day) {\r\n this.day = day;\r\n }",
"public void setDay(Date day) {\r\n this.day = day;\r\n }",
"public void setDay(Date day) {\r\n this.day = day;\r\n }",
"public void setDay(Date day) {\n this.day = day;\n }",
"public int determineDayRandomly() {\n\t\treturn 0;\r\n\t}",
"public static boolean dayOrNight(Context context) {\n SimpleDateFormat format = new SimpleDateFormat(\"HH\");\n String nowTime = format.format(new Date());\n int timeVal = Integer.valueOf(nowTime);\n\n ContentResolver cv = context.getContentResolver();\n String strTimeFormat = android.provider.Settings.System.getString(cv, android.provider.Settings.System.TIME_12_24);\n if (strTimeFormat != null && strTimeFormat.equals(\"24\")) {\n Logger.getLogger().i(\"24\");\n\n if(timeVal >= 18) {\n return false;\n } else {\n return true;\n }\n } else {\n Calendar c = Calendar.getInstance();\n int amPm = c.get(Calendar.AM_PM);\n\n Logger.getLogger().i(\"amPm \" + amPm);\n switch(amPm){\n case Calendar.AM:\n if(timeVal < 6) { //午夜\n return false;\n }\n return true;\n case Calendar.PM:\n if(timeVal >= 6) { //晚上\n return false;\n } else {\n return true;\n }\n }\n }\n\n return true;\n }",
"private int checkDay(int testDay) {\n\t\t// check if day in range for month\n\t\tif (testDay > 0 && testDay <= daysPerMonth[month])\n\t\t\treturn testDay;\n\n\t\t// check for leap year\n\t\tif (month == 2 && testDay == 29 && (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)))\n\t\t\treturn testDay;\n\n\t\tthrow new IllegalArgumentException(\"day out-of-range for the specified month and year\");\n\t}",
"boolean hasContinuousDay();",
"boolean hasToDay();",
"public BigDecimal getCheckDay() {\n return checkDay;\n }",
"public boolean checkDate(int year, int month, int day) {\n\t\tboolean cd = checkDate(year, month, day, 0.0);\n\t\treturn cd;\n\t}",
"public void setDay(int day) {\r\n this.day = day;\r\n }",
"public void setDay(int day) {\n\t\tthis.day = day;\n\t}",
"public void setDay(int day) {\n\t\tthis.day = day;\n\t}",
"private static void checkDay(Calendar calendar, int days, int daysPerWeek) {\r\n\r\n\t\tint day = calendar.get(Calendar.DAY_OF_WEEK) - 1;\r\n\r\n\t\tswitch (daysPerWeek) {\r\n\r\n\t\tcase 1:\r\n\t\t\tif (day == 1)\r\n\t\t\t\tcalendar.add(Calendar.DAY_OF_WEEK, 7);\r\n\t\t\telse\r\n\t\t\t\tcalendar.add(Calendar.DAY_OF_WEEK, (getRestDaysOfWeek(day) + 1));\r\n\r\n\t\t\tbreak;\r\n\t\tcase 7:\r\n\t\t\tcalendar.add(Calendar.DAY_OF_MONTH, days);\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tcheckDayHelper(calendar, days, daysPerWeek, day);\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t}",
"protected void runEachDay() {\n \n }",
"@Test\n\tpublic void dayTimeAndNightTimeAreDetectedCorrectlyTest() {\n\t\tcurrentDate = LocalDate.of(2019, 01, 27);\n\t\tAverageTemperatureAndPressure atp = forecastService.getAverageTemperatureAndPressure(city, currentDate, 3);\n\t\t\n\t\tassertEquals(3, atp.getAvrgDayTimeTemperature(), 0.000000001);\n\t\tassertEquals(7, atp.getAvrgNightTimeTemperature(), 0.000000001);\n\t\tassertEquals(6, atp.getAvrgPressure(), 0.000000001);\n\t}",
"public void setDay(int day)\n {\n this.day = day;\n }",
"public void setDay(int day)\r\n {\n \tif (!(day <= daysInMonth(month) || (day < 1)))\r\n\t\t{\r\n \t\tthrow new IllegalArgumentException(\"Bad day: \" + day);\r\n\t\t}\r\n this.day = day;\r\n }",
"@POST\n public FormValidation doCheckMonday(@QueryParameter boolean monday,\n @QueryParameter boolean tuesday,\n @QueryParameter boolean wednesday,\n @QueryParameter boolean thursday,\n @QueryParameter boolean friday,\n @QueryParameter boolean saturday,\n @QueryParameter boolean sunday) {\n if (!(monday || tuesday || wednesday || thursday || friday || saturday || sunday)) {\n return FormValidation.warning(\"At least one day should be checked or minimum number of instances won't be active\");\n }\n return FormValidation.ok();\n }",
"public void setDay(int day) {\r\n if ((day >= 1) && (day <= 31)) {\r\n this.day = day; //Validate day if true set else throws an exception\r\n } else {\r\n throw new IllegalArgumentException(\"Invalid Day!\");\r\n }\r\n\r\n }",
"public void setDay(final int day) {\n\t\tthis.day = day;\n\t}",
"private boolean checkTuesdayEleven(Schedule sched)\n\t{\n\t\t//Looks at all the course's timeslots and checks time start time and day\n\t\tfor(int i = 0; i<sched.getCourses().size();i++)\n\t\t{\n\t\t\tif(sched.getCourses().get(i).getSlot() != null)\n\t\t\t{\n\t\t\t\tif((sched.getCourses().get(i).getSlot().getDay() == ScheduleDay.TU) && \n\t\t\t\t\t\t(sched.getCourses().get(i).getSlot().getStartTime() == 1100))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//If we made it here, we found no conflict. Check passes \n\t\treturn true;\n\t}",
"boolean hasFromDay();",
"@Override\r\n\t\t public void run() {\r\n\t\t\tdayElimVoteTimeout(); // this might need a catch\r\n\r\n\t\t }",
"void dailyLife() {\n\t\tString action = inputPrompt.dailyOptions(dailyTime).toLowerCase();\r\n\t\tswitch(action) {\r\n\t\tcase \"exercise\":\tthis.exercise();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\tcase \"study\":\t\tthis.study();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\tcase \"rocket\":\t\tthis.buildRocket();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\tcase \"eat\":\t\t\tthis.eat();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\tcase \"meds\":\t\tthis.getEnergised();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\tcase \"fun\":\t\t\tthis.haveFun();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\tdefault:\t\t\tdailyLife();\r\n\t\t}\t\r\n\t}",
"public static void checkForScoreReset() {\n\t\tif (mActivityScoreDate != null) {\n\t\t\tTime now = new Time();\n\t\t\tnow.setToNow();\n\n\t\t\t// this is the easiest way to check for a day being different, there\n\t\t\t// is a downfall\n\t\t\t// in that when a new year starts, the previous week's data will be\n\t\t\t// cleared.\n\t\t\tif (now.yearDay != mActivityScoreDate.yearDay) {\n\t\t\t\tshiftScores(now.yearDay - mActivityScoreDate.yearDay);\n\t\t\t}\n\t\t} else {\n\t\t\tmActivityScoreDate = new Time();\n\t\t}\n\t\tmActivityScoreDate.setToNow();\n\t\tsaveScore();\n\n\t}",
"private String checkIfToday(String day) {\n GregorianCalendar cal = new GregorianCalendar();\n switch(cal.get(Calendar.DAY_OF_WEEK)) {\n case Calendar.MONDAY:\n if (day.equals(\"Mo.\") || day.equals(\"Mon\")) {\n return International.getString(\"heute\");\n }\n case Calendar.TUESDAY:\n if (day.equals(\"Di.\") || day.equals(\"Tue\")) {\n return International.getString(\"heute\");\n }\n case Calendar.WEDNESDAY:\n if (day.equals(\"Mi.\") || day.equals(\"Wed\")) {\n return International.getString(\"heute\");\n }\n case Calendar.THURSDAY:\n if (day.equals(\"Do.\") || day.equals(\"Thu\")) {\n return International.getString(\"heute\");\n }\n case Calendar.FRIDAY:\n if (day.equals(\"Fr.\") || day.equals(\"Fri\")) {\n return International.getString(\"heute\");\n }\n case Calendar.SATURDAY:\n if (day.equals(\"Sa.\") || day.equals(\"Sat\")) {\n return International.getString(\"heute\");\n }\n case Calendar.SUNDAY:\n if (day.equals(\"So.\") || day.equals(\"Sun\")) {\n return International.getString(\"heute\");\n }\n }\n return day;\n }",
"public boolean setDay(int newDay, boolean check) {\n\t\tthis.day = newDay;\n\t\tdeltatIsValid = false;\n\t\tthis.jd = swe_julday(this.year, this.month, this.day, this.hour, this.calType); // ->\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// erzeugt\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// JD\n\t\tif (check) {\n\t\t\tdouble oldYear = this.year;\n\t\t\tdouble oldMonth = this.month;\n\t\t\tIDate dt = swe_revjul(this.jd, this.calType); // -> erzeugt neues\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Datum\n\t\t\tthis.year = dt.year;\n\t\t\tthis.month = dt.month;\n\t\t\tthis.day = dt.day;\n\t\t\tthis.hour = dt.hour;\n\t\t\treturn (this.year == oldYear && this.month == oldMonth && this.day == newDay);\n\t\t}\n\t\treturn true;\n\t}",
"public boolean isOverdue(int today);",
"public void setDay(int day) {\n if(day < 1 || day > 31) {\n this.day = 1;\n } else {\n this.day = day;\n }\n\n if(month == 2 && this.day > 29) {\n this.day = 29;\n } else if((month==4 || month==6 || month==8 || month==11) && this.day > 30) {\n this.day = 30;\n }\n }",
"@Test\n public void computeFactor_WinterTimeDay() {\n long startTimeUsage = DateTimeHandling\n .calculateMillis(\"2012-10-21 00:00:00\");\n long endTimeUsage = DateTimeHandling\n .calculateMillis(\"2012-10-30 23:59:59\");\n BillingInput billingInput = BillingInputFactory.newBillingInput(\n \"2012-10-01 00:00:00\", \"2012-11-01 00:00:00\");\n\n // when\n double factor = calculator.computeFactor(PricingPeriod.DAY,\n billingInput, startTimeUsage, endTimeUsage, true, true);\n\n // then\n assertEquals(10, factor, 0);\n }",
"public boolean isSetDay()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(DAY$0) != 0;\n }\n }",
"private boolean checkHoursRestrictions(List<Long> daysworked) {\n boolean isOk = true;\n if (daysworked.size() >= 225) {\n //this worker has\n Toast.makeText(getApplicationContext(), mUserName + \" has more than 225 work shifts\", Toast.LENGTH_SHORT).show();\n Toast.makeText(getApplicationContext(), mUserName + \" has more than 225 work shifts\", Toast.LENGTH_SHORT).show();\n isOk = false;\n }\n Collections.sort(daysworked);\n int shiftsInTheSameWeek = 0;\n int pivotWeek = -1;\n int weekNumber = -1;\n for (Long day : daysworked) {\n Calendar cal = Calendar.getInstance();\n cal.setTimeInMillis(day);\n weekNumber = cal.get(Calendar.WEEK_OF_YEAR);\n shiftsInTheSameWeek++;\n if (pivotWeek == weekNumber) {\n if (shiftsInTheSameWeek > 5) {\n Toast.makeText(getApplicationContext(), mUserName + \" has more than 40 hours in week\" + weekNumber, Toast.LENGTH_SHORT).show();\n isOk = false;\n break;//\n }\n pivotWeek = weekNumber;\n } else {\n shiftsInTheSameWeek = 1;\n pivotWeek = weekNumber;\n }\n }\n return isOk;\n }",
"public boolean isNightTime() {\n\t\tint hour24 = this.total % 24;\n\t\tif (hour24 < 7 || hour24 > 18) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public boolean modifyVacationDay(GregorianCalendar date, int morningDrs, int eveningDrs, int nightDrs, String especialDate) throws IOException{\r\n\t\t// checking input data\r\n\t\tif (!calendar.existsVacationDay(date)) throw new IOException(\"La fecha no corresponde a ningun dia vacacional \");\r\n\t\telse if (morningDrs < 0) throw new IOException(\"El numero de doctores del turno de manana no es correcto \");\r\n\t\telse if (eveningDrs < 0) throw new IOException(\"El numero de doctores del turno de tarde no es correcto \");\r\n\t\telse if (nightDrs < 0) throw new IOException(\"El numero de doctores del turno de noche no es correcto \");\r\n\t\t// making changes\r\n\t\telse {\r\n\t\t\tcalendar.getShift(date, shiftTypes[0]).setNumberOfDoctors(morningDrs);\r\n\t\t\tcalendar.getShift(date, shiftTypes[1]).setNumberOfDoctors(eveningDrs);\r\n\t\t\tcalendar.getShift(date, shiftTypes[2]).setNumberOfDoctors(nightDrs);\r\n\t\t\tcalendar.getShift(date, shiftTypes[0]).setSpecialDate(especialDate);\r\n\t\t\tcalendar.getShift(date, shiftTypes[1]).setSpecialDate(especialDate);\r\n\t\t\tcalendar.getShift(date, shiftTypes[2]).setSpecialDate(especialDate);\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"public void setDay(final short day) {\r\n\t\tthis.day = day;\r\n\t}",
"public boolean occursOn(int year, int month, int day){\n if (day == mDay){\n return true;\n }\n else {\n return false;\n }\n }",
"public void verifyData() {\n\n saveDay();\n\n }",
"public void die() {\n if (dayCountDown == 0) {\n new Holdable(getLocation()).init();\n }\n }",
"public static void testSleepIn(boolean weekday, boolean vacation) {\n\n\t}",
"public static boolean sleepIn(final boolean weekDay, final boolean vacation) {\n // Your code goes here.\n if (!weekDay || vacation) {\n return true;\n }\n else{\n return false;\n }\n\n }",
"void setUserVoteSalaryWeeklyDayOfWeek(DayOfWeek voteSalaryDayOfWeek);",
"public boolean hasDay() {\n return day_ != null;\n }",
"private void checkElim(int origin) {\r\n\r\n\t// if (elimDay.size() > playerIDs.size() / 2) {\r\n\tserver.publicMessage(players.get(origin) + \" has voted to eliminate \" + server.getUsername(playerOnTrialID));\r\n\r\n\tif (elimDay.size() > players.size() / 2) {\r\n\t eliminateDay();\r\n\t}\r\n\r\n }",
"public static int snail(int column, int day, int night) {\n\n int count = 0;\n int d = 0;\n while (d < column) {\n d += day;\n count++;\n if (d < column) {\n d -= night;\n }\n }\n\n return count;\n }",
"public boolean isNight() {\r\n return hours < 6 || hours >= 20;\r\n }",
"public boolean hasDay() {\n return dayBuilder_ != null || day_ != null;\n }",
"private void \n\tcheckFinished(\n\t\t\tboolean start_of_day )\n\t{\n\t\tfinal boolean all_pieces_done =disk_mgr.getRemainingExcludingDND() ==0;\n\n\t\tif (all_pieces_done)\n\t\t{\n\t\t\tseeding_mode\t= true;\n\t\t\t\n\t\t\tprefer_udp_bloom = null;\n\t\t\t\n\t\t\tpiecePicker.clearEndGameChunks();\n\n\t\t\tif (!start_of_day)\n\t\t\t\tadapter.setStateFinishing();\n\n\t\t\t_timeFinished = SystemTime.getCurrentTime();\n\t\t\tfinal ArrayList peer_transports = peer_transports_cow;\n\n\t\t\t//remove previous snubbing\n\t\t\tfor (int i =0; i <peer_transports.size(); i++ )\n\t\t\t{\n\t\t\t\tfinal PEPeerTransport pc = (PEPeerTransport) peer_transports.get(i);\n\t\t\t\tpc.setSnubbed(false);\n\t\t\t}\n\t\t\tsetNbPeersSnubbed(0);\n\n\t\t\tfinal boolean checkPieces =COConfigurationManager.getBooleanParameter( \"Check Pieces on Completion\" );\n\n\t\t\t//re-check all pieces to make sure they are not corrupt, but only if we weren't already complete\n\t\t\tif (checkPieces &&!start_of_day)\n\t\t\t{\n\t\t\t\tfinal DiskManagerCheckRequest req =disk_mgr.createCheckRequest(-1, new Integer(CHECK_REASON_COMPLETE));\n\t\t\t\tdisk_mgr.enqueueCompleteRecheckRequest(req, this);\n\t\t\t}\n\n\t\t\t_timeStartedSeeding = SystemTime.getCurrentTime();\n\n\t\t\ttry{\n\t\t\t\tdisk_mgr.saveResumeData(false);\n\t\t\t\t\n\t\t\t}catch( Throwable e ){\n\t\t\t\tDebug.out( \"Failed to save resume data\", e );\n\t\t\t}\n\t\t\tadapter.setStateSeeding( start_of_day );\n\t\t\tdisk_mgr.downloadEnded();\n\t\t} else\n\t\t{\n\t\t\tseeding_mode = false;\n\t\t}\n\t}",
"public Component canOnlyVoteAtDay() {\n return MiniMessage.get().parse(canOnlyVoteAtDay);\n }",
"private boolean checkTravel(int month, int day) throws SQLException {\n\t\tcheckTravelStatement.clearParameters();\n\t\tcheckTravelStatement.setInt(1, month);\n\t\tcheckTravelStatement.setInt(2, day);\n\t\tcheckTravelStatement.setString(3, this.username);\n\t\tResultSet result = checkTravelStatement.executeQuery();\n\t\tresult.next();\n\t\tboolean out = result.getInt(1) == 1;\n\t\tif (DEBUG) {\n\t\t\tSystem.out.println(\"checkTravel: \"+result.getInt(1)+\"\\n\");\n\t\t}\n\t\tresult.close();\n\t\treturn out;\n\t}",
"public void cycleDay() {\r\n player.gametick();\r\n }",
"public boolean checkReservationDateFromToday(String resMonth, String resDay, String resYear){\n int daysDiff,monthDiff,yearDiff; //date difference\n int monthToday,dayToday,yearToday; //date today\n int monthReserved,dayReserved,yearReserved; //date of reservation\n \n //date of reservation\n String sMonth,sDay,sYear;\n sMonth = resMonth;\n sDay = resDay;\n sYear = resYear;\n \n getCurrentDate(); //call to get current date\n \n boolean dateValid = false;\n sMonth = convertMonthToDigit(sMonth); //convert string month to string number\n \n monthToday = parseInt(month);\n dayToday = parseInt(day);\n yearToday = parseInt(year);\n \n //convert to integer\n monthReserved = parseInt(sMonth);\n dayReserved = parseInt(sDay);\n yearReserved = parseInt(sYear);\n \n //get the difference\n monthDiff = monthReserved - monthToday;\n daysDiff = dayReserved - dayToday;\n yearDiff = yearReserved - yearToday;\n \n System.out.println(\"startMonth: \"+ sMonth);\n System.out.println(\"yearDiff: \" + yearDiff);\n System.out.println(\"daysDiff: \" + daysDiff);\n System.out.println(\"monthDiff: \" + monthDiff);\n \n if(yearDiff > 0){ //next year\n return true;\n }\n \n if(yearDiff == 0){ //this year\n if(monthDiff >= 0){\n if(monthDiff == 0 && daysDiff == 0){ //cannot reserve room on the day\n //invalid day, the date is today\n dateValid = false;\n System.out.println(\"reservation day must not today.\");\n }else if(monthDiff==0 && daysDiff < 0){ // same month today, invalid day diff\n dateValid = false; \n System.out.println(\"reservation day must not in the past\");\n }else if(monthDiff>0 && daysDiff < 0){ //not the same month today, accept negative day diff\n dateValid = true;\n }else{ //the same month and valid future day\n dateValid = true;\n }\n }else{\n //invalid month\n System.out.println(\"reservation month must not in the past.\");\n }\n }else{\n //invalid year\n System.out.println(\"reservation year must not in the past.\");\n }\n \n return dateValid;\n }",
"public void CheckAvail(LocalDate indate, LocalDate outdate)\r\n {\n if (Days.daysBetween(lastupdate, outdate).getDays() > 30)\r\n {\r\n System.out.println(\"more than 30\");\r\n return;\r\n }//Check if checkin date is before today\r\n if (Days.daysBetween(lastupdate, indate).getDays() < 0)\r\n {\r\n System.out.println(\"Less than 0\");\r\n return;\r\n }\r\n int first = Days.daysBetween(lastupdate, indate).getDays();\r\n int last = Days.daysBetween(lastupdate, outdate).getDays();\r\n for (int i = 0; i < roomtypes.size(); i++)\r\n {\r\n boolean ispossible = true;\r\n for (int j = first; j < last; j++)\r\n {\r\n if (roomtypes.get(i).reserved[j] >= roomtypes.get(i).roomcount)\r\n {\r\n ispossible = false;\r\n }\r\n } \r\n \r\n if (ispossible)\r\n System.out.println(roomtypes.get(i).roomname);\r\n }\r\n }",
"public boolean hasDay() {\n return day_ != null;\n }",
"public void setGeboorteDatum(int geboorteDag, int geboorteMaand, int geboorteJaar)\n {\n switch (geboorteMaand){\n case 1 : \n case 3 :\n case 5 :\n case 7 :\n case 8 :\n case 10:\n case 12:\n if (geboorteDag >= 1 && geboorteDag <= 31){\n this.geboorteDag = geboorteDag;\n geldigeDag = true;\n }\n else {\n System.out.println (\"Dag voldoet niet aan de voorwaarden.\"); \n }\n break ;\n case 4 :\n case 6 :\n case 9 :\n case 11:\n if (geboorteDag >= 1 && geboorteDag <= 30){\n this.geboorteDag = geboorteDag;\n geldigeDag = true;\n }\n else {\n System.out.println (\"Dag voldoet niet aan de voorwaarden deze maand heeft geen 31 dagen.\");\n\n }\n break ;\n case 2 :\n if(geboorteJaar % 4 == 0)\n {\n if((geboorteJaar % 100 == 0) && (geboorteJaar % 400 != 0))\n {\n isSchrikkeljaar = false;\n }\n else\n {\n isSchrikkeljaar = true;\n }\n }\n else\n {\n isSchrikkeljaar = false;\n } \n\n if(isSchrikkeljaar == false)\n {\n if(geboorteDag >= 1 && geboorteDag <= 28){\n geboorteDag = geboorteDag;\n geldigeDag = true;\n }\n else{\n geboorteDag = 0;\n geldigeDag = false;\n System.out.println (\"deze maand gaat maar tot 28 dagen\");\n }\n }\n\n if(isSchrikkeljaar == true)\n {\n if(geboorteDag >= 1 && geboorteDag <= 29){\n geboorteDag = geboorteDag;\n geldigeDag = true;\n }\n else{\n geboorteDag = 0;\n geldigeDag = false;\n System.out.println (\"deze maand gaat maar tot 29 dagen\");\n }\n }\n break ;\n }\n\n if (geboorteMaand >= 1 && geboorteMaand <= 12 && geldigeDag == true){\n this.geboorteMaand = geboorteMaand;\n }\n else {\n System.out.println (\"Maand voldoet niet aan de voorwaarden.\");\n geboorteMaand = 0;\n }\n\n if (geboorteJaar >= 1900 && geboorteJaar <= 2100 && geldigeDag == true){\n this.geboorteJaar = geboorteJaar;\n }\n else {\n System.out.println (\"Jaar voldoet niet aan de voorwaarden.\");\n geboorteJaar = 0;\n } \n }",
"public boolean checkDiary() {\n if (this.activities.size() % 2 == 0) return false; //we have to end with an stay! so the number must be odd!\n for (int i = 0; i < this.activities.size(); i++) {\n if (((i % 2) == 0 && !this.activities.get(i).stay) || //even and not a stay: bad!\n ((i % 2) == 1 && this.activities.get(i).stay) // odd and not a trip: bad!\n ) {\n return false;\n }\n if (this.activities.get(i).getDurtation() <= 0) {\n if (this.activities.get(i).start_min == 0 && this.activities.get(i).end_min == 0)\n continue;//starts at midnight are ok!\n System.out.println(\"Error in diary!\");\n this.activities.get(i).printElement();\n return false;\n }\n }\n //now check if the first and last stays are home\n return this.activities.size() > 0 && this.activities.get(0).home && this.activities.get(\n this.activities.size() - 1).home;\n }",
"public void setDay(java.lang.String param) {\r\n localDayTracker = param != null;\r\n\r\n this.localDay = param;\r\n }",
"public void setDay(java.lang.String param) {\r\n localDayTracker = param != null;\r\n\r\n this.localDay = param;\r\n }",
"public void dailyInventoryCheck(){\n\n\t\tint i;\n\t\tStock tempStock, tempRestockTracker;\n\t\tint listSizeInventory = this.inventory.size();\n\t\tfor(i = 0; i < listSizeInventory; i++){\n\n\t\t\t\tif(this.inventory.get(i).getStock() == 0){\n\t\t\t\t\t//If stock is 0 add 1 to the out of stock counnter then reset it to the inventory level\n\t\t\t\t\tthis.inventory.get(i).setStock(inventoryLevel);\n\t\t\t\t\tthis.inventoryOrdersDone.get(i).addStock(1);\n\t\t\t\t\t//inventoryOrdersDone.set(i,tempRestockTracker);\n\t\t\t\t\t//tempStock.setStock(inventoryLevel);\n\t\t\t\t\t//this.inventory.set(i,tempStock);\n\t\t\t\t}\n\t\t\t}\n\n\t}",
"@Test(timeout = 4000)\n public void test12() throws Throwable {\n FileSystemHandling.setPermissions((EvoSuiteFile) null, true, true, false);\n JDayChooser jDayChooser0 = new JDayChooser(false);\n jDayChooser0.validate();\n jDayChooser0.setMonth(699);\n jDayChooser0.setDay(100);\n assertEquals(30, jDayChooser0.getDay());\n }",
"boolean getDayNull();",
"public int daysOverdue(int today);",
"public void dayStartNew() {\n dateOfLastEdit = currentDate;\n sumOfExpenses = 0;\n challengeDaysRunning++;\n\n expensesRefresh();\n carry = moneyLeft;\n\n currentStateSaveToSharedPref();\n expensesUpdateWaterfallChart();\n }",
"public void setMatchesForDay(int day, Match m){\n\t\tfor (int i = 0; i < this.matches.size(); i++) {\n\t\t\tMatch matchSchedule = this.matches.get(i);\n\t\t\tif(m.getTeamHome().getNm().equals(matchSchedule.getTeamHome().getNm()) & m.getTeamAway().getNm().equals(matchSchedule.getTeamAway().getNm())){\n\t\t\t\tmatchSchedule.setGoalsHome(m.getGoalsHome());\n\t\t\t\tmatchSchedule.setGoalsAway(m.getGoalsAway());\n\t\t\t}\n\t\t}\n\t}",
"@Test(timeout = 4000)\n public void test27() throws Throwable {\n JDayChooser jDayChooser0 = new JDayChooser(false);\n jDayChooser0.setMaxSelectableDate((Date) null);\n jDayChooser0.drawDays();\n jDayChooser0.setEnabled(true);\n assertTrue(jDayChooser0.isDayBordersVisible());\n assertEquals(14, jDayChooser0.getDay());\n assertTrue(jDayChooser0.isDecorationBackgroundVisible());\n }",
"public static void boarDay (Grid grid) {\n grid.weekday = dateArray[(int) (Math.random() * 7)];\n }",
"public boolean checkCategoryInput(Die [] dice, int chose) {\n if (!checkCategory(chose)) {\n\n switch (chose) {\n //case 1 is Aces\n case (1):\n case (2):\n case (3):\n case (4):\n case (5):\n case (6):\n if (checkUpper(dice, chose)) {\n categoryScore[chose - 1] = sumDice(dice, chose);\n categoryCheck[chose - 1] = true;\n }\n else{\n categoryScore[chose - 1] = 0;\n categoryCheck[chose - 1] = true;\n }\n return categoryCheck[chose - 1];\n\n\n //case 7 is ThreeOfAKind\n case (7):\n if (checkLowerSector[1] == true) {\n categoryScore[chose - 1] = ;\n categoryCheck[chose - 1] = true;\n return checkMatch(dice, 3);\n }\n return categoryCheck[chose - 1];\n\n\n //case 8 is FourOfAKind\n case (8):\n if (checkLowerSector[2] = true) {\n categoryScore[chose - 1] =;\n categoryCheck[chose - 1] = true;\n return checkMatch(dice, 4);\n\n }\n\n //case 9 is SmallStraight\n case (9):\n\n return true;\n\n //case 10 is LargeStraight\n case (10):\n if (inDice(\n scoreStraight(\n false,inDice(dice,))))\n return true;\n\n //case 11 is FullHouse\n case (11):\n //test print lines were for testing.\n /* System.out.println(\"Test 11\");*/\n if (checkMatch(dice, 3) &&\n checkMatch(dice, 2)) {\n return true;\n }\n //not sure if i need the !checkMatch(5)\n break;\n\n //case 12 is Yahtzee\n case (12):\n if (checkLowerSector[3] = true) {\n return checkMatch(dice, 5);\n }\n\n //case 13 is Chance\n case (13):\n sumDice(dice, chose);\n return true;\n //test print lines were for testing.\n\n\n\n default:\n System.out.println(\"Invalid number or faulty code.\");\n break;\n }\n// if (chose < 7 && chose > 0) {\n// if (checkUpper(player.getDice(), chose)) {\n// categoryScore[chose - 1] = sumDice(player.getDice(), chose);\n// categoryCheck[chose - 1] = true;\n// return true;\n// }\n// } else {\n//\n//\n// }\n\n } else {\n return false;\n\n }\n\n return false;\n\n }",
"private void dayOfWeek(HplsqlParser.Expr_func_paramsContext ctx) {\n Integer v = getPartOfDate(ctx, Calendar.DAY_OF_WEEK);\n if (v != null) {\n evalInt(v);\n }\n else {\n evalNull();\n }\n }",
"@Override\n public void doDayEndActions() {\n if (this.getCurrentDay() == 1) {\n this.spawnTrees();\n }\n Iterator<GroundTile> allEditedTiles = this.editedTiles.iterator();\n Iterator<Tile> allTreeTiles = this.treeTiles.iterator();\n\n while (allTreeTiles.hasNext()) {\n Tile currentTile = allTreeTiles.next();\n TileComponent currentContent = currentTile.getContent();\n if ((currentContent != null) && (currentContent instanceof ExtrinsicTree)) {\n ((ExtrinsicTree)currentTile.getContent()).grow();\n }\n }\n\n while (allEditedTiles.hasNext()) {\n GroundTile currentTile = allEditedTiles.next();\n currentTile.determineImage(this.getCurrentDay());\n\n if (currentTile.getContent() != null) {\n TileComponent content = currentTile.getContent();\n if (content instanceof ExtrinsicCrop) {\n if (this.getSeason() != ((IntrinsicCrop)((ExtrinsicCrop)content).getIntrinsicSelf()).getPlantingSeason()) {\n currentTile.setContent(null); \n } else {\n if (currentTile.getLastWatered() == this.getCurrentDay() - 1) {\n ((ExtrinsicCrop)currentTile.getContent()).grow();\n //- Kill the crop if it wasn't watered for some time\n } else if (currentTile.getLastWatered() == this.getCurrentDay() - 3) {\n currentTile.setContent(null);\n }\n }\n }\n } else {\n //- If the tile is tilled but there's nothing on it, untill it\n if (currentTile.getTilledStatus()) { \n currentTile.setTilledStatus(false);\n currentTile.determineImage(this.getCurrentDay());\n //- Remove the tile from the iterator to prevent ConcurrentModificationException\n allEditedTiles.remove();\n this.editedTiles.remove(currentTile);\n }\n }\n }\n }",
"public static void main(String[] args) {\n\n\n Scanner scan = new Scanner(System.in);\n\n System.out.println(\"Enter a number please \");\n int day = scan.nextInt();\n\n\n\n if (day == 1) {\n System.out.println(\"It's a Monday!\");\n }\n if (day == 2) {\n System.out.println(\"It's a Tuesday!\");\n }\n if (day == 3) {\n System.out.println(\"It's a Wednesday!\");\n }\n if (day == 4) {\n System.out.println(\"It's a Thursday!\");\n }\n if (day == 5) {\n System.out.println(\"It's a Friday!\");\n }\n if (day == 6) {\n System.out.println(\"It's a Saturday!\");\n }\n if (day == 7) {\n System.out.println(\"It's a Sunday!\");\n }else if(day>7 || day <1){\n System.out.println(\"There is no such a day!\");\n }\n\n\n\n\n\n\n }",
"private void renewTimes() {\n String time_morgens_new = time_prefs.getString(\"time_morgens\", getResources().getString(R.string.default_morgens));\n String time_mittags_new = time_prefs.getString(\"time_mittags\", getResources().getString(R.string.default_mittags));\n String time_abends_new = time_prefs.getString(\"time_abends\", getResources().getString(R.string.default_abends));\n String time_zur_nacht_new = time_prefs.getString(\"time_morgens\", getResources().getString(R.string.default_morgens));\n /*comparison of class local time variblaes with new Preferences\n deletes alarms affected medicines and creates new alarms for them\n */\n\n if (!time_morgens.equals(time_morgens_new)) {\n //list all affected Meds and iterate for each\n List<Meds> meds = Meds.find(Meds.class, \"time = ?\", \"Morgens\");\n for (Meds m : meds) {\n if (!m.getDays().equals(\"\")) {\n cancelAlarm(m.getId());\n }\n }\n\n for (Meds m : meds) {\n if (!m.getDays().equals(\"\")) {\n createAlarm(m.getDays(), m.getTime(), m.getId());\n }\n }\n }\n\n if (!time_mittags.equals(time_mittags_new)) {\n List<Meds> meds = Meds.find(Meds.class, \"time = ?\", \"Mittags\");\n for (Meds m : meds) {\n if (!m.getDays().equals(\"\")) {\n cancelAlarm(m.getId());\n }\n }\n\n for (Meds m : meds) {\n if (!m.getDays().equals(\"\")) {\n createAlarm(m.getDays(), m.getTime(), m.getId());\n }\n }\n }\n if (!time_abends.equals(time_abends_new)) {\n List<Meds> meds = Meds.find(Meds.class, \"time = ?\", \"Abends\");\n for (Meds m : meds) {\n if (!m.getDays().equals(\"\")) {\n cancelAlarm(m.getId());\n }\n }\n\n for (Meds m : meds) {\n if (!m.getDays().equals(\"\")) {\n createAlarm(m.getDays(), m.getTime(), m.getId());\n }\n }\n }\n if (!time_zur_nacht.equals(time_zur_nacht_new)) {\n List<Meds> meds = Meds.find(Meds.class, \"time = ?\", \"Morgens\");\n for (Meds m : meds) {\n if (!m.getDays().equals(\"\")) {\n cancelAlarm(m.getId());\n }\n }\n\n for (Meds m : meds) {\n if (!m.getDays().equals(\"\")) {\n createAlarm(m.getDays(), m.getTime(), m.getId());\n }\n }\n }\n }",
"private boolean isFixedDayOff(final Calendar date) {\n return isChristmasDay(date) || isAugustFifteenth(date)\n || isJanuaryFirst(date) || isJulyFourteenth(date)\n || isMayFirst(date) || isMayEighth(date)\n || isNovemberFirst(date) || isNovemberEleventh(date);\n\n }",
"private static boolean isDay(long sunrise, long sunset, long currentTime) {\n\n Calendar calendarSunrise = Calendar.getInstance();\n Calendar calendarSunset = Calendar.getInstance();\n Calendar calendarCurrentTime = Calendar.getInstance();\n\n calendarSunrise.setTimeInMillis(sunrise);\n calendarSunset.setTimeInMillis(sunset);\n calendarCurrentTime.setTimeInMillis(currentTime);\n\n if (calendarCurrentTime.get(calendarCurrentTime.HOUR_OF_DAY)\n > calendarSunrise.get(calendarSunrise.HOUR_OF_DAY)\n &&\n calendarCurrentTime.get(calendarCurrentTime.HOUR_OF_DAY)\n < calendarSunset.get(calendarSunset.HOUR_OF_DAY)) {\n\n Log.d(TAG_WEATHER_MANAGEMENT, \"isDay: true\");\n return true;\n } else {\n Log.d(TAG_WEATHER_MANAGEMENT, \"isDay: false\");\n return false;\n }\n }"
] | [
"0.61771977",
"0.60001826",
"0.57496643",
"0.5747044",
"0.57036054",
"0.5645454",
"0.5561454",
"0.5510661",
"0.54561394",
"0.5361419",
"0.53197074",
"0.52677524",
"0.5191157",
"0.5191157",
"0.50555426",
"0.5043042",
"0.5042498",
"0.5015262",
"0.50122875",
"0.5001154",
"0.4992802",
"0.4985984",
"0.49271083",
"0.48953032",
"0.4894202",
"0.4894202",
"0.4894202",
"0.4894202",
"0.4894202",
"0.48888534",
"0.48877358",
"0.4885689",
"0.4864301",
"0.4858531",
"0.48515165",
"0.48501998",
"0.48056865",
"0.47808203",
"0.4778888",
"0.4778888",
"0.4776883",
"0.47750014",
"0.4773274",
"0.4765003",
"0.47581303",
"0.47571898",
"0.4728337",
"0.47162902",
"0.47103927",
"0.4702295",
"0.4698961",
"0.4695391",
"0.46909764",
"0.46908203",
"0.46865076",
"0.4684022",
"0.46765882",
"0.4674999",
"0.46723053",
"0.46661437",
"0.46564764",
"0.46423763",
"0.46393985",
"0.46393585",
"0.46387756",
"0.46331456",
"0.4628927",
"0.46273795",
"0.46237537",
"0.46171764",
"0.4615251",
"0.46142572",
"0.4608769",
"0.46051568",
"0.45908958",
"0.45885122",
"0.45802188",
"0.45581654",
"0.45556164",
"0.45553383",
"0.45508826",
"0.4550768",
"0.4536929",
"0.45369026",
"0.45369026",
"0.45310944",
"0.4527487",
"0.45255953",
"0.45241714",
"0.4523127",
"0.45170707",
"0.451508",
"0.45101765",
"0.4509777",
"0.45071983",
"0.45059028",
"0.45015186",
"0.44986472",
"0.4498229",
"0.44854188"
] | 0.6776941 | 0 |
The checkNight method checks if the votes to change the game to night, are in the majority. If so then the vote for night is successful, the votes cleared, game changed to night and chat set to inactive. | private void checkNight(int origin) {
server.publicMessage(players.get(origin) + " has voted for it to remain night");
// if (nightVote.size() > playerIDs.size() / 2) {
if (nightVote.size() > players.size() / 2) {
night();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void voteNight(int origin) {\r\n\t// if (playerOnTrialID != null) {\r\n\tif (elimDayVoteInProgress) {\r\n\t server.privateMessage(\"you cannot start a vote for it to be night when there is a vote in progress \"\r\n\t\t + \"to eliminate a player\", origin);\r\n\r\n\t} else if (nightVote.contains(origin)) {\r\n\t server.privateMessage(\"you have already voted to change the game to night\", origin);\r\n\r\n\t} else if (!players.containsKey(origin)) {\r\n\t server.privateMessage(\"you are not in the game, so cannot participate\", origin);\r\n\r\n\t} else {\r\n\t nightVoteInProgress = true;\r\n\r\n\t if (dayVote.contains(origin)) {\r\n\t\tint index = dayVote.indexOf(origin);\r\n\t\tdayVote.remove(index);\r\n\t }\r\n\r\n\t nightVote.add(origin);\r\n\r\n\t if (nightVote.size() == 1) {\r\n\t\tTimerTask nightVoteTimeout = new TimerTask() {\r\n\r\n\t\t @Override\r\n\t\t public void run() {\r\n\t\t\tnightVoteTimeout(); // this might need a catch\r\n\r\n\t\t }\r\n\t\t};\r\n\r\n\t\tnightVoteTimer = new Timer();\r\n\r\n\t\tnightVoteTimer.schedule(nightVoteTimeout, 20000);\r\n\t } else {\r\n\t\tcheckNight(origin);\r\n\t }\r\n\r\n\t}\r\n }",
"public boolean isNight() {\r\n return hours < 6 || hours >= 20;\r\n }",
"public Component canOnlyVoteAtNight() {\n return MiniMessage.get().parse(canOnlyVoteAtNight);\n }",
"boolean checkDayNight(boolean daytime);",
"public boolean isNightTime() {\n\t\tint hour24 = this.total % 24;\n\t\tif (hour24 < 7 || hour24 > 18) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public static void checkWinner() {\n\t\tcontinueGame = false;\n\t\tfor (int k = 0; k < secretWordLength; k++) {\n\t\t\tif (!unseenBoard.get(k).equals(\"*\")) {\n\t\t\t\tcontinueGame = true;\n\t\t\t}\n\t\t}\n\t}",
"private static void winnerOrTie()\n\t{\n\t\t//Check each row for winning or tie condition.\n\t\tif(tictactoeBoard[0] == tictactoeBoard[1] && tictactoeBoard[1] == tictactoeBoard[2] && tictactoeBoard[0] != 1)\n\t\t{\n\t\t\tSystem.out.println(\"Winner\");\n\t\t}\n\t\tif(tictactoeBoard[3] == tictactoeBoard[4] && tictactoeBoard[4] == tictactoeBoard[5] && tictactoeBoard[3] != 4)\n\t\t{\n\t\t\tSystem.out.println(\"Winner\");\n\t\t}\n\t\tif(tictactoeBoard[6] == tictactoeBoard[7] && tictactoeBoard[7] == tictactoeBoard[8] && tictactoeBoard[6] != 7)\n\t\t{\n\t\t\tSystem.out.println(\"Winner\");\n\t\t}\n\t\t//Check diagonally for winning or tie condition.\n\t\tif(tictactoeBoard[0] == tictactoeBoard[4] && tictactoeBoard[4] == tictactoeBoard[8] && tictactoeBoard[0] != 1)\n\t\t{\n\t\t\tSystem.out.println(\"Winner\");\n\t\t}\n\t\tif(tictactoeBoard[6] == tictactoeBoard[4] && tictactoeBoard[4] == tictactoeBoard[2] && tictactoeBoard[6] != 7)\n\t\t{\n\t\t\tSystem.out.println(\"Winner\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//nobody has won yet.\n\t\t\t//changeTurn();\n\t\t}\n\t}",
"public static String checkEndGame(){\n\t\tif(turn.equals(\"white\") && king.whiteKingCheck == true){\n\t\t\tif(endGame.checkMate(board, \"white\")){\n\t\t\t\tincrementPoints(\"black\");\n\t\t\t\treturn \"Check Mate! Black Wins!\\n Press OK to start new game\";\n\t\t\t}\n\t\t}\n\t\tif(turn.equals(\"black\") && king.blackKingCheck == true){\n\t\t\tif(endGame.checkMate(board, \"black\")){\n\t\t\t\tincrementPoints(\"white\");\n\t\t\t\treturn \"Check Mate! White Wins!\\n Press OK to start new game\";\n\t\t\t}\n\t\t}\n\t\treturn \"noCheckMate\";\n\t}",
"boolean hasDayNight();",
"@Test\r\n\tpublic void gameWinCheckCallsCorrectWinner() {\r\n\t\tBowl bowl = new Bowl();\r\n\t\tvar answer = bowl.gameWinCheck();\r\n\t\tassertEquals(-1,answer);\r\n\t\tbowl = setupGame(bowl);\r\n\t\tanswer = bowl.gameWinCheck();\r\n\t\tassertEquals(1,answer);\r\n\t\tbowl.getNeighbor(6).passTheft(49);\r\n\t\tanswer = bowl.getNeighbor(2).gameWinCheck();\r\n\t\tassertEquals(0,answer);\r\n\t}",
"void checkWinner() {\n\t}",
"private void checkAndUpdateIfSmallGameWin(SmallGameBoard gameToCheckForWin){\n String[] letters = gameToCheckForWin.getLettersOfAllButtons();\n if (checkGameWin(letters)) {\n //Set buttons' properties \"partOfWonBoard = true\" so they cannot be clicked again\n for (ButtonClass b : chosenGame.getAllButtons()) {\n b.setPartOfWonBoard(true);\n }\n chosenGame.changeGameColor(activity.getColor());\n chosenGame.setLetterOfWinner(currentLetter);\n //If this win leads to a big game win, then MainActivity finishes the game\n if(checkForBigGameWin()){\n activity.finishGame();\n }\n }\n }",
"void setNightModeState(boolean b);",
"private void checkForGameEnd() {\n\t\tint checkWin = controller.checkForWinner();\n\t\tif(playerType == null && checkWin == 1 || (playerType != null && playerType == checkWin)) {\n\t\t\tgameFinished = true;\n\t\t\tAlert alert = new Alert(Alert.AlertType.WARNING);\n\t\t\talert.setTitle(\"VICTORY\");\n\t\t\talert.setHeaderText(\"VICTORY\");\n\t\t\talert.setContentText(\"CONGRATULATIONS! YOU WIN!\");\n\t\t\talert.showAndWait()\n\t\t .filter(response -> response == ButtonType.OK)\n\t\t .ifPresent(response -> formatSystem());\n\t\t\t\n\t\t}else if (playerType == null && checkWin == 2 || (playerType != null && playerType%2 + 1 == checkWin)) {\n\t\t\tgameFinished = true;\n\t\t\tAlert alert = new Alert(Alert.AlertType.WARNING);\n\t\t\talert.setTitle(\"DEFEAT\");\n\t\t\talert.setHeaderText(\"DEFEAT\");\n\t\t\talert.setContentText(\"SHAME! YOU LOSE!\");\n\t\t\talert.showAndWait()\n\t\t .filter(response -> response == ButtonType.OK)\n\t\t .ifPresent(response -> formatSystem());\n\t\t\t\n\t\t}else if (controller.checkForTie()) {\n\t\t\tgameFinished = true;\n\t\t\tAlert alert = new Alert(Alert.AlertType.WARNING);\n\t\t\talert.setTitle(\"STALEMATE\");\n\t\t\talert.setHeaderText(\"STALEMATE\");\n\t\t\talert.setContentText(\"ALAS! TIE GAME!\");\n\t\t\talert.showAndWait()\n\t\t .filter(response -> response == ButtonType.OK)\n\t\t .ifPresent(response -> formatSystem());\n\t\t}\n\t\t\n\t\tif(playerType != null && gameFinished) {\n\t\t\tSystem.out.println(\"closing connection\");\n\t\t\ttry {\n\t\t\t\tconnection.close();\n\t\t\t}catch (Exception e) {\n\t\t\t\tSystem.out.println(\"ERROR CLOSING\");\n\t\t\t}\n\t\t}\n\t}",
"private void announceWinner() {\n // FIXME\n if (_board.turn() == Piece.WP) {\n System.out.println(\"Black wins.\");\n } else {\n System.out.println(\"White wins.\");\n }\n }",
"public void winGame() {\n this.isWinner = true;\n }",
"public void gameSet(final String userid, final Boolean end, final Boolean survivorZero,final Boolean press) {\n findSurvivor(userid,end,survivorZero,press);\n\n if (!userid.equals(userId)){\n if (end|survivorZero) {\n questionCard.setVisibility(View.GONE);\n gamesetView.setVisibility(View.VISIBLE);\n //check if the current user is winner\n db.child(\"Games\").child(userid).child(\"Redblue\").child(\"Winner\").addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n\n\n if (dataSnapshot.hasChild(userId)) {\n winMsg.setText(\"Congrat! you win!\");\n } else {\n winMsg.setText(\"Game end\");\n\n }\n\n\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n\n }\n });\n db.child(\"Games\").child(userid).child(\"Redblue\").child(\"Loser\").addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n if (dataSnapshot.hasChild(userId)) {\n winMsg.setText(\"Congrat!, you lose!\");\n } else {\n winMsg.setText(\"Game end\");\n\n }\n\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n\n }\n });\n }else{\n db.child(\"Games\").child(userid).child(\"Redblue\").child(\"Loser\").addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n if (dataSnapshot.hasChild(userId)) {\n winMsg.setText(\"Congrat!, you lose!\");\n questionCard.setVisibility(View.GONE);\n gamesetView.setVisibility(View.VISIBLE);\n } else {\n winMsg.setText(\"Game end\");\n\n }\n\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n\n }\n });\n }\n\n }else{\n //couple case\n if(end||survivorZero){\n questionCard.setVisibility(View.GONE);\n gamesetView.setVisibility(View.VISIBLE);\n db.child(\"Games\").child(userid).child(\"Redblue\").child(\"Winner\").addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n if (dataSnapshot.hasChild(userId)) {\n winMsg.setText(\"Congrat!, you win!\");\n } else {\n winMsg.setText(\"Game end\");\n\n }\n\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n\n }\n });\n db.child(\"Games\").child(userid).child(\"Redblue\").child(\"Loser\").addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n if (dataSnapshot.hasChild(userId)) {\n winMsg.setText(\"Congrat!, you lose!\");\n } else {\n winMsg.setText(\"Game end\");\n\n }\n\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n\n }\n });\n }\n }\n\n\n\n\n\n\n cddMsg = new CustomDialogClassMsgWin(GameRB.this,end);\n// if (!isFinishing()|!cddMsg.isShowing())\n// cddMsg.show();\n\n\n// db.child(\"Games\").child(userid).child(\"Redblue\").child(\"AnswerGuest\").addListenerForSingleValueEvent(new ValueEventListener() {\n//\n// @Override\n// public void onDataChange(DataSnapshot dataSnapshot) {\n// final String correct;\n// int correntNum = 0;\n// for (DataSnapshot child : dataSnapshot.getChildren()) {\n// for (DataSnapshot userAns : child.getChildren()) {\n// if (userAns.getKey().equals(userId) && userAns.getValue().equals(true)) {\n// correntNum++;\n// }\n// }\n// }\n// String correctNumber = String.valueOf(correntNum);\n// correct = correctNumber;\n// runOnUiThread(new Runnable() {\n// @Override\n// public void run() {\n// if (!GameRB.this.isFinishing()){\n//\n//// new SweetAlertDialog(GameRB.this)\n//// .setTitleText(\"Game Set!\")\n//// .setContentText(\"You have \" + correct + \" questions right!\")\n//// .setConfirmText(\"OK\")\n//// .setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {\n//// @Override\n//// public void onClick(SweetAlertDialog sDialog) {\n//// Intent pIntent = new Intent(GameRB.this, MainActivity.class);\n//// pIntent.putExtra(\"Game\", \"Redblue\");\n//// startActivity(pIntent);\n//// sDialog.dismissWithAnimation();\n//// finish();\n//// }\n//// })\n//// .show();\n//\n//\n// }\n// }\n// });\n//\n// }\n//\n// @Override\n// public void onCancelled(DatabaseError databaseError) {\n//\n// }\n// });\n }",
"protected static boolean isNightMode(Context context) {\n int currentNightMode = context.getResources().getConfiguration().uiMode\n & Configuration.UI_MODE_NIGHT_MASK;\n return currentNightMode == Configuration.UI_MODE_NIGHT_YES;\n }",
"public void announceWinner() {\r\n Piece winer;\r\n if (_board.piecesContiguous(_board.turn().opposite())) {\r\n winer = _board.turn().opposite();\r\n } else {\r\n winer = _board.turn();\r\n }\r\n if (winer == WP) {\r\n _command.announce(\"White wins.\", \"Game Over\");\r\n System.out.println(\"White wins.\");\r\n } else {\r\n _command.announce(\"Black wins.\", \"Game Over\");\r\n System.out.println(\"Black wins.\");\r\n }\r\n }",
"@Test\n public void shouldCheckTieBreakReturnTrueAfter6GamesWonByEachPlayer() {\n \n scoreService.saveWinnerGame(\"Winner is Federer\") ;\n scoreService.saveWinnerGame(\"Winner is Federer\") ;\n scoreService.saveWinnerGame(\"Winner is Federer\") ;\n scoreService.saveWinnerGame(\"Winner is Federer\") ;\n scoreService.saveWinnerGame(\"Winner is Federer\") ;\n scoreService.saveWinnerGame(\"Winner is Nadal\") ;\n scoreService.saveWinnerGame(\"Winner is Nadal\") ;\n scoreService.saveWinnerGame(\"Winner is Nadal\") ;\n scoreService.saveWinnerGame(\"Winner is Nadal\") ;\n scoreService.saveWinnerGame(\"Winner is Nadal\") ;\n scoreService.saveWinnerGame(\"Winner is Federer\") ;\n scoreService.saveWinnerGame(\"Winner is Nadal\") ;\n \n boolean expResult = true ;\n boolean result = scoreService\n .checkTieBreak( \"Nadal\",\n \"Federer\") ;\n \n assertEquals(expResult, result) ;\n }",
"private void checkWinningMove(TicTacToeElement element,int x,int y) {\n int logicalSize = boardProperties.getBoardLength()-1;\r\n // Check column (only the one we just played)\r\n for(int i=0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[x][i] != element.getValue()){\r\n break;\r\n }\r\n // Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n\r\n }\r\n // Check row (only the one we just played)\r\n for(int i=0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[i][y] != element.getValue()){\r\n break;\r\n }\r\n // Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n }\r\n // Check diagonal\r\n // normal diagonal\r\n for(int i= 0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[i][i] != element.getValue()){\r\n break;\r\n }\r\n // Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n }\r\n // anti diagonal\r\n for(int i= 0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[i][logicalSize-i] != element.getValue()){\r\n break;\r\n }\r\n //Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n }\r\n // check draw\r\n if(gameState.getMoveCount() == Math.pow(logicalSize,2)-1){\r\n gameState.setDraw(true);\r\n }\r\n\r\n }",
"public void onNightModeChanged(int i) {\n }",
"public static int checkForWin(BitSet state, BitSet theirBoard) {\n \n BitSet[] myWins = Shifts.doShifts(state, 5, true);\n BitSet[] theirWins = Shifts.doShifts(theirBoard, 5, true);\n\n\n boolean iWon = !myWins[0].isEmpty() || !myWins[1].isEmpty() || !myWins[2].isEmpty() || !myWins[3].isEmpty();\n boolean theyWon = !theirWins[0].isEmpty() || !theirWins[1].isEmpty() || !theirWins[2].isEmpty() || !theirWins[3].isEmpty();\n \n if (iWon && theyWon) {\n //draw, we both have a win\n return 0;\n }\n else if (iWon) {\n return 3000; \n }\n else if (theyWon){\n return -3000;\n }\n else {\n return 13;\n }\n }",
"public void win() {\n if (turn == 1) {\n p1.incrementLegs();\n if (p1.getLegs() == 5) {\n p1.incrementSets();\n p1.setLegs(0);\n p2.setSets(0);\n\n }\n if (p1LastScore > p1.getHighout()) {\n p1.setHighout(p1LastScore);\n\n }\n\n if (p1.getHighout() > OVERALL_HIGH_OUT) {\n OVERALL_HIGH_OUT = p1.getHighout();\n }\n } else if (turn == 2) {\n p2.incrementLegs();\n if (p2.getLegs() == 5) {\n p2.incrementSets();\n p2.setLegs(0);\n p1.setSets(0);\n\n }\n if (p2LastScore > p2.getHighout()) {\n p2.setHighout(p2LastScore);\n }\n\n if (p2.getHighout() > OVERALL_HIGH_OUT) {\n OVERALL_HIGH_OUT = p2.getHighout();\n }\n\n\n\n }\n changeFirstTurn();\n win = true;\n\n\n\n }",
"void gameTurn(int move){\n int gameWon = -1;\n boolean gameTie = false;\n //set the board to a move and print it\n if (loggedInUser.myGame.currentLetter.equals(\"X\")){\n gameBoard [move] = 1;\n printMove(move,\"X\");\n }\n else{\n gameBoard[move] = 2;\n printMove(move,\"O\");\n }\n //Update the status of the buttons graying out the ones that were played\n updateButtons();\n\n //checks if the game has been won or not\n gameWon = checkGameWon();\n\n //check of the game has been tied\n gameTie = checkTie();\n\n Game game = new Game(loggedInUser.opponentId);\n game.currentMove = move;\n\n if (loggedInUser.myGame.currentLetter.equals(\"X\")){\n game.currentLetter = \"O\";\n }else {\n game.currentLetter = \"X\";\n }\n\n //if the game hasn't been won and the game hasnt been tied the other playesr turn is made\n if(gameWon != 0 && !gameTie){\n game.gameInProgress = true;\n }\n //if game won\n else if (gameWon != 0){\n //remove all of the buttons\n removeAllButtons();\n game.gameInProgress = false;\n }\n else{\n playerText.setText(\"The game is tie\");\n turn.setText(\"No one wins\");\n game.gameInProgress = false;\n }\n\n //set data\n mDatabaseRef.child(loggedInUser.myId).child(\"myGame\").setValue(game);\n mDatabaseRef.child(loggedInUser.opponentId).child(\"myGame\").setValue(game);\n }",
"public void checkWin(){\n boolean result = false;\n if(game.getTurn() > 3){\n Player currentPlayer = game.getPlayerTurn();\n int playernumber = currentPlayer.getPlayericon();\n result = game.winChecker(game.getBored(),playernumber);\n if(result == true) {\n setWinMsgBox(currentPlayer.getPlayerName() + \" Is victorious :)\",\"WIN\");\n }else if(game.getTurn() == 8 && result == false){\n setWinMsgBox(\"Too bad it is a draw, No one out smarted the other -_-\",\"DRAW\");\n }else{}\n }else{\n result = false;\n }\n }",
"private void checkWin() {\n // Check if a dialog is already displayed\n if (!this.gameOverDisplayed) {\n // Check left paddle\n if (Objects.equals(this.scoreL.currentScore, this.winCount) && (this.scoreL.currentScore != 0)) {\n if (twoUser) {\n gameOver(GeneralFunctions.TWO_1_WIN);\n } else {\n gameOver(GeneralFunctions.ONE_LOSE);\n }\n // Right paddle\n } else if (Objects.equals(this.scoreR.currentScore, this.winCount) && (this.scoreR.currentScore != 0)) {\n if (twoUser) {\n gameOver(GeneralFunctions.TWO_2_WIN);\n } else {\n gameOver(GeneralFunctions.ONE_WIN);\n }\n }\n }\n }",
"public boolean checkWinner(Cell value) {\n\t\tif(turn >63) {\n\t\t\t//\t\t\tSystem.out.println(\"Game is a draw.\");\n\t\t\treturn true;\n\t\t}\n\n\t\tif(check2DRowWinner(value) || check2DColWinner(value) || check2DDimWinner(value) || check2DDiagnolWinner(value) || check3DRowDiagnol(value) || check3DColDiagnol(value) || check3DDiagnolWinner(value)) {\n\t\t\tif (value.equals(Cell.O)) {\n\t\t\t\twinner = \"O\";\n\t\t\t} else {\n\t\t\t\twinner = \"X\";\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\n\t}",
"public static void checkWinCondition() {\n\t\twin = false;\n\t\tif (curPlayer == 1 && arrContains(2, 4))\n\t\t\twin = true;\n\t\telse if (curPlayer == 2 && arrContains(1, 3))\n\t\t\twin = true;\n\t\tif (curPlayer == 2 && !gameLogic.Logic.arrContains(2, 4))\n\t\t\tP2P.gameLost = true;\n\t\telse if (gameLogic.Logic.curPlayer == 1 && !gameLogic.Logic.arrContains(1, 3))\n\t\t\tP2P.gameLost = true;\n\t\tif (P2P.gameLost == true) {\n\t\t\tif (gameLogic.Logic.curPlayer == 1)\n\t\t\t\tEndScreen.infoWindow.setText(\"<html><center><b><font size=25 color=black> Black player won! </font></b></center></html>\");\n\t\t\telse\n\t\t\t\tEndScreen.infoWindow.setText(\"<html><center><b><font size=25 color=black> Red player won! </font></b></center></html>\");\n\t\t}\n\t\telse\n\t\t\twin = false;\n\t}",
"public void winGame() {\r\n if (data.gameState == 3) \r\n data.winner = 1;\r\n else if (data.gameState == 4) \r\n data.winner = 2;\r\n data.victoryFlag = true;\r\n data.gameState = 5;\r\n }",
"public int gameState() {\n \tboolean check = isCheck(turn);\n \t\n \t//change this code to be some sort of checkmate detection\n \tif(check) {\n \t\t//we need to check whether there is a legal move that puts the king out of check\n \t\t//we need to loop through all pieces of the same color as the turn and make all legal moves\n \t\t//then after each move, check whether the king is still in check\n \t\t\n \t\t//first generate a list of all pieces for the turn color\n \t\tArrayList<Piece> pieces = getPieces(turn);\n \t\t\n \t\tboolean freedom;\n \t\t\n \t\t//now for each piece, check whether moving that piece can get the king out of check\n \t\tfor(int i = 0; i < pieces.size(); i++) {\n \t\t\tfreedom = simulate(pieces.get(i));\n \t\t\tif(freedom) {\n \t \t\tupdateCheckMove(false);\n \t \t\tSystem.out.println(\"Check on \" + turn + \" King!\");\n \t\t\t\treturn 2; //if the king can move, then the game isn't over yet\n \t\t\t}\n \t\t}\n \t\t\n \t\t//the game is over if we reach this far, so we can assume checkmate\n \t\t//resignation logic will probably be specific to Display class\n \t\t\n \t\tupdateCheckMove(true);\n \t\t\n \t\tif(turn == PieceColor.White) return -1; //black win if white king in check and can't move\n \t\tif(turn == PieceColor.Black) return 1;\n \t}\n \t\n \t//if all of these fail, the game isn't over yet\n \treturn 2;\n }",
"public synchronized boolean voteTeam() {\n //tally the votes\n int yes = 0, no = 0;\n for (boolean vote : playerVotes.values()) {\n if (vote) {\n yes++;\n } else {\n no++;\n }\n }\n\n if (yes > no) {\n doMissionState = voteTeamState.acceptTeam();\n state = State.DO_MISSION;\n successiveRejections = 0;\n teamMemberChoices = new HashMap<>();\n return true;\n } else {\n pickTeamState = voteTeamState.rejectTeam();\n state = State.PICK_TEAM;\n successiveRejections++;\n teamSelection = new HashSet<>();\n return false;\n }\n }",
"private void getWinner() {\r\n int nWhite = 0, nBlack = 0;\r\n if(nextPlayer.getChecks() == 0 && nextPlayer.getQueens() == 0){\r\n winner = currentPlayer;\r\n }\r\n else if(currentPlayer.getQueens() == nextPlayer.getQueens()){\r\n for (int i = 1; i<8; i++){\r\n for (int x = 0; x<8; x++) {\r\n if (checks[i][x] == 1) nBlack++;\r\n if (checks[7 - i][x] == 2) nWhite++;\r\n }\r\n if (nWhite>nBlack) winner = getPlayer(WHITE);\r\n else if(nBlack>nWhite)winner = getPlayer(BLACK);\r\n nWhite = 0;\r\n nBlack = 0;\r\n }\r\n }\r\n else if (currentPlayer.getQueens() > nextPlayer.getQueens()){ winner = currentPlayer;}\r\n else{winner = nextPlayer; }\r\n }",
"private void voteDay(int origin) {\r\n\tif (!nightVoteInProgress) {\r\n\t server.privateMessage(\"cannot use this command when there isn't a vote to change to night\", origin);\r\n\r\n\t} else if (dayVote.contains(origin)) {\r\n\t server.privateMessage(\"you have already voted to keep the game in the day phase\", origin);\r\n\r\n\t} else if (!players.containsKey(origin)) {\r\n\t server.privateMessage(\"you are not in the game, so cannot participate\", origin);\r\n\r\n\t} else {\r\n\t if (nightVote.contains(origin)) {\r\n\t\tint index = nightVote.indexOf(origin);\r\n\t\tnightVote.remove(index);\r\n\t }\r\n\r\n\t dayVote.add(origin);\r\n\t checkDay(origin);\r\n\t}\r\n }",
"private int checkWinner() {\n if (this.turnCount >= 2) {\n int colWin = this.checkColumn();\n if (colWin > 0) {\n return colWin;\n }\n\n int rowWin = this.checkRow();\n if (rowWin > 0) {\n return rowWin;\n }\n\n int diagWin = checkDiagonal();\n if (diagWin > 0) {\n return diagWin;\n }\n }\n return 0;\n }",
"public boolean checkSouth(HashMap<Coordinate,MapTile> currentView){\n\t\t\tCoordinate currentPosition = new Coordinate(getPosition());\n\t\t\tfor(int i = 0; i <= wallSensitivity; i++){\n\t\t\t\tMapTile tile = currentView.get(new Coordinate(currentPosition.x, currentPosition.y-i));\n\t\t\t\tif(tile.isType(MapTile.Type.WALL)){\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}",
"private void checkVictory() {\n\t\tboolean currentWin = true;\n\t\t\n\t\t//Vertical win\n\t\tfor (int i = 0; i<DIVISIONS; i++){\n\t\t\tif (gameArray[i][yGuess] != currentPlayer){\n\t\t\t\tcurrentWin = false;\n\t\t\t}\n\t\t}\n\t\tif (currentWin){\n\t\t\tgameWon = true;\n\t\t}\n\t\t\n\t\t//Horizontal win\n\t\tcurrentWin = true;\n\t\tfor (int i = 0; i<DIVISIONS; i++){\n\t\t\tif (gameArray[xGuess][i] != currentPlayer){\n\t\t\t\tcurrentWin = false;\n\t\t\t}\n\t\t}\n\t\tif (currentWin){\n\t\t\tgameWon = true;\n\t\t}\n\t\t\n\t\t//Top left bottom right diagonal win\n\t\tcurrentWin = true;\n\t\tif (xGuess == yGuess){\n\t\tfor (int i = 0; i<DIVISIONS; i++){\n\t\t\tif (gameArray[i][i] != currentPlayer){\n\t\t\t\tcurrentWin = false;\n\t\t\t}\n\t\t}\n\t\tif (currentWin){\n\t\t\tgameWon = true;\n\t\t}\n\t\t}\n\t\t\n\t\t//Bottom left top right diagonal win\n\t\tcurrentWin = true;\n\t\tif (yGuess + xGuess == DIVISIONS - 1){\n\t\t\tfor (int i = 0; i<DIVISIONS; i++){\n\t\t\t\tif (gameArray[i][(DIVISIONS - 1) -i] != currentPlayer){\n\t\t\t\t\tcurrentWin = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (currentWin){\n\t\t\t\tgameWon = true;\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"boolean isWinner() {\n boolean win = true;\n // first method to win\n for (int i = 0; i < 9; i++) {\n for (int j = 0; j < 9; j++) {\n if ((state[i][j] == 'X' && stateGame[i][j] != '*') || (state[i][j] != 'X' && stateGame[i][j] == '*'))\n win = false;\n }\n }\n if (win)\n return true;\n\n win = true;\n // second method to win\n for (int i = 0; i < 9; i++) {\n for (int j = 0; j < 9; j++) {\n if (state[i][j] == '.' && stateGame[i][j] == '.')\n win = false;\n }\n }\n return win;\n }",
"static void yellow_fight () {\n monsterchoices_y_r = arenafight_y.nextInt(4);\n if (monsterchoices_y_r == 0) {//if integer is zero, you will fight a spider\n System.out.println(\"You encountered a giant spider.\");//#enemyobject-enemy that player tries to defeat\n spider_fight();\n }else if(monsterchoices_y_r == 1) {//if integer is 1 you would fight a goblin\n System.out.println(\"You encountered a goblin.\");//#enemyobject-enemy that player tries to defeat\n goblin_fights(); \n }else if(monsterchoices_y_r == 2) { //if integer is 2, you would fight a golbat\n System.out.println(\"You encountered a golbat.\");//#enemyobject-enemy that player tries to defeat\n golbat_fights();\n }else if(monsterchoices_y_r == 3) { //if the integer is 3, you would fight a witch\n System.out.println(\"You encountered a witch.\");//#enemyobject-enemy that player tries to defeat\n witch_fights();\n }\n \n }",
"private void elimDayVote(String player, int origin) {\r\n\r\n\t// int playerID = server.getUserID(player);\r\n\tif (players.containsValue(player)) {\r\n\t OrderedBidiMap<String, Integer> invPlayers = players.inverseBidiMap();\r\n\r\n\t int playerID = invPlayers.get(player);\r\n\r\n\t // if (nightVote.size() > 0) {\r\n\t if (nightVoteInProgress) {\r\n\t\tserver.privateMessage(\r\n\t\t\t\"cannot vote to eliminate a player while there is a vote to change the game to night\", origin);\r\n\r\n\t\t// } else if (!playerIDs.contains(playerID)) { // this is for\r\n\t\t// when\r\n\t\t// using ArrayList of playerIDs\r\n\t } else if (playerID == origin) {\r\n\t\tserver.privateMessage(\"you cannot vote for yourself\", origin);\r\n\r\n\t } else if (elimDay.contains(origin)) {\r\n\t\tserver.privateMessage(\"you have already voted to start\", origin);\r\n\r\n\t } else if (!players.containsKey(origin)) {\r\n\t\tserver.privateMessage(\"you are not in the game, so cannot participate\", origin);\r\n\r\n\t } else if (playerOnTrialID == null) {\r\n\t\telimDayVoteInProgress = true;\r\n\t\tplayerOnTrialID = playerID;\r\n\t\telimDay.add(origin);\r\n\r\n\t\tTimerTask dayElimVoteTimeout = new TimerTask() { // not sure if\r\n\t\t\t\t\t\t\t\t // this\r\n\t\t\t\t\t\t\t\t // will work\r\n\t\t\t\t\t\t\t\t // properly\r\n\t\t\t\t\t\t\t\t // (method\r\n\t\t\t\t\t\t\t\t // should\r\n\t\t\t\t\t\t\t\t // continue\r\n\t\t\t\t\t\t\t\t // without\r\n\t\t\t\t\t\t\t\t // waiting for\r\n\t\t\t\t\t\t\t\t // it\r\n\t\t\t\t\t\t\t\t // to finish\r\n\r\n\t\t @Override\r\n\t\t public void run() {\r\n\t\t\tdayElimVoteTimeout(); // this might need a catch\r\n\r\n\t\t }\r\n\t\t};\r\n\r\n\t\tdayElimTimer = new Timer();\r\n\r\n\t\tdayElimTimer.schedule(dayElimVoteTimeout, 20000);\r\n\r\n\t } else {\r\n\t\tif (playerOnTrialID != playerID) {\r\n\t\t server.privateMessage(\"cannot vote for \" + player + \" while the vote for \"\r\n\t\t\t + server.getUsername(playerOnTrialID) + \" is in progress\", origin);\r\n\t\t} else {\r\n\t\t if (save.contains(origin)) {\r\n\t\t\tint index = save.indexOf(origin);\r\n\t\t\tsave.remove(index);\r\n\t\t }\r\n\r\n\t\t elimDay.add(origin);\r\n\t\t checkElim(origin);\r\n\t\t}\r\n\t }\r\n\t} else if (!players.containsValue(player)) {\r\n\t server.privateMessage(player + \" is not in this game/has already been eliminated\", origin);\r\n\r\n\t}\r\n\r\n }",
"public boolean checkSouth(HashMap<Coordinate,MapTile> currentView){\n\t\tCoordinate currentPosition = new Coordinate(getPosition());\n\t\tfor(int i = 0; i <= wallSensitivity; i++){\n\t\t\tMapTile tile = currentView.get(new Coordinate(currentPosition.x, currentPosition.y-i));\n\t\t\tif(tile.isType(MapTile.Type.WALL)){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"private boolean checkGameStatus() {\n int res = model.getWinner();\n if (res == Model.DRAW) {\n draw();\n return false;\n } else if (res == Model.WHITE) {\n whiteScore++;\n view.getPrompt().setText(whiteName + \" win!\");\n prepareRestart();\n return false;\n } else if (res == Model.BLACK) {\n blackScore++;\n view.getPrompt().setText(blackName + \" win!\");\n prepareRestart();\n return false;\n }\n return true;\n }",
"private void evaluateWin(boolean finalCheck)\r\n\t{\r\n\t\t// Stores player and dealer scores in local variables, rather than repeatedly call the get methods\r\n\t\tint scoreP = player1.getTotal();\r\n\t\tint scoreD = dealer.getTotal();\r\n\t\t\r\n\t\t// first check: is the game still going? If it has ended, then no evaluation needs to be made\r\n\t\tif ( !endGame )\r\n\t\t{\r\n\t\t\t/* second check: is this the final evaluation? if not, the first block of statements executes.\r\n\t\t\tIf Player == 21 and Dealer == 21, Tie\r\n\t\t\tIf Player == 21 and Dealer != 21, Player wins\r\n\t\t\tIf Player != 21 and Dealer == 21, Dealer wins\r\n\t\t\tIf Player > 21, Dealer wins at any number\r\n\t\t\tIf Player > Dealer at the end of the game and no one has busted or hit 21, Player wins\r\n\t\t\tThe last check is performed only if finalCheck is true.\r\n\t\t\t*/\r\n\t\t\tif ( !finalCheck )\r\n\t\t\t{\r\n\t\t\t\tif (scoreP > BUST_SCORE)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"You lose...\");\r\n\t\t\t\t\tendGame = true;\r\n\t\t\t\t}\r\n\t\t\t\telse if (scoreP == BUST_SCORE)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (scoreD == BUST_SCORE)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.println(\"It's a tie.\");\r\n\t\t\t\t\t\tendGame = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.println(\"You win!\");\r\n\t\t\t\t\t\tendGame = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t} // end scoreP > BUST_SCORE\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tif (scoreD == BUST_SCORE)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.println(\"You lose...\");\r\n\t\t\t\t\t\tendGame = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (scoreD > BUST_SCORE)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.println(\"You win!\");\r\n\t\t\t\t\t\tendGame = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t} // end ScoreP <= BUST SCORE\r\n\t\t\t} // end finalCheck = false\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// Final victory condition check\r\n\t\t\t\tif ( dealer.getTotal() < player1.getTotal() )\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"You win!\");\r\n\t\t\t\t}\r\n\t\t\t\telse if ( dealer.getTotal() == player1.getTotal() )\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"It's a tie.\");\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"You lose...1\");\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t} // end finalCheck = true\r\n\t\t\r\n\t\t} // end endGame = false if\r\n\t\r\n\t}",
"private void checkWinner() {\n\t\tif(player.getHandVal() == BLACKJACK && dealer.getHandVal() == BLACKJACK) {\n\t\t\tSystem.out.println(\"Both players have Blackjack!\\n\");\n\t\t\tresult = \"TIE\";\n\t\t}\n\t\telse if (player.getHandVal() == BLACKJACK) {\n\t\t\tSystem.out.println(\"The Player has Blackjack!\\n\");\n\t\t\tresult = \"PLAYER\";\n\t\t}\n\t\telse if (dealer.getHandVal() == BLACKJACK) {\n\t\t\tSystem.out.println(\"The Dealer has Blackjack!\\n\");\n\t\t\tresult = \"DEALER\";\n\t\t}\n\t\telse if(player.getHandVal() > BLACKJACK && dealer.getHandVal() > BLACKJACK) {\n\t\t\tSystem.out.println(\"Both players bust!\\n\");\n\t\t\tresult = \"DEALER\";\n\t\t}\n\t\telse if(player.getHandVal() > BLACKJACK) {\n\t\t\tSystem.out.println(\"The Player has busted!\\n\");\n\t\t\tresult = \"DEALER\";\n\t\t}\n\t\telse if(dealer.getHandVal() > BLACKJACK) {\n\t\t\tSystem.out.println(\"The Dealer has busted!\\n\");\n\t\t\tresult = \"PLAYER\";\n\t\t}\n\t\telse if(player.getHandVal() > dealer.getHandVal()) {\n\t\t\tSystem.out.println(\"The Player has a higher score!\\n\");\n\t\t\tresult = \"PLAYER\";\n\t\t}\n\t\telse if(player.getHandVal() < dealer.getHandVal()){\n\t\t\tSystem.out.println(\"The dealer has a higher score!\\n\");\n\t\t\tresult = \"DEALER\";\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"Both players have the same score!\\n\");\n\t\t\tresult = \"TIE\";\n\t\t}\n\t}",
"public static void decidedWinner(){\n if(playerOneWon == true ){\n//\n// win.Fill(\"Player One Has Won !\");\n// new WinnerWindow().setVisible(true);\n }\n else if (playerTwoWon == true){\n// win.Fill(\"Player Two Has Won !\");\n// new WinnerWindow().setVisible(true);\n }\n else\n {\n// win.Fill(\"Match Has been Tied !\");\n// new WinnerWindow().setVisible(true);\n }\n }",
"public static int gameOver(Node nd){\n\t\tint win;\n\t\tfor(int i=0; i<6; i++){\n\t\t\tfor(int j=0; j<7; j++){\n\t\t\t\tif((win = utilVert(nd,i,j)) != 0){\n\t\t\t\t\tif(win == -512)\n\t\t\t\t\t\treturn -512;\n\t\t\t\t\telse if(win == 512)\n\t\t\t\t\t\treturn 512;\n\t\t\t\t}\n\n\t\t\t\tif((win = utilHori(nd,i,j)) != 0){\n\t\t\t\t\tif(win == -512)\n\t\t\t\t\t\treturn -512;\n\t\t\t\t\telse if(win == 512)\n\t\t\t\t\t\treturn 512;\n\t\t\t\t}\n\n\t\t\t\tif((win = utilRDiag(nd,i,j)) != 0){\n\t\t\t\t\tif(win == -512)\n\t\t\t\t\t\treturn -512;\n\t\t\t\t\telse if(win == 512)\n\t\t\t\t\t\treturn 512;\n\t\t\t\t}\n\n\t\t\t\tif((win = utilLDiag(nd,i,j)) != 0){\n\t\t\t\t\tif(win == -512)\n\t\t\t\t\t\treturn -512;\n\t\t\t\t\telse if(win == 512)\n\t\t\t\t\t\treturn 512;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(fullBoard(nd))\n\t\t\treturn 1;\n\n\t\treturn 0;\n\t}",
"public static void checkMateScenario(String loser){\n\t\tif(loser.equals(\"noCheckMate\")){\n\t\t\treturn;\n\t\t}\n\t\tJOptionPane.showMessageDialog(userInterface.frame, loser);\n\t\t\n\t\tuserInterface.check.setText(\"\");\n\t\tuserInterface.turn.setText(\"Player turn: white\");\n\t\tturn = \"white\";\n\t\tnewGame();\n\t}",
"public void caughtCheating(){\n\t\tinGoodStanding = false;\n\t}",
"private Boolean win(int counter) {\n \n winner = false;\n //if the counter is greater than 8, recognizes that it is a draw\n if (counter >= 8) {\n announce.setText(\"Draw\");\n turn.setText(\"\"); //game ends and is no ones turn\n }\n //list of all of the winning options\n if ((tBoard[0] == tBoard[1] && tBoard[1] == tBoard[2] && tBoard[0] != 2)\n || (tBoard[0] == tBoard[3] && tBoard[3] == tBoard[6] && tBoard[0] != 2)\n || (tBoard[3] == tBoard[4] && tBoard[4] == tBoard[5] && tBoard[3] != 2)\n || (tBoard[6] == tBoard[7] && tBoard[7] == tBoard[8] && tBoard[6] != 2)\n || (tBoard[1] == tBoard[4] && tBoard[4] == tBoard[7] && tBoard[1] != 2)\n || (tBoard[2] == tBoard[5] && tBoard[5] == tBoard[8] && tBoard[2] != 2)\n || (tBoard[0] == tBoard[4] && tBoard[4] == tBoard[8] && tBoard[0] != 2)\n || (tBoard[2] == tBoard[4] && tBoard[4] == tBoard[6] && tBoard[2] != 2)) {\n //if counter is even then recognizes that it is the person who has the X symbol and knows that X won \n if (counter % 2 == 0) {\n announce.setText(\"X is the Winner\"); //announces that X has won\n turn.setText(\"\"); //no ones turn anymore\n } //if it is not X, O has won the game and recognizes\n else {\n announce.setText(\"O is the Winner\"); //announces that O has won\n turn.setText(\"\"); //no ones turn anymore\n\n }\n //winner is set to true and stops allowing user to press other squares through pressed method\n winner = true;\n\n }\n //returns winner\n return winner;\n\n }",
"void setDayOrNight(int day) {\n setStat(day, dayOrNight);\n }",
"public void checkBestScoreAndChangeIt() {\n \tbestTime = readPreference(difficulty);\n \t\n \tif (currentTime < bestTime) {\n \t\tbestTime = currentTime;\n \t\tsavePreference(bestTime, difficulty);\n \t}\n }",
"public boolean checkStonesAround(int i, int j) {\n if (i != 0) {\n if ((board[i][j] == 1 && board[i - 1][j] == 0)\n || (board[i][j] == 0 && board[i - 1][j] == 1)) { // different color -> check LiveDeath of the different color\n if (!checkLiveDeath(i - 1, j)) clearStones(i - 1, j);\n }\n }\n // check for right stone\n if (j != 8) {\n if ((board[i][j] == 1 && board[i][j + 1] == 0)\n || (board[i][j] == 0 && board[i][j + 1] == 1)) { // different color -> check LiveDeath of the different color\n if (!checkLiveDeath(i, j + 1)) clearStones(i, j + 1);\n }\n }\n // check for left stone\n if (j != 0) {\n if ((board[i][j] == 1 && board[i][j - 1] == 0)\n || (board[i][j] == 0 && board[i][j - 1] == 1)) { // different color -> check LiveDeath of the different color\n if (!checkLiveDeath(i, j - 1)) clearStones(i, j - 1);\n }\n }\n // check for bottom stone\n if (i != 8) {\n if ((board[i][j] == 1 && board[i + 1][j] == 0)\n || (board[i][j] == 0 && board[i + 1][j] == 1)) { // different color -> check LiveDeath of the different color\n if (!checkLiveDeath(i + 1, j)) clearStones(i + 1, j);\n }\n }\n if (!checkLiveDeath(i, j)) { // check LiveDeath of the recent stone\n turn--;\n return false;\n }\n return true;\n }",
"private void updateGame(int roundWinner) {\n\n\t\t// War cards get face down\n\t\tif (game.getWarring() == 2) {\n\t\t\tcpuStack.setIcon(new ImageIcon(Card.CARD_DOWN));\n\t\t\tplayerStack.setIcon(new ImageIcon(Card.CARD_DOWN));\n\t\t\tgame.clearWar();\n\t\t} else if (game.getWarring() == 1)\n\t\t\tgame.nextDown(); // next one is down, current battle triggered a war\n\t\telse {\n\n\t\t\tcpuStack.setIcon(new ImageIcon(game.getCardImage(War.CPU)));\n\t\t\tplayerStack.setIcon(new ImageIcon(game.getCardImage(War.PLAYER)));\n\t\t}\n\t\tif (roundWinner == War.TIE_FLAG) {\n\t\t\tstatus.setText(\"Tie Game!\");\n\t\t\tplayerDeck.setEnabled(false);\n\t\t} else if (roundWinner == War.WAR_FLAG)\n\t\t\tstatus.setText(\"War!\");\n\t\telse if (game.gameWinner() != null) {\n\t\t\tif (game.cpuScore() > game.playerScore())\n\t\t\t\tstatus.setText(\"CPU Wins!\");\n\t\t\telse\n\t\t\t\tstatus.setText(\"You Win!\");\n\t\t\tplayerDeck.setEnabled(false);\n\t\t} else {\n\t\t\tif (roundWinner == War.CPU)\n\t\t\t\tstatus.setText(\"CPU \" + \"wins the round!\");\n\t\t\telse\n\t\t\t\tstatus.setText(\"Player \" + \"wins the round!\");\n\n\t\t}\n\t\tcpuScore.setText(game.getCPUScore());\n\t\tplayerScore.setText(game.getPlayerScore());\n\t\tupdateDecks();\n\t}",
"public void checkWinner(){\n \n if ((board[0][0] == 'X' && board[0][1] == 'X' && board[0][2] == 'X')||(board[1][0] == 'X' && board[1][1] == 'X' && board[1][2] == 'X')||(board[2][0] == 'X' && board[2][1] == 'X' && board[2][2] == 'X')){\n winner();\n }\n else if ((board[0][0] == 'X' && board[1][0] == 'X' && board[2][0] == 'X')||(board[0][1] == 'X' && board[1][1] == 'X' && board[2][1] == 'X')||(board[0][2] == 'X' && board[1][2] == 'X' && board[2][2] == 'X')){\n winner();\n }\n else if ((board[0][0] == 'X' && board[1][1] == 'X' && board[2][2] == 'X')||(board[0][2] == 'X' && board[1][1] == 'X' && board[2][0] == 'X')){\n winner();\n }\n else if ((board[0][0] == 'O' && board[0][1] == 'O' && board[0][2] == 'O')||(board[1][0] == 'O' && board[1][1] == 'O' && board[1][2] == 'O')||(board[2][0] == 'O' && board[2][1] == 'O' && board[2][2] == 'O')){\n winner();\n }\n else if ((board[0][0] == 'O' && board[1][0] == 'O' && board[2][0] == 'O')||(board[0][1] == 'O' && board[1][1] == 'O' && board[2][1] == 'O')||(board[0][2] == 'O' && board[1][2] == 'O' && board[2][2] == 'O')){\n winner();\n }\n else if ((board[0][0] == 'O' && board[1][1] == 'O' && board[2][2] == 'O')||(board[0][2] == 'O' && board[1][1] == 'O' && board[2][0] == 'O')){\n winner();\n }\n \n }",
"private void computeWinLose() {\n\n if (!id11.getText().isEmpty()) {\n if ((id11.getText().equals(id00.getText()) && id11.getText().equals(id22.getText())) ||\n (id11.getText().equals(id02.getText()) && id11.getText().equals(id20.getText())) ||\n (id11.getText().equals(id10.getText()) && id11.getText().equals(id12.getText())) ||\n (id11.getText().equals(id01.getText()) && id11.getText().equals(id21.getText()))) {\n winner = id11.getText();\n }\n }\n\n if (!id00.getText().isEmpty()) {\n if ((id00.getText().equals(id01.getText()) && id00.getText().equals(id02.getText())) ||\n id00.getText().equals(id10.getText()) && id00.getText().equals(id20.getText())) {\n winner = id00.getText();\n }\n }\n\n if (!id22.getText().isEmpty()) {\n if ((id22.getText().equals(id21.getText()) && id22.getText().equals(id20.getText())) ||\n id22.getText().equals(id12.getText()) && id22.getText().equals(id02.getText())) {\n winner = id22.getText();\n }\n }\n\n // If all the grid entries are filled, it is a draw\n if (!id00.getText().isEmpty() && !id01.getText().isEmpty() && !id02.getText().isEmpty() && !id10.getText().isEmpty() && !id11.getText().isEmpty() && !id12.getText().isEmpty() && !id20.getText().isEmpty() && !id21.getText().isEmpty() && !id22.getText().isEmpty()) {\n winner = \"Draw\";\n }\n\n if (winner != null) {\n if (\"X\".equals(winner)) {\n winner = playerX;\n } else if (\"O\".equals(winner)) {\n winner = playerO;\n } else {\n winner = \"Draw\";\n }\n showWindow(winner);\n }\n }",
"private boolean isKingThreatened(int col, int row, List<Piece> threats) {/Down/Left/Right: queens, rooks\n // Up\n for (int r = row + 1; r < 8; r++) {\n if (threatenCheck(board[r][col], threats, Who.ROOK)) break;\n }\n // Right\n for (int c = col + 1; c < 8; c++) {\n if (threatenCheck(board[row][c], threats, Who.ROOK)) break;\n }\n // Down\n for (int r = row - 1; r >= 0; r--) {\n if (threatenCheck(board[r][col], threats, Who.ROOK)) break;\n }\n // Left\n for (int c = col - 1; c >= 0; c--) {\n if (threatenCheck(board[row][c], threats, Who.ROOK)) break;\n }\n\n // Sideways: queens, bishops\n // Up-right\n for (int r = row + 1, c = col + 1; r < 8 && c < 8; r++, c++) {\n if (threatenCheck(board[r][c], threats, Who.BISHOP)) break;\n }\n // Right-down\n for (int r = row - 1, c = col + 1; r >= 0 && c < 8; r--, c++) {\n if (threatenCheck(board[r][c], threats, Who.BISHOP)) break;\n }\n // Down-left\n for (int r = row - 1, c = col - 1; r >= 0 && c >= 0; r--, c--) {\n if (threatenCheck(board[r][c], threats, Who.BISHOP)) break;\n }\n // Left-up\n for (int r = row + 1, c = col - 1; r < 8 && c >= 0; r++, c--) {\n if (threatenCheck(board[r][c], threats, Who.BISHOP)) break;\n }\n\n // Checking for knights\n int r = row, c = col;\n // Up\n if (r < 6) {\n // Right\n if (c < 7)\n threatenCheck1Piece(board[r + 2][c + 1], threats, Who.KNIGHT);\n // Left\n if (c > 0)\n threatenCheck1Piece(board[r + 2][c - 1], threats, Who.KNIGHT);\n }\n // Right\n if (c < 6) {\n // Up\n if (r < 7)\n threatenCheck1Piece(board[r + 1][c + 2], threats, Who.KNIGHT);\n // Down\n if (r > 0)\n threatenCheck1Piece(board[r - 1][c + 2], threats, Who.KNIGHT);\n }\n // Down\n if (r > 1) {\n // Right\n if (c < 7)\n threatenCheck1Piece(board[r - 2][c + 1], threats, Who.KNIGHT);\n // Left\n if (c > 0)\n threatenCheck1Piece(board[r - 2][c - 1], threats, Who.KNIGHT);\n }\n // Left\n if (c > 1) {\n // Up\n if (r < 7)\n threatenCheck1Piece(board[r + 1][c - 2], threats, Who.KNIGHT);\n // Down\n if (r > 0)\n threatenCheck1Piece(board[r - 1][c - 2], threats, Who.KNIGHT);\n }\n\n // Checking for pawns.\n boolean doPawns = true;\n if (whoseTurn == Owner.WHITE) {\n // No threat from pawns.\n if (row == 7) doPawns = false;\n row++;\n } else {\n // No threat from pawns.\n if (row == 0) doPawns = false;\n row--;\n }\n if (doPawns) {\n // Right side\n if (col < 7)\n threatenCheck1Piece(board[row][col + 1], threats, Who.PAWN);\n // Left side\n if (col > 0)\n threatenCheck1Piece(board[row][col - 1], threats, Who.PAWN);\n }\n\n return threats.size() != 0;\n }",
"public void testIsGameLost()\r\n {\r\n board.loadBoardState(\"OOOO\",\r\n \"OOOO\",\r\n \"O*OO\",\r\n \"OOOO\");\r\n assertEquals(true, board.isGameLost());\r\n board.loadBoardState(\"OOOO\",\r\n \"OOOO\",\r\n \"O+OO\",\r\n \"OOOO\");\r\n assertEquals(false, board.isGameLost());\r\n }",
"public void setGameWon(Boolean won){\n\t\tm_gameWon = won;\n\t}",
"@Override\n public boolean isKnight() {\n return true;\n }",
"public int checkForWinner() {\n\n // Check horizontal wins\n for (int i = 0; i <= 6; i += 3)\t{\n if (mBoard[i] == HUMAN_PLAYER &&\n mBoard[i+1] == HUMAN_PLAYER &&\n mBoard[i+2]== HUMAN_PLAYER)\n return 2;\n if (mBoard[i] == COMPUTER_PLAYER &&\n mBoard[i+1]== COMPUTER_PLAYER &&\n mBoard[i+2] == COMPUTER_PLAYER)\n return 3;\n }\n\n // Check vertical wins\n for (int i = 0; i <= 2; i++) {\n if (mBoard[i] == HUMAN_PLAYER &&\n mBoard[i+3] == HUMAN_PLAYER &&\n mBoard[i+6]== HUMAN_PLAYER)\n return 2;\n if (mBoard[i] == COMPUTER_PLAYER &&\n mBoard[i+3] == COMPUTER_PLAYER &&\n mBoard[i+6]== COMPUTER_PLAYER)\n return 3;\n }\n\n // Check for diagonal wins\n if ((mBoard[0] == HUMAN_PLAYER &&\n mBoard[4] == HUMAN_PLAYER &&\n mBoard[8] == HUMAN_PLAYER) ||\n (mBoard[2] == HUMAN_PLAYER &&\n mBoard[4] == HUMAN_PLAYER &&\n mBoard[6] == HUMAN_PLAYER))\n return 2;\n if ((mBoard[0] == COMPUTER_PLAYER &&\n mBoard[4] == COMPUTER_PLAYER &&\n mBoard[8] == COMPUTER_PLAYER) ||\n (mBoard[2] == COMPUTER_PLAYER &&\n mBoard[4] == COMPUTER_PLAYER &&\n mBoard[6] == COMPUTER_PLAYER))\n return 3;\n\n // Check for tie\n for (int i = 0; i < BOARD_SIZE; i++) {\n // If we find a number, then no one has won yet\n if (mBoard[i] != HUMAN_PLAYER && mBoard[i] != COMPUTER_PLAYER)\n return 0;\n }\n\n // If we make it through the previous loop, all places are taken, so it's a tie\n return 1;\n }",
"public final boolean checkForWin() {\r\n boolean result = false;\r\n String player = \"\";\r\n \r\n for (Rail rail : rails) {\r\n if (rail.isWinner()) {\r\n result = true;\r\n for(Tile tile : rail.getTiles()) {\r\n tile.setBackground(Color.GREEN);\r\n player = tile.getText();\r\n }\r\n if (player.equals(\"X\")) {\r\n winningPlayer = \"X\";\r\n this.xWins++;\r\n } else if (player.equals(\"0\")) {\r\n winningPlayer = \"0\";\r\n this.oWins++;\r\n }\r\n break;\r\n }\r\n }\r\n \r\n return result;\r\n }",
"public static void checkWinner() {\n for (int i = 0; i < 3; i++) {\r\n if (winner) {\r\n break;\r\n }\r\n for (int j = 0; j < 3; j++) {\r\n // Check each row\r\n if (output[i][0] == output[i][1] && output[i][0] == output[i][2]) {\r\n if (output[i][0] != ' ') {\r\n System.out.println(output[i][0] + \" wins!\");\r\n System.exit(0);\r\n winner = true;\r\n }\r\n break;\r\n }\r\n // Check each column\r\n else if (output[0][j] == output[1][j] && output[0][j] == output[2][j]) {\r\n if (output[0][j] != ' ') {\r\n System.out.println(output[0][j] + \" wins!\");\r\n System.exit(0);\r\n winner = true;\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n // Check Diagonals\r\n if (output[0][0] == output[1][1] && output[0][0] == output[2][2]) {\r\n if (output[0][0] != ' ') {\r\n System.out.println(output[0][0] + \" wins!\");\r\n System.exit(0);\r\n winner = true;\r\n }\r\n\r\n } else if (output[2][0] == output[1][1] && output[2][0] == output[0][2]) {\r\n if (output[2][0] != ' ') {\r\n System.out.println(output[2][0] + \" wins!\");\r\n System.exit(0);\r\n winner = true;\r\n }\r\n\r\n } else if (winner = false) {\r\n System.out.println(\"Draw\");\r\n System.exit(0);\r\n }\r\n }",
"@Test\n public void isGameOverNoWhite()\n {\n // Setup.\n final CheckersGameInjector injector = new CheckersGameInjector();\n final List<Agent> agents = createAgents(injector);\n final CheckersEnvironment environment = createEnvironment(injector, agents);\n\n for (int y = 0; y < 3; y++)\n {\n for (int x = 0; x < 8; x++)\n {\n if ((x % 2) != (y % 2))\n {\n final CheckersPosition position = CheckersPosition.findByCoordinates(x, y);\n environment.removeToken(position);\n }\n }\n }\n\n assertThat(environment.getTokenCountFor(CheckersTeam.RED), is(12));\n assertThat(environment.getTokenCountFor(CheckersTeam.WHITE), is(0));\n\n final CheckersAdjudicator adjudicator = injector.injectAdjudicator();\n\n // Run / Verify.\n assertTrue(adjudicator.isGameOver(environment));\n }",
"protected boolean checkForWin() {\r\n \t\r\n if (squaresRevealed == this.width * this.height - this.mines) {\r\n finishFlags();\r\n finish(GameStateModel.WON);\r\n return true;\r\n } \t\r\n \t\r\n return false;\r\n \t\r\n }",
"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 void finishGame() {\n boolean didWin = true;\n\n int dimension = mBoardSquaresGrid.length;\n\n for(int i = 0; i < dimension; i++) {\n for(int j = 0; j < dimension; j++) {\n TileView tileView = mTileViewsGrid[i][j];\n BoardSquare boardSquare = mBoardSquaresGrid[i][j];\n\n int state = tileView.getState();\n boolean doesContainMine = boardSquare == null ? false : boardSquare.doesContainMine();\n\n if(state == TileView.COVERED) {\n // User did not place a flag over a mine.\n if(doesContainMine) {\n didWin = false;\n }\n\n // Uncover all tiles without flags.\n tileView.setState(TileView.UNCOVERED);\n }\n else if(state == TileView.FLAGGED_AS_MINE) {\n if(!doesContainMine) {\n // Uncover flags not covering mines.\n tileView.setState(TileView.UNCOVERED);\n }\n }\n }\n }\n publishGameResult(didWin);\n }",
"private boolean checkWinner() {\n\t\tboolean frontDiagWin = !myBoard.isEmpty(0, 0);\n\t\tchar frontDiagToken = myBoard.getCell(0, 0);\n\t\tboolean backDiagWin = !myBoard.isEmpty(0, Board.BOARD_SIZE - 1);\n\t\tchar backDiagToken = myBoard.getCell(0, Board.BOARD_SIZE - 1);\n\t\tfor (int i = 0; i < Board.BOARD_SIZE; i++) {\n\t\t\t// check Diagonals\n\t\t\tfrontDiagWin = myBoard.getCell(i, i) == frontDiagToken ? frontDiagWin\n\t\t\t\t\t: false;\n\t\t\tbackDiagWin = myBoard.getCell(i, (Board.BOARD_SIZE - 1) - i) == backDiagToken ? backDiagWin\n\t\t\t\t\t: false;\n\t\t\t// check Rows and Columns\n\t\t\tboolean rowWin = !myBoard.isEmpty(i, 0);\n\t\t\tchar startRowToken = myBoard.getCell(i, 0);\n\t\t\tboolean colWin = !myBoard.isEmpty(0, i);\n\t\t\tchar startColToken = myBoard.getCell(0, i);\n\t\t\tfor (int j = 0; j < Board.BOARD_SIZE; j++) {\n\t\t\t\trowWin = myBoard.getCell(i, j) == startRowToken ? rowWin\n\t\t\t\t\t\t: false;\n\t\t\t\tcolWin = myBoard.getCell(j, i) == startColToken ? colWin\n\t\t\t\t\t\t: false;\n\t\t\t}\n\t\t\tif (rowWin || colWin) {\n\t\t\t\tSystem.out.println(\"\\\"\"\n\t\t\t\t\t\t+ (rowWin ? startRowToken : startColToken)\n\t\t\t\t\t\t+ \"\\\" wins the game!\");\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tif (frontDiagWin || backDiagWin) {\n\t\t\tSystem.out.println(\"\\\"\"\n\t\t\t\t\t+ (frontDiagWin ? frontDiagToken : backDiagToken)\n\t\t\t\t\t+ \"\\\" wins the game!\");\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public void setGamesWon(int number) {\n\t\tthis.gamesWon = number;\n\t}",
"public static int snail(int column, int day, int night) {\n\n int count = 0;\n int d = 0;\n while (d < column) {\n d += day;\n count++;\n if (d < column) {\n d -= night;\n }\n }\n\n return count;\n }",
"private boolean checkForBigGameWin(){\n boolean truth = false;\n if (checkGameWin(getLettersOfAllGames())){\n truth = true;\n }\n return truth;\n }",
"public void checkEndGame() {\n\t\tint total = 0;\n\t\tint total2 = 0;\n\t\tfor (int i = 0; i < 6; i++) {\n\t\t\ttotal += board[i];\n\t\t}\n\t\tfor (int i = 7; i < 13; i++) {\n\t\t\ttotal2 += board[i];\n\t\t}\n\n\t\tif (total == 0 || total2 == 0) {\n\t\t\tgameOver = true;\n\t\t}\n\t}",
"private void checkTurn(int ticks){\n\t\tif (ticks>40){\n\t\t\t//System.out.println(\"Sorry, you have over-spun. The lock has been reset. Please try again.\");\n\t\t\tthis.reset();\n\t\t}\n\t}",
"public void gameOfLife(int[][] board) {\n int m = board.length;\n int n = ( m > 0 ? board[0].length : 0);\n int[] dx = {-1, -1, -1, 0, 1, 1, 1, 0};\n int[] dy = {-1, 0, 1, 1, 1, 0, -1, -1};\n for (int i = 0; i < m; i++) {\n for (int j = 0; j < n; j++) {\n int cnt = 0;\n /**\n * Count the neighbors with live status.\n */\n for (int k = 0; k < 8; k++) {\n int x = i + dx[k];\n int y = j + dy[k];\n /**\n * Notice using board[x][y] here, not board[i][j]\n * The next state is created by applying the above rules simultaneously to every cell in the current state,\n * so we concern state==1 and state==2(both states indicate live)\n */\n if (x >= 0 && x < m && y >= 0 && y < n && (board[x][y] == 1 || board[x][y] == 2)) {\n cnt++;\n }\n }\n if (board[i][j] == 1 && (cnt < 2 || cnt > 3)) {\n /**\n * From live to dead.\n */\n board[i][j] = 2;\n }\n if (board[i][j] == 0 && cnt == 3) {\n /**\n * From dead to live\n */\n board[i][j] = 3;\n }\n }\n }\n /**\n * Restore state back to 0 and 1.\n */\n for (int i = 0; i < m; i++) {\n for (int j = 0; j < n; j++) {\n board[i][j] %= 2;\n }\n }\n }",
"public void updatePossibleMovesKnights(){}",
"public abstract boolean isRolling(int turnTotal, int opponentScore);",
"private boolean checkWinner(){\n String [][] field = new String[3][3];\n for(int i = 0; i<3; i++){\n for(int j = 0; j<3; j++){\n field[i][j] = buttons[i][j].getText().toString();\n }\n }\n\n //check the vertical is win\n for(int i = 0; i<3; i++){\n if (field[i][0].equals(field[i][1])\n && field[i][0].equals(field[i][2])\n && !field[i][0].equals(\"\")){\n buttons[i][0].setTextColor(Color.parseColor(\"#FFD145\"));\n buttons[i][1].setTextColor(Color.parseColor(\"#FFD145\"));\n buttons[i][2].setTextColor(Color.parseColor(\"#FFD145\"));\n return true;\n }\n }\n\n //check the horizontal is win\n for(int i = 0; i<3; i++){\n if (field[0][i].equals(field[1][i])\n && field[0][i].equals(field[2][i])\n && !field[0][i].equals(\"\")){\n buttons[0][i].setTextColor(Color.parseColor(\"#FFD145\"));\n buttons[1][i].setTextColor(Color.parseColor(\"#FFD145\"));\n buttons[2][i].setTextColor(Color.parseColor(\"#FFD145\"));\n return true;\n }\n }\n\n //check the slash case 1(\"\\\") is win\n for(int i = 0; i<3; i++){\n if (field[0][0].equals(field[1][1])\n && field[0][0].equals(field[2][2])\n && !field[0][0].equals(\"\")){\n buttons[0][0].setTextColor(Color.parseColor(\"#FFD145\"));\n buttons[1][1].setTextColor(Color.parseColor(\"#FFD145\"));\n buttons[2][2].setTextColor(Color.parseColor(\"#FFD145\"));\n return true;\n }\n }\n\n //check the slash case 2(\"/\") is win\n for(int i = 0; i<3; i++){\n if (field[0][2].equals(field[1][1])\n && field[0][2].equals(field[2][0])\n && !field[0][2].equals(\"\")){\n buttons[0][2].setTextColor(Color.parseColor(\"#FFD145\"));\n buttons[1][1].setTextColor(Color.parseColor(\"#FFD145\"));\n buttons[2][0].setTextColor(Color.parseColor(\"#FFD145\"));\n return true;\n }\n }\n return false;\n }",
"@RequestMapping(value=\"/players/killLastNight\", method=RequestMethod.POST)\n\t\t@ResponseBody\n\t\tpublic void switchKillLastNight(String id) {\n\t\t\tSystem.out.println(\"in place vote \");\n\t\t\tPlayer thePlayer = playerService.getPlayerById(id);\n\t\t\tthePlayer.switchKilledLastNight();\n\t\t\tplayerService.switchKilledLastNight(thePlayer);\n\t\t}",
"public boolean CheckVictory()\n {\n\n for (int i = 0; i < 6; i++) {\n if(isFiveAligned(\n getCell(i, 0),\n getCell(i, 1),\n getCell(i, 2),\n getCell(i, 3),\n getCell(i, 4),\n getCell(i, 5) )){\n Winner=getCell(i, 2);\n return true;\n }\n }\n\n for (int i = 0; i < 6; i++) {\n if(isFiveAligned(\n getCell(0,i),\n getCell(1,i),\n getCell(2,i),\n getCell(3,i),\n getCell(4,i),\n getCell(5,i) )){\n Winner=getCell(2, i);\n return true;\n }\n }\n CellType[] arrTypes={getCell(0, 0),getCell(1, 1),getCell(2, 2),getCell(3, 3),\n getCell(4, 4),getCell(5, 5)};\n\n \n if(isFiveAligned(arrTypes))\n {\n Winner=arrTypes[2];\n return true;\n }\n\n CellType[] REVERSE_arrTypes={getCell(0, 5),getCell(1, 4),getCell(2, 3),getCell(3, 2),\n getCell(4, 1),getCell(5, 0)};\n\n \n\n if(isFiveAligned(REVERSE_arrTypes))\n {\n Winner=REVERSE_arrTypes[2]; \n return true;\n }\n\n\n if(isFiveAligned(new CellType[]{getCell(0, 1),\n getCell(1, 2),\n getCell(2, 3),\n getCell(3, 4),\n getCell(4, 5),\n CellType.None\n })) {\n Winner=getCell(3, 4);\n return true;\n }\n \n if(isFiveAligned(new CellType[]{getCell(1, 0),\n getCell(2, 1),\n getCell(3, 2),\n getCell(4, 3),\n getCell(5, 4),\n CellType.None\n })) {\n Winner=getCell(4, 3);\n return true;\n }\n\n if(isFiveAligned(new CellType[]{\n getCell(4, 0),\n getCell(3, 1),\n getCell(2, 2),\n getCell(1, 3),\n getCell(0, 4),\n CellType.None\n \n })){\n Winner=getCell(2, 2);\n return true;}\n\n if(isFiveAligned(new CellType[]{\n getCell(5, 1),\n getCell(4, 2),\n getCell(3, 3),\n getCell(2, 4),\n getCell(1, 5),\n CellType.None\n \n })){\n Winner=getCell(3, 3);\n return true;}\n\n \n \n\n\n \n\n return false;\n }",
"public boolean[] isFightWinning() {\n RobotInfo[] nearbyEnemies = Cache.getEngagementEnemies();\n if (nearbyEnemies.length == 0) {\n return new boolean[] {true};\n }\n \n RobotInfo closestEngageable = null;\n double closestDist = Double.MAX_VALUE;\n double tempDist = 0;\n for (RobotInfo bot : nearbyEnemies) {\n switch (bot.type) {\n case HQ:\n case TOWER:\n // TODO figure out how to deal with towers that turn up...\n return new boolean[] {false, false};\n case BEAVER:\n case DRONE:\n case SOLDIER:\n case TANK:\n case COMMANDER:\n case MINER:\n case BASHER:\n case MISSILE:\n tempDist = curLoc.distanceSquaredTo(bot.location);\n if (tempDist < closestDist) {\n closestDist = tempDist;\n closestEngageable = bot;\n }\n break;\n default:\n break;\n }\n }\n \n if (closestEngageable == null) {\n return new boolean[] {true};\n }\n \n RobotInfo[] allies = rc.senseNearbyRobots(closestEngageable.location, ALLY_INLCUDE_RADIUS_SQ, myTeam);\n double allyScore = Util.getDangerScore(allies);\n double enemyScore = Util.getDangerScore(rc.senseNearbyRobots(closestEngageable.location, ENEMY_INCLUDE_RADIUS_SQ, theirTeam));\n // rc.setIndicatorString(2, \"Ally score: \" + allyScore + \", Enemy score: \" + enemyScore);\n if (allyScore > enemyScore) {\n return new boolean[] {true};\n } else {\n // Check if we are definitely going to die.\n double myHealth = rc.getHealth();\n int myID = rc.getID();\n boolean isAlone = true;\n for (int i = allies.length; i-- > 0;) {\n if (allies[i].ID != myID) {\n isAlone = false;\n if(allies[i].health < myHealth) {\n return new boolean[] {false, false};\n }\n }\n }\n // We didn't find any bots with lower health, so we are the lowest.\n // If we are alone, we should retreat anyways...\n return new boolean[] {false, !isAlone};\n }\n }",
"boolean checkWin(Tile initialTile);",
"public void fight(Knight otherKnight){\n System.out.println(\"Starting the great fight: \" + this.name + \" VS \" + otherKnight.name);\n if (this.sumEquipmentWeight() + this.weight < otherKnight.sumEquipmentWeight() + otherKnight.weight)\n System.out.println(\"Winner is \" + otherKnight.name);\n else if (this.sumEquipmentWeight() + this.weight > otherKnight.sumEquipmentWeight() + otherKnight.weight)\n System.out.println(\"Winner is \" + this.name);\n else if (this.sumEquipmentPrice() < otherKnight.sumEquipmentPrice())\n System.out.println(\"Winner is \" + otherKnight.name);\n else if (this.sumEquipmentPrice() > otherKnight.sumEquipmentPrice())\n System.out.println(\"Winner is \" + this.name);\n else System.out.println(\"We have no winner.\");\n }",
"public boolean hasWinner() {\n\t\tint[][] board = myGameBoard.getBoard();\n\t\t\n\t\t// check for vertical win\n\t\tfor(int i = 0; i < board[0].length; i++) {\n\t\t\tfor(int j = 0; j < board.length - 3; j++) {\n\t\t\t\tint thisSlot = board[j][i];\n\t\t\t\tif(thisSlot == GameBoard.EMPTY) continue;\n\t\t\t\t\n\t\t\t\tif(thisSlot == board[j+1][i]) {\n\t\t\t\t\tif(thisSlot == board[j+2][i]) {\n\t\t\t\t\t\tif(thisSlot == board[j+3][i]) {\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}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// check for horizontal win\n\t\tfor(int i = 0; i < board[0].length - 3; i++) {\n\t\t\tfor(int j = 0; j < board.length; j++) {\n\t\t\t\tint thisSlot = board[j][i];\n\t\t\t\tif(thisSlot == GameBoard.EMPTY) continue;\n\t\t\t\t\n\t\t\t\tif(thisSlot == board[j][i+1]) {\n\t\t\t\t\tif(thisSlot == board[j][i+2]) {\n\t\t\t\t\t\tif(thisSlot == board[j][i+3]) {\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}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// check for diagonal win left to right, upwards\n\t\tfor(int i = 0; i < board[0].length - 3; i++) {\n\t\t\tfor(int j = 3; j < board.length; j++) {\n\t\t\t\tif(board[j][i] != GameBoard.EMPTY) {\n\t\t\t\t\tint thisSlot = board[j][i];\n\t\t\t\t\t\n\t\t\t\t\tif(board[j-1][i+1] == thisSlot) {\n\t\t\t\t\t\tif(board[j-2][i+2] == thisSlot) {\n\t\t\t\t\t\t\tif(board[j-3][i+3] == thisSlot) {\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// check for diagonal win right to left, upwards\n\t\tfor(int i = 3; i < board[0].length; i++) {\n\t\t\tfor(int j = 3; j < board.length; j++) {\n\t\t\t\tif(board[j][i] != GameBoard.EMPTY) {\n\t\t\t\t\tint thisSlot = board[j][i];\n\t\t\t\t\t\n\t\t\t\t\tif(board[j-1][i-1] == thisSlot) {\n\t\t\t\t\t\tif(board[j-2][i-2] == thisSlot) {\n\t\t\t\t\t\t\tif(board[j-3][i-3] == thisSlot) {\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn false;\n\t}",
"private void gameWon() {\n\n stopTime();\n //reveal all mines and mark them\n for (int i = 0; i < minefield.getRows(); i++) {\n for (int j = 0; j < minefield.getCols(); j++) {\n if (minefield.getMinefield()[i][j].isMined()) {\n tileLabel[i][j].setIcon(flagIcon);\n tile[i][j].setBackground(Color.green);\n }\n }\n }\n\n JFrame winframe = new JFrame(\"Winner!\");\n JPanel winpanel = new JPanel();\n JLabel label = new JLabel(\"Well done, you beat the game!\");\n JLabel label2 = new JLabel(\" Time taken: \" + time + \" \");\n JButton close = new JButton(\"Close\");\n JButton restart = new JButton(\"Restart\");\n\n close.addActionListener((ActionEvent e) -> {\n winframe.dispose();\n });\n\n restart.addActionListener((ActionEvent e) -> {\n frame.dispose();\n winframe.dispose();\n createNewGame(minefield.getRows(), minefield.getCols(), minefield.getMaxMines());\n });\n\n winpanel.add(label);\n winpanel.add(label2);\n winpanel.add(close);\n winpanel.add(restart);\n winframe.add(winpanel);\n winframe.setLocationRelativeTo(null);\n winframe.setSize(220, 110);\n winframe.setResizable(false);\n winframe.setVisible(true);\n }",
"private void checkWinner() {\n if (btn_0.getText() == \"X\" && btn_1.getText() == \"X\" && btn_2.getText() == \"X\") {\n Toast.makeText(MainActivity.this, \"Player One Wins!!\", Toast.LENGTH_SHORT).show();\n disablingALLbuttons();\n player_1_score++;\n View color = this.getWindow().getDecorView();\n color.setBackgroundColor(blue);\n\n\n }\n if (btn_0.getText() == \"O\" && btn_1.getText() == \"O\" && btn_2.getText() == \"O\") {\n Toast.makeText(MainActivity.this, \"Player Two Wins!!\", Toast.LENGTH_SHORT).show();\n disablingALLbuttons();\n player_2_score++;\n View color = this.getWindow().getDecorView();\n color.setBackgroundColor(red);\n }\n\n// Second Row Checker Boxes 3 , 4 , 5\n if (btn_3.getText() == \"X\" && btn_4.getText() == \"X\" && btn_5.getText() == \"X\") {\n Toast.makeText(MainActivity.this, \"Player One Wins!!\", Toast.LENGTH_SHORT).show();\n disablingALLbuttons();\n player_1_score++;\n View color = this.getWindow().getDecorView();\n color.setBackgroundColor(blue);\n\n }\n if (btn_3.getText() == \"O\" && btn_4.getText() == \"O\" && btn_5.getText() == \"O\") {\n Toast.makeText(MainActivity.this, \"Player Two Wins!!\", Toast.LENGTH_SHORT).show();\n disablingALLbuttons();\n player_2_score++;\n View color = this.getWindow().getDecorView();\n color.setBackgroundColor(red);\n }\n\n// Third Row Checker Boxes 6, 7, 8\n if (btn_6.getText() == \"X\" && btn_7.getText() == \"X\" && btn_8.getText() == \"X\") {\n Toast.makeText(MainActivity.this, \"Player One Wins!!\", Toast.LENGTH_SHORT).show();\n disablingALLbuttons();\n player_1_score++;\n View color = this.getWindow().getDecorView();\n color.setBackgroundColor(blue);\n\n }\n if (btn_6.getText() == \"O\" && btn_7.getText() == \"O\" && btn_8.getText() == \"O\") {\n Toast.makeText(MainActivity.this, \"Player Two Wins!!\", Toast.LENGTH_SHORT).show();\n disablingALLbuttons();\n player_2_score++;\n View color = this.getWindow().getDecorView();\n color.setBackgroundColor(red);\n }\n\n// 1st Column Checker Boxes 0, 3, 6\n if (btn_0.getText() == \"X\" && btn_3.getText() == \"X\" && btn_6.getText() == \"X\") {\n Toast.makeText(MainActivity.this, \"Player One Wins!!\", Toast.LENGTH_SHORT).show();\n disablingALLbuttons();\n player_1_score++;\n View color = this.getWindow().getDecorView();\n color.setBackgroundColor(blue);\n }\n if (btn_0.getText() == \"O\" && btn_3.getText() == \"O\" && btn_6.getText() == \"O\") {\n Toast.makeText(MainActivity.this, \"Player Two Wins!!\", Toast.LENGTH_SHORT).show();\n disablingALLbuttons();\n player_2_score++;\n View color = this.getWindow().getDecorView();\n color.setBackgroundColor(red);\n }\n\n// Second Column Checker 1, 4, 7\n if (btn_1.getText() == \"X\" && btn_4.getText() == \"X\" && btn_7.getText() == \"X\") {\n Toast.makeText(MainActivity.this, \"Player One Wins!!\", Toast.LENGTH_SHORT).show();\n disablingALLbuttons();\n player_1_score++;\n View color = this.getWindow().getDecorView();\n color.setBackgroundColor(blue);\n }\n if (btn_1.getText() == \"O\" && btn_4.getText() == \"O\" && btn_7.getText() == \"O\") {\n Toast.makeText(MainActivity.this, \"Player Two Wins!!\", Toast.LENGTH_SHORT).show();\n disablingALLbuttons();\n player_2_score++;\n View color = this.getWindow().getDecorView();\n color.setBackgroundColor(red);\n }\n\n// Third Row Checker 2 , 5 , 8\n if (btn_2.getText() == \"X\" && btn_5.getText() == \"X\" && btn_8.getText() == \"X\") {\n Toast.makeText(MainActivity.this, \"Player One Wins!!\", Toast.LENGTH_SHORT).show();\n disablingALLbuttons();\n player_1_score++;\n View color = this.getWindow().getDecorView();\n color.setBackgroundColor(blue);\n }\n if (btn_2.getText() == \"O\" && btn_5.getText() == \"O\" && btn_8.getText() == \"O\") {\n Toast.makeText(MainActivity.this, \"Player Two Wins!!\", Toast.LENGTH_SHORT).show();\n disablingALLbuttons();\n player_2_score++;\n View color = this.getWindow().getDecorView();\n color.setBackgroundColor(red);\n }\n// First Diagonal Checker 0 , 4, 8\n if (btn_0.getText() == \"X\" && btn_4.getText() == \"X\" && btn_8.getText() == \"X\") {\n Toast.makeText(MainActivity.this, \"Player One Wins!!\", Toast.LENGTH_SHORT).show();\n disablingALLbuttons();\n player_1_score++;\n View color = this.getWindow().getDecorView();\n color.setBackgroundColor(blue);\n }\n if (btn_0.getText() == \"O\" && btn_4.getText() == \"O\" && btn_8.getText() == \"O\") {\n Toast.makeText(MainActivity.this, \"Player Two Wins!!\", Toast.LENGTH_SHORT).show();\n disablingALLbuttons();\n player_2_score++;\n View color = this.getWindow().getDecorView();\n color.setBackgroundColor(red);\n }\n// Second Diagonal Checker 2, 4, 6\n if (btn_2.getText() == \"X\" && btn_4.getText() == \"X\" && btn_6.getText() == \"X\") {\n Toast.makeText(MainActivity.this, \"Player One Wins!!\", Toast.LENGTH_SHORT).show();\n disablingALLbuttons();\n player_1_score++;\n View color = this.getWindow().getDecorView();\n color.setBackgroundColor(blue);\n }\n if (btn_2.getText() == \"O\" && btn_4.getText() == \"O\" && btn_6.getText() == \"O\") {\n Toast.makeText(MainActivity.this, \"Player Two Wins!!\", Toast.LENGTH_SHORT).show();\n disablingALLbuttons();\n player_2_score++;\n View color = this.getWindow().getDecorView();\n color.setBackgroundColor(red);\n }\n }",
"@Override\n public void onCtFwSNow(final CtFwSGameState gs, final CtFwSGameState.Now now) {\n final long tbcf = System.currentTimeMillis() - SystemClock.elapsedRealtime();\n\n Log.d(\"CtFwS\", \"Display game state; nowMS=\" + now.wallMS + \" r=\" + now.round + \" rs=\" + now.roundStart + \" re=\" + now.roundEnd);\n\n if (now.rationale != null) {\n Log.d(\"CtFwS\", \"Rationale: \" + now.rationale + \" stop=\" + now.stop);\n // TODO: display rationale somewhere, probably by hiding the game state!\n doReset();\n return;\n }\n // Otherwise, it's game on!\n\n // Upper line text\n {\n final TextView tv_jb = (TextView) (mAct.findViewById(R.id.tv_jailbreak));\n tv_jb.post(new Runnable() {\n @Override\n public void run() {\n if (now.round == 0) {\n tv_jb.setText(R.string.ctfws_gamestart);\n } else if (now.round == gs.getRounds()) {\n tv_jb.setText(R.string.ctfws_gameend);\n } else {\n tv_jb.setText(\n String.format(mAct.getResources().getString(R.string.ctfws_jailbreak),\n now.round, gs.getRounds() - 1));\n }\n }\n });\n }\n\n // Upper progress bar and chronometer\n {\n final ProgressBar pb_jb = (ProgressBar) (mAct.findViewById(R.id.pb_jailbreak));\n pb_jb.post(new Runnable() {\n @Override\n public void run() {\n pb_jb.setIndeterminate(false);\n pb_jb.setMax((int) (now.roundEnd - now.roundStart));\n pb_jb.setProgress(0);\n }\n });\n\n final Chronometer ch_jb = (Chronometer) (mAct.findViewById(R.id.ch_jailbreak));\n ch_jb.post(new Runnable() {\n @Override\n public void run() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {\n ch_jb.setBase((now.roundEnd + 1) * 1000 - tbcf);\n ch_jb.setCountDown(true);\n } else {\n ch_jb.setBase(now.roundStart * 1000 - tbcf);\n ch_jb.setBackgroundColor(Color.BLACK);\n ch_jb.setTextColor(Color.WHITE);\n }\n ch_jb.setOnChronometerTickListener(new Chronometer.OnChronometerTickListener() {\n @Override\n public void onChronometerTick(Chronometer c) {\n pb_jb.setProgress((int) (now.roundEnd - System.currentTimeMillis() / 1000));\n }\n });\n ch_jb.start();\n }\n });\n }\n\n // Lower progress bar and chronometer\n if (now.round > 0) {\n final ProgressBar pb_gp = (ProgressBar) (mAct.findViewById(R.id.pb_gameProgress));\n pb_gp.post(new Runnable() {\n @Override\n public void run() {\n pb_gp.setIndeterminate(false);\n pb_gp.setMax(gs.getComputedGameDuration());\n pb_gp.setProgress(0);\n }\n });\n\n final Chronometer ch_gp = (Chronometer) (mAct.findViewById(R.id.ch_gameProgress));\n ch_gp.post(new Runnable() {\n @Override\n public void run() {\n ch_gp.setBase(gs.getFirstRoundStartT() * 1000 - tbcf);\n ch_gp.setOnChronometerTickListener(new Chronometer.OnChronometerTickListener() {\n @Override\n public void onChronometerTick(Chronometer c) {\n pb_gp.setProgress((int) (System.currentTimeMillis() / 1000\n - gs.getFirstRoundStartT()));\n }\n });\n ch_gp.setVisibility(View.VISIBLE);\n ch_gp.start();\n }\n });\n } else {\n final ProgressBar pb_gp = (ProgressBar) (mAct.findViewById(R.id.pb_gameProgress));\n pb_gp.post(new Runnable() {\n @Override\n public void run() {\n pb_gp.setIndeterminate(true);\n }\n });\n\n final Chronometer ch_gp = (Chronometer) (mAct.findViewById(R.id.ch_gameProgress));\n ch_gp.post(new Runnable() {\n @Override\n public void run() {\n ch_gp.setOnChronometerTickListener(null);\n ch_gp.stop();\n ch_gp.setVisibility(INVISIBLE);\n }\n });\n }\n {\n final TextView tv_flags = (TextView) (mAct.findViewById(R.id.tv_flags_label));\n tv_flags.post(new Runnable() {\n @Override\n public void run() {\n tv_flags.setText(mAct.getResources()\n .getQuantityString(R.plurals.ctfws_flags,gs.flagsTotal,gs.flagsTotal));\n }\n });\n }\n }",
"public void gameOverCheck() {\n //users\n if (tankTroubleMap.getUsers().size() != 0) {\n tankTroubleMap.setWinnerGroup(tankTroubleMap.getUsers().get(0).getGroupNumber());\n for (int i = 1; i < tankTroubleMap.getUsers().size(); i++) {\n if (tankTroubleMap.getUsers().get(i).getGroupNumber() != tankTroubleMap.getWinnerGroup())\n return;\n }\n }\n //bots\n int firstBot = 0;\n if (tankTroubleMap.getBots().size() != 0) {\n if (tankTroubleMap.getWinnerGroup() == -1) {\n firstBot = 1;\n tankTroubleMap.setWinnerGroup(tankTroubleMap.getBots().get(0).getGroupNumber());\n }\n for (int i = firstBot; i < tankTroubleMap.getBots().size(); i++) {\n if (tankTroubleMap.getBots().get(i).getGroupNumber() != tankTroubleMap.getWinnerGroup())\n return;\n }\n }\n tankTroubleMap.setGameOver(true);\n }",
"private void checkDay(int origin) {\r\n\tserver.publicMessage(players.get(origin) + \" has voted for it to remain day\");\r\n\r\n\t// if (dayVote.size() > playerIDs.size() / 2) {\r\n\tif (dayVote.size() > players.size() / 2) {\r\n\t day();\r\n\t} else if (dayVote.size() == players.size() / 2 && players.size() % 2 == 0) {\r\n\t day();\r\n\t}\r\n }",
"public static boolean outputScenarioWinner(String scene)\n\t{\n\t\ttry{\n\t\t\tboolean result = false;\n\t\t\tscores = calculateScores(scenarioResults);\n\t\t\tint maxscore = scores[0];\n\t\t\tfor(int i = 1; i < scores.length; i++)\n\t\t\t{\n\t\t\t\tif(scores[i] > maxscore)\n\t\t\t\t\tmaxscore = scores[i];\n\t\t\t}\n\t\t\tscene = scene.substring(0,scene.length()-1);\n\t\t\twriter.write(\"Winner(s) for \" + scene +\": \");\n\t\t\tfor(int j = 0; j < scores.length; j++)\n\t\t\t{\n\t\t\t\tif(scores[j]==maxscore){\n\t\t\t\t\tif(j == checkIndex){\n\t\t\t\t\t\tresult = true;\n\t\t\t\t\t\twinningScenario = scene;\n\t\t\t\t\t}\n\t\t\t\t\twriter.write(entrants[j]+\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\twriter.write(\"with \"+maxscore+\" points. \"+entrants[checkIndex]+\" had \"+scores[checkIndex]+\" points.\\n\");\n\t\t\treturn result;\n\t\t}catch(IOException e) {\n\t\t\tSystem.out.println(\"problem with output\");\n\t\t\treturn false;\n\t\t\t//System.exit(1);\n\t\t}\n\t}",
"int checkGameWon(){\n int sx,sy,ex,ey;\n Point size = new Point();\n //get the size of current window\n Display display = getWindowManager().getDefaultDisplay();\n display.getSize(size);\n int width = size.x;\n int height = size.y;\n\n //win first row\n if (gameBoard[0] != 0 && gameBoard[0] == gameBoard[1] && gameBoard[0] == gameBoard[2]){\n sx = 0;\n sy =(int) (height * .30);\n\n ex = width;\n ey = (int) (height * .30);\n drawLine(sx,sy,ex,ey,imageView10);\n return gameBoard[0];\n }\n //win second row\n else if (gameBoard[3] != 0 && gameBoard[3] == gameBoard[4] && gameBoard[3] == gameBoard[5]){\n sx = 0;\n sy = (int) (height * .54);\n ex = width;\n ey = (int) (height * .54);\n\n drawLine(sx,sy,ex,ey,imageView10);\n return gameBoard[3];\n }\n //win third row\n else if (gameBoard[6] != 0 && gameBoard[6] == gameBoard[7] && gameBoard[6] == gameBoard[8]){\n sx = 0;\n sy = (int) (height * .77);\n\n ex = width;\n ey = (int) (height * .77);\n\n drawLine(sx,sy,ex,ey,imageView10);\n return gameBoard[6];\n }\n //win first colum\n else if (gameBoard[0] != 0 && gameBoard[0] == gameBoard[3] && gameBoard[0] == gameBoard[6]){\n sx = (int) (width *.15);\n sy = (int) (height * .18);\n ex = (int) (width * .15);\n ey=(int) (height * .89);\n\n drawLine(sx,sy,ex,sy,imageView10);\n return gameBoard[0];\n }\n //win second colum\n else if (gameBoard[1] != 0 && gameBoard[1] == gameBoard[4] && gameBoard[1] == gameBoard[7]){\n sx = (int) (width * .50);\n sy = (int) (height * .18);\n\n ex = (int) (width * .50);\n ey = (int) (height * .89);\n\n drawLine(sx,sy,ex,ey,imageView10);\n return gameBoard[1];\n }\n //win third colum\n else if (gameBoard[2] != 0 && gameBoard[2] == gameBoard[5] && gameBoard[2] == gameBoard[8]){\n sx = (int) (width * .85);\n sy = (int) (height * .18);\n\n ex = (int) (width * .85);\n ey = (int) (height * .89);\n\n drawLine(sx,sy,ex,ey,imageView10);\n return gameBoard[2];\n }\n else{\n //game not won\n return 0;\n }\n }",
"public int evaluate(int[][] gameBoard) {\n for (int r = 0; r < 3; r++) {\n if (gameBoard[r][0] == gameBoard[r][1] && gameBoard[r][1] == gameBoard[r][2]) {\n if (gameBoard[r][0] == ai)\n return +10;\n else if (gameBoard[r][0] == human)\n return -10;\n }\n }\n // Checking for Columns for victory.\n for (int c = 0; c < 3; c++) {\n if (gameBoard[0][c] == gameBoard[1][c] && gameBoard[1][c] == gameBoard[2][c]) {\n //gameLogic.getWinType();\n if (gameBoard[0][c] == ai)\n return +10;\n else if (gameBoard[0][c] == human)\n return -10;\n }\n }\n // Checking for Diagonals for victory.\n if (gameBoard[0][0] == gameBoard[1][1] && gameBoard[1][1] == gameBoard[2][2]) {\n if (gameBoard[0][0] == ai)\n return +10;\n else if (gameBoard[0][0] == human)\n return -10;\n }\n if (gameBoard[0][2] == gameBoard[1][1] && gameBoard[1][1] == gameBoard[2][0]) {\n if (gameBoard[0][2] == ai)\n return +10;\n else if (gameBoard[0][2] == human)\n return -10;\n }\n // Else if none of them have won then return 0\n return 0;\n }",
"void onGameEnded(Chess.Color winner);",
"public static boolean isGameFinished() {\n return mafiaIsWinner() || citizenIsWinner();\n }",
"private void finaliseGame() {\r\n gameOn = false;\r\n if(bestAnswer==null) {\r\n target.reply(\"Nobody got an answer. The best answer was: \" + CountdownSolver.Solve( sourceNumbers, targetNumber ));\r\n return;\r\n }\r\n if( bestAnswer.getAnswer() == bestPossibleAnswer ) {\r\n String reply = Constants.BOLD + bestAnswer.getUsername() + Constants.BOLD\r\n + \" has won with \" + bestAnswer.getAnswer() + \"!\";\r\n if( bestPossibleAnswer!=targetNumber)\r\n reply+=\" This was the best possible answer.\";\r\n target.reply(reply);\r\n } else {\r\n target.reply( \"The best answer was \" + bestAnswer.getAnswer() + \" by \" + bestAnswer.getUsername() + \".\"\r\n + \" But the best possible answer was: \" + CountdownSolver.Solve( sourceNumbers, targetNumber ));\r\n }\r\n bestAnswer=null;\r\n runner.stop();\r\n }",
"public int checkWin(Piece piece) {\n\t\t//check winning and losing\n\t\tint color=piece.getColor();\n\t\tif(piece.isRabbit()) {\n\t\t\tif(((Rabbit)piece).isOtherSide()) {\n\t\t\t\treturn color;\n\t\t\t}\n\t\t}\n\t\tif(rabbitcount[color]<=0) {\n\t\t\treturn 3-color;//the opponent wins\n\t\t}\n\t\treturn 0;\n\t}",
"@Test\n public void determineWinnerNoWhiteMove()\n {\n // Setup.\n final CheckersGameInjector injector = new CheckersGameInjector();\n final List<Agent> agents = createAgents(injector);\n final Agent agentRed = agents.get(0);\n final Agent agentWhite = agents.get(1);\n final CheckersEnvironment environment = new CheckersEnvironment();\n\n environment.placeToken(CheckersPosition.P26, King.RED.withAgent(agentRed));\n environment.placeToken(CheckersPosition.P30, Pawn.RED.withAgent(agentRed));\n environment.placeToken(CheckersPosition.P31, Pawn.RED.withAgent(agentRed));\n environment.placeToken(CheckersPosition.P21, Pawn.WHITE.withAgent(agentWhite));\n environment.placeToken(CheckersPosition.P25, Pawn.WHITE.withAgent(agentWhite));\n environment.placeToken(CheckersPosition.P29, King.WHITE.withAgent(agentWhite));\n // System.out.println(environment);\n\n assertThat(environment.getTokenCountFor(CheckersTeam.RED), is(3));\n assertThat(environment.getTokenCountFor(CheckersTeam.WHITE), is(3));\n\n final CheckersAdjudicator adjudicator = injector.injectAdjudicator();\n\n // Run / Verify.\n assertTrue(adjudicator.isGameOver(environment));\n assertThat(adjudicator.determineWinner(environment), is(agentRed));\n }",
"@Test\n\tpublic void testIfKingHasLost()\n\t{\n\t\tData d = new Data(); \n\t\td.set(14, 34); // set a black piece to square 34\n\t\td.set(15, 32); // set a black piece to square 32\n\t\td.set(16, 22); //set a black piece to square 22, i.e. one above the king\n\t\td.set(17, 44); // set a black piece to square 44, i.e. one below the king\n\t\t\n\t\tassertTrue(d.kingLost(33));\n\t}",
"public void checkGame() {\n\n\t}",
"public void clickNightHandler(View v) {\n SharedPreferences.Editor editor = preferences.edit();\n editor.putBoolean(night_key, !this.isNightModeEnabled);\n editor.apply();\n\n this.isNightModeEnabled = !this.isNightModeEnabled;\n\n Intent i = getBaseContext().getPackageManager()\n .getLaunchIntentForPackage( getBaseContext().getPackageName() );\n i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n startActivity(i);\n\n this.recreate();\n }",
"public void checkGame(){\r\n\t\tif (foodCounter == 0){ // all food is gone, win\r\n\t\t\tSystem.out.println(\"You won!\");\r\n\t\t\t//stops ghosts and pacman\r\n\t\t\tpacman.speed = 0;\r\n\t\t\tg1.speed = 0;\r\n\t\t\tg2.speed = 0;\r\n\t\t\tg3.speed = 0;\r\n\t\t\tlost = true; // return to menu \r\n\t\t}\r\n\t\t// if pacman collide with ghost, lose\r\n\t\tif (collision2(pacmansprite,g1.sprite) || collision2(pacmansprite,g2.sprite) || collision2(pacmansprite,g3.sprite)){\r\n\t\t\tSystem.out.println(\"You lost\");\r\n\t\t\tlost = true;\r\n\t\t}\r\n\t}",
"public static void gameOfLife(int[][] board) {\n int[] neighbors = {0, 1, -1};\n\n int rows = board.length;\n int cols = board[0].length;\n\n // Iterate through board cell by cell.\n for (int row = 0; row < rows; row++) {\n for (int col = 0; col < cols; col++) {\n\n // For each cell, count the number of live neighbors.\n int liveNeighbors = 0;\n\n for (int i = 0; i < 3; i++) {\n for (int j = 0; j < 3; j++) {\n\n if (!(neighbors[i] == 0 && neighbors[j] == 0)) {\n int r = (row + neighbors[i]);\n int c = (col + neighbors[j]);\n\n // Check the validity of the neighboring cell.\n // and whether it was originally a live cell.\n if ((r < rows && r >= 0) && (c < cols && c >= 0) && (Math.abs(board[r][c]) == 1)) {\n liveNeighbors += 1;\n }\n }\n }\n }\n\n // Rule 1 or Rule 3\n if ((board[row][col] == 1) && (liveNeighbors < 2 || liveNeighbors > 3)) {\n // -1 signifies the cell is now dead but originally was live.\n board[row][col] = -1;\n }\n // Rule 4\n if (board[row][col] == 0 && liveNeighbors == 3) {\n // 2 signifies the cell is now live but was originally dead.\n board[row][col] = 2;\n }\n }\n }\n\n // Get the final representation for the newly updated board.\n for (int row = 0; row < rows; row++) {\n for (int col = 0; col < cols; col++) {\n if (board[row][col] > 0) {\n board[row][col] = 1;\n } else {\n board[row][col] = 0;\n }\n }\n }\n }"
] | [
"0.66301686",
"0.60020095",
"0.5762093",
"0.552674",
"0.55111057",
"0.54680586",
"0.53649426",
"0.53543234",
"0.5300513",
"0.5248809",
"0.5220297",
"0.5194092",
"0.5154995",
"0.5092643",
"0.50770336",
"0.5066728",
"0.5053439",
"0.50309116",
"0.50173116",
"0.50157595",
"0.5014428",
"0.50103813",
"0.4994147",
"0.49934527",
"0.49913403",
"0.498524",
"0.49836823",
"0.49593323",
"0.49545166",
"0.49529058",
"0.49142495",
"0.49085224",
"0.49048072",
"0.49007833",
"0.4887168",
"0.48746812",
"0.4863186",
"0.48600802",
"0.4859413",
"0.4857416",
"0.4825568",
"0.48192456",
"0.48162252",
"0.480775",
"0.4806544",
"0.48055288",
"0.47926307",
"0.47866255",
"0.47857895",
"0.47805557",
"0.47787458",
"0.47786686",
"0.4776958",
"0.4775685",
"0.4773913",
"0.4771188",
"0.47619438",
"0.47511736",
"0.47406104",
"0.47306082",
"0.47305086",
"0.47302696",
"0.47246632",
"0.47201902",
"0.47056448",
"0.47050261",
"0.4698853",
"0.4692848",
"0.46898332",
"0.46855396",
"0.46850717",
"0.4678647",
"0.46772766",
"0.46672633",
"0.46668",
"0.4665463",
"0.46622896",
"0.46622372",
"0.46466735",
"0.46422058",
"0.46365944",
"0.46363175",
"0.46357176",
"0.46306017",
"0.46273303",
"0.4621392",
"0.46208256",
"0.46158192",
"0.46102247",
"0.46100783",
"0.45956713",
"0.45926395",
"0.45915762",
"0.45894364",
"0.45891345",
"0.45788488",
"0.45787513",
"0.45732975",
"0.45707148",
"0.456985"
] | 0.68852437 | 0 |
could make public to force the game to end | private void gameEnd() {
server.publicMessage("The mafia were: " + mafiaAtStart);
gameInProgress = false;
players.clear();
mafia.clear();
innocentIDs.clear();
server.unMuteAllPlayers();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void endGame() {\n\t\tsuper.endGame();\n\t}",
"@Override\n\tpublic void OnGameEnd() {\n\t\tsuper.OnGameEnd();\n\t}",
"public void finishGame(){\r\n\t\t\t\tgameStarted = false;\r\n\t\t\t}",
"@Override\n public void endGame(){\n gameOver = true;\n }",
"@Override\n\tpublic void gameStopped() {\n\t}",
"boolean endOfGame() {\n return false;\n }",
"@Override\r\n\tpublic void endTurn() {\n\t\t\r\n\t}",
"public void endGame() {\n\r\n\t\tplaying = false;\r\n\t\tstopShip();\r\n\t\tstopUfo();\r\n\t\tstopMissle();\r\n\t}",
"public void endTurn() {\n }",
"boolean endGame() throws Exception;",
"public void gameEnded() {}",
"public synchronized void setEndGame() {\n this.endGame = true;\n }",
"public void endGame(){\n if(character.getHp() > 0 )effectHandler.endGame();\n character.clearBuffs();\n }",
"protected void quitGame() {\n gameOver = true;\n }",
"public void finishGame() {\r\n gameFinished = true;\r\n }",
"boolean end() {\r\n\t\tif (this.gameOver == true)\r\n\t\t\treturn true;\r\n\t\treturn false;\r\n\t}",
"public void endGame()\n\t{\n\t\tbuttonPanel.endGameButton.setEnabled(false);\n\t\tstopThreads();\n\t\tsendScore();\n\t}",
"public void endOfTurn();",
"public void Gamefinished()\n\t\t{\n\t\t\tplayers_in_game--;\n\t\t}",
"protected void end() {\n\t\tshooter.stopShooter();\n\t}",
"public void endGame(){\n updateHighscore();\n reset();\n }",
"public static void end() {\n\t\tif(firstTime)\r\n\t\t\tfirstTime=false;\r\n\t\tif (over) {\r\n\t\t\treset();\r\n\t\t\tover = false;\r\n\t\t}\r\n\t\tGUI.panel.changeGame();\r\n\t}",
"protected void end() {\n \tRobot.shooter.speed(0.0);\n }",
"public static void endGameSequence()\n\t{\n\t\ttfBet.setEnabled(false);\n\t\tbtnPlay.setEnabled(false);\n\t\tbtnHit.setEnabled(false);\n\t\tbtnStay.setEnabled(false);\n\t\tbtnDouble.setEnabled(false);\n\t\tlblUpdate.setText(\"Game over! You are out of money!\");\n\t}",
"void gameFinished();",
"public void endGame() {\r\n\t\tthis.gameStarted = false;\r\n\t\tthis.sendMessages = false;\r\n\t\tthis.centralServer.removeServer(this);\r\n\t}",
"void endLife();",
"public void quitGame() {\n quitGame = true;\n }",
"protected void end() {\n \tshooterWheel.shooterWheelSpeedControllerAft.Pause();\n }",
"protected void end() {\n\t\tRobot.conveyor.Stop();\n\t}",
"void gameResumed();",
"protected void end() {\n Robot.shooter.Stop();\n }",
"public void endGame()\r\n {\r\n mode = 2;\r\n }",
"protected void end() {\n drivebase.setArcade(0, 0);\n drivebase.disableTurnController();\n }",
"protected void end() {\n \tRobot.conveyor.stop();\n }",
"static void playerLost() {\n\n\t\tSystem.exit(0); // This code ends the program\n\t}",
"private void endGame() {\r\n\t\t// Change state (if not already done)\r\n\t\tstate = GameState.STOPPED;\r\n\t\t\r\n\t\t// End simulator\r\n\t\tsimulator.endGame();\r\n\t}",
"public void endGame()\r\n {\r\n for (Cell c : gameBoard.bombList)\r\n {\r\n if (c.isBomb())\r\n {\r\n if (c.getText() == \"X\")\r\n {\r\n c.setId(\"correctFlag\");\r\n }\r\n else\r\n {\r\n c.setId(\"bombClicked\");\r\n }\r\n }\r\n else if (c.getText() == \"X\")\r\n {\r\n c.setId(\"incorrectFlag\");\r\n }\r\n c.setDisable(true);\r\n }\r\n if (gameBoard.emptyRemaining == 0)\r\n {\r\n win();\r\n }\r\n else\r\n {\r\n lose();\r\n }\r\n System.out.println(\"Game Over...\");\r\n scoreBoard.resetBtn.setDisable(false);\r\n }",
"protected abstract boolean isGameFinished();",
"public void onTurnEnd() {\n\n\t}",
"@Callable\n public static void stopGame() {\n Blockchain.require(Blockchain.getCaller().equals(owner));\n Blockchain.require(isGameOnGoing);\n\n requireNoValue();\n\n isGameOnGoing = false;\n BettingEvents.gameStopped();\n }",
"void endGame () {\n gameOver = true;\n System.out.println(\"Game over\");\n timer.cancel();\n }",
"private void gameTimerOnFinish() {\n if (currentScreenGameState == GameState.PLAYING) {\n stopGame();\n }\n }",
"void endUpdate();",
"public void endGame() {\n dispose();\n System.out.println(\"Thank you for playing\");\n System.exit(0);\n }",
"@Override\n protected void end() {\n Robot.shooter.setShooterSpeed(0);\n Robot.elevator.elevatorUp(0);\n Robot.hopper.hopperOut(0);\n Robot.intake.enableIntake(0);\n\n\n }",
"protected void end() {\n \tRobot.hand.setWrist(0.0);\n }",
"public void quitGame() {\n\t\tactive = false;\n\t}",
"private void exitGame() {\n System.exit(0);\n }",
"private void gameOver() {\n\t\t\n\t}",
"public void endGame() {\n\t\twaitingPlayers.addAll(players);\n\t\tplayers.clear();\n\t\tfor(ClientThread player: waitingPlayers) {\n\t\t\tplayer.points = 0;\n\t\t\tplayer.clientCards.clear();\n\t\t}\n\t\twinners = 0;\n\t\tlosers = 0;\n\t\tpassCounter = 0;\n\t\tdeck.init();\n\t\tview.changeInAndWait(players.size(), waitingPlayers.size());\n\t\tview.writeLog(\"-------------GAME END--------------\");\n\t\tstatus = \"waiting\";\n\t\tstatusCheck();\n\t}",
"@Override\n public void stopGame() {\n ((MultiplayerHostController) Main.game).stopGame();\n super.stopGame();\n }",
"public void triggerEndGame()\n\t{\n\t\tif(livesRemaining <= 0)\n\t\t{\n\t\t\tmP[0].stop();\n\t\t\tmP[1].stop();\n\t\t\tmP[2].stop();\n\t\t\tendGame = new Alert(AlertType.CONFIRMATION);\n\t\t\tendGame.setTitle(\"1942\");\n\t\t\tendGame.setHeaderText(null);\n\t\t\tendGame.getButtonTypes().clear();\n\t\t\tendGame.setContentText(\"You're dead! \\nYou finished with \" + p1Score + \" points. \\nWould you like to play again?\");\n\t\t\tendGame.getButtonTypes().addAll(ButtonType.YES, ButtonType.NO);\n\t\t\tendGame.setGraphic(new ImageView(new Image(\"file:images/gameOver.png\")));\n\t\t\tspawnTimerTL.stop();\n\t\t\tmainTimer.stop();\n\t\t\tp1.getNode().setImage(null); //Removes player from screen\n\t\t\tOptional<ButtonType> result = endGame.showAndWait();\n\n\t\t\tif(result.get() == ButtonType.YES)\n\t\t\t{\n\t\t\t\tlivesRemaining = 3;\n\t\t\t\thealthRemaining = 10;\n\t\t\t\tivHealthBar.setImage(imgHealth[healthRemaining]);\n\t\t\t\tivLives.setImage(imgLives[livesRemaining]);\t\n\n\t\t\t\tif (highScore < p1Score)\n\t\t\t\t\thighScore = p1Score;\n\t\t\t\ttry //Writes new high score and throws IO Exception\n\t\t\t\t{\n\t\t\t\tfileWriter = new FileWriter(highScoreSave);\n\t\t\t\tfileWriter.write(String.valueOf(highScore));\n\t\t\t\tfileWriter.close();\n\t\t\t\t}\n\t\t\t\tcatch(IOException e)\n\t\t\t\t{e.printStackTrace();}\n\t\t\t\t\n\t\t\t\tlblHighScore.setText(Integer.toString(highScore));\n\t\t\t\tp1Score = 0;\n\t\t\t\tlblp1score.setText(Integer.toString(p1Score));\n\n\t\t\t\tp1.setDead(false);\n\t\t\t\tmainTimer.start();\n\t\t\t\tspawnTimerTL.play();\n\t\t\t\t\n\t\t\t\tfor(int k = 0; k < enemyPlanes.length; k++)\n\t\t\t\t{\n\t\t\t\t\tenemyPlanes[k].toggleIsDead(true);\n\t\t\t\t\tenemyPlanes[k].setY(2000);\n\t\t\t\t\tenemyPlanes[k].getNode().setLayoutY(enemyPlanes[k].getY());\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (highScore < p1Score)\n\t\t\t\t\thighScore = p1Score;\n\t\t\t\ttry //Writes new high score and throws IO Exception\n\t\t\t\t{\n\t\t\t\tfileWriter = new FileWriter(highScoreSave);\n\t\t\t\tfileWriter.write(String.valueOf(highScore));\n\t\t\t\tfileWriter.close();\n\t\t\t\t}\n\t\t\t\tcatch(IOException e)\n\t\t\t\t{e.printStackTrace();}\n\t\t\t\tthankYou = new Alert(AlertType.INFORMATION);\n\t\t\t\tthankYou.setTitle(\"1942\");\n\t\t\t\tthankYou.setHeaderText(null);\n\t\t\t\tthankYou.setGraphic(new ImageView(new Image(\"file:images/plane.png\")));\n\t\t\t\tthankYou.setContentText(\"Thank you for playing.\\nGoodbye!\");\n\t\t\t\tthankYou.show();\n\t\t\t\tPlatform.exit();\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\n\t\t}\n\t}",
"public void gameOver() \n {\n Greenfoot.stop();\n }",
"@Override\r\n\tpublic void updateGameFinished() {\n\t\t\r\n\t}",
"public void endTurn(){\n game.setNextActivePlayer();\n myTurn = false;\n\n stb.updateData(\"playerManager\", game.getPlayerManager());\n stb.updateData(\"aktivePlayer\", game.getPlayerManager().getAktivePlayer());\n stb.updateData(\"roomList\", game.getRoomManager().getRoomList());\n\n getIntent().putExtra(\"GAME\",game);\n getIntent().putExtra(\"myTurn\", false);\n finish();\n if(!game.getPlayerManager().getPlayerList().get(whoAmI).isDead())\n startActivity(getIntent());\n else\n fcm.unbindListeners();\n }",
"public void endGame()\n\t{\n\t\tthis.opponent = null;\n\t\tthis.haveGame = false;\n\t\tthis.isTurn = false;\n\t\tfor(int i = 0; i < 3; i++)\n\t\t{\n\t\t\tfor(int j = 0; j < 3; j++)\n\t\t\t{\n\t\t\t\tboard[i][j] = 0;\n\t\t\t}\n\t\t}\n\t}",
"public void toEndingTurn() {\n }",
"@Override\n public void RageQuit() {\n //They won't have a score\n timer.stopTimer();\n\n if (view.confirmRageQuit()){\n // Punish them!\n DesktopAudio.getInstance().playPunish();\n grid = game.getSolved();\n for (int i = 0; i < 9; i++){\n for (int j = 0; j < 9; j++){\n view.setGiven(i, j, grid.getNumber(i, j));\n }\n }\n if (view.confirmNewGame()){\n setNextGame();\n }\n }else{\n timer.startTimer();\n }\n }",
"public void playerLost()\r\n {\r\n \r\n }",
"public void endGame() {\n \t\tisOver = true;\n \t\ttimeGameEnded = System.nanoTime();\n \t\tremoveAll();\n \t\trequestFocusInWindow();\n \t}",
"public void endTurn() {\n controller.endTurn();\n }",
"protected void end()\n\t{\n\t\t//\t\tdouble intakeSpeed[] = { 0.0, 0.0 };\n\t\t//\t\tRobot.intake.setSpeed(intakeSpeed);\n\t}",
"protected void end() {\n \tRobotMap.feedMotor1.set(0);\n \tRobotMap.shootAgitator.set(0);\n }",
"private void gameEnd(String loser) {\n }",
"protected void end() {\n \tRobotMap.gearIntakeRoller.set(0);\n }",
"protected void end() {\n \tRobot.driveBase.stopDead();\n }",
"public void gameOver() \n {\n new GameOver();\n Greenfoot.stop();\n }",
"public void endGame() {\r\n if (state[0]) {\r\n if (state[1]) {\r\n frame.remove(pause);\r\n state[1] = false;\r\n }\r\n records.newRecord(game.map, game.end());\r\n frame.remove(game);\r\n records.saveRecords();\r\n state[0] = false;\r\n menu.setVisible(true);\r\n }\r\n }",
"public void exit() {\n\tif (hasPlayed) {\n\t hasPlayed = false;\n\t lastExit = System.currentTimeMillis(); // note the time of exit\n\t}\n }",
"private void quitarCorazones(){\n if(ramiro.estadoItem== Ramiro.EstadoItem.NORMAL){\n efectoDamage.play();\n vidas--;\n }\n }",
"private void endGame() {\r\n\r\n m_state.setState(State.ENDING_GAME);\r\n\r\n /* find winner */\r\n for(KimTeam team : m_survivingTeams) {\r\n if(team != null) {\r\n if(!team.isOut()) {\r\n m_winner = team;\r\n }\r\n\r\n //remove survivors from m_teams so not to duplicate stats\r\n m_teams[team.m_freq] = null;\r\n }\r\n }\r\n\r\n /* end poll */\r\n if(m_poll != null) {\r\n m_poll.endPoll(m_winner, m_connectionName);\r\n m_poll = null;\r\n }\r\n\r\n /* display scoresheet */\r\n m_botAction.sendArenaMessage(\"--------Base1--------W--L --------Base2--------W--L --------Base3--------W--L --------Base4--------W--L\");\r\n\r\n if(!m_skipFirstRound) {\r\n printFormattedTeams(m_teams, m_numTeams);\r\n m_botAction.sendArenaMessage(\"------------------------- ------------------------- ------------------------- -------------------------\");\r\n }\r\n\r\n printFormattedTeams(m_survivingTeams, 4);\r\n m_botAction.sendArenaMessage(\"-------------------------------------------------------------------------------------------------------\");\r\n\r\n if(m_winner != null) {\r\n m_botAction.sendArenaMessage(\"Winner: \" + m_winner.toString(), 5);\r\n\r\n for(KimPlayer kp : m_winner) {\r\n Player p = m_botAction.getPlayer(kp.m_name);\r\n\r\n if(p != null && p.isPlaying()) {\r\n m_botAction.warpTo(p.getPlayerID(), 512, 277);\r\n }\r\n }\r\n } else {\r\n m_botAction.sendArenaMessage(\"No winner.\");\r\n }\r\n\r\n updateDB();\r\n\r\n /* announce mvp and clean up */\r\n m_botAction.scheduleTask(new TimerTask() {\r\n public void run() {\r\n m_botAction.sendArenaMessage(\"MVP: \" + m_mvp.m_name, 7);\r\n //refreshScoreboard();\r\n cleanUp();\r\n resetArena();\r\n m_state.setState(State.STOPPED);\r\n }\r\n }, 4000);\r\n }",
"public boolean gameWon(){\n return false;\n }",
"public void endGame() {\n\t\t// If Avengers lose and Loki wins\n\t\tif (!avengersAlive()) {\n\t\t\tca_attack.setEnabled(false);\n\t\t\the_attack.setEnabled(false);\n\t\t\tbw_attack.setEnabled(false);\n\t\t\thulk_attack.setEnabled(false);\n\t\t\tthor_attack.setEnabled(false);\n\t\t\tloki_attack.setEnabled(false);\n\t\t\ttextArea.append(\"\\n G A M E O V E R \\n\");\n\t\t\ttextArea.append(\"Oh no! Avengers lost... Loki conquered earth...\");\n\t\t}\n\t\t\n\t\t// If Loki loses and Avengers win\n\t\telse if (!lokiAlive()) {\n\t\t\tca_attack.setEnabled(false);\n\t\t\the_attack.setEnabled(false);\n\t\t\tbw_attack.setEnabled(false);\n\t\t\thulk_attack.setEnabled(false);\n\t\t\tthor_attack.setEnabled(false);\n\t\t\tloki_attack.setEnabled(false);\n\t\t\ttextArea.append(\"\\n Y O U W O N \\n\");\n\t\t\ttextArea.append(\"Yay! Avengers saved the world from Loki! Nice work!\");\n\t\t}\n\t}",
"public static void endGame(){\n\t\tmainPanel.grid1.enabledGrid(false);\n\t\tif(speler.heleVlootKapot){\n\t\t\tmainPanel.melding2.setText(\"Helaas, de computer heeft gewonnen.\");\n\t\t}else{\n\t\t\tmainPanel.melding2.setText(\"Gefeliciteerd, u heeft gewonnen.\");\n\t\t}\n\t}",
"private void endTurn(){\r\n String currentPlayer = cantStop.getGameBoard().getCurrentPlayer().getName();\r\n\t\tgameOver = cantStop.getGameBoard().endTurn(didBust);\r\n\t\t\r\n\t\tif(gameOver){\r\n\t\t\tstatusLabel.setText(currentPlayer + \r\n\t\t\t\t\t\" wins! Go again?\");\r\n\t\t\tupdate();\r\n\t\t} else {\r\n\t\t\tcantStop.getGameBoard().startNewTurn();\r\n\t\t\tallowNewRoll();\r\n\t\t}\r\n\t}",
"private GameResponse endGame() {\n if(gameResponse.getScore() > 0) {\n gameResponse.getPlayer().setHighScore(gameResponse.getScore());\n playerService.save(gameResponse.getPlayer());\n }\n gameResponse.setNewGame(true);\n return gameResponse;\n }",
"private void resetAfterGame() {\n }",
"public void forceStop() {\r\n\t\tchaseObj = false;\r\n\t}",
"protected void end() {\n \tRobot.vision_.stopGearLiftTracker();\n }",
"public static void playerEffectivelyEndsBattlePhase() {\r\n for (int index = 1; index <= 5; index++){\r\n SummonedMonster MonsterCPU = SummonedMonster.getNthSummonedMonster(index, false);\r\n if (MonsterCPU.isExisting) {\r\n MonsterCPU.canStillAttackThisTurn = false;\r\n }\r\n }\r\n endAttack(false);\r\n }",
"protected void end() {\n \tRobot.gearIntake.setIsDown(false);\n \tRobot.gearIntake.setGearRollerSpeed(0);\n }",
"public void end()\n\t{\n\t\tStateManager.setState(StateManager.GameState.MAINMENU);\n\t\tStateManager.setGame(null);\n\t}",
"void finishTurn();",
"public void endGame() {\n for (Player player : this.players.values()) {\n if (player.getBankroll() == this.playerAmount * DEFAULT_BANKROLL) {\n this.doPokerEnds = true;\n break;\n }\n }\n this.startingGamePlayer = ++this.startingGamePlayer % this.playerAmount;\n }",
"protected void end() {\n Robot.m_Cannon.stop();\n }",
"@Override\n public void endTurn() {\n battle.setState(new EnemyTurn(battle));\n battle.continueBattle();\n }",
"protected void end() {\n Robot.shooter.set(0);\n RobotMap.Armed=false;\n RobotMap.shootState=false;\n System.out.println(\"done shooting\");\n if (this.isTimedOut()==true) {\n System.out.println(\n \"shot timed out\");\n \n }\n if (RobotMap.inPosition.get()!=OI.shooterArmed){\n System.out.println(\"in position is different than shooter armed\");\n }\n}",
"public abstract void onLostGame();",
"public void endGame() {\n Player player = playerManager.getWinner();\n MainActivity mainActivity = (MainActivity) this.getContext();\n updateLiveComment(\"Winner : \" + player.getName());\n mainActivity.setAlertDialog(player.getName()+\" Wins !\", \"Congratulations\", true);\n }",
"protected void end() {\n \n this.getPIDController().disable();\n shooter.setShooterMotor(0.0);\n }",
"public void endGameMessage() {\n gameArena.addText(endGameMsg);\n }",
"@Override\r\n public int playGameLoop() {\r\n return 0;\r\n }",
"boolean checkEndGame() throws RemoteException;",
"@Override\n protected void result(Object object) {\n gamePaused = false;\n }",
"@Override\n protected void result(Object object) {\n gamePaused = false;\n }",
"protected void end() {\n \tif (waitForMovement) Robot.intake.setHopperTracker(deploy ? Status.deployed : Status.stowed);\n }",
"public void gameOver() {\n\t}",
"public void endTurn() {\r\n\t\tSystem.out.println(\"[DEBUG LOG/Game.java] Started endTurn() for player \"+currentPlayer.getNumber());\r\n\t\tturnIsEnding = true;\r\n\r\n\t\t// End turn restrictions\r\n\t\tif (!currentPlayer.isDead() && !currentPlayer.isFree() && !currentPlayer.hasQuit()) {\r\n\t\t\tif (currentPlayer.getPlayArea().getNonPlayedSize() > 0) {\r\n\t\t\t\tgameChannel.sendMessage(\"**[ERROR]** Cannot end turn until all cards in play area are played\").queue();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (mustChoose.size() > 0) {\r\n\t\t\t\tgameChannel.sendMessage(\"**[ERROR]** Cannot end turn until all choices are made\").queue();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (mustTrash.size() > 0) {\r\n\t\t\t\tgameChannel.sendMessage(\"**[ERROR]** Cannot end turn until all trashes are made\").queue();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t// Don't need to discard\r\n\t\t}\r\n\t\t\r\n\t\t// Mass deletes\r\n\t\tclearMessages();\r\n\t\t\r\n\t\t// If just escaped, send message after clearing\r\n\t\tif (currentPlayer.getCurrentRoom() == 0 && currentPlayer.getPiece().getX() == GlobalVars.playerCoordsPerRoom[39][0]) {\r\n\t\t\t// Update room\r\n\t\t\tcurrentPlayer.setCurrentRoom(39);\r\n\t\t\tif (firstEscapee == currentPlayer) {\r\n\t\t\t\tgameChannel.sendMessage(\":helicopter: **\"+currentName+\"** was the first to escape! They received a **20** :star: **Mastery Token**\\n:skull: Only **4** turn(s) left!\").queue();\r\n\t\t\t} else {\r\n\t\t\t\tgameChannel.sendMessage(\":helicopter: **\"+currentName+\"** escaped in time! They received a **20** :star: **Mastery Token**\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Set cards in PlayArea to not played for next time, Undos the Discarded tag\r\n\t\tfor (int i = 0; i < currentPlayer.getPlayArea().getSize(); i++) {\r\n\t\t\tcurrentPlayer.getPlayArea().getCard(i).setPlayed(false);\r\n\t\t\tif (currentPlayer.getPlayArea().getCard(i).toStringHand().contentEquals(\"*[Discarded]*\")) currentPlayer.getPlayArea().getCard(i).setStringInHand();\r\n\t\t}\r\n\t\t\r\n\t\t// Clear swords, skill, boots, etc\r\n\t\tcurrentPlayer.endOfTurnReset();\r\n\t\tmustDiscard.clear();\r\n\t\t\r\n\t\t// Replaces cards in dungeon row. Only one attack per turn\r\n\t\tif (!status.contentEquals(\"over\")) {\r\n\t\t\tboolean hasAttackedThisTurn = false;\r\n\t\t\tfor (int i = 0; i < 6; i++) {\r\n\t\t\t\t// Checks to see if it should replace card\r\n\t\t\t\tif (dungeonRow[i].isBought()) {\r\n\t\t\t\t\tdungeonRow[i] = mainDeck.getNext();\r\n\t\t\t\t\tif (dungeonRow[i].isDragonAttack() && !hasAttackedThisTurn) {\r\n\t\t\t\t\t\tdragonAttack(cubesPerLevel[attackLevel]);\r\n\t\t\t\t\t\thasAttackedThisTurn = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (dungeonRow[i].isHasArrive()) {\r\n\t\t\t\t\t\tdoArriveEffect(dungeonRow[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tmainDeck.removeTop();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Instantly go on to next player if no dragon attack\r\n\t\t\tif (!hasAttackedThisTurn) {\r\n\t\t\t\tdetermineNextPlayer();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}",
"void askEndTurn();"
] | [
"0.8058109",
"0.7837002",
"0.77753985",
"0.7680899",
"0.7669035",
"0.7662278",
"0.762069",
"0.7509928",
"0.7496087",
"0.74651295",
"0.74608326",
"0.7458559",
"0.7452097",
"0.7423565",
"0.7419669",
"0.74071306",
"0.7396095",
"0.7388357",
"0.7377519",
"0.73553926",
"0.733097",
"0.73243684",
"0.73176056",
"0.7309505",
"0.72708726",
"0.72319776",
"0.72313476",
"0.72239965",
"0.7217953",
"0.72129667",
"0.7205656",
"0.71829873",
"0.71676165",
"0.7164303",
"0.71567506",
"0.7152172",
"0.7149292",
"0.7148826",
"0.71344864",
"0.71153873",
"0.7113572",
"0.7110907",
"0.70924723",
"0.7072547",
"0.7069994",
"0.7064922",
"0.7059103",
"0.7048713",
"0.70438886",
"0.7042239",
"0.7033195",
"0.7032374",
"0.70212615",
"0.70157534",
"0.7012355",
"0.69990355",
"0.69818217",
"0.69705683",
"0.69615704",
"0.6945822",
"0.6944311",
"0.6941412",
"0.69379056",
"0.6937409",
"0.6934231",
"0.6929361",
"0.6921439",
"0.6917828",
"0.69154924",
"0.6914742",
"0.69117266",
"0.6889674",
"0.6877346",
"0.6873072",
"0.6863906",
"0.68638694",
"0.68575025",
"0.6853626",
"0.6851532",
"0.68502355",
"0.6849166",
"0.68466085",
"0.68374836",
"0.68331224",
"0.6825203",
"0.68223226",
"0.6816888",
"0.68101573",
"0.6804649",
"0.6804115",
"0.68013203",
"0.67972034",
"0.6782956",
"0.67745626",
"0.67716235",
"0.67716235",
"0.6769726",
"0.6769318",
"0.6767899",
"0.6765258"
] | 0.69180346 | 67 |
Method used to convert Strings to BitStrings, in order to allow the instructions to be entered more easily above. | private static BitString convertToBitString(final String theBits) {
return BitString.fromBits(32, theBits.toCharArray());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static BitSet BitStringToBitSet(String s) {\n BitSet result = new BitSet();\n for (int i = 0; i < s.length(); i++) {\n if (s.charAt(i) == '1') {\n result.set(i);\n }\n }\n return result;\n }",
"public static Bits fromBinaryString(String binaryString) {\n final int length = binaryString.length();\n final boolean bitsFit = (length % 8) == 0;\n final Bits bits = new Bits(new byte[length / 8 + (bitsFit ? 0 : 1)]);\n\n for (int i = 0; i < length; i++)\n if (binaryString.charAt(i) == '1')\n bits.setBit(i);\n else\n bits.unsetBit(i);\n\n return bits;\n }",
"public static BitSet createBitSetFromBinaryString(String bitsAsBinaryString) {\r\n\t\tBitSet bitSet = new BitSet(bitsAsBinaryString.length());\r\n\r\n\t\tfor (int i = 0; i < bitsAsBinaryString.length(); i++) {\r\n\t\t\tif (bitsAsBinaryString.substring(i, i + 1).equals(\"1\")) {\r\n\t\t\t\tbitSet.set(i, true);\r\n\t\t\t} else {\r\n\t\t\t\tbitSet.set(i, false);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn bitSet;\r\n\t}",
"String bsToStr(BitSet bs){\n String s = \"\";\n for(int i=0; i<bitsetLen; i++){\n if(bs.get(i) == true)\n s += '1';\n else\n s += '0';\n }\n \n return new StringBuilder(s).reverse().toString();\n }",
"public static int stringToBits(String s) {\n if (s.length() > 32) throw new RuntimeException(\"Cannot handle more than 32 bits. input='\" + s + \"'\");\n\n int retVal = 0;\n for (int i = 0; i <= (s.length() - 1); i++) {\n if (s.charAt(i) == '1') {\n retVal = retVal + 1;\n }\n if (i < (s.length() - 1))\n retVal <<= 1;\n }\n return retVal;\n }",
"private static int createBitVector(String str) {\n\t\tint bitVector = 0;\n\t\tfor(char c : str.toCharArray()) {\n\t\t\tint x = getCharNum(c);\n\t\t\tbitVector = toggle(bitVector, x);\n\t\t}\n\t\treturn bitVector;\n\t}",
"public static String BitStringToText(String s) {\n StringBuffer sb = new StringBuffer();\n int begIndex = 0;\n int endIndex = 8;\n for (int i = 0; i < s.length() / 8; i++) {\n String chunk = s.substring(begIndex, endIndex);\n int charCode = Integer.parseInt(chunk, 2);\n String y = new Character((char) charCode).toString();\n sb.append(y);\n begIndex += 8;\n endIndex += 8;\n }\n return sb.toString();\n }",
"static StringBuilder convert_to_binary(String msg) {\n byte[] bytes = msg.getBytes();\r\n StringBuilder binary = new StringBuilder();\r\n for (byte b : bytes) {\r\n int val = b;\r\n for (int i = 0; i < 8; i++) {\r\n binary.append((val & 128) == 0 ? 0 : 1);\r\n val <<= 1;\r\n }\r\n binary.append(\"\");\r\n }\r\n return binary;\r\n }",
"static String convert(String bits) {\n\t\tStringBuilder stringBuilder = new StringBuilder();\n\t\tstringBuilder.append(String.valueOf(hexLookUp.charAt(Integer.parseInt(bits, 2))));\n\t\tString hex = stringBuilder.toString();\n\t\treturn hex;\n\t}",
"public static String toBinaryString( final BitSet bitSet ) {\n // Converts the result to a String\n final StringBuilder builder = new StringBuilder( bitSet.length() );\n for ( int i = 0; i < bitSet.length(); i++ ) {\n builder.append( bitSet.get( i ) ? '1' : '0' );\n }\n final String res = builder.toString();\n return res;\n }",
"boolean isBinary(String str)\n\t{\n\t if(str.length() < 1) return false;\n\t \n\t for(int i=0; i<str.length(); i++){\n\t char t = str.charAt(i);\n\t if(t=='1' || t=='0') continue;\n\t else return false;\n\t }\n\t \n\t return true;\n\t}",
"public String toBitString (int i) {\n\tint[] result = new int[64];\n\tint counter = 0;\n\twhile (i > 0) {\n\t\tresult[counter] = i % 2;\n\t\ti /= 2;\n\t\tcounter++;\n\t}\n\tString answer = \"\";\n\tfor (int j = 0; j < counter; j++)\n\t\tanswer += \"\" + result[j];\n\treturn answer;\t\n}",
"@Test\n public void test2(){\n\n String s =\"1000000000000001\";\n //s = BinaryCalculate.BinaryArithmeticalRightShift(s,1);\n s = BinaryCalculate.BinaryLogicRightShift(s,1);\n int a = BitConversion.fromBinaryStringToInt(s);\n System.out.println(a);\n }",
"@DSSafe(DSCat.SAFE_OTHERS)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 13:00:53.096 -0500\", hash_original_method = \"AD601F3532730C1588B10C0B2F4700C0\", hash_generated_method = \"7CF3579665197E3D9616E88D35150E2D\")\n \npublic ASN1BitString() {\n super(TAG_BITSTRING);\n }",
"private boolean[] characterToBitArray(String character) {\n String binaryString = format(\"%4s\", Integer.toBinaryString(parseInt(character, 16))).replace(' ', '0');\n boolean[] bits = new boolean[NUMBER_OF_BITS_PER_CHAR];\n for (int i = 0; i < NUMBER_OF_BITS_PER_CHAR; i++) {\n bits[i] = binaryString.charAt(i) == '1';\n }\n return bits;\n }",
"public static String TextToBinary(String input){\n\t\tString output = \"\";\n\t\tfor(int i = 0; i < input.length(); i++){\n\t\t\toutput += Integer.toBinaryString(0x100 | input.charAt(i)).substring(1);\n\t\t}\n\t\treturn output;\n\t}",
"public static List<String> splitBitStrings(String bitString){\n\t\tList<String> LR = new ArrayList<String>();\n\t\tString L = bitString.substring(0,(bitString.length()/2));\n\t\tString R = bitString.substring((bitString.length()/2),bitString.length());\n\t\tLR.add(L);\n\t\tLR.add(R);\n\t\t\n\t\treturn LR;\n\n\t}",
"public String stringBits(String str) {\n if (str.length() < 1) {\n return \"\";\n } else if (str.length() < 2) {\n return str;\n } else {\n return str.charAt(0) + stringBits(str.substring(2));\n }\n }",
"private String toBinary( byte[] bytes )\n\t{\n \t\tStringBuilder sb = new StringBuilder(bytes.length * Byte.SIZE);\n\t\tfor( int i = 0; i < Byte.SIZE * bytes.length; i++ )\n\t\t\tsb.append((bytes[i / Byte.SIZE] << i % Byte.SIZE & 0x80) == 0 ? '0' : '1');\n\t\treturn sb.toString();\n\t}",
"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}",
"@Ignore\r\n @Test\r\n public void testCreateEncodingsLabelBitString()\r\n {\r\n System.out.println(\"createEncodingsLabelBitString\");\r\n HuffmanEncoder huffman = new HuffmanEncoder(p, ensemble);\r\n HuffmanNode root = huffman.createTree();\r\n EncodingsLabelTextCreator enc = new EncodingsLabelTextCreator(root);\r\n String expResult = \"{ a: 01, b: 10, c: 11, d: 001, e: 000 }\"; \r\n String result = enc.getLabelText();\r\n System.out.println(result);\r\n assertEquals(expResult, result);\r\n }",
"public static String binaryCode(String n)\n\t{\n\t\tString retValue = \"\";\n\n\t\tint num = Integer.parseInt(n);\t//convert the input string into int\n\n\t\twhile(num>0)\n\t\t{\n\t\t\tif(num==1)\n\t\t\t\tretValue += num;\n\t\t\telse\n\t\t\t\tretValue += Integer.toString(num%2);\t//resto della divisione\n\t\t\t\tnum = num/2;\t\t\t\t\t\t\t//divide the number by 2\n\t\t}\n\n\t\treturn new StringBuilder(retValue).reverse().toString();\n\t}",
"private byte[] stringToBytes(String bytesInStringForm) {\n byte[] bytes = new byte[16];\n String[] byteValues = bytesInStringForm.split(\",\");\n for (int byteIndex = 0; byteIndex < 16; byteIndex++) {\n bytes[byteIndex] = (byte) Integer.parseInt(byteValues[byteIndex]);\n }\n return bytes;\n\n }",
"public String toString()\n\t{\n\t\tString binary = \"\"; //string to store the binary number\n\t\t\n\t\t//loops through each of the bit positions\n\t\tfor (int i=binaryCode.length-1; i>=0; i--)\n\t\t{\n\t\t\t\n\t\t\t//checks the value of the bit\n\t\t\tif (binaryCode[i]==false)\n\t\t\t{\n\t\t\t\t//if the boolean is false, then the bit is a 0\n\t\t\t\tbinary+=\"0\";\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t//since there are only two states, if it is not 0, then it is 1\n\t\t\t\tbinary+=\"1\";\t\t\n\t\t\t}\n\t\t}\t\t\n\t\t//returns the binary number as a string\n\t\treturn binary;\n\t}",
"public static boolean[] stringToBooleanArray(String s){\n\t\tboolean[] output = new boolean[s.length()];\n\t\tfor (int i=0; i<s.length(); i++){\n\t\t\tif (s.charAt(i) == '0')\n\t\t\t\toutput[i] = false;\n\t\t\telse\n\t\t\t\toutput[i] = true;\n\t\t}\n\t\treturn output;\n\t}",
"public static boolean basicBinaryTests()\n\t{\n\t\tSystem.out.println(\"Beginning Basic Binary Tests...\");\n\t\tSystem.out.println(\"isBitSet[Array]...\");\n\t\tfinal byte[] original_bytes = { 3, 54 };\n\t\tfinal String binary_str_rep = Integer.toBinaryString(3) + Integer.toBinaryString(54);\n\t\tString binary_str_rebuilt = \"\";\n\t\tfor(int i = 0; i < original_bytes.length; i ++)\n\t\t{\n\t\t\tfinal byte byte_len = (byte) (Integer.toBinaryString(original_bytes[i]).length() - BIT_ONE_);\n\t\t\tfor( int a = byte_len; a > -1; a --)\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tbinary_str_rebuilt += isBitSet(original_bytes, i, a) ? BIT_ONE : BIT_ZERO;\n\t\t\t\t}\n\t\t\t\tcatch (BitException e)\n\t\t\t\t{\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t}\n\t\t\t\n\t\tfinal boolean success_0 = binary_str_rebuilt.equals(binary_str_rep);\n\t\t\n\t\tSystem.out.println(\"Binary String[0]: \"+binary_str_rep);\n\t\tSystem.out.println(\"Rebuilt Binary[0]: \"+binary_str_rebuilt);\n\t\tSystem.out.println(\"Success[0]: \" + success_0 + \"\\n\");\n\n\t\tSystem.out.println(\"isBitSet[Byte]...\");\n\t\t\n\t\tbinary_str_rebuilt = \"\";\n\t\tfor(int i = 0; i < original_bytes.length; i ++)\n\t\t{\n\t\t\tfinal byte byte_len = (byte) (Integer.toBinaryString(original_bytes[i]).length() - BIT_ONE_);\n\t\t\tfor( int a = byte_len; a > -1; a --)\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tbinary_str_rebuilt += isBitSet(original_bytes[i], a) ? BIT_ONE : BIT_ZERO;\n\t\t\t\t}\n\t\t\t\tcatch (BitException e)\n\t\t\t\t{\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t}\n\t\t\t\n\t\tfinal boolean success_1 = binary_str_rebuilt.equals(binary_str_rep);\n\t\t\n\t\tSystem.out.println(\"Binary String[1]: \"+binary_str_rep);\n\t\tSystem.out.println(\"Rebuilt Binary[1]: \"+binary_str_rebuilt);\n\t\tSystem.out.println(\"Success[1]: \" + success_1 + \"\\n\");\n\t\t\n\t\treturn success_0 && success_1;\n\t}",
"public static StringBuilder stringtoBinary(final String text)\n\t{\n\t\tfinal StringBuilder builder = new StringBuilder();\n\t\tbuilder.append(Long.toBinaryString(text.charAt(0)));\n\t\tfor(int i = 1; i < text.length(); i ++)\n\t\t\tbuilder.append(BYTE_DELIMITER+Long.toBinaryString(text.charAt(i)));\n\t\treturn builder;\n\t}",
"@Ignore\r\n @Test\r\n public void testCreateEncodingsLabelBitString2()\r\n {\r\n System.out.println(\"testCreateEncodingsLabelBitString2\");\r\n HuffmanEncoder huffman = new HuffmanEncoder(p2, ensemble2);\r\n HuffmanNode root = huffman.createTree();\r\n EncodingsLabelTextCreator enc = new EncodingsLabelTextCreator(root);\r\n String expResult = \"{ a: 01, b: 00, c: 0 }\"; \r\n String result = enc.getLabelText();\r\n System.out.println(result);\r\n assertEquals(expResult, result);\r\n }",
"public static boolean basicBinaryStrTests()\n\t{\n\t\tSystem.out.println(\"Beginning Basic Binary String Tests...\");\n\t\tStringBuilder unscrambled = stringtoBinary(TEST_STR);\n\t\tStringBuilder scrambled = basicScramble(unscrambled, false);\n\t\tunscrambled = basicScramble(scrambled, true);\n\t\t\n\t\tbyte[] decoded = array(unscrambled.toString());\n\t\tbyte[] encoded = array(scrambled.toString());\n\t\t\n\t\tfinal String decoded_text = new String(decoded);\n\t\tfinal boolean match = decoded.equals(encoded), \n\t\t\t\tsuccess = decoded_text.equals(TEST_STR) && !match;\n\t\t\n\t\tSystem.out.println(\"Encoded: \"+new String(encoded));\n\t\tSystem.out.println(\"Decoded: \"+new String(decoded));\n\t\tSystem.out.println(\"Match: \" + match);\n\t\tSystem.out.println(\"Success: \" + success + \"\\n\");\n\t\treturn success;\n\t}",
"@Override\n public BinaryType andBinary(BinaryType BinaryType) {\n int n = BinaryType.getValue().length();\n StringBuilder resultado = new StringBuilder();\n for (int i = 0; i < n; i++){\n boolean b1 = BinaryType.getValue().charAt(i) == '1';\n boolean b2 = this.getValue().charAt(i) == '1';\n resultado.append((b1 && b2) ? '1' : '0');\n }\n return TypeFactory.getBinaryType(resultado.toString());\n }",
"public static boolean advancedBinaryStrTests()\n\t{\n\t\tSystem.out.println(\"Beginning Advanced Binary String Tests...\");\n\t\tString binary = stringtoBinary(TEST_STR).toString();\n\t\tfinal Smartprint blueprint = new Smartprint(binary);\n\t\tbinary = scramble(binary, blueprint);\n\t\tfinal byte[] scrambled = array(binary);\n\t\tbinary = scramble(binary, blueprint);\n\t\tfinal byte[] unscrambled = array(binary);\n\t\t\n\t\tfinal String translated = new String(unscrambled);\n\t\tfinal boolean match = unscrambled.equals(scrambled), \n\t\t\t\tsuccess = translated.equals(TEST_STR) && !match;\n\t\t\n\t\tSystem.out.println(\"Encoded: \"+new String(scrambled));\n\t\tSystem.out.println(\"Decoded: \"+new String(unscrambled));\n\t\tSystem.out.println(\"Match: \" + match);\n\t\tSystem.out.println(\"Success: \" + success + \"\\n\");\n\t\treturn success;\n\t}",
"private StringBuilder binConversion(StringBuilder input) {\n\t\tStringBuilder finalres = new StringBuilder();\n\t\tString currentVal = \"\";\n\t\tchar tempVal = ' ';\n\t\t\n\t\tfor(int i = 0; i < input.length(); i++)\n\t\t{\n\t\t\t\n\t\t\ttempVal = input.charAt(i);\n\t\t\t\n\t\t\tif(isOperator(input.charAt(i)) == false)\n\t\t\t{\n\t\t\t\tcurrentVal = currentVal + Character.toString(tempVal);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tint val = Integer.parseInt(currentVal,2);\n\t\t\t\t\n\t\t\t\tfinalres.append(val + Character.toString(tempVal));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// converting the last currentVal\n\t\t\n\t\tint val = Integer.parseInt(currentVal,2);\n\t\t\n\t\tfinalres.append(val);\n\t\t\n\t\treturn finalres;\n\t}",
"public EncodeAndDecodeStrings() {}",
"@Test\n public void shouldParseBIT() {\n printTest(\"shouldParseBIT()\");\n String typeString = getDataTypeString(DataTypes.DTYPE_BIT);\n String content = typeString;\n\n DdlTokenStream tokens = getTokens(content);\n\n DataType dType = parser.parse(tokens);\n\n Assert.assertNotNull(\"DataType was NOT found for Type = \" + typeString, dType);\n Assert.assertEquals(\"Wrong DataType found\", typeString, dType.getName());\n }",
"public String hexToBinary(String hex, boolean bool_is64bits) {\n String binary_String = \"\";\n for (int i = 0; i < hex.length(); i++) { // Umwandlung: String \"hex\"-->hex-digit at\n // String-position_i-->integer-->binary\n String temporary = Integer.toBinaryString(Character.digit(hex.charAt(i), 16));// 16 =\n // Basis\n\n // Erzeugung einer 4-bit Darstellung durch Hinzufuegen von leading Nullen +++\n // Concatenation (li->re)\n binary_String = binary_String + getLeadingZero(4 - temporary.length()) + temporary;\n }\n\n if (!bool_is64bits)\n return binary_String; // false: \"binary_String\" hat Rueckgabe-Laenge evtl. verschieden\n // von 64\n else\n // true: \"binary_String\" hat Rueckgabe-Laenge von 64\n return getLeadingZero(64 - binary_String.length()) + binary_String;\n }",
"public abstract String toString(String bin);",
"private byte[] toByteArray(String s)\r\n\t\t{\n\t\t\tlong l = 0;\r\n\t\t\tif (s.startsWith(\"0x\") || s.startsWith(\"0X\")) {\r\n\t\t\t\tfinal byte[] d = new byte[(s.length() - 1) / 2];\r\n\t\t\t\tint k = (s.length() & 0x01) != 0 ? 3 : 4;\r\n\t\t\t\tfor (int i = 2; i < s.length(); i = k, k += 2)\r\n\t\t\t\t\td[(i - 1) / 2] = (byte) Short.parseShort(s.substring(i, k), 16);\r\n\t\t\t\treturn d;\r\n\t\t\t}\r\n\t\t\telse if (s.length() > 1 && s.startsWith(\"0\"))\r\n\t\t\t\tl = Long.parseLong(s, 8);\r\n\t\t\telse if (s.startsWith(\"b\"))\r\n\t\t\t\tl = Long.parseLong(s.substring(1), 2);\r\n\t\t\telse\r\n\t\t\t\tl = Long.parseLong(s);\r\n\t\t\tint i = 0;\r\n\t\t\tfor (long test = l; test != 0; test /= 0x100)\r\n\t\t\t\t++i;\r\n\t\t\tfinal byte[] d = new byte[i == 0 ? 1 : i];\r\n\t\t\tfor (; i-- > 0; l /= 0x100)\r\n\t\t\t\td[i] = (byte) (l & 0xff);\r\n\t\t\treturn d;\r\n\t\t}",
"public void testToString_AND() {\n assertEquals(\"Returns an incorrect string\", \"AND\", BinaryOperation.AND.toString());\n }",
"public String toBitsString() {\n\t\tStringBuffer buf = new StringBuffer(actualsizeinwords * wordinbits);\n\t\tint bitPos = 0;\n\t\tfinal EWAHIterator iter =\n\t\t\t\tnew EWAHIterator(this.buffer, actualsizeinwords);\n\n\t\twhile (iter.hasNext()) {\n\t\t\tRunningLengthWord rlw = iter.next();\n\t\t\tif (rlw.getRunningLength() > 0) {\n\t\t\t\tchar bit;\n\t\t\t\tif (rlw.getRunningBit())\n\t\t\t\t\tbit = '1';\n\t\t\t\telse\n\t\t\t\t\tbit = '0';\n\t\t\t\tfor (int i = 0; i < rlw.getRunningLength() * 64; i++) {\n\t\t\t\t\tbuf.append(bit);\n\t\t\t\t\tif (i != 0 && i % 8 == 0)\n\t\t\t\t\t\tbuf.append(' ');\n\t\t\t\t}\n\t\t\t\tbitPos += rlw.getRunningLength() * 64;\n\t\t\t\tbuf.append(' ');\n\t\t\t}\n\t\t\tfor (int i = 1; i <= rlw.getNumberOfLiteralWords(); i++) {\n\t\t\t\tbitPos += 64;\n\t\t\t\tif (bitPos > sizeinbits)\n\t\t\t\t\tbuf.append(longToBitString(this.buffer[rlw.position + i],\n\t\t\t\t\t\t\tsizeinbits % 64));\n\t\t\t\telse {\n\t\t\t\t\tbuf.append(longToBitString(this.buffer[rlw.position + i]));\n\t\t\t\t\tbuf.append(' ');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn buf.toString();\n\t}",
"@Test\n\tpublic void testStringToBoolean() {\n\n\t\t// forwards for yes and no\n\t\tAssert.assertEquals(converter.convertForward(\"Yes\"), new Boolean(true));\n\t\tAssert.assertEquals(converter.convertForward(\"No\"), new Boolean(false));\n\n\t}",
"public String getBinaryMnemonic(){\n\t\tswitch(this) {\n\t\tcase STOP -> \t{return \t\"00000000\";}\n\t\tcase RETTR -> \t{return \t\"00000001\";}\n\t\tcase MOVSPA -> \t{return \t\"00000010\";}\n\t\tcase MOVFLGA -> {return \t\"00000011\";}\n\t\t\n\t\tcase BR -> \t\t{return \t\"0000010\";}\n\t\tcase BRLE -> \t{return \t\"0000011\";}\n\t\tcase BRLT -> \t{return \t\"0000100\";}\n\t\tcase BREQ -> \t{return \t\"0000101\";}\n\t\tcase BRNE -> \t{return \t\"0000110\";}\n\t\tcase BRGE -> \t{return \t\"0000111\";}\n\t\tcase BRGT -> \t{return \t\"0001000\";}\n\t\tcase BRV -> \t{return \t\"0001001\";}\n\t\tcase BRC -> \t{return \t\"0001010\";}\n\t\tcase CALL -> \t{return \t\"0001011\";}\n\t\t\n\t\tcase NOTA -> \t{return \t\"00011000\";}\n\t\tcase NOTX -> \t{return \t\"00011001\";}\n\t\tcase NEGA -> \t{return \t\"00011010\";}\n\t\tcase NEGX -> \t{return \t\"00011011\";}\n\t\tcase ASLA -> \t{return \t\"00011100\";}\n\t\tcase ASLX -> \t{return \t\"00011101\";}\n\t\tcase ASRA -> \t{return \t\"00011110\";}\n\t\tcase ASRX -> \t{return \t\"00011111\";}\n\t\tcase ROLA -> \t{return \t\"00100000\";}\n\t\tcase ROLX -> \t{return \t\"00100001\";}\n\t\tcase RORA -> \t{return \t\"00100010\";}\n\t\tcase RORX -> \t{return \t\"00100011\";}\n\t\t\n\t\tcase NOP -> \t{return \t\"00101\";}\n\t\tcase DECI -> \t{return \t\"00110\";}\n\t\tcase DECO -> \t{return \t\"00111\";}\n\t\tcase STRO -> \t{return \t\"01000\";}\n\t\tcase CHARI -> \t{return \t\"01001\";}\n\t\tcase CHARO -> \t{return \t\"01010\";}\n\t\t\n//\t\tcase RETn\n\t\t\n\t\tcase ADDSP -> \t{return \t\"01100\";}\n\t\tcase SUBSP -> \t{return \t\"01101\";}\n\t\t\n\t\tcase ADDA -> \t{return \t\"0111\";}\n\t\tcase SUBA -> \t{return \t\"1000\";}\n\t\tcase ANDA -> \t{return \t\"1001\";}\n\t\tcase ORA -> \t{return \t\"1010\";}\n\t\tcase CPA -> \t{return \t\"1011\";}\n\t\tcase LDA -> \t{return \t\"1100\";}\n\t\tcase LDBYTEA -> {return \t\"1101\";}\n\t\tcase STA -> \t{return \t\"1110\";}\n\t\tcase STBYTEA -> {return \t\"1111\";}\n\t\t\n\t\tcase i -> \t{return \t\"000\";}\n\t\tcase d -> \t{return \t\"001\";}\n\t\tcase n -> \t{return \t\"010\";}\n\t\tcase s -> \t{return \t\"011\";}\n\t\tcase sf -> \t{return \t\"100\";}\n\t\tcase x -> \t{return \t\"101\";}\n\t\tcase sx -> \t{return \t\"110\";}\n\t\tcase sfx -> {return \t\"111\";}\n\t\t\n\t\tcase A -> {return \"0\";}\n\t\tcase X -> {return \"1\";}\n\t\t\n\t\tcase ADDRSS -> \t{return \"\";}\n\t\tcase ASCII -> \t{return \"\";}\n\t\tcase BLOCK -> \t{return \"\";}\n\t\tcase BURN -> \t{return \"\";}\n\t\tcase BYTE -> \t{return \"\";}\n\t\tcase END -> \t{return \"\";}\n\t\tcase EQUATE -> {return \"\";}\n\t\tcase WORD -> \t{return \"\";}\n\t\t\n\t\tdefault -> throw new IllegalArgumentException(\"This is an illegal mnemonic. \\nPlease double check your code.\");\n\t\t\n\t\t}\n\t\t\n\t}",
"static String hexToBin(String s) {\n\t\treturn new BigInteger(s, 16).toString(2);\n\t}",
"private byte[] intToBits(int number, int n) {\n\t\tbyte[] bits = new byte[n];\n\t\t\n\t\tString bitString = Integer.toBinaryString(number);\n\t\twhile (bitString.length() < n) {\n\t\t\tbitString = \"0\" + bitString;\n\t\t}\n\t\t\n\t\tfor(int i = 0, maxLen = bits.length; i < maxLen; i++) {\n\t\t\tbits[i] = (byte) (bitString.charAt(i) == 1 ? 1 : 0);\n\t\t}\n\t\t\n\t\treturn bits;\n\t}",
"public String addBinString(String s1, String s2) {\r\n // not invalid input, only 0 and 1, no leading 0, \r\n // first char is the most significant\r\n // no perf requirement\r\n // formal api requirement ( documentations, comments, meaningful names), or focus on correctness of the implementation first.\r\n if(s1==null || s1.length() ==0)\r\n return s2;\r\n if(s2==null || s2.length() ==0)\r\n return s1;\r\n \r\n StringBuffer buf1 = new StringBuffer(s1);\r\n StringBuffer buf2 = new StringBuffer(s2);\r\n if(s1.length()<s2.length()) {\r\n StringBuffer tmp = buf1;\r\n buf1 = buf2;\r\n buf2 = tmp;\r\n }\r\n \r\n buf1.reverse();\r\n buf2.reverse();\r\n StringBuffer res = new StringBuffer(); \r\n int carry = 0;\r\n for(int i=0;i< buf1.length();i++) {\r\n char c1 = buf1.charAt(i);\r\n char c2 = '0';\r\n if(i<buf2.length())\r\n c2 = buf2.charAt(i);\r\n int sum = (c1 -'0') + (c2 -'0') + carry;\r\n if(sum%2 ==1)\r\n res.append('1');\r\n else\r\n res.append('0');\r\n carry = sum / 2;\r\n }\r\n if(carry ==1)\r\n res.append(\"1\");\r\n return res.reverse().toString();\r\n\r\n }",
"static int[] hexStringToBits(String hex) {\n int[] bits = new int[128];\n for (int i = 0; i < hex.length(); i++) {\n int n = (int)hex.charAt(i);\n for (int j = 0; j < 4; j++) {\n bits[4 * i + j] = (n >> (3 - j)) & 1;\n }\n }\n return bits;\n }",
"public String convertToAssemblyBin(String bin)\n {\n if(bin.equals(\"01101001010000000000000100000000\"))\n {\n return \"MOVEZ X0 data\";\n } else if(bin.equals(\"01111100001000000000000000000001\"))\n {\n return \"LDUR X1, X0, #0\";\n } else if(bin.equals(\"01011010000000000000001000000010\"))\n {\n return \"CBZ X2, #32\";\n } else if(bin.equals(\"00000000101000000000000000001100\"))\n {\n return \"B #12\";\n } else if(bin.equals(\"00000100100010000001010000100010\"))\n {\n return \"ADDI X2, X2, #20\";\n }else if(bin.equals(\"00000110010110000001000000100010\"))\n {\n return \"SUB X2, X1, X2\";\n }else if(bin.equals(\"00000010001000100000000000000010\"))\n {\n return \"PUSH X2\";\n }else if(bin.equals(\"00000000000000000000000000000000\"))\n {\n return \"NOP\";\n }else if(bin.equals(\"00000011001100110000000000000011\"))\n {\n return \"POP X3\";\n }else if(bin.equals(\"01111100000000000000000000000011\"))\n {\n return \"STUR X3, X0, #0\";\n }else if(bin.equals(\"00000110010100000010000000110011\"))\n {\n return \"EOR X3, X2, X3\";\n }else if(bin.equals(\"01011010000000000000000001000011\"))\n {\n return \"CBZ X3, #4\";\n }else if(bin.equals(\"00010001000100010001000100010001\"))\n {\n return \"HALT\";\n } else if(bin.equals(\"00000000101010111010101100000000\") || bin.equals(\"00000000000000001010101100000000\"))\n {\n return \"DATA VALUE: \" + Integer.parseInt(\"ab\", 16);\n } else if(bin.equals(\"00000000000000000000110111101111\"))\n {\n return \"STACK VALUE: \" + Integer.parseInt(\"def\", 16);\n }\n return \"\";\n }",
"private void toHex(){\n\t\tStringBuilder sb = new StringBuilder();\n\t\tStringBuilder tempsb = new StringBuilder(binary);\n\t\t\n\t\t\tfor (int i = 0;i<binary.length();i+=4){//maps each nibble to its binary value\n\t\t\t\tif (tempsb.substring(i,i+4).equals(\"0000\")) \n\t\t\t\t\tsb.append('0');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"0001\"))\n\t\t\t\t\tsb.append('1');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"0010\"))\n\t\t\t\t\tsb.append('2');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"0011\"))\n\t\t\t\t\tsb.append('3');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"0100\"))\n\t\t\t\t\tsb.append('4');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"0101\"))\n\t\t\t\t\tsb.append('5');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"0110\"))\n\t\t\t\t\tsb.append('6');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"0111\"))\n\t\t\t\t\tsb.append('7');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1000\"))\n\t\t\t\t\tsb.append('8');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1001\"))\n\t\t\t\t\tsb.append('9');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1010\"))\n\t\t\t\t\tsb.append('A');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1011\"))\n\t\t\t\t\tsb.append('B');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1100\"))\n\t\t\t\t\tsb.append('C');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1101\"))\n\t\t\t\t\tsb.append('D');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1110\"))\n\t\t\t\t\tsb.append('E');\n\t\t\t\telse if (tempsb.substring(i,i+4).equals(\"1111\"))\n\t\t\t\t\tsb.append('F');\n\t\t\t}\n\t\t\tsb.insert(0,\"0x\");\n\t\t\tbinary = sb.toString();\n\t}",
"private static String or(String s, String t)\r\n\t{\r\n\t\tchar[] out = s.toCharArray();\r\n\t\tfor (int i = 0; i < out.length; i++)\r\n\t\t{\r\n\t\t\tif(out[i] == '0' && t.charAt(i) == '1')\r\n\t\t\t\tout[i] = '1';\r\n\t\t}\r\n\t\treturn new String(out);\r\n\t}",
"@Test\n public void testToBinary() {\n Object[][] datas = new Object[][]{\n {0, \"0\"},\n {5, \"101\"},\n {10, \"1010\"},\n {11, \"1011\"}\n };\n for (Object[] data : datas) {\n String result = Tools.toBinary((int) data[0]); //Actual\n String expResult = (String) data[1]; //Expected\n assertEquals(result, expResult);\n System.out.println(\"testToBinary()\");\n }\n }",
"public static int[] convertToBinary(String[] str)\n {\n int binaryArr[] = new int[32];\n int a, b, c, d, i, remainder;\n a = b = c = d = 1;\n Stack<Integer> st = new Stack<Integer>();\n\n // Separate each number of the IP address e.g. for 10.0.0.1 => a=10, b=0, c=0, d=1\n if (str != null)\n {\n a = Integer.parseInt(str[0]);\n b = Integer.parseInt(str[1]);\n c = Integer.parseInt(str[2]);\n d = Integer.parseInt(str[3]);\n }\n\n // convert first number to binary\n for (i = 0; i <= 7; i++)\n {\n remainder = a % 2;\n st.push(remainder);\n a = a / 2;\n }\n\n // Obtain First octet\n for (i = 0; i <= 7; i++) {\n binaryArr[i] = st.pop();\n }\n\n // convert second number to binary\n for (i = 8; i <= 15; i++) {\n remainder = b % 2;\n st.push(remainder);\n b = b / 2;\n }\n\n // Obtain Second octet\n for (i = 8; i <= 15; i++) {\n binaryArr[i] = st.pop();\n }\n\n // convert Third number to binary\n for (i = 16; i <= 23; i++) {\n remainder = c % 2;\n st.push(remainder);\n c = c / 2;\n }\n\n // Obtain Third octet\n for (i = 16; i <= 23; i++) {\n binaryArr[i] = st.pop();\n }\n\n // convert fourth number to binary\n for (i = 24; i <= 31; i++) {\n remainder = d % 2;\n st.push(remainder);\n d = d / 2;\n }\n\n // Obtain Fourth octet\n for (i = 24; i <= 31; i++) {\n binaryArr[i] = st.pop();\n }\n\n return (binaryArr);\n }",
"private static String scramble(final String byte_, final boolean reverse)\n\t{\n\t\tStringBuilder builder = new StringBuilder(byte_);\n\t\tfor( int i = 0; i < byte_.length(); i ++)\n\t\t\tif(byte_.charAt(i) == ( !reverse ? BIT_ONE : BIT_ZERO))\n\t\t\t{\n\t\t\t\tbuilder.setCharAt(i, ( !reverse ? BIT_ZERO : BIT_ONE));\n\t\t\t\treturn builder.toString();\n\t\t\t}\n\t\treturn null;\n\t}",
"public boolean genStringAsByteArray();",
"public BinaryNumber(String str) {\n\t\tint length = str.length();\n\t\tdata = new int[length];\n\t\tfor(int i = 0;i < str.length();i++) {\n\t\t\tint number = Character.getNumericValue(str.charAt(i));\n\t\t\tif (number == 0||number == 1) {\n\t\t\t\tdata[i] = number;\n\t\t\t}\n\t\t}\n\t}",
"public static String fakeBin(String numberString) {\n numberString = numberString.replaceAll(\"[0-4]\", \"0\");\n numberString = numberString.replaceAll(\"[5-9]\", \"1\");\n return numberString;\n }",
"public static String toBinary(int n){\n int length = (int)Math.ceil(Math.log(n)/Math.log(2));\n int[] bits = new int[length];\n for(int x = 0; x < length; x++){\n double val = Math.pow(2, length - x);\n if(n >= val){\n bits[x] = 1;\n n -= val;\n }\n else{\n bits[x] = 0;\n }\n }\n String convert = \"\";\n for(int x = 0; x < length; x++){\n convert += bits[x];\n }\n return convert;\n }",
"@Override\n\t\tpublic byte[] convert(String s) {\n\t\t\treturn s.getBytes();\n\t\t}",
"public String toString()\n\t{\n\t\tString result = new String();\n\t\tfor (boolean bit : bits)\n\t\t{\n\t\t\tif (bit) result += '1';\n\t\t\telse result += '0';\n\t\t}\n\t\treturn result;\n\t}",
"@Test\n public void decodeString()\n {\n final BinaryEncoder encoder = new BinaryEncoder(16);\n assertThat(encoder.decode(\"0011\"), is(3.0));\n }",
"public String get2sComplement(String binaryVal) {\r\n\t\tString onesComp = new String();\r\n\t\tString twosComp = new String();\r\n\t\tchar carry = '0';\r\n\t\tint i;\r\n\t\t// finding one's complement--------------------------------\r\n\t\tfor (i = 0; i < binaryVal.length(); i++) {\r\n\t\t\tif (binaryVal.charAt(i) == '0')\r\n\t\t\t\tonesComp = onesComp + \"1\";\r\n\t\t\telse\r\n\t\t\t\tonesComp = onesComp + \"0\";\r\n\t\t} \r\n\t\t\r\n\t\t//finding the 2's complement. adding '1' to the binary(which is 1's complement)\r\n\t\tchar lsb = onesComp.charAt(onesComp.length() - 1);\r\n\t\tif (lsb == '1') {\r\n\t\t\ttwosComp = \"0\" + twosComp;\r\n\t\t\tcarry = '1';\r\n\t\t} else\r\n\t\t\ttwosComp = \"1\" + twosComp;\r\n\t\tfor (i = onesComp.length() - 2; i >= 0; i--) {\r\n\t\t\tchar digit = onesComp.charAt(i);\r\n\t\t\tif (carry == '0' && digit == '0')\r\n\t\t\t\ttwosComp = \"0\" + twosComp;\r\n\t\t\telse if (carry == '0' && digit == '1')\r\n\t\t\t\ttwosComp = \"1\" + twosComp;\r\n\t\t\telse if (carry == '1' && digit == '0') {\r\n\t\t\t\ttwosComp = \"1\" + twosComp;\r\n\t\t\t\tcarry = '0';\r\n\t\t\t} else {\r\n\t\t\t\ttwosComp = \"0\" + twosComp;\r\n\t\t\t\tcarry = '1';\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn twosComp;\r\n\t\t }",
"@Override\n public BinaryType orBinary(BinaryType BinaryType) {\n int n = BinaryType.getValue().length();\n StringBuilder resultado = new StringBuilder();\n for (int i = 0; i < n; i++){\n boolean b1 = BinaryType.getValue().charAt(i) == '1';\n boolean b2 = this.getValue().charAt(i) == '1';\n resultado.append((b1 || b2) ? '1' : '0');\n }\n return TypeFactory.getBinaryType(resultado.toString());\n }",
"private String convertToString(boolean isUsed) {\n\t\tif (isUsed)\n\t\t\treturn \"1\";\n\t\treturn \"0\";\n\t}",
"@Test\n public void testConvertStringSidToBinary() throws Exception {\n byte[] expectedSid = {(byte) 0x01, (byte) 0x05, (byte) 0x00, (byte) 0x00,\n (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x05,\n (byte) 0x15, (byte) 0x00, (byte) 0x00, (byte) 0x00,\n (byte) 0xe9, (byte) 0x67, (byte) 0xbb, (byte) 0x98,\n (byte) 0xd6, (byte) 0xb7, (byte) 0xd7, (byte) 0xbf,\n (byte) 0x82, (byte) 0x05, (byte) 0x1e, (byte) 0x6c,\n (byte) 0x28, (byte) 0x06, (byte) 0x00, (byte) 0x00};\n byte[] result = LdapUtils.convertStringSidToBinary(\"S-1-5-21-2562418665-3218585558-1813906818-1576\");\n assertTrue(\"incorrect length of array\", ArrayUtils.isSameLength(expectedSid, result));\n for (int i = 0; i < result.length; i++) {\n assertEquals(\"i=\" + i + \",\", expectedSid[i], result[i]);\n }\n }",
"private boolean convertToBoolean (String s) {\n return (\"1\".equalsIgnoreCase(s)\n || \"yes\".equalsIgnoreCase(s)\n || \"true\".equalsIgnoreCase(s)\n || \"on\".equalsIgnoreCase(s)\n || \"y\".equalsIgnoreCase(s)\n || \"t\".equalsIgnoreCase(s));\n }",
"public static Symbol binary(String text)\r\n\t{\r\n\t\treturn number(text, 2);\r\n\t}",
"private static String validateBinaryStr(String binStr) throws UnsignedBigIntUtilsException {\n String tmpStr = RegExp.replaceAll(\"[ \\\\|\\\\t\\\\n]+\", binStr, \"\");\n tmpStr = RegExp.replaceFirst(\"0b\", tmpStr, \"\");\n if (tmpStr.matches(\"[0-1]+\") == false) {\n String msg = \"ERROR: Invalid BINARY characters in input => \" + tmpStr + \"\\n\";\n throw new UnsignedBigIntUtilsException(msg);\n }\n return (tmpStr);\n }",
"public Object visitBitwiseAndExpression(GNode n) {\n Object a, b, result;\n \n nonboolean = true;\n \n dostring = true;\n \n a = dispatch(n.getGeneric(0));\n b = dispatch(n.getGeneric(1));\n \n dostring = false;\n \n if (a instanceof Long && b instanceof Long) {\n result = (Long) a & (Long) b;\n }\n else {\n result = parens(a) + \" & \" + parens(b);\n }\n \n return result;\n }",
"@SuppressWarnings(\"unused\")\n\tprivate static void testFromStringToCompiledByteCode()\n\t{\n\t\tfinal String test = \"do end\";\n\t\tfinal int[] raw = compileFromRawString(test);\n\t\tfinal OpCodeMapper mapper = OpCodeMapper_v5_1.getInstance();\n\n\t\tfor (int i = raw.length - 1; i < raw.length; i++)\n\t\t{\n\t\t\tfinal int ByteCode = raw[i] & 0x3f;\n\t\t\tfinal AbstractOpCodes OpType = mapper.getOpCodeFor(ByteCode);\n\t\t\tfinal InstructionTypes instType = mapper.getTypeOf(OpType);\n\t\t\tfinal Instruction curInstruct;\n\n\t\t\tswitch (instType)\n\t\t\t{\n\t\t\t\tcase iABC:\n\t\t\t\t{\n\t\t\t\t\tcurInstruct = RawInstruction_iABC.parseFromRaw(raw[i], mapper);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase iABx:\n\t\t\t\t{\n\t\t\t\t\tcurInstruct = RawInstruction_iABx.parseFromRaw(raw[i], mapper);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase iAsBx:\n\t\t\t\t{\n\t\t\t\t\tcurInstruct = RawInstruction_iAsBx.parseFromRaw(raw[i], mapper);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t{\n\t\t\t\t\tthrow new IllegalArgumentException();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//System.out.println(curInstruct.toString() + \"\\r\\n\\r\\n\");\n\t\t}\n\t}",
"private String toBinary(byte caracter){\n byte byteDeCaracter = (byte)caracter;\n String binario=\"\";\n for( int i = 7; i>=0; i--){\n binario += ( ( ( byteDeCaracter & ( 1<<i ) ) > 0 ) ? \"1\" : \"0\" ) ;\n }\n return binario;\n }",
"private static boolean stringToBoolean(String value) {\n if (value.equals(\"1\")) {\n return true;\n }\n else {\n return false;\n }\n }",
"@Test\n\tpublic void testBooleanToString() {\n\n\t\t// forwards for yes and no\n\t\tAssert.assertEquals(converter.convertReverse(false), \"No\");\n\t\tAssert.assertEquals(converter.convertReverse(true), \"Yes\");\n\n\t}",
"@Override\n public String convertedText() {\n\n String input = mStringInputEditText.getText().toString();\n if (input.length() != 0) {\n String hexCode = String.format(\"%x\", new BigInteger(1, input.getBytes()));\n return mCheckBox.isChecked() ? hexCode.replaceAll(\"..(?!$)\", \"$0 \") : hexCode;\n } else {\n return \"\";\n }\n }",
"C11996a mo41085b(String str);",
"public char[] twosComplementNegate(char[] binaryStr) {\n\t\t// TODO: Implement this method.\n\t\treturn null;\n\t}",
"public static String toBinaryString(int number) {\r\n\t\tString result = \"\";\r\n\t\tint origin = Math.abs(number);\r\n\r\n\t\twhile (origin > 0) {\r\n\t\t\tif (origin % 2 == 0)\r\n\t\t\t\tresult = \"0\" + result;\r\n\t\t\telse\r\n\t\t\t\tresult = \"1\" + result;\r\n\t\t\torigin = origin / 2;\r\n\t\t}\r\n\t\twhile (result.length() < 16)\r\n\t\t\tresult = \"0\" + result;\r\n\r\n\t\tif (number > 0)\r\n\t\t\treturn result;\r\n\t\telse {\r\n\t\t\tString result2 = \"\";\r\n\t\t\tfor (int i = 0; i < result.length(); i++)\r\n\t\t\t\tresult2 += result.charAt(i) == '1' ? \"0\" : \"1\";\r\n\t\t\tchar[] result2Array = result2.toCharArray();\r\n\t\t\tfor (int i = result2Array.length - 1; i >= 0; i--)\r\n\t\t\t\tif (result2Array[i] == '0') {\r\n\t\t\t\t\tresult2Array[i] = '1';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} else\r\n\t\t\t\t\tresult2Array[i] = '0';\r\n\t\t\tresult2 = \"\";\r\n\t\t\tfor (int i = 0; i < result2Array.length; i++)\r\n\t\t\t\tresult2 += String.valueOf(result2Array[i]);\r\n\t\t\treturn result2;\r\n\t\t}\r\n\t}",
"public static boolean string2boolean(String str) {\r\n \tif (Constants.FALSE.equals(str)) {\r\n \t\treturn false;\r\n \t} else {\r\n \t\treturn true;\r\n \t}\r\n }",
"protected boolean stringToBoolean(String input) {\n if (input.equals(\"Y\")) {\n return true;\n }\n return false;\n }",
"@Test\n public void Test2x2Swaps()\n {\n AssertSwappedBitSetIs(StringToBitSet(\"1011\"), 0, 1, \"1101\", 2);\n }",
"public boolean canConvert(String s);",
"public Code(ArrayList<Boolean> bits)\n\t{\n\t\tthis.bits = bits;\n\t}",
"public static String writeBits(byte b) {\n\n StringBuffer stringBuffer = new StringBuffer();\n int bit = 0;\n\n for (int i = 7; i >= 0; i--) {\n\n bit = (b >>> i) & 0x01;\n stringBuffer.append(bit);\n\n }\n\n return stringBuffer.toString();\n\n }",
"private static byte[] string2Bytes(final String string) {\n if (string == null) return null;\n return string.getBytes();\n }",
"@Override\n\t\tpublic Boolean convert(String s) {\n\t\t\tString value = s.toLowerCase();\n\t\t\tif (\"true\".equals(value) || \"1\".equals(value) /* || \"yes\".equals(value) || \"on\".equals(value) */) {\n\t\t\t\treturn Boolean.TRUE;\n\t\t\t}\n\t\t\telse if (\"false\".equals(value) || \"0\".equals(value) /* || \"no\".equals(value) || \"off\".equals(value) */) {\n\t\t\t\treturn Boolean.FALSE;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new RuntimeException(\"Can not parse to boolean type of value: \" + s);\n\t\t\t}\n\t\t}",
"public String cleanTheBinString(String input) {\n String result = \"\";\n if (input != null && !input.isEmpty()) {\n\n for (int k = 0; k < input.length(); k++) {\n if (!(input.charAt(k) == '0' || input.charAt(k) == '1') || input.charAt(k) == ' ') {\n } else\n result = result + Character.toString(input.charAt(k));\n }\n\n }\n\n return result;\n }",
"String byteOrBooleanRead();",
"private Term parseBitwiseAnd(final boolean required) throws ParseException {\n Term t1 = parseAdd(required);\n while (t1 != null) {\n int tt = _tokenizer.next();\n if (tt == '&') {\n Term t2 = parseAdd(true);\n if ((t1.isI() && t2.isI()) || !isTypeChecking()) {\n t1 = new Term.AndI(t1, t2);\n } else {\n reportTypeErrorI2(\"'&'\");\n }\n } else {\n _tokenizer.pushBack();\n break;\n }\n }\n return t1;\n }",
"String byteOrBooleanWrite();",
"State mo5880e(String str);",
"private int convertstringtobyte(String string) {\n return Integer.parseInt(string, 16);\n }",
"abstract char[] parseFlags(String rawFlags);",
"private void sumbit(String ip){\n }",
"@SuppressWarnings({\"unchecked\", \"rawtypes\"})\n private void setStringValue(final String valueString) {\n // figure out the type of T and create object based on T=Integer, T=Double, T=Boolean, T=Valuable\n if (value instanceof List<?>) {\n List list = (List) get();\n list.clear();\n // remove start and end spaces\n String valueString2 = valueString.replaceAll(\"^\\\\s+\", \"\");\n valueString2 = valueString2.replaceAll(\"\\\\s+$\", \"\");\n // split into space-separated bits\n String[] valuesString = valueString2.split(\"\\\\s+\");\n for (int i = 0; i < valuesString.length; i++) {\n if (theClass.equals(Integer.class)) {\n list.add(new Integer(valuesString[i % valuesString.length]));\n } else if (theClass.equals(Double.class)) {\n list.add(new Double(valuesString[i % valuesString.length]));\n } else if (theClass.equals(Boolean.class)) {\n String str = valuesString[i % valuesString.length].toLowerCase();\n list.add(str.equals(\"1\") || str.equals(\"true\") || str.equals(\"yes\"));\n } else if (theClass.equals(String.class)) {\n list.add(new String(valuesString[i % valuesString.length]));\n }\n }\n return;\n }\n\n if (theClass.equals(Integer.class)) {\n setValue(new Integer(valueString));\n return;\n }\n if (theClass.equals(Double.class)) {\n \tsetValue(new Double(valueString));\n return;\n }\n if (theClass.equals(Boolean.class)) {\n final String valueString2 = valueString.toLowerCase();\n if (valueString2.equals(\"yes\") || valueString2.equals(\"true\")) {\n \tsetValue(Boolean.TRUE);\n return;\n } else if (valueString2.equals(\"no\") || valueString2.equals(\"false\")) {\n \tsetValue(Boolean.FALSE);\n return;\n }\n }\n if (theClass.equals(Function.class)) {\n \tfinal Function.Constant param = new Function.Constant(valueString);\n \tsetValue(param);\n param.getOutputs().add(BEASTObjectStore.INSTANCE.getBEASTObject(beastObject));\n return;\n }\n\n if (theClass.isEnum()) {\n \tif (possibleValues == null) {\n \t\tpossibleValues = (T[]) theClass.getDeclaringClass().getEnumConstants();\n \t}\n for (final T t : possibleValues) {\n if (valueString.equals(t.toString())) {\n \tsetValue(t);\n return;\n }\n }\n throw new IllegalArgumentException(\"Input 104: value \" + valueString + \" not found. Select one of \" + Arrays.toString(possibleValues));\n }\n\n // call a string constructor of theClass\n try {\n Constructor ctor;\n Object v = valueString;\n try {\n \tctor = theClass.getDeclaredConstructor(String.class);\n } catch (NoSuchMethodException e) {\n \t// we get here if there is not String constructor\n \t// try integer constructor instead\n \ttry {\n \t\tif (valueString.startsWith(\"0x\")) {\n \t\t\tv = Integer.parseInt(valueString.substring(2), 16);\n \t\t} else {\n \t\t\tv = Integer.parseInt(valueString);\n \t\t}\n \tctor = theClass.getDeclaredConstructor(int.class);\n \t\n \t} catch (NumberFormatException e2) {\n \t// could not parse as integer, try double instead\n \t\tv = Double.parseDouble(valueString);\n \tctor = theClass.getDeclaredConstructor(double.class);\n \t}\n }\n ctor.setAccessible(true);\n final Object o = ctor.newInstance(v);\n setValue(o);\n if (o instanceof BEASTInterface) {\n ((BEASTInterface) o).getOutputs().add(BEASTObjectStore.INSTANCE.getBEASTObject(beastObject));\n }\n } catch (Exception e) {\n throw new IllegalArgumentException(\"Input 103: type mismatch, cannot initialize input '\" + getName() +\n \"' with value '\" + valueString + \"'.\\nExpected something of type \" + getType().getName() +\n \".\\n\" + (e.getMessage() != null ? e.getMessage() : \"\"));\n }\n }",
"static StringBuilder xOrBits(StringBuilder original) {\n\n\t\tfor (int k = 0; k < CRCPOLY.length(); k++) {\n\t\t\tif (original.charAt(k) == CRCPOLY.charAt(k)) {\n\t\t\t\toriginal.replace(k, k + 1, \"0\");\n\t\t\t} else\n\t\t\t\toriginal.replace(k, k + 1, \"1\");\n\t\t}\n\n\t\treturn original;\n\t}",
"private void m81843b(String str) {\n if (this.f58083o) {\n if (C6969H.m41409d(\"G6F82D909BA\").equals(str)) {\n this.f58077i = true;\n m81851o();\n return;\n }\n this.f58077i = false;\n m81851o();\n } else if (C6969H.m41409d(\"G6F82D909BA\").equals(str)) {\n this.f58077i = true;\n m81851o();\n } else if (C6969H.m41409d(\"G7D91C01F\").equals(str)) {\n this.f58077i = false;\n m81851o();\n }\n }",
"String getIndexBits();",
"private static BitSet makeBitSet( int... args ) {\n\tBitSet result = new BitSet( MAX_OPCODE + 1 ) ;\n\tfor (int value : args )\n\t result.set( value ) ;\n\treturn result ;\n }",
"boolean[] bitwiseChangeList();",
"public static String decodeMessage(ArrayList<Boolean> data) {\n // get each group of 8 bits and assemble into a byte\n StringBuilder text = new StringBuilder();\n int counter = 0;\n for (int j=0; j<data.size()-11; j=j+9) {\n byte ascii = 0;\n for (int i = 0; i < 10; i++) {\n // DEBUG System.out.print(data.get(i+j) ? \"1\" : \"0\");\n if (data.get(i+j)) {\n ascii = set(ascii, i);\n }\n }\n\n if (!checkParity((int)ascii) == parityChecker.get(counter)) {\n text.append(\"[PARITY ERROR]\");\n } else {\n text.append(Character.toString((char) ascii));\n }\n\n\n // DEBUG System.out.println(\" \" + ascii + \" = \" + text);\n\n counter++;\n }\n return text.toString();\n }",
"public static BigInteger binaryToBI(String binStr) throws UnsignedBigIntUtilsException {\n BigInteger biResult = new BigInteger(UnsignedBigIntUtils.validateBinaryStr(binStr), 2);\n return biResult;\n }",
"private static String hex(String binStr) {\n\n\n\t\tString newStr = new String();\n\n\t\ttry {\n\t\t\tString hexStr = \"0123456789ABCDEF\";\n\t\t\tbyte[] p = binStr.getBytes();\n\t\t\tfor (int k = 0; k < p.length; k++) {\n\t\t\t\tint j = (p[k] >> 4) & 0xF;\n\t\t\t\tnewStr = newStr + hexStr.charAt(j);\n\t\t\t\tj = p[k] & 0xF;\n\t\t\t\tnewStr = newStr + hexStr.charAt(j) + \" \";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tlog.info(\"Failed to convert into hex values: \" + e);\n\t\t}\n\t\treturn newStr;\n\t}",
"public static String ReturnSet(BitSet bs, int size) {\n StringBuffer sb = new StringBuffer();\n for (int i = 0; i < size; i++) {\n String s1;\n if (bs.get(i) == true) {\n s1 = \"1\";\n } else {\n s1 = \"0\";\n }\n sb.append(s1);\n }\n return sb.toString();\n }"
] | [
"0.66984737",
"0.6483191",
"0.64235395",
"0.621255",
"0.62057835",
"0.6183111",
"0.6182281",
"0.6136546",
"0.6106903",
"0.5990568",
"0.58885336",
"0.5883836",
"0.5881793",
"0.587821",
"0.5874716",
"0.58272755",
"0.5818065",
"0.5807603",
"0.57982963",
"0.5739919",
"0.5638422",
"0.5632887",
"0.5598749",
"0.55926216",
"0.5569995",
"0.5524802",
"0.54671484",
"0.54647386",
"0.54483515",
"0.5438673",
"0.5428123",
"0.540549",
"0.5387872",
"0.53857046",
"0.53720295",
"0.53699714",
"0.5346251",
"0.5320511",
"0.53182656",
"0.529443",
"0.5290929",
"0.5283178",
"0.5276742",
"0.52742755",
"0.52526164",
"0.52176",
"0.52158725",
"0.51980937",
"0.5185419",
"0.5184983",
"0.51838493",
"0.5171759",
"0.5169408",
"0.51440024",
"0.51425135",
"0.51386535",
"0.5132968",
"0.5119957",
"0.5097484",
"0.50971794",
"0.5090065",
"0.5075255",
"0.5071734",
"0.5064394",
"0.5058823",
"0.5050875",
"0.5048895",
"0.502497",
"0.5019845",
"0.5004544",
"0.4993761",
"0.49817187",
"0.4979034",
"0.49747214",
"0.49658582",
"0.4958199",
"0.49518773",
"0.49511978",
"0.49462882",
"0.4943016",
"0.49428865",
"0.49417403",
"0.49397132",
"0.4928515",
"0.49144006",
"0.4911129",
"0.49083206",
"0.49069473",
"0.4903173",
"0.4891159",
"0.48874804",
"0.48832294",
"0.48752075",
"0.48646456",
"0.48571953",
"0.485093",
"0.48471126",
"0.4845085",
"0.4820783",
"0.48201334"
] | 0.7399548 | 0 |
Entry point into the program. | public static void main(String... strings) {
final MipsComputer comp = new MipsComputer();
File f = new File(filePath);
if (f.exists() && !f.isDirectory()) {
comp.setFromMars(true);
readInstructionsFromFile(f, comp);
} else {
comp.setFromMars(false);
readInstructionsFromArray(comp);
}
comp.execute();
comp.print();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void main() {\n \n }",
"public static void main()\n\t{\n\t}",
"public static void main(){\n\t}",
"public static void main() {\n }",
"public static void main(String[] args){\n\n MyApp myApp = new MyApp(); //1\n myApp.runMyApp(); //2\n System.out.println(\"End of Program\"); //3\n }",
"public static void main(String... args) {\n doMain().run();\n }",
"public static void main (String[]args) throws IOException {\n }",
"public static void main(String[] args) {\r\n// Use for unit testing\r\n }",
"public static void main (String []args){\n }",
"public static void main(String[] args) {\n \n \n \n\t}",
"public static void main(String[] args) throws IOException{\n\t\trunProgram();\n\t}",
"public static void main(String[] args) {\n \n \n \n \n }",
"public static void main(String[] args) {\n \n\n }",
"public static void main(String[]args) {\n\t\n\t\t\n\n}",
"public static void main(String[] args) {\n\t \t\n\t \t\n\t }",
"public static void main(String[] args) {}",
"public static void main(String[] args) {}",
"public void runProgram()\n\t{\n\t\tintro();\n\t\tfindLength();\n\t\tguessLetter();\n\t\tguessName();\n\t}",
"public static void main(String[] args) {\n //launch it\n launch();\n }",
"public static void main(String []args){\n\n }",
"public static void main (String[] args) {\r\n\t\t \r\n\t\t}",
"public void main(){\n }",
"public static void main(String[] args) {\n \n }",
"public static void main(String[] args) {\n \n }",
"public static void main(String[] args) {\n \n }",
"public static void main(String[] args) {\n \n }",
"public static void main(String[] args) {\n \n }",
"public static void main(String[] args) {\n \n }",
"public static void main(String[] args) {\n // TODO code application logic here\n // some testing? or actually we can't run it standalone??\n }",
"public static void main(String[] args) {\n \n \n }",
"public static void main(String[] args) {\n \n \n }",
"public static void main(String[] args) {\r\n \r\n }",
"public static void main(String[] args) {\r\n \r\n }",
"public static void main(String []args){\n }",
"public static void main(String []args){\n }",
"public static void main(String[] args) {\n init();\n runIterator();\n Scanner scanner = new Scanner(System.in);\n runApplication(scanner);\n }",
"public static void main(String[] args) {\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}",
"public static void main(String[] args) {\n \r\n\t}",
"public Main() {\r\n\t\tsuper();\r\n\t\tinitialize();\r\n\r\n\t}",
"public static void main(String[] args) {\n \n }",
"public static void main(String[] args) {\n launch(args);\r\n \r\n }",
"public static void main(String[] args){\n\t\t\n\t\t\n \t}",
"public static void main (String[] args) {\n\t\t\n\t}",
"public static void main(String[] args) {\n \n\t}",
"public static void main(String[] args) {\n new Main().run();\n }",
"static void main(String[] args)\n {\n }",
"public Main() {\n \n \n }",
"static void main(String[] args) {\n }",
"public static void main (String args[]) {\n\t\t\n }",
"public static void main(String[] args) {\n Run();\n }",
"public static void main(String[] args){\n\t\tInitializeProgram startProgram = new InitializeProgram();\n\t\tstartProgram.runProgram();\n\t}",
"public static void main(String[] args) throws IOException {\n \t\n }",
"public static void main (String[] args) {\n launch(args);\n }",
"public static void main(String[] args) {\n\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}",
"public static void main(String[] args) {\n\r\n Starter starter = new Starter();\r\n starter.start();\r\n\r\n\r\n }",
"public static void main(String[] args) {\n \n\t}",
"public static void main(String[] args) {\n\t \t\n\t \t\n\t}",
"public static void main(String[] args) {\n\n\t\t\n\t\t\n\t}",
"public static void main(String[] args) {\n \n\t\t}",
"public static void main(String args[]) throws Exception\n {\n \n \n \n }",
"public static void main(String args[]) throws IOException {\r\n\t\t\r\n\t}",
"public static void main(String arg[]) {\n\n\t\tUtility.runApplication();\n\t}",
"public static void main(String[] args) {\n\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\t\r\n\t}",
"public static void main(String[] args) {\n\t\t\r\n\t}",
"public static void main(String[] args) {\n\t\t\r\n\t}",
"public static void main(String[] args) {\n\t\t\r\n\t}",
"public static void main(String[] args) {\n\t\t\r\n\t}",
"public static void main(String[] args) {\n\t\t\r\n\t}",
"public static void main(String[] args) {\n\t\t\r\n\t}",
"public static void main(String[] args) {\n\t\t\r\n\t}",
"public static void main(String[] args) {\n\t\t\r\n\t}",
"public static void main(String argv[]) {\n\n\n\n\t}",
"public static void main( String[] args )\n\t{\n\t\trunApp();\n\t}",
"public static void main(String[] args) \n {\n\t \n\t \n\t \n}",
"public static void main(String[] args) {\n\t\t\r\n\t\t\r\n\r\n\t}",
"public static void main(String[] args) {\t}",
"public static void main(String[] args) {\n\t\t\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\t\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\t\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\t\n\t\t\n\t}",
"public static void main(String[] args) { }",
"public Main() {\n\t\tsuper();\n\t}",
"public static void main(String[] args) {\t\n\t\t\n\t}",
"public static void main(String[] args) {\r\n\t\t\r\n\t\t\r\n\t}",
"public static void main(String[] args) {\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\t\n\t}"
] | [
"0.7761774",
"0.76646066",
"0.7555626",
"0.75300765",
"0.7324681",
"0.7312442",
"0.7277643",
"0.7264781",
"0.7225461",
"0.7205256",
"0.7191637",
"0.71787584",
"0.7168591",
"0.71482104",
"0.71448934",
"0.7136887",
"0.7136887",
"0.7124166",
"0.7119622",
"0.71029055",
"0.70892817",
"0.7085138",
"0.7079237",
"0.7079237",
"0.7079237",
"0.7079237",
"0.7079237",
"0.7079237",
"0.70687705",
"0.7064348",
"0.7064348",
"0.70638764",
"0.70638764",
"0.70630896",
"0.70630896",
"0.7062821",
"0.7060576",
"0.7060576",
"0.7055292",
"0.7040641",
"0.7036202",
"0.70315164",
"0.702669",
"0.70209503",
"0.70122176",
"0.700411",
"0.7003503",
"0.7000335",
"0.69966435",
"0.6990001",
"0.69893956",
"0.6986993",
"0.6981434",
"0.69787866",
"0.6976455",
"0.6975257",
"0.69731295",
"0.697151",
"0.69671625",
"0.6966803",
"0.69541436",
"0.6953448",
"0.6952945",
"0.6949869",
"0.6946767",
"0.6946767",
"0.6946767",
"0.6946767",
"0.6946767",
"0.6946767",
"0.6946767",
"0.6946767",
"0.6946767",
"0.69409263",
"0.6939022",
"0.693706",
"0.69328666",
"0.6931713",
"0.69312775",
"0.69312775",
"0.69312775",
"0.69312775",
"0.6929428",
"0.6929179",
"0.69265735",
"0.6919848",
"0.6917699",
"0.6917699",
"0.6917699",
"0.6917699",
"0.6917699",
"0.6917699",
"0.6917699",
"0.6917699",
"0.6917699",
"0.6917699",
"0.6917699",
"0.6917699",
"0.6917699",
"0.6917699",
"0.6917699"
] | 0.0 | -1 |
Method used to load computer with instructions that are found in the given file. | public static void readInstructionsFromFile(final File file, final MipsComputer comp) {
System.out.println("Loading instructions from file...");
final Scanner s;
try {
s = new Scanner(file);
while(s.hasNextLine()){
comp.loadInstruction(convertToBitString(s.nextLine().replaceAll("\\s", "")));
}
} catch (final IOException e) {
e.printStackTrace();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Interpreter(String fileName) throws FileNotFoundException {\n super(fileName);\n instructionsStack.push(new ArrayList<>());\n }",
"public void readInstFromFile(int exeCycle, String fileName){\n\t\ttry (FileReader fp = new FileReader(fileName)) {\n\t\t\tBufferedReader lineReader = new BufferedReader(fp);\n\t\t\tinstructions = new ArrayList<>();\n\t\t\textraCycle += exeCycle;\n\t\t\tint instrCount = 0;\n\t\t\tString line;\n\t\t\t//readline untill new line found\n\t\t\tfor(int i=0; (line = lineReader.readLine()) != null; i++){\n\t\t\t\tline = line.replaceAll(\"[\\\\,\\\\#]\",\"\"); //regex to remove commas in the instructions\n\t\t\t\tString[] instParts = line.split(\" \");\n\t\t\t\tInstructionStructure inst = new InstructionStructure();\n\t\t\t\tinst.setInst_number(instrCount); //set the instruction number which helps in execution order \n\t\t\t\tinstrCount += 1;\n\t\t\t\tinstructions.add(inst);\n\t\t\t\tinst.setLogicOpSign(instParts[0]);\n\t\t\t\tinst.setStage(\"Read\"); \n\t\t\t\t//Based on the operation available instructions \n\t\t\t\t// the instructions is split and assign to the Instruction structure POJO\n\t\t\t\tswitch(instParts[0]){\n\t\t\t\t\tcase \"ADD\":\n\t\t\t\t\tcase \"SUB\":\n\t\t\t\t\tcase \"AND\":\n\t\t\t\t\tcase \"OR\":\n\t\t\t\t\tcase \"EXOR\":\n\t\t\t\t\tcase \"MUL\":\n\t\t\t\t\t\tinst.setDest(instParts[1]);\n\t\t\t\t\t\tinst.setSrc1(instParts[2]);\n\t\t\t\t\t\tinst.setSrc2(instParts[3]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"MOVC\":\n\t\t\t\t\t\tinst.setDest(instParts[1]);\n\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\tint literal = Integer.parseInt(instParts[2]);\n\t\t\t\t\t\t\tinst.setLiteral(literal);\n\t\t\t\t\t\t\tinst.decodedSrc1 = literal;\n\t\t\t\t\t\t}catch(Exception e){\n\t\t\t\t\t\t\tinst.setSrc1(instParts[2]);\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"BZ\":\n\t\t\t\t\tcase \"BNZ\":\n\t\t\t\t\t\tInstructionStructure lastInst = instructions.get(i-1); // getting the previous instruction in pipeline\n\t\t\t\t\t\tif(lastInst != null){\n\t\t\t\t\t\t\tint literal2 = Integer.parseInt(instParts[1]);\n\t\t\t\t\t\t\tinst.setSrc1(lastInst.getDest()); // set previous instruction destination register as source\n\t\t\t\t\t\t\tinst.setLiteral(literal2);\n\t\t\t\t\t\t\tinst.decodedSrc2 = literal2;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tSystem.out.println(\"Branch without any last Instruction\");\n\t\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"JUMP\":\n\t\t\t\t\t\tinst.setSrc1(instParts[1]);\n\t\t\t\t\t\tint literal3 = Integer.parseInt(instParts[2]);\n\t\t\t\t\t\tinst.setLiteral(literal3);\n\t\t\t\t\t\tinst.decodedSrc2 = literal3;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"STORE\":\n\t\t\t\t\t\tinst.setSrc1(instParts[1]);\n\t\t\t\t\t\tinst.setSrc2(instParts[2]);\n\t\t\t\t\t\tint literal = Integer.parseInt(instParts[3]);\n\t\t\t\t\t\tinst.setLiteral(literal);\n\t\t\t\t\t\tinst.decodedDest = literal;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"LOAD\":\n\t\t\t\t\t\tinst.setDest(instParts[1]);\n\t\t\t\t\t\tinst.setSrc1(instParts[2]);\n\t\t\t\t\t\tint literal1 = Integer.parseInt(instParts[3]);\n\t\t\t\t\t\tinst.setLiteral(literal1);\n\t\t\t\t\t\tinst.decodedSrc2 = literal1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlineReader.close();\n\t\t\t//check the looping cycle(extracycle) with in cycle limit\n\t\t\twhile (extraCycle >= cycles){\n\t\t\t\tInstructionExecution instructionExecution = new InstructionExecution();\n\t\t\t\tMap<String, InstructionStructure> pipelineStatus = ApexSimulatorHelper.INSTANCE.getPipelineStatus();\n\t\t\t\tnew StageExecution().ExeInstructionInStages();\n\n\t\t\t\tif(pipelineStatus.get(\"WB\") != null ){\n\t\t\t\t\tInstructionStructure instr = pipelineStatus.get(\"WB\");\n\t\t\t\t\tString destRegister = instr.getDest();\n\t\t\t\t\tRegisterHandler registerOp = ApexSimulatorHelper.INSTANCE.getRegister(destRegister);\n\t\t\t\t\tRegisterHandler PSWreg = ApexSimulatorHelper.INSTANCE.getRegister(\"PSW\");\n\n\t\t\t\t\tif(registerOp != null){\n\t\t\t\t\t\tregisterOp.setStatus(false);\n\t\t\t\t\t}\n\t\t\t\t\tif(instr.isCurrentValue()){\n\t\t\t\t\t\tregisterOp.setValue(instr.getResult());\n\t\t\t\t\t\tif(!instr.getLogicOpSign().equals(\"MOVC\")){\n\t\t\t\t\t\t\tif(instr.getResult() == 0){\n\t\t\t\t\t\t\t\tPSWreg.setValue(1); // set psw zero flag because the computed result is 0.\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tPSWreg.setValue(0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(pipelineStatus.get(\"MEM\") != null){\n\t\t\t\t\tInstructionStructure instr = pipelineStatus.get(\"MEM\");\n\t\t\t\t\tinstructionExecution.ExecuteInstr(instr);\n\t\t\t\t\tswitch(instr.getLogicOpSign()){\n\t\t\t\t\t\tcase \"LOAD\":\n\t\t\t\t\t\t\tif(instr.getDest() != null){\n\t\t\t\t\t\t\t\tRegisterHandler destination = ApexSimulatorHelper.INSTANCE.getRegister(instr.getDest());\n\t\t\t\t\t\t\t\tdestination.setStatus(true);\n\t\t\t\t\t\t\t\tint src1 = instr.decodedSrc1;\n\t\t\t\t\t\t\t\tint literal = instr.decodedSrc2;\n\t\t\t\t\t\t\t\tint address = src1 + literal;\n\t\t\t\t\t\t\t\tdestination.setValue(memoryOp.get(address));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"STORE\":\n\t\t\t\t\t\t\tif(instr.getSrc2()!=null){\n\t\t\t\t\t\t\t\tint lit = instr.decodedDest;\n\t\t\t\t\t\t\t\tint src1 = instr.decodedSrc1;\n\t\t\t\t\t\t\t\tint dest1 = instr.decodedSrc2;\n\t\t\t\t\t\t\t\tint address = dest1 + lit;\n\t\t\t\t\t\t\t\tmemoryOp.set(address, src1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(pipelineStatus.get(\"MUL1\") != null){\n\t\t\t\t\tInstructionStructure instr = pipelineStatus.get(\"MUL1\");\n\t\t\t\t\tinstructionExecution.ExecuteInstr(instr);\n\t\t\t\t\tinstructionExecution.Mul1Execution(instr);\n\t\t\t\t}\n\t\t\t\tif(pipelineStatus.get(\"MUL2\") != null){\n\t\t\t\t\tInstructionStructure instr = pipelineStatus.get(\"MUL2\");\n\t\t\t\t\tinstructionExecution.ExecuteInstr(instr);\n\t\t\t\t\tinstructionExecution.Mul2Execution(instr);\n\t\t\t\t}\n\t\t\t\tif(pipelineStatus.get(\"IFU\") != null){\n\t\t\t\t\tInstructionStructure instr = pipelineStatus.get(\"IFU\");\n\t\t\t\t\tinstructionExecution.ExecuteInstr(instr);\n\t\t\t\t\tinstructionExecution.IntegerFUExecution(instr);\n\t\t\t\t}\n\t\t\t\tif(pipelineStatus.get(\"DECODE\") != null){\n\t\t\t\t\tInstructionStructure instr = pipelineStatus.get(\"DECODE\");\n\t\t\t\t\tString src1 = instr.getSrc1();\n\t\t\t\t\tString src2 = instr.getSrc2();\n\t\t\t\t\tif(src1 != null){\n\t\t\t\t\t\tif(!ApexSimulatorHelper.INSTANCE.getRegister(src1).isStatus()){\n\t\t\t\t\t\t\tinstr.decode_source1();\n\t\t\t\t\t\t\tif(src2 != null){\n\t\t\t\t\t\t\t\tif(!ApexSimulatorHelper.INSTANCE.getRegister(src2).isStatus()){\n\t\t\t\t\t\t\t\t\tinstr.setStage(\"ready\");\n\t\t\t\t\t\t\t\t\tinstr.decode_source2();\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\tinstr.setStage(\"stalled\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tinstr.setStage(\"ready\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tinstr.setStage(\"stalled\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\tinstr.setStage(\"ready\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tApexSimulatorHelper.INSTANCE.printState();\n\t\t\t\tcycles += 1;\n\t\t\t\tStageExecution stageExecution = new StageExecution();\n\t\t\t\tif(!stageExecution.allInstructionsExecuted()){\n\t\t\t\t\tif(cycles > extraCycle){\n\t\t\t\t\t\tApexSimulatorHelper.INSTANCE.printArchState();\n\t\t\t\t\t\tSystem.out.println(\"Do you want to Simulate for some more cycles?Y/N\");\n\t\t\t\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\t\t\t\tif(br.readLine().equalsIgnoreCase(\"Y\")){\n\t\t\t\t\t\t\tSystem.out.println(\"Please enter the number of cycles you want to simulate more\");\n\t\t\t\t\t\t\textraCycle = extraCycle + Integer.parseInt(br.readLine());\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tApexSimulatorHelper.INSTANCE.actualCycle = cycles;\n\t\t\t\t\t\t\tcycles = 1;\n\t\t\t\t\t\t\tStageExecution.pc = 4000;\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tApexSimulatorHelper.INSTANCE.actualCycle = cycles; \n\t\t\t\t\tApexSimulatorHelper.INSTANCE.printArchState();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}catch (Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"private void loadSpaceObjects(String file){\n\t\ttry{\n\t\t\tFileReader fr = new FileReader(file);\n\t\t\tBufferedReader br = new BufferedReader(fr);\n\t\t\tScanner sc = new Scanner(br);\n\t\t\t\n\t\t\tloadFactory(sc);\n\t\t\tloadPlanets(sc);\n\n\t\t\tsc.close();\n\t\t\tbr.close();\n\t\t\tfr.close();\n\t\t\t\t\n\t\t}catch(Exception e){\n\t\t\tSystem.out.println(\"File not found: SpaceProgramPlanets.txt\");\n\t\t}\n\t}",
"static void loadProgram(String assemblyProgramFile)\n\t{\n\t\t\n\t\tMainMemory mainmemory = Simulator.processor.getMainMemory();\n\t int currMemLocation=0;\n\t \n\t\ttry\n\t\t {\n\t\t DataInputStream instr = \n\t\t new DataInputStream(\n\t\t new BufferedInputStream(\n\t\t new FileInputStream( assemblyProgramFile ) ) );\n\t\t \t\n\t\t int instruction;\n\t\t Boolean pcSet=false;\n\t\t processor.getRegisterFile().setValue(0, 0);\n\t\t processor.getRegisterFile().setValue(1, 65535);\n\t\t processor.getRegisterFile().setValue(2, 65535);\n\n\t\t \n\t\t while(true) {\n\t\t\t try {\n\t\t\t \t instruction = instr.readInt();\n\t\t\t \t if(pcSet==false) {\n\t\t\t \t\t processor.getRegisterFile().setProgramCounter(instruction);\n\t\t\t \t\t processor.getEX_IF_Latch().setBranchPC(instruction);\n\t\t\t \t\t System.out.println(\"Simulator - pc set to \"+instruction);\n\t\t\t \t\t pcSet=true;\n\t\t\t \t }else {\n\t\t\t \t\t mainmemory.setWord(currMemLocation, instruction);\n\t\t\t \t\t currMemLocation++;\n\t\t\t \t }\n\t\t\t \t \n\t\t\t }\n\t\t\t catch(EOFException e) {\n\t\t\t \t break;\n\t\t\t }\n\t\t }\n\t\t \n\t\t instr.close();\n\t\t }\n\t\t catch ( IOException iox )\n\t\t {\n\t\t System.out.println(\"Problem reading \" + assemblyProgramFile );\n\t\t }\n\t\t\n\t\tSystem.out.println(mainmemory.getContentsAsString(0,currMemLocation+10));\n\t}",
"public void loadMemory(String inputFile){\n\t\tint pc = 0;\n\t\ttry{\n\t\t\tRandomAccessFile raf = new RandomAccessFile(new File(inputFile),\"rw\");\n\t\t\tString strLine;\n\t\t\tint decimalNumber;\n\t\t\twhile ((strLine = raf.readLine())!=null){\n\t\t\t\tstrLine = strLine.substring(0, 8); //get the first 8 char(hex instruction)\n\t\t\t\tdecimalNumber = new BigInteger(strLine, 16).intValue(); //decode the hex into integer\n\t\t\t\tloadInstructionInMemory(pc, decimalNumber);\n\t\t\t\tpc += 4;\n\t\t\t}\n\t\t\traf.close();\n\t\t}\n\t\tcatch (Exception e){\n\t\t\tSystem.out.println(\"Error:\");\n\t\t\tSystem.out.println(e.getMessage());\n\t\t\tSystem.exit(0);\n\t\t}\n\t}",
"void load(File file);",
"public void load (File file) throws Exception;",
"public static void main(String... strings) {\n\t\t\n\t\tfinal MipsComputer comp = new MipsComputer();\n\t\t\n\t\tFile f = new File(filePath);\n\t\tif (f.exists() && !f.isDirectory()) {\n\t\t\tcomp.setFromMars(true);\n\t\t\treadInstructionsFromFile(f, comp);\n\t\t} else {\n\t\t\tcomp.setFromMars(false);\n\t\t\treadInstructionsFromArray(comp);\n\t\t}\n\t\t\n\t\tcomp.execute();\n\t\tcomp.print();\n\t}",
"public SimpleRuntimeMachine(String fileName) {\n\t\tram = new int[RAM_CAPACITY];\n\t\tprogramStack = new Stack<String>();\n\t\tprocessCommands(fileName);\n\t}",
"public boolean load(String file);",
"default void load(String file) {\n load(new File(file));\n }",
"public void loadInstructionInMemory(int pc, int decimalNumber){\n\t\tif (pc % 4 != 0){\n\t\t\tSystem.out.println(\"Wrong number for PC\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t\tmemory[(pc / 4)] = decimalNumber;\n\t}",
"public Cmdline(String file) {\n \n try {\n File selectedFile = new File(file);\n Model m = loadModel( selectedFile );\n if( m != null )\n models.add( m );\n } catch (FileNotFoundException fnfe) {\n System.out.println(\"File not found\");\n } catch( ParseException pe ) {\n System.out.println(\"Parse Error: \" + pe.getMessage());\n } catch( LemException le ) {\n System.out.println(\"Parse Error: \" + le.getMessage());\n } catch( IOException ioe ) {\n System.out.println(\"I/OO Error: \" + ioe.getMessage());\n }\n \n/* metamodel.Procedure p = m.getDomain( \"Publications\" ).getClass( \"Manuscript\" ).getStateMachine().getState(\"Adding\").getProcedure();\n runtime.ModelInstance i = new runtime.ModelInstance();\n \n p.execute(i); */\n }",
"private void loadScheme(File file)\n\t{\n\t\tString name = file.getName();\n\n\t\ttry\n\t\t{\n\t\t\tBedrockScheme particle = BedrockScheme.parse(FileUtils.readFileToString(file, Charset.defaultCharset()));\n\n\t\t\tthis.presets.put(name.substring(0, name.indexOf(\".json\")), particle);\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public void loadSaveGameFromFile(File file) {\r\n\t\t//TODO\r\n\t}",
"public void loadFromFile(String file) throws IOException {\n loadFromFile(file,DEFAULT_CHAR_SET);\n }",
"public void load(File source);",
"private void loadNeighbours(String file){\n\t\tString neighbour = null;\n\t\ttry{\n\t\t\tFileReader fr = new FileReader(file);\n\t\t\tBufferedReader br = new BufferedReader(fr);\n\t\t\tScanner sc = new Scanner(br);\n\t\t\t\n\t\t\twhile(sc.hasNextLine()){\n\t\t\t\tString planetName = sc.nextLine();\n\t\t\t\tneighbour = sc.nextLine();\n\t\n\t\t\t\twhile(!(neighbour.equals(\"#\"))){\n\t\t\t\t\ttry{\n\t\t\t\t\t\tString split [] = neighbour.split(\",\");\n\t\t\t\t\t\tasignNeighbours(split, planetName);\n\t\t\t\t\t\t\n\t\t\t\t\t}catch(Exception e){\n\t\t\t\t\t\tSystem.out.println(\"Data can't be loaded\");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t\tneighbour = sc.nextLine();\n\t\t\t\t}\n\t\t\t}\n\t\t\tsc.close();\n\t\t\tbr.close();\n\t\t\tfr.close();\n\t\t\t\n\t\t}catch(Exception e){\n\t\t\tSystem.out.println(\"File not found: SpaceProgramNeghbours.txt\");\n\t\t}\n\t}",
"public static void loadProgram() throws Exception{\n\t\t\n\t\tInteger instructionNumber = 0; \n\t\t\n\t\ttry {\n\t\t\tScanner scanner = new Scanner(new File(ramProgram));\n\t\t\twhile (scanner.hasNext()){\n\t\t\t\tString next = scanner.nextLine();\n\t\t\t\tnext = next.trim();\n\t\t\t\tString [] array = next.split(\"\\\\s+\");\n\t\t\t\t\n\t\t\t\tif (next.startsWith(\"#\") || next.isEmpty()){\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t\n\t\t\t\t\tif (array[0].endsWith(\":\")){\n\t\t\t\t\t\ttagList.add(new Tag(array[0], instructionNumber));\n\t\t\t\t\t\t\n\t\t\t\t\t\tswitch (array.length){\n\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\tthrow new Exception(\"Error en la etiqueta:\" + array[0] + \". Línea: \" + getLine(next));\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\tprogramMemory.add(new Instruction(array[1], \"\", getLine(next)));\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\tprogramMemory.add(new Instruction(array[1], array[2], getLine(next)));\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tthrow new Exception(\"Error en la instrucción: \" + array[0] + \". Línea: \" + getLine(next));\n\t\t\t\t\t\t\t\t\n\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\tswitch (array.length){\n\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\tprogramMemory.add(new Instruction(array[0], \"\", getLine(next)));\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\tprogramMemory.add(new Instruction(array[0], array[1], getLine(next)));\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tthrow new Exception(\"Error en la instrucción: \" + array[0] + \". Línea: \" + getLine(next));\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tinstructionNumber++;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tscanner.close();\n\t\t} \n\t\tcatch (FileNotFoundException e) {\n\t\t\n\t\t}\n\t}",
"public void loadMem(final File file) {\r\n TempMem.clearNamdAddresses();\r\n TempMem.setText(Input.loadFile(file));\r\n }",
"private void loadAssembly () {\r\n Factory assemblyFactory = new AssemblyFactory(mySimulation);\r\n int response = INPUT_CHOOSER.showDialog(null, \"Assembly file\");\r\n if (response == JFileChooser.APPROVE_OPTION) {\r\n assemblyFactory.loadFile(INPUT_CHOOSER.getSelectedFile());\r\n }\r\n }",
"public void load (IFile file) throws Exception;",
"public boolean loadGame(File file){\n\t\treturn true;\n\t}",
"public void executeLoad(){\n\t\tBitString destBS = mIR.substring(4, 3);\n\t\tBitString pcOffset = mIR.substring(7, 9);\n\t\tBitString wantedVal = mMemory[mPC.getValue() + pcOffset.getValue2sComp()];\n\t\tmRegisters[destBS.getValue()] = wantedVal;\n\n\t\tsetConditionalCode(wantedVal);\n\t\t//now I just need to set the conditional codes.\n\t}",
"private void loadDescriptor(File descriptorFile) throws IOException, InvalidXMLException,\n ResourceInitializationException {\n XMLInputSource in = new XMLInputSource(descriptorFile);\n ResourceSpecifier specifier = UIMAFramework.getXMLParser().parseResourceSpecifier(in);\n ResourceManager manager = UIMAFramework.newDefaultResourceManager();\n\n this.ae = UIMAFramework.produceAnalysisEngine(specifier, manager, null);\n this.cas = this.ae.newCAS();\n\n }",
"Map<String, Equation> compile(File file) throws IOException;",
"public Memory(String file) {\n\t\tfor(int i=0; i < Constants.MEM_SIZE; ++i){\n\t\t\tmemory[i] = 0;\n\t\t}\n\t\tinstructions = new FileProcessor(file).fetchInstructions();\n\t}",
"void load(final File file) {\n this.file = Preconditions.checkNotNull(file);\n this.gameModelPo = gameModelPoDao.loadFromFile(file);\n visibleAreaService.setMapSize(getMapSize());\n initCache();\n }",
"public static void load(File file) throws IOException {\n while (LogicManager.isUpdating()) {} // wait until current update has finished\n\n LogicManager.setPaused(true);\n\n // clear current scene\n GridManager.clearScene();\n\n // open input stream\n ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(new FileInputStream(file)));\n\n try {\n // load viewport data\n Point viewport = (Point) in.readObject();\n int scaling = (Integer) in.readObject();\n Window.getCurrentInstance()\n .getGameDisplay()\n .setViewport(viewport);\n Window.getCurrentInstance()\n .getGameDisplay()\n .setScaling(scaling);\n SwingUtilities.invokeLater(() -> {\n Window.getCurrentInstance()\n .getGameDisplay()\n .revalidate();\n Window.getCurrentInstance()\n .getGameDisplay()\n .repaint();\n });\n\n // load point data\n Point[] data;\n data = (Point[]) in.readObject();\n GridManager.loadScene(data);\n } catch (ClassNotFoundException e) {\n in.close();\n throw new IOException(\"File contains illegal data\");\n }\n in.close();\n }",
"public void load(String file){\n try{\n Scanner sc = new Scanner(new FileReader(file));\n ArrayList <String> saving = new ArrayList<String>();\n boolean line = sc.hasNext();\n while(line ==true ){\n String x = sc.next();\n if(!(x.contains(\"CO\")||x.contains(\"CB\"))){\n saving.add(x);\n line = sc.hasNext();\n }\n }\n sc.close();\n setValues(saving);\n }catch(IOException e){\n JOptionPane.showMessageDialog(null, \"error in reading file\", \"Error\",\n JOptionPane.ERROR_MESSAGE);\n }\n }",
"public void\tload(String fileName) throws IOException;",
"public void actionPerformed(ActionEvent e){\n\t\t\tInputStream f = getClass().getResourceAsStream(\"/LoadTXT.txt\");\n\t\t\tboolean isFirst = true;\n\t\t\tBufferedReader reader = null;\n\t\t\ttry {\n\t\t\t\treader = new BufferedReader(new InputStreamReader(f));\n\t\t\t\tString Ins = null;\n\t\t\t\tint line = 1;\n\t\t\t\t//Read the file line by line and split the line into two parts by symbol \",\"\n\t\t\t\twhile ((Ins = reader.readLine()) != null) {\n\t\t\t\t\tString[] str = Ins.split(\",\");\n\t\t\t\t\tint index = Integer.parseInt(str[0]);\t\t\t\t\t\n\t\t\t\t\tShort con = Integer.valueOf(str[1],2).shortValue();\n\t\t\t\t\tif(isFirst){\n\t\t\t\t\t\tcpu.setPc((short) index);\n\t\t\t\t\t\tisFirst=false;\n\t\t\t\t\t}\n\t\t\t\t\tcpu.setMem(con, index);\t\t\t\t\t\n\t\t\t\t\tline++;\n\t\t\t\t}\n\t\t\t\treader.close();\n\t\t\t} catch (IOException ex) {\n\t\t\t\tex.printStackTrace();\n\t\t\t} finally {\n\t\t\t\tif (reader != null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\treader.close();\n\t\t\t\t\t} catch (IOException e1) {\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\tSystem.out.println(\"The PC value is: \");\n\t\t\tSystem.out.println(cpu.getPc());\n\t\t\t//Call the function to show the data on the screen\n\t\t\tShowData();\n\t\t}",
"public void load(File file) throws IOException {\n FileReader reader = new FileReader(file); //new File Reader\r\n char str[] = new char[10000]; //create a character string array of 10000 values\r\n reader.read(str);//read the file\r\n boolean temp[][] = new boolean[100][100]; //create a temporary new colony\r\n for (int r = 0; r < 100; r++) { //iterate through to fill with values\r\n for (int c = 0; c < 100; c++) {\r\n if (str[r*100 + c] == '1') { //if the char is equal to one, cell is alive\r\n temp[r][c] = true;\r\n } else {\r\n temp[r][c] = false; //else, the cell is dead\r\n }\r\n }\r\n }\r\n grid = temp;\r\n }",
"public void assemble(String filePath) throws Exception {\n\n System.out.println(\"Starting\");\n System.out.println(\"Loading Parser . . .\");\n File inputFile= new File(filePath);\n Parser parser = new Parser(inputFile);\n\n System.out.println(\"Loading SymbolTable . . . \");\n SymbolTable symbolTable = new SymbolTable();\n\n System.out.println(\"Parser first pass . . . \");\n parser.firstPass(symbolTable);\n System.out.println(\"Parser second pass . . . \");\n parser.secondPass(symbolTable);\n\n System.out.println(\"Complete\");\n\n }",
"public void readFile(String file)\n\t{\t\n\t\tfindPieces(file);\n\t}",
"private void loadGame(String fileName){\n\n }",
"public void load(String filePath){\r\n File loadFile = new File(filePath);\r\n if (!loadFile.exists()){\r\n System.out.println(\"I failed. There are no saved games.\");\r\n return;\r\n }\r\n FileInputStream fis = null;\r\n ObjectInputStream in = null;\r\n try {\r\n fis = new FileInputStream(filePath);\r\n in = new ObjectInputStream(fis);\r\n long versionUID = (long) in.readObject();\r\n if (versionUID != this.serialVersionUID) {\r\n throw new UnsupportedClassVersionError(\"Version mismatch for save game!\");\r\n }\r\n this.p = (Character) in.readObject();\r\n this.map = (SpecialRoom[][]) in.readObject();\r\n\r\n } catch (FileNotFoundException ex){\r\n System.out.println(\"The saved game was not found!\");\r\n ex.printStackTrace();\r\n } catch (IOException ex) {\r\n System.out.println(\"There was an error reading your save game :(\");\r\n ex.printStackTrace();\r\n System.out.println(\")\");\r\n } catch (ClassNotFoundException ex) {\r\n System.out.println(\"The version of the save game is not compatible with this game!\");\r\n ex.printStackTrace();\r\n } catch (UnsupportedClassVersionError ex) {\r\n System.out.println(ex.getMessage());\r\n ex.printStackTrace();\r\n } catch (Exception ex) {\r\n System.out.println(\"An unknown error occurred!\");\r\n }\r\n\r\n }",
"public void readMachineDescription(String filename){readMachineDescription(new File(filename));}",
"void load();",
"void load();",
"public ScanOperator(File file){\r\n\t\tthis.file = file;\r\n\t\ttry{\r\n\t\t br = new RandomAccessFile(this.file, \"r\");\r\n\t\t}catch(FileNotFoundException e){\r\n\t\t\tSystem.out.println(\"File not found!\");\r\n\t\t}\r\n\t}",
"public void load(File tFile) throws FileNotFoundException, IOException {\n BufferedReader reader = new BufferedReader(new FileReader(tFile));\n String line;\n\n\n while ((line = reader.readLine()) != null) {\n line = line.replaceAll(\"\\\\s+\", \" \");\n String[] elements = line.split(\" \");\n\n CSID desc = new CSID();\n // normalised lines are easier to compare as it is well defined, which point will be the 1st\n desc.axis1 = (ExtLine2D) ExtLine2D.normaliseLine(new ExtLine2D(Double.parseDouble(elements[0]),\n Double.parseDouble(elements[1]),\n Double.parseDouble(elements[2]),\n Double.parseDouble(elements[3])));\n desc.axis2 = (ExtLine2D) ExtLine2D.normaliseLine(new ExtLine2D(Double.parseDouble(elements[4]),\n Double.parseDouble(elements[5]),\n Double.parseDouble(elements[6]),\n Double.parseDouble(elements[7])));\n desc.isCS = elements[8].equals(\"Y\");\n\n this.csDescriptors.add(desc);\n }\n }",
"public void loadFile(File p_file) throws IOException;",
"public void LoadMaze(File file) {\r\n try {\r\n ObjectInputStream in = new ObjectInputStream(new FileInputStream(file));\r\n Maze m = (Maze) in.readObject();\r\n PlayerPositionRow = (int) in.readObject();\r\n PlayerPositionCol = (int) in.readObject();\r\n maze = new Maze(m.Struct);\r\n maze.setStartPotision( new Position(PlayerPositionRow, PlayerPositionCol));\r\n maze.setGoalPosition(new Position(m.getGoalPosition().getRowIndex(), m.getGoalPosition().getColIndex()));\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n } catch (ClassNotFoundException e) {\r\n e.printStackTrace();\r\n }\r\n setChanged();\r\n notifyObservers(\"load\");\r\n }",
"public void load();",
"public void load();",
"public BrickStructure loadStructureFromBinaryFile(File file) {\n\t\tthrow new NullPointerException();\n\t}",
"public void load (String argFileName) throws IOException;",
"public static InstructionBlock readInstructionBlock(\n String filepath)\n {\n try\n {\n XStream xstream = new XStream();\n FileReader fileIn = new FileReader(filepath);\n BufferedReader read = new BufferedReader(fileIn);\n String complete = \"\";\n String temp;\n while ((temp = read.readLine()) != null)\n {\n complete = complete + temp;\n }\n InstructionBlock instructions =\n (InstructionBlock) xstream.fromXML(complete);\n return instructions;\n } catch (IOException exc)\n {\n System.out.println(\"There was a problem reading the \" +\n \"instructions file\");\n exc.printStackTrace();\n System.exit(1);\n }\n return null;\n }",
"public void load(String code) {\n\n\t\tEngine.console.write(\"load method echo\");\n\t\tif (!code.matches(\"(\\\\d){4}\")) {\n\t\t\tEngine.console.write(\"code does not match regex for map ID\");\n\t\t\treturn;\n\t\t} else {\n\t\t\tEngine.console.write(\"code matches regex\");\n\t\t\ttry {\n\t\t\t\tFileInputStream fis = new FileInputStream(\"/boards/\" + code + \".map\");\n\t\t\t\tObjectInputStream ois = new ObjectInputStream(fis);\n\t\t\t\tBoard loaded = (Board) ois.readObject();\n\t\t\t\tEngine.activeBoard = loaded;\n\t\t\t\tEngine.console.write(\"loaded and assigned\");\n\t\t\t\tSystem.out.println(Engine.activeBoard);\n\t\t\t} catch (IOException ex) {\n\t\t\t\tEngine.console.write(\"File \" + code + \".map not found\", Console.ERROR);\n\t\t\t} catch (ClassNotFoundException ex) {\n\t\t\t\tEngine.console.write(\"Class not found\", Console.ERROR);\n\t\t\t}\n\t\t}\n\t}",
"public void loadFile(String fname) \n\t{\n\t\t// use Scanner used to read the file\n\t\ttry{\n\t\t\tScanner scan = new Scanner(new FileReader(fname));\n\t\t\t//read in number of row and column in the first line\n\t\t\treadRC(scan);\n\t\t\treadMaze(scan);\n\t\t\t//close the scanner\n\t\t\tscan.close();\t\t\t\t\t\t\t\t\n\t\t}catch(FileNotFoundException e){\n\t\t\tSystem.out.println(\"FileNotFound\"+e.getMessage());\n\t\t}\n\t}",
"private void cmdOpenUseFile(String file) {\n MModel model = null;\n FileInputStream specStream = null;\n\n String filename = getFilenameToOpen(file);\n \n try {\n Log.verbose(\"compiling specification...\");\n specStream = new FileInputStream(filename);\n model = USECompiler.compileSpecification(specStream, filename,\n new PrintWriter(System.err), new ModelFactory());\n } catch (FileNotFoundException e) {\n Log.error(\"File `\" + filename + \"' not found.\");\n } finally {\n if (specStream != null)\n try {\n \tspecStream.close();\n } catch (IOException ex) {}\n }\n\n // compile ok?\n if (model != null) {\n // print some info about model\n Log.verbose(model.getStats());\n\n // create system\n fSession.setSystem(new MSystem(model));\n }\n \n setFileClosed();\n }",
"public static void main(String argv[]) throws UnsupportedEncodingException, ExecutionException, FileNotFoundException {\r\n // Check arguments\r\n if(argv.length <= 0) { System.err.println(\"Usage: <filename>\"); return; }\r\n\r\n // Start the machine\r\n Main.traceStream = System.out;\r\n Machine.powerOn();\r\n\r\n // Assemble the file\r\n Assembler assembler = new Assembler();\r\n InputStream stream = new FileInputStream(argv[0]);\r\n try { assembler.Assemble(stream); }\r\n catch(InvalidInstructionException e)\r\n { System.err.println(e.getMessage()); return; }\r\n catch(LabelNotResolvedException e)\r\n { System.err.println(e.getMessage()); return; }\r\n catch(ProgramSizeException e)\r\n { System.err.println(e.getMessage()); return; }\r\n\r\n // Run the code\r\n Machine.setPC((short) 0);\r\n Machine.setMSP((short) assembler.getSize());\r\n Machine.setMLP((short) (Machine.memorySize - 1));\r\n Machine.run();\r\n }",
"void loadExperiment();",
"public TileWorldUtil(String fileName) {\n load(fileName);\n }",
"public static void load() {\n }",
"public void load() ;",
"public void loadStateFromFile(String fileName)\n\t{\n\t\ttry\n\t\t{\n\t\t\tFile f = new File(fileName);\n\t\t\tScanner input = new Scanner(f);\n\t\t\t_rows = input.nextInt();\n\t\t\t_cols = input.nextInt();\n\t\t\t_puzzle = new int[_rows][_cols];\n\t\t\tfor (int r_idx = 0; r_idx < _rows; r_idx++)\n\t\t\t\tfor (int c_idx = 0; c_idx<_cols; c_idx++)\n\t\t\t\t{\n\t\t\t\t\t_puzzle[r_idx][c_idx] = input.nextInt();\n\t\t\t\t\tif (_puzzle[r_idx][c_idx] == 0){\n\t\t\t\t\t\t_holes.add(new Coordinate(r_idx,c_idx));\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tSystem.out.println(e.getMessage());\n\t\t\tSystem.exit(-1);\n\t\t}\n\t}",
"public void load(Car c,int x,int y){\n load.load(c,x,y);\n }",
"public void loadFile(String file) {\n\t\ttry {\n\t\t\tabd_realize.getProxy().loadFile(file);\n\t\t}\n\t\tcatch (FileReadErrorException ex) {\n\t\t\tlog(\"file read error: \" + ex.filename);\n\t\t}\n\t\tcatch (SyntaxErrorException ex) {\n\t\t\tlog(\"syntax error: \" + ex.error + \" in \" + ex.filename + \" on line \" + ex.line);\n\t\t}\n\t}",
"void loadSimpleCodesFromFile() {\n\t\tReader reader;\r\n\t\ttry {\r\n\t\t\t//reader = new FileReader(pathStr + \"/../pt.iscte.pidesco.codegenerator/Settings/Code.cg\");\r\n\t\t\treader = new FileReader(\"Code.cg\");\r\n\t\t\tint data = reader.read();\r\n\t\t\tString output = \"\";\r\n\t\t\twhile (data != -1) {\r\n\t\t\t\tchar dataChar = (char) data;\r\n\t\t\t\toutput += dataChar;\r\n\t\t\t\tdata = reader.read();\r\n\t\t\t}\r\n\t\t\tString[] Codes = output.split(\"-CGCodeSeparator-\");\r\n\t\t\tfor (String code : Codes) {\r\n\t\t\t\tString[] Code = code.split(\"-CGSeparator-\");\r\n\t\t\t\tif (Code.length > 1)\r\n\t\t\t\t\tSimpleCodeMap.put(Code[0], new SimpleCode(Code[0], Code[1]));\r\n\t\t\t}\r\n\r\n\t\t\treader.close();\r\n\t\t\trefreshList();\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t} catch (IOException e) {\r\n\t\t}\r\n\t}",
"public static Game loadGame(String fileName){\n Game game = null;\n try {\n File file1 = new File(fileName);\n FileInputStream fileInputStream = new FileInputStream(file1);\n ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream);\n game = (Game) objectInputStream.readObject();\n game.makeGUIVisible();\n }catch (Exception e){\n System.err.println(\"Error when loading file\");\n }\n return game;\n }",
"private void loadFromFile(String fileName) {\n try {\n InputStream inputStream = this.openFileInput(fileName);\n if (inputStream != null) {\n ObjectInputStream input = new ObjectInputStream(inputStream);\n boardManager = (BoardManager) input.readObject();\n inputStream.close();\n }\n } catch (FileNotFoundException e) {\n Log.e(\"login activity\", \"File not found: \" + e.toString());\n } catch (IOException e) {\n Log.e(\"login activity\", \"Can not read file: \" + e.toString());\n } catch (ClassNotFoundException e) {\n Log.e(\"login activity\", \"File contained unexpected data type: \" + e.toString());\n }\n }",
"private void loadInstructions(byte... codes) {\r\n\t\tint instructionLocation = instructionBase;\r\n\t\tfor (int i = -128; i < 128; i++) {\r\n\t\t\tfor (byte code : codes) {\r\n\t\t\t\tcpuBuss.write(instructionLocation++, code);\r\n\t\t\t} // for codes\r\n\t\t\tcpuBuss.write(instructionLocation++, (byte) i);\r\n\t\t} // for\r\n\t\twrs.setProgramCounter(instructionBase);\r\n\t}",
"public void loadMemory() {\n Converter c = new Converter(); //object to help with binary to decimal conversions and vice-versa\n \n int midpoint = (int) Math.floor(size/2); //divide memory into two haves\n \n //variables that will be needed\n int opcode;\n int address = midpoint;\n int index=0;\n\n //Initial instructions\n opcode = c.convertDecToBin(3); //0011\n instruction = new Instruction(opcode, c.convertDecToBin(address)); //load AC from stdin\n Memory.memloc.set(index, instruction); //saving instruction to memory\n\n opcode = c.convertDecToBin(7); //0111;\n instruction = new Instruction(opcode, c.convertDecToBin(address)); //store AC to stdout\n Memory.memloc.set(index+1, instruction);\n\n opcode = c.convertDecToBin(2); //0010\n instruction = new Instruction(opcode, c.convertDecToBin(address)); //store AC to memory\n Memory.memloc.set(index+2, instruction); //saving instruction to memory\n\n opcode = c.convertDecToBin(3); //0011\n instruction = new Instruction(opcode, c.convertDecToBin(address)); //load AC from stdin\n Memory.memloc.set(index+3, instruction); //saving instruction to memory\n\n opcode = c.convertDecToBin(2); //0010\n instruction = new Instruction(opcode, c.convertDecToBin(address+1)); //store AC to memory\n Memory.memloc.set(index+4, instruction); //saving instruction to memory\n\n\n //The rest of the instructions\n for (int i = 5; i < midpoint; i = i + 6) {\n index = i;\n\n if ((index + 5) < midpoint-1) { //if index + 5 is not greater than the midpoint-1\n\n opcode = c.convertDecToBin(1); //0001\n instruction = new Instruction(opcode, c.convertDecToBin(address)); //load AC from memory\n Memory.memloc.set(index, instruction); //saving instruction to memory\n \n opcode = c.convertDecToBin(5); //0101;\n address++;\n instruction = new Instruction(opcode, c.convertDecToBin(address)); //add to AC from memory\n Memory.memloc.set(index + 1, instruction);\n\n opcode = c.convertDecToBin(7); //0111;\n instruction = new Instruction(opcode, c.convertDecToBin(address)); //store AC to stdout\n Memory.memloc.set(index + 2, instruction);\n\n opcode = c.convertDecToBin(2); //0010;\n address++;\n instruction = new Instruction(opcode, c.convertDecToBin(address)); //store AC to memory\n Memory.memloc.set(index + 3, instruction);\n\n opcode = c.convertDecToBin(4); //0100;\n address--;\n instruction = new Instruction(opcode, c.convertDecToBin(address)); //subtract from AC from memory\n Memory.memloc.set(index + 4, instruction);\n\n opcode = c.convertDecToBin(2); //0010;\n address = address + 2;\n instruction = new Instruction(opcode, c.convertDecToBin(address)); //store AC to memory\n Memory.memloc.set(index + 5, instruction);\n\n address--;\n } \n }\n\n //Loading the final intsruction in memory\n opcode = c.convertDecToBin(15); //1111;\n address++;\n instruction = new Instruction(opcode, c.convertDecToBin(address)); //halt\n Memory.memloc.set(index++, instruction);\n\n\n }",
"public void LoadBoard(String strFilePath){\n\t\t_TEST stack = new _TEST();\t\t\t\t\t\t/* TEST */\n\t\tstack.PrintHeader(ID,\"strFilePath:String\", \"\");\t/* TEST */\n\t\tParseFile(strFilePath);\n\t\tstack.PrintTail(ID,\"strFilePath:String\", \"\"); \t\t/* TEST */\n\n\t}",
"public void loadGame(File fileLocation, boolean replay);",
"private void loadWorld(String path) {\r\n StringBuilder builder = new StringBuilder();\r\n \r\n try {\r\n BufferedReader br = new BufferedReader(new FileReader(path));\r\n String line;\r\n while ((line = br.readLine()) != null) {\r\n builder.append(line + \"\\n\");\r\n }\r\n br.close();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n \r\n String file = builder.toString();\r\n String[] tokens = file.split(\"\\\\s+\");\r\n width = Integer.parseInt(tokens[0]);\r\n height = Integer.parseInt(tokens[1]);\r\n spawnX = Integer.parseInt(tokens[2]);\r\n spawnY = Integer.parseInt(tokens[3]);\r\n winX = Integer.parseInt(tokens[4]);\r\n winY = Integer.parseInt(tokens[5]);\r\n \r\n tiles = new int[width][height];\r\n for (int y = 0;y < height;y++) {\r\n for (int x = 0;x < width;x++) {\r\n tiles[x][y] = Integer.parseInt(tokens[(x + y * width) + 6]);\r\n }\r\n }\r\n \r\n assert (tiles != null);\r\n }",
"protected static void loadFromFile(File worldsFile, Server server) {\n\t\tfinal FileConfiguration configuration = YamlConfiguration.loadConfiguration(worldsFile);\n\t\t\n\t\tfor (final String worldName : configuration.getStringList(\"worlds\")) {\n\t\t\tworlds.add(server.getWorld(worldName));\n\t\t}\n\t}",
"public void load() {\n }",
"public static Object load(File mazeFile) throws IOException, ClassNotFoundException {\n\n /* IO stuff */\n ObjectInputStream oi = new ObjectInputStream( new FileInputStream( mazeFile ) );\n\n Object instance = oi.readObject();\n\n oi.close();\n\n return instance;\n }",
"private static void load(){\n }",
"public void loadEPILine(File file)\r\n\t{\r\n\t\tString name=file.getName();\r\n\t\tint [][] result=null;\r\n\t\ttry \r\n\t\t{\r\n\t\t\tScanner scanner=new Scanner(file);\r\n\t\t\tint size=scanner.nextInt();\r\n\t\t\tint width=scanner.nextInt();\t\t\t\r\n\t\t\tresult=new int[size][width];\r\n\t\t\tscanner.useDelimiter(\",\");\r\n\t\t\tString temp;\r\n\t\t\tfor(int i=0;i<size;i++)\r\n\t\t\t\tfor(int j=0;j<width;j++)\r\n\t\t\t\t{\r\n\t\t\t\t\ttemp=scanner.next();\r\n\t\t\t\t\tresult[i][j]=Integer.parseInt(temp.trim());\r\n\t\t\t\t}\r\n\t\t\tscanner.close();\t\r\n\t\t} catch (FileNotFoundException e) \r\n\t\t{\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t_pixels=result;\r\n\t\t\r\n\t\t//That's why I needed to get rid of \"_\" in directory name\r\n\t\tname=name.substring(0,name.lastIndexOf(\".\"));\r\n\t\tString[] split=name.split(\"_\");\r\n\t\t_line=Integer.parseInt(split[1])+1;\r\n\t\t_position=Position.valueOf(split[2]);\r\n\t\t\r\n\t}",
"public static void load(String filename, Supervisor k) throws FileNotFoundException{\n String source = \"\";\n try {\n Scanner in = new Scanner(new FileReader(filename));\n while(in.hasNext()){\n source = source + in.next();\n }\n } catch (FileNotFoundException ex) {\n //throw ex;\n System.out.println(\"Could not read config file: \" + ex);\n System.out.println(\"trying to create a new one...\");\n String stsa = \"Done!\\n\";\n try (\n Writer writer = new BufferedWriter(new OutputStreamWriter(\n new FileOutputStream(filename), \"utf-8\"))) {\n writer.write(\"\");\n writer.close();\n }\n \n catch (IOException ex1) {\n stsa = \"\";\n System.out.println(\"FAILED, SKIPPING CONFIG READ BECOUSE:\");\n Logger.getGlobal().warning(ex1.toString());\n System.out.println(\"Console version: \" + ex1.toString());\n }\n System.out.print(stsa);\n }\n LinkedList<String[]> raw = fetch(source);\n \n if(k.Logic == null){\n Logger.getGlobal().warning(\"ENGINE NOT INITIALIZED PROPERLY, ABORTING APPLYING CONFIG\");\n return;\n }\n if(k.Logic.Vrenderer == null){\n Logger.getGlobal().warning(\"ENGINE RENDERER NOT INITIALIZED PROPERLY, ABORTING APPLYING CONFIG\");\n return;\n }\n \n for(String[] x: raw){\n String value = x[1];\n if(!k.features_overrideAllStandard)\n switch(x[0]){\n case \"nausea\":\n int numValue = 0;\n try{\n numValue = Integer.parseInt(value);\n }\n catch(Exception e){\n quickTools.alert(\"configReader\", \"invalid nausea value\");\n break;\n }\n if(numValue > 0){\n k.Logic.Vrenderer.dispEffectsEnabled = true;\n }\n //k.Logic.Vrenderer.di\n break;\n default:\n\n break;\n }\n customFeatures(x[0], x[1], k);\n }\n }",
"public Puzzle loadPuzzle () {\n Puzzle puzzle = null;\n File file;\n if (chooser.showOpenDialog (null) == JFileChooser.APPROVE_OPTION) {\n file = chooser.getSelectedFile ();\n if (file != null) {\n try {\n Scanner scan = new Scanner (file);\n String type = scan.nextLine ();\n puzzle = Puzzle.getConstructor (type);\n puzzle.load (scan);\n } catch (FileNotFoundException e) {\n JOptionPane.showMessageDialog (null, \"File IO Exception\\n\" + e.getLocalizedMessage (), \"Error!\", JOptionPane.ERROR_MESSAGE);\n } catch (IllegalArgumentException e) {\n JOptionPane.showMessageDialog (null, \"A Critical Error Has Occurred\", \"Error!\", JOptionPane.ERROR_MESSAGE);\n }\n }\n }\n return puzzle;\n }",
"private static DecisionTree loadTree(File file) throws FileNotFoundException {\r\n\t\tScanner scan = new Scanner(file); // Read from file\r\n\t\t// First line of file is question at root node\r\n\t\tDecisionTree dt = new DecisionTree(scan.nextLine());\r\n\t\tBinaryNode<String> root = dt.getRootNode();\r\n\t\tfillTree(Branch.LEFT, scan, root); // Fill left subtree using Scanner\r\n\t\tfillTree(Branch.RIGHT, scan, root); // Fill right subtree using Scanner\r\n\t\tscan.close(); // Close the file loaded from\r\n\t\treturn dt;\r\n\t}",
"public void loadFromSortedFile(String file) throws Exception{\n if(file == null){\n throw new Exception(\"file is null\");\n }\n try{\n FileReader fr = new FileReader(file);\n BufferedReader br = new BufferedReader(fr);\n\n String s = null;\n while((s = br.readLine()) != null) {\n QueryItem qi = null;\n try{\n qi = new QueryItem(s);\n }catch(Exception e){\n System.out.println(\"[\"+s+\"] load error\");\n continue;\n }\n updateMobile(qi);\n }\n\n br.close();\n fr.close();\n }catch(IOException e){\n e.printStackTrace();\n }\n System.out.println(\"load finished\");\n }",
"public void load(){\n Player temp;\n try{\n FileInputStream inputFile = new FileInputStream(\"./data.sec\");\n ObjectInputStream objectIn = new ObjectInputStream(inputFile);\n temp = (Player)objectIn.readObject();\n Arena.CUR_PLAYER = temp;\n objectIn.close();\n inputFile.close(); \n }\n catch(FileNotFoundException e ){\n System.err.print(\"data.sec not found\");\n }\n catch(IOException e){\n System.out.println(\"Error 201\");\n }\n catch(ClassNotFoundException e){\n System.out.println(\"Error 202\");\n }\n }",
"public Cartridge(String fileName) {\n\t\ttry {\n\t\t\tInputStream i = new FileInputStream(fileName);\n\t\t\tbyte[] header = new byte[16];\n\t\t\ti.read(header);\n\t\t\tif((header[6]&0x04)!=0) i.skip(512);\n\t\t\tnMapperID = (byte) ((((header[7]&0xFF)>>4)<<4)|((header[6]&0xFF)>>4));\n\t\t\tmirror = (header[6]&0x01)!=0;\n\t\t\tint nFileType = 1;\n\t\t\tif(nFileType==0) {\n\t\t\t\t\n\t\t\t}\n\t\t\tif(nFileType==1) {\n\t\t\t\tnPRGBanks = header[4];\n\t\t\t\tvPRGMemory = new byte[nPRGBanks*16384];\n\t\t\t\ti.read(vPRGMemory);\n\t\t\t\tnCHRBanks = header[5];\n\t\t\t\tvCHRMemory = new byte[nCHRBanks>0?nCHRBanks*8192:8192];\n\t\t\t\ti.read(vCHRMemory);\n\t\t\t}\n\t\t\tif(nFileType==2) {\n\t\t\t\t\n\t\t\t}\n\t\t\tswitch(nMapperID&0xFF) {\n\t\t\tcase 0: mapper = new Mapper000(nPRGBanks,nCHRBanks);break;\n\t\t\t}\n\t\t\ti.close();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\timageValid = true;\n\t}",
"public void load() {\n\t}",
"public void load( File file )\n {\n try\n {\n if ( _core.getImageFile() != null )\n _core.reset( true );\n\n _core.setImageFile(\n file );\n\n setDirectoryEntries(\n _core.getImageFileDirectory() );\n }\n catch ( Exception e )\n {\n throw new RuntimeException( e );\n }\n }",
"@Override\n\tpublic Object load(String file) {\n\t\treturn null;\n\t}",
"public void load() throws ClassNotFoundException, IOException;",
"@Override\n public boolean load(String file) {\n try {\n FileInputStream streamIn = new FileInputStream(file);\n ObjectInputStream objectinputstream = new ObjectInputStream(streamIn);\n WGraph_Algo readCase = (WGraph_Algo) objectinputstream.readObject();\n this.ga=null;//initialize the graph\n this.ga=readCase.ga;//take the graph from readCase to this.ga\n }\n catch(Exception e) {\n e.printStackTrace();\n }\n return false;\n }",
"public static void readInstructionsFromArray(final MipsComputer comp) {\n\t\tSystem.out.println(\"Loading instructions from array...\");\n\t\tfor (int i = 0; i < INSTRUCTIONS.length; i++) {\n\t\t\tcomp.loadInstruction(convertToBitString(INSTRUCTIONS[i].replaceAll(\"\\\\s\", \"\")));\n\t\t}\n\t}",
"public void fileLoaderMethod(String filename) {\n\t\t\n\t\tString fileloc = \"\";\n\t\tif(!prf.foldername.getText().equals(\"\"))\n\t\t\tfileloc += prf.foldername.getText()+\"/\";\n\t\t\n\t\tfileloc += filename;\n\t\tFile fl = new File(fileloc);\n\t\t\n\t\tString code = \"\";\n\t\t\n\t\tif(!fl.exists()) {\n\t\t\tJOptionPane.showMessageDialog(null, \"The specified file doesnt exist at the given location.\");\n\t\t} else {\t\n\t\t\ttry {\n\t\t\t\tFileReader flrd = new FileReader(fileloc);\n\t\t\t\tBufferedReader bufread = new BufferedReader(flrd);\t\t\n\t\t\t\tString str;\n\t\t\t\twhile((str = bufread.readLine()) != null) {\n\t\t\t\t\tcode += str + \"\\n\";\n\t\t\t\t}\t\t\n\t\t\t\tbufread.close();\n\t\t\t\tflrd.close();\t\t\t\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\t\n\t\tinterpretorMainMethod(code, 0);\n\t}",
"public static void loadFromFile() {\n\t\tloadFromFile(Main.getConfigFile(), Main.instance.getServer());\n\t}",
"public LogicalCpu(File file, int id) {\t\n\t\t\tif (mLogicalCpus.size() > id) {\n\t\t\t\tthrow new AssertionError(\"Logical CPU with id \" + id + \" already exists!\");\n\t\t\t}\n\t\t\t\n\t\t\tmRoot = file;\n\t\t\tmId = id;\n\t\t\tmCpuStat = new CpuStat(id);\n\t\t}",
"public abstract void load();",
"private void loadImages(File file) {\n\t\timages = new ArrayList<PerceptronImage>();\n\t\ttry {\n\t\t\tScanner scan = new Scanner(file);\n\t\t\twhile (scan.hasNext()) {\n\t\t\t\timages.add(load(scan));\n\t\t\t}\n\t\t\tscan.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"private static String loadFile(File file) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new FileReader(file));\n\t\treturn br.readLine();\n\t}",
"public boolean readAndTranslate(Labels lab, ArrayList<Instruction> prog) {\n\n try (Scanner sc = new Scanner(new File(fileName))) {\n // Scanner attached to the file chosen by the user\n labels = lab;\n labels.reset();\n program = prog;\n program.clear();\n\n try {\n line = sc.nextLine();\n } catch (NoSuchElementException ioE) {\n return false;\n }\n\n // Each iteration processes line and reads the next line into line\n while (line != null) {\n // Store the label in label\n String label = scan();\n\n if (label.length() > 0) {\n Instruction ins = getInstruction(label);\n if (ins != null) {\n labels.addLabel(label);\n program.add(ins);\n }\n }\n\n try {\n line = sc.nextLine();\n } catch (NoSuchElementException ioE) {\n return false;\n }\n }\n } catch (IOException ioE) {\n System.out.println(\"File: IO error \" + ioE.getMessage());\n System.exit(-1);\n return false;\n }\n return true;\n }",
"public void loadWorkflow(String filename);",
"public Schedule loadSchedules(File file) {\n\n return readWrite.loadSchedules(file, this);\n }",
"public MutableTextLabels loadOps(TextBase base,File file) throws IOException,FileNotFoundException\n\t{\n\t\tMutableTextLabels labels = new BasicTextLabels(base);\n\t\timportOps(labels,base,file);\n\t\treturn labels;\n\t}",
"public void loadGame(File f) {\n clearGame();\n loadgame = new LoadGame(f, chessboard, this, gamelog);\n System.out.println(\"Gamed Loaded.\");\n \n frame.update(frame.getGraphics());\n\n }",
"public void open() {\r\n\t\tFile f = getOpenFile(\"Map Files\", \"tilemap\");\r\n\t\tif (f == null) return;\r\n\t\tfile = f;\r\n\t\tframe.setTitle(\"Tile Mapper - \"+file.getName());\r\n\t\tSystem.out.println(\"Opening \"+file.getAbsolutePath());\r\n\r\n\t\ttry {\r\n\t\t\tDocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\r\n\t\t\tInputStream is = this.getClass().getClassLoader().getResourceAsStream(\"tilemapper/Map.xsd\");\r\n\t\t\tfactory.setSchema(SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI).newSchema(new StreamSource(is)));\r\n\r\n\t\t\tDocument dom = factory.newDocumentBuilder().parse(file);\r\n\r\n\t\t\t// we have a valid document\r\n\t\t\t//printNode(dom, \"\");\r\n\t\t\tNode mapNode = null;\r\n\t\t\tNodeList nodes = dom.getChildNodes();\r\n\t\t\tfor (int i=0; i<nodes.getLength(); i++) {\r\n\t\t\t\tNode node = nodes.item(i);\r\n\t\t\t\tif (node.getNodeName() == \"Map\") mapNode = node;\r\n\t\t\t}\r\n\t\t\tif (mapNode == null) return;\r\n\t\t\tmapPanel.parseDOM((Element)mapNode);\r\n\r\n\t\t} catch (ParserConfigurationException e) {\r\n\t\t\tSystem.out.println(\"The underlying parser does not support the requested features.\");\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (FactoryConfigurationError e) {\r\n\t\t\tSystem.out.println(\"Error occurred obtaining Document Builder Factory.\");\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"public Resource load(IFile f);",
"public static List<ClientWorker> LoadServer(String fileName) throws FileNotFoundException, IOException{\n List<ClientWorker> connection = new LinkedList<ClientWorker>();\n \n // FileReader reads text files in the default encoding.\n FileReader fileReader = new FileReader(fileName);\n\n BufferedReader bufferedReader = new BufferedReader(fileReader);\n String line;\n while ((line = bufferedReader.readLine()) != null) {\n connection.add(new ClientWorker(line));\n // System.out.println(line);\n }\n bufferedReader.close();\n \n return connection;\n }",
"public void load(String filename) {\n\t\tsetup();\n\t\tparseOBJ(getBufferedReader(filename));\n\t}"
] | [
"0.6053166",
"0.5876184",
"0.5832916",
"0.58204174",
"0.5806581",
"0.5768463",
"0.5764265",
"0.575017",
"0.5744006",
"0.56932044",
"0.5630625",
"0.562786",
"0.56245446",
"0.55780804",
"0.5552043",
"0.55520225",
"0.5534264",
"0.5528546",
"0.5527045",
"0.548107",
"0.54731864",
"0.5471311",
"0.5471233",
"0.5467313",
"0.5419329",
"0.53978634",
"0.5355796",
"0.5354373",
"0.53534436",
"0.5338416",
"0.53337413",
"0.5333414",
"0.5324129",
"0.5323071",
"0.5309202",
"0.52993244",
"0.5284527",
"0.5265788",
"0.5258537",
"0.5258537",
"0.5245015",
"0.5239236",
"0.5215664",
"0.5184463",
"0.5162437",
"0.5162437",
"0.5150032",
"0.51410764",
"0.5138731",
"0.5128403",
"0.5111911",
"0.5102464",
"0.5099334",
"0.5099302",
"0.5094185",
"0.5087319",
"0.5063057",
"0.5062312",
"0.50522375",
"0.504059",
"0.50389934",
"0.5037104",
"0.5027294",
"0.5021247",
"0.5016332",
"0.50135785",
"0.5005061",
"0.50021785",
"0.50003517",
"0.49991012",
"0.49990794",
"0.49859396",
"0.4985841",
"0.4984323",
"0.49826643",
"0.49826318",
"0.4971325",
"0.49653596",
"0.49488962",
"0.49439648",
"0.49373418",
"0.4934969",
"0.49272686",
"0.4923271",
"0.49220622",
"0.491993",
"0.4911997",
"0.4911712",
"0.4903215",
"0.48993856",
"0.4898805",
"0.4880456",
"0.48772657",
"0.48745766",
"0.48704776",
"0.48628527",
"0.48530734",
"0.4852846",
"0.48507366",
"0.48462474"
] | 0.68011373 | 0 |
Method used to load computer with instructions that are found in the static array found above. | public static void readInstructionsFromArray(final MipsComputer comp) {
System.out.println("Loading instructions from array...");
for (int i = 0; i < INSTRUCTIONS.length; i++) {
comp.loadInstruction(convertToBitString(INSTRUCTIONS[i].replaceAll("\\s", "")));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void loadInstructions(byte... codes) {\r\n\t\tint instructionLocation = instructionBase;\r\n\t\tfor (int i = -128; i < 128; i++) {\r\n\t\t\tfor (byte code : codes) {\r\n\t\t\t\tcpuBuss.write(instructionLocation++, code);\r\n\t\t\t} // for codes\r\n\t\t\tcpuBuss.write(instructionLocation++, (byte) i);\r\n\t\t} // for\r\n\t\twrs.setProgramCounter(instructionBase);\r\n\t}",
"public void executeLoad(){\n\t\tBitString destBS = mIR.substring(4, 3);\n\t\tBitString pcOffset = mIR.substring(7, 9);\n\t\tBitString wantedVal = mMemory[mPC.getValue() + pcOffset.getValue2sComp()];\n\t\tmRegisters[destBS.getValue()] = wantedVal;\n\n\t\tsetConditionalCode(wantedVal);\n\t\t//now I just need to set the conditional codes.\n\t}",
"protected abstract void initHardwareInstructions();",
"public void load_cntl_code_1() {\n\n control_memory[0] = new Fetch0();\n control_memory[1] = new Fetch1();\n control_memory[2] = new Fetch2();\n control_memory[5] = new NOP();\n control_memory[10] = new LOADI0();\n\n control_memory[15] = new RSTART(\"ADD\", false);\n control_memory[16] = new ADD(\"ADD\", false);\n control_memory[17] = new RFINISH(\"ADD\");\n\n control_memory[20] = new RSTART(\"SUB\", false);\n control_memory[21] = new SUB(\"SUB\", false);\n control_memory[22] = new RFINISH(\"SUB\");\n\n control_memory[25] = new RSTART(\"ADDS\", false);\n control_memory[26] = new ADD(\"ADDS\", true);\n control_memory[27] = new RFINISH(\"ADDS\");\n\n control_memory[30] = new RSTART(\"SUBS\", false);\n control_memory[31] = new SUB(\"SUBS\", true);\n control_memory[32] = new RFINISH(\"SUBS\");\n\n control_memory[35] = new RSTART(\"AND\", false);\n control_memory[36] = new AND(\"AND\");\n control_memory[37] = new RFINISH(\"AND\");\n\n control_memory[40] = new RSTART(\"ORR\", false);\n control_memory[41] = new ORR(\"ORR\");\n control_memory[42] = new RFINISH(\"ORR\");\n\n control_memory[45] = new RSTART(\"EOR\", false);\n control_memory[46] = new EOR(\"EOR\");\n control_memory[47] = new RFINISH(\"EOR\");\n\n control_memory[50] = new LSL0();\n control_memory[51] = new LSL1();\n control_memory[52] = new RFINISH(\"LSR\");\n\n control_memory[55] = new LSR0();\n control_memory[56] = new LSR1();\n control_memory[57] = new RFINISH(\"LSR\");\n\n control_memory[60] = new BR0();\n control_memory[61] = new BR1();\n\n control_memory[65] = new RSTART(\"ADDI\", true);\n control_memory[66] = new ADD(\"ADDI\", false);\n control_memory[67] = new RFINISH(\"ADDI\");\n\n control_memory[70] = new RSTART(\"SUBI\", true);\n control_memory[71] = new SUB(\"SUBI\", false);\n control_memory[72] = new RFINISH(\"SUBI\");\n\n control_memory[75] = new RSTART(\"ADDIS\", true);\n control_memory[76] = new ADD(\"ADDIS\", true);\n control_memory[77] = new RFINISH(\"ADDIS\");\n\n control_memory[80] = new RSTART(\"SUBIS\", true);\n control_memory[81] = new SUB(\"SUBIS\", true);\n control_memory[82] = new RFINISH(\"SUBIS\");\n\n control_memory[85] = new RSTART(\"ANDI\", true);\n control_memory[86] = new AND(\"ANDI\");\n control_memory[87] = new RFINISH(\"ANDI\");\n\n control_memory[90] = new RSTART(\"ORRI\", true);\n control_memory[91] = new ORR(\"ORRI\");\n control_memory[92] = new RFINISH(\"ORRI\");\n\n control_memory[95] = new RSTART(\"EORI\", true);\n control_memory[96] = new EOR(\"EORI\");\n control_memory[97] = new RFINISH(\"EORI\");\n\n control_memory[100] = new LDUR0();\n control_memory[101] = new LDUR1();\n control_memory[102] = new LDUR2();\n control_memory[103] = new LDUR3();\n control_memory[104] = new LDUR4();\n\n control_memory[105] = new STUR0();\n control_memory[106] = new STUR1();\n control_memory[107] = new STUR2();\n control_memory[108] = new STUR3();\n control_memory[109] = new STUR4();\n\n control_memory[140] = new CBSTART(\"CBZ\");\n control_memory[141] = new CBZ();\n control_memory[142] = new CBFINISH(\"CBZ\");\n\n control_memory[145] = new CBSTART(\"CBNZ\");\n control_memory[146] = new CBNZ();\n control_memory[147] = new CBFINISH(\"CBNZ\");\n\n control_memory[155] = new BCONDSTART(\"BEQ\");\n control_memory[156] = new BEQ();\n control_memory[157] = new BCONDFINISH(\"BEQ\");\n\n control_memory[160] = new BCONDSTART(\"BNE\");\n control_memory[161] = new BNE();\n control_memory[162] = new BCONDFINISH(\"BNE\");\n\n control_memory[165] = new BCONDSTART(\"BLT\");\n control_memory[166] = new BLT();\n control_memory[167] = new BCONDFINISH(\"BLT\");\n\n control_memory[170] = new BCONDSTART(\"BLE\");\n control_memory[171] = new BLE();\n control_memory[172] = new BCONDFINISH(\"BLE\");\n\n control_memory[175] = new BCONDSTART(\"BGT\");\n control_memory[176] = new BGT();\n control_memory[177] = new BCONDFINISH(\"BGT\");\n\n control_memory[180] = new BCONDSTART(\"BGE\");\n control_memory[181] = new BGE();\n control_memory[182] = new BCONDFINISH(\"BGE\");\n\n control_memory[185] = new B0();\n control_memory[186] = new B1();\n control_memory[187] = new B2();\n\n\n }",
"public static void loadProgram() throws Exception{\n\t\t\n\t\tInteger instructionNumber = 0; \n\t\t\n\t\ttry {\n\t\t\tScanner scanner = new Scanner(new File(ramProgram));\n\t\t\twhile (scanner.hasNext()){\n\t\t\t\tString next = scanner.nextLine();\n\t\t\t\tnext = next.trim();\n\t\t\t\tString [] array = next.split(\"\\\\s+\");\n\t\t\t\t\n\t\t\t\tif (next.startsWith(\"#\") || next.isEmpty()){\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t\n\t\t\t\t\tif (array[0].endsWith(\":\")){\n\t\t\t\t\t\ttagList.add(new Tag(array[0], instructionNumber));\n\t\t\t\t\t\t\n\t\t\t\t\t\tswitch (array.length){\n\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\tthrow new Exception(\"Error en la etiqueta:\" + array[0] + \". Línea: \" + getLine(next));\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\tprogramMemory.add(new Instruction(array[1], \"\", getLine(next)));\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\tprogramMemory.add(new Instruction(array[1], array[2], getLine(next)));\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tthrow new Exception(\"Error en la instrucción: \" + array[0] + \". Línea: \" + getLine(next));\n\t\t\t\t\t\t\t\t\n\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\tswitch (array.length){\n\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\tprogramMemory.add(new Instruction(array[0], \"\", getLine(next)));\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\tprogramMemory.add(new Instruction(array[0], array[1], getLine(next)));\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tthrow new Exception(\"Error en la instrucción: \" + array[0] + \". Línea: \" + getLine(next));\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tinstructionNumber++;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tscanner.close();\n\t\t} \n\t\tcatch (FileNotFoundException e) {\n\t\t\n\t\t}\n\t}",
"public void loadInstructionInMemory(int pc, int decimalNumber){\n\t\tif (pc % 4 != 0){\n\t\t\tSystem.out.println(\"Wrong number for PC\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t\tmemory[(pc / 4)] = decimalNumber;\n\t}",
"protected void initializeInstructions() {\r\n // official instruction\r\n addInstruction(new CPU6502Instruction(\"ADC\", 0x6d, ADC, CPU6502Instruction.ABSOLUTE, 4));\r\n addInstruction(new CPU6502Instruction(\"ADC\", 0x69, ADC, CPU6502Instruction.IMMEDIATE, 2));\r\n addInstruction(new CPU6502Instruction(\"ADC\", 0x61, ADC, CPU6502Instruction.INDIRECT_X, 6));\r\n addInstruction(new CPU6502Instruction(\"ADC\", 0x71, ADC, CPU6502Instruction.INDIRECT_Y, 5, true));\r\n addInstruction(new CPU6502Instruction(\"ADC\", 0x7d, ADC, CPU6502Instruction.ABSOLUTE_X, 4, true));\r\n addInstruction(new CPU6502Instruction(\"ADC\", 0x79, ADC, CPU6502Instruction.ABSOLUTE_Y, 4, true));\r\n addInstruction(new CPU6502Instruction(\"ADC\", 0x65, ADC, CPU6502Instruction.ZERO, 3));\r\n addInstruction(new CPU6502Instruction(\"ADC\", 0x75, ADC, CPU6502Instruction.ZERO_X, 4));\r\n addInstruction(new CPU6502Instruction(\"AND\", 0x2d, AND, CPU6502Instruction.ABSOLUTE, 4));\r\n addInstruction(new CPU6502Instruction(\"AND\", 0x29, AND, CPU6502Instruction.IMMEDIATE, 2));\r\n addInstruction(new CPU6502Instruction(\"AND\", 0x21, AND, CPU6502Instruction.INDIRECT_X, 6));\r\n addInstruction(new CPU6502Instruction(\"AND\", 0x31, AND, CPU6502Instruction.INDIRECT_Y, 5, true));\r\n addInstruction(new CPU6502Instruction(\"AND\", 0x3d, AND, CPU6502Instruction.ABSOLUTE_X, 4, true));\r\n addInstruction(new CPU6502Instruction(\"AND\", 0x39, AND, CPU6502Instruction.ABSOLUTE_Y, 4, true));\r\n addInstruction(new CPU6502Instruction(\"AND\", 0x25, AND, CPU6502Instruction.ZERO, 3));\r\n addInstruction(new CPU6502Instruction(\"AND\", 0x35, AND, CPU6502Instruction.ZERO_X, 4));\r\n addInstruction(new CPU6502Instruction(\"ASL\", 0x0E, ASL, CPU6502Instruction.ABSOLUTE, 6));\r\n addInstruction(new CPU6502Instruction(\"ASL\", 0x0A, ASL, CPU6502Instruction.ACCUMULATOR, 2));\r\n addInstruction(new CPU6502Instruction(\"ASL\", 0x1E, ASL, CPU6502Instruction.ABSOLUTE_X, 7));\r\n addInstruction(new CPU6502Instruction(\"ASL\", 0x06, ASL, CPU6502Instruction.ZERO, 5));\r\n addInstruction(new CPU6502Instruction(\"ASL\", 0x16, ASL, CPU6502Instruction.ZERO_X, 6));\r\n addInstruction(new CPU6502Instruction(\"BCC\", 0x90, BCC, CPU6502Instruction.RELATIVE, 2));\r\n addInstruction(new CPU6502Instruction(\"BCS\", 0xb0, BCS, CPU6502Instruction.RELATIVE, 2));\r\n addInstruction(new CPU6502Instruction(\"BEQ\", 0xf0, BEQ, CPU6502Instruction.RELATIVE, 2));\r\n addInstruction(new CPU6502Instruction(\"BIT\", 0x2c, BIT, CPU6502Instruction.ABSOLUTE, 4));\r\n addInstruction(new CPU6502Instruction(\"BIT\", 0x24, BIT, CPU6502Instruction.ZERO, 3));\r\n addInstruction(new CPU6502Instruction(\"BMI\", 0x30, BMI, CPU6502Instruction.RELATIVE, 2));\r\n addInstruction(new CPU6502Instruction(\"BNE\", 0xd0, BNE, CPU6502Instruction.RELATIVE, 2));\r\n addInstruction(new CPU6502Instruction(\"BPL\", 0x10, BPL, CPU6502Instruction.RELATIVE, 2));\r\n addInstruction(new CPU6502Instruction(\"BRK\", 0x00, BRK, CPU6502Instruction.IMPLIED, 7));\r\n addInstruction(new CPU6502Instruction(\"BVC\", 0x50, BVC, CPU6502Instruction.RELATIVE, 2));\r\n addInstruction(new CPU6502Instruction(\"BVS\", 0x70, BVS, CPU6502Instruction.RELATIVE, 2));\r\n addInstruction(new CPU6502Instruction(\"CLC\", 0x18, CLC, CPU6502Instruction.IMPLIED, 2));\r\n addInstruction(new CPU6502Instruction(\"CLD\", 0xd8, CLD, CPU6502Instruction.IMPLIED, 2));\r\n addInstruction(new CPU6502Instruction(\"CLI\", 0x58, CLI, CPU6502Instruction.IMPLIED, 2));\r\n addInstruction(new CPU6502Instruction(\"CLV\", 0xb8, CLV, CPU6502Instruction.IMPLIED, 2));\r\n addInstruction(new CPU6502Instruction(\"CMP\", 0xcd, CMP, CPU6502Instruction.ABSOLUTE, 4));\r\n addInstruction(new CPU6502Instruction(\"CMP\", 0xc9, CMP, CPU6502Instruction.IMMEDIATE, 2));\r\n addInstruction(new CPU6502Instruction(\"CMP\", 0xc1, CMP, CPU6502Instruction.INDIRECT_X, 6));\r\n addInstruction(new CPU6502Instruction(\"CMP\", 0xd1, CMP, CPU6502Instruction.INDIRECT_Y, 5, true));\r\n addInstruction(new CPU6502Instruction(\"CMP\", 0xdd, CMP, CPU6502Instruction.ABSOLUTE_X, 4, true));\r\n addInstruction(new CPU6502Instruction(\"CMP\", 0xd9, CMP, CPU6502Instruction.ABSOLUTE_Y, 4, true));\r\n addInstruction(new CPU6502Instruction(\"CMP\", 0xc5, CMP, CPU6502Instruction.ZERO, 3));\r\n addInstruction(new CPU6502Instruction(\"CMP\", 0xd5, CMP, CPU6502Instruction.ZERO_X, 4));\r\n addInstruction(new CPU6502Instruction(\"CPX\", 0xec, CPX, CPU6502Instruction.ABSOLUTE, 4));\r\n addInstruction(new CPU6502Instruction(\"CPX\", 0xe0, CPX, CPU6502Instruction.IMMEDIATE, 2));\r\n addInstruction(new CPU6502Instruction(\"CPX\", 0xe4, CPX, CPU6502Instruction.ZERO, 3));\r\n addInstruction(new CPU6502Instruction(\"CPY\", 0xcc, CPY, CPU6502Instruction.ABSOLUTE, 4));\r\n addInstruction(new CPU6502Instruction(\"CPY\", 0xc0, CPY, CPU6502Instruction.IMMEDIATE, 2));\r\n addInstruction(new CPU6502Instruction(\"CPY\", 0xc4, CPY, CPU6502Instruction.ZERO, 3));\r\n addInstruction(new CPU6502Instruction(\"DEC\", 0xce, DEC, CPU6502Instruction.ABSOLUTE, 6));\r\n addInstruction(new CPU6502Instruction(\"DEC\", 0xde, DEC, CPU6502Instruction.ABSOLUTE_X, 7));\r\n addInstruction(new CPU6502Instruction(\"DEC\", 0xc6, DEC, CPU6502Instruction.ZERO, 5));\r\n addInstruction(new CPU6502Instruction(\"DEC\", 0xd6, DEC, CPU6502Instruction.ZERO_X, 6));\r\n addInstruction(new CPU6502Instruction(\"DEX\", 0xca, DEX, CPU6502Instruction.IMPLIED, 2));\r\n addInstruction(new CPU6502Instruction(\"DEY\", 0x88, DEY, CPU6502Instruction.IMPLIED, 2));\r\n addInstruction(new CPU6502Instruction(\"EOR\", 0x4d, EOR, CPU6502Instruction.ABSOLUTE, 4));\r\n addInstruction(new CPU6502Instruction(\"EOR\", 0x49, EOR, CPU6502Instruction.IMMEDIATE, 2));\r\n addInstruction(new CPU6502Instruction(\"EOR\", 0x41, EOR, CPU6502Instruction.INDIRECT_X, 6));\r\n addInstruction(new CPU6502Instruction(\"EOR\", 0x51, EOR, CPU6502Instruction.INDIRECT_Y, 5, true));\r\n addInstruction(new CPU6502Instruction(\"EOR\", 0x5d, EOR, CPU6502Instruction.ABSOLUTE_X, 4, true));\r\n addInstruction(new CPU6502Instruction(\"EOR\", 0x59, EOR, CPU6502Instruction.ABSOLUTE_Y, 4, true));\r\n addInstruction(new CPU6502Instruction(\"EOR\", 0x45, EOR, CPU6502Instruction.ZERO, 3));\r\n addInstruction(new CPU6502Instruction(\"EOR\", 0x55, EOR, CPU6502Instruction.ZERO_X, 4));\r\n addInstruction(new CPU6502Instruction(\"INC\", 0xee, INC, CPU6502Instruction.ABSOLUTE, 6));\r\n addInstruction(new CPU6502Instruction(\"INC\", 0xfe, INC, CPU6502Instruction.ABSOLUTE_X, 7));\r\n addInstruction(new CPU6502Instruction(\"INC\", 0xe6, INC, CPU6502Instruction.ZERO, 5));\r\n addInstruction(new CPU6502Instruction(\"INC\", 0xf6, INC, CPU6502Instruction.ZERO_X, 6));\r\n addInstruction(new CPU6502Instruction(\"INX\", 0xe8, INX, CPU6502Instruction.IMPLIED, 2));\r\n addInstruction(new CPU6502Instruction(\"INY\", 0xc8, INY, CPU6502Instruction.IMPLIED, 2));\r\n addInstruction(new CPU6502Instruction(\"JMP\", 0x4c, JMP, CPU6502Instruction.ABSOLUTE, 3));\r\n addInstruction(new CPU6502Instruction(\"JMP\", 0x6c, JMP, CPU6502Instruction.INDIRECT, 5));\r\n addInstruction(new CPU6502Instruction(\"JSR\", 0x20, JSR, CPU6502Instruction.ABSOLUTE, 6));\r\n addInstruction(new CPU6502Instruction(\"LDA\", 0xad, LDA, CPU6502Instruction.ABSOLUTE, 4));\r\n addInstruction(new CPU6502Instruction(\"LDA\", 0xa9, LDA, CPU6502Instruction.IMMEDIATE, 2));\r\n addInstruction(new CPU6502Instruction(\"LDA\", 0xa1, LDA, CPU6502Instruction.INDIRECT_X, 6));\r\n addInstruction(new CPU6502Instruction(\"LDA\", 0xb1, LDA, CPU6502Instruction.INDIRECT_Y, 5, true));\r\n addInstruction(new CPU6502Instruction(\"LDA\", 0xbd, LDA, CPU6502Instruction.ABSOLUTE_X, 4, true));\r\n addInstruction(new CPU6502Instruction(\"LDA\", 0xb9, LDA, CPU6502Instruction.ABSOLUTE_Y, 4, true));\r\n addInstruction(new CPU6502Instruction(\"LDA\", 0xa5, LDA, CPU6502Instruction.ZERO, 3));\r\n addInstruction(new CPU6502Instruction(\"LDA\", 0xb5, LDA, CPU6502Instruction.ZERO_X, 4));\r\n addInstruction(new CPU6502Instruction(\"LDX\", 0xae, LDX, CPU6502Instruction.ABSOLUTE, 4));\r\n addInstruction(new CPU6502Instruction(\"LDX\", 0xa2, LDX, CPU6502Instruction.IMMEDIATE, 2));\r\n addInstruction(new CPU6502Instruction(\"LDX\", 0xbe, LDX, CPU6502Instruction.ABSOLUTE_Y, 4, true));\r\n addInstruction(new CPU6502Instruction(\"LDX\", 0xa6, LDX, CPU6502Instruction.ZERO, 3));\r\n addInstruction(new CPU6502Instruction(\"LDX\", 0xb6, LDX, CPU6502Instruction.ZERO_Y, 4));\r\n addInstruction(new CPU6502Instruction(\"LDY\", 0xac, LDY, CPU6502Instruction.ABSOLUTE, 4));\r\n addInstruction(new CPU6502Instruction(\"LDY\", 0xa0, LDY, CPU6502Instruction.IMMEDIATE, 2));\r\n addInstruction(new CPU6502Instruction(\"LDY\", 0xbc, LDY, CPU6502Instruction.ABSOLUTE_X, 4, true));\r\n addInstruction(new CPU6502Instruction(\"LDY\", 0xa4, LDY, CPU6502Instruction.ZERO, 3));\r\n addInstruction(new CPU6502Instruction(\"LDY\", 0xb4, LDY, CPU6502Instruction.ZERO_X, 4));\r\n addInstruction(new CPU6502Instruction(\"LSR\", 0x4e, LSR, CPU6502Instruction.ABSOLUTE, 6));\r\n addInstruction(new CPU6502Instruction(\"LSR\", 0x4a, LSR, CPU6502Instruction.ACCUMULATOR, 2));\r\n addInstruction(new CPU6502Instruction(\"LSR\", 0x5e, LSR, CPU6502Instruction.ABSOLUTE_X, 7));\r\n addInstruction(new CPU6502Instruction(\"LSR\", 0x46, LSR, CPU6502Instruction.ZERO, 5));\r\n addInstruction(new CPU6502Instruction(\"LSR\", 0x56, LSR, CPU6502Instruction.ZERO_X, 6));\r\n addInstruction(new CPU6502Instruction(\"NOP\", 0xea, NOP, CPU6502Instruction.IMPLIED, 2));\r\n addInstruction(new CPU6502Instruction(\"ORA\", 0x0D, ORA, CPU6502Instruction.ABSOLUTE, 4));\r\n addInstruction(new CPU6502Instruction(\"ORA\", 0x09, ORA, CPU6502Instruction.IMMEDIATE, 2));\r\n addInstruction(new CPU6502Instruction(\"ORA\", 0x01, ORA, CPU6502Instruction.INDIRECT_X, 6));\r\n addInstruction(new CPU6502Instruction(\"ORA\", 0x11, ORA, CPU6502Instruction.INDIRECT_Y, 5, true));\r\n addInstruction(new CPU6502Instruction(\"ORA\", 0x1D, ORA, CPU6502Instruction.ABSOLUTE_X, 4, true));\r\n addInstruction(new CPU6502Instruction(\"ORA\", 0x19, ORA, CPU6502Instruction.ABSOLUTE_Y, 4, true));\r\n addInstruction(new CPU6502Instruction(\"ORA\", 0x05, ORA, CPU6502Instruction.ZERO, 3));\r\n addInstruction(new CPU6502Instruction(\"ORA\", 0x15, ORA, CPU6502Instruction.ZERO_X, 4));\r\n addInstruction(new CPU6502Instruction(\"PHA\", 0x48, PHA, CPU6502Instruction.IMPLIED, 3));\r\n addInstruction(new CPU6502Instruction(\"PHP\", 0x08, PHP, CPU6502Instruction.IMPLIED, 3));\r\n addInstruction(new CPU6502Instruction(\"PLA\", 0x68, PLA, CPU6502Instruction.IMPLIED, 4));\r\n addInstruction(new CPU6502Instruction(\"PLP\", 0x28, PLP, CPU6502Instruction.IMPLIED, 4));\r\n addInstruction(new CPU6502Instruction(\"ROL\", 0x2e, ROL, CPU6502Instruction.ABSOLUTE, 6));\r\n addInstruction(new CPU6502Instruction(\"ROL\", 0x2a, ROL, CPU6502Instruction.ACCUMULATOR, 2));\r\n addInstruction(new CPU6502Instruction(\"ROL\", 0x3e, ROL, CPU6502Instruction.ABSOLUTE_X, 7));\r\n addInstruction(new CPU6502Instruction(\"ROL\", 0x26, ROL, CPU6502Instruction.ZERO, 5));\r\n addInstruction(new CPU6502Instruction(\"ROL\", 0x36, ROL, CPU6502Instruction.ZERO_X, 6));\r\n addInstruction(new CPU6502Instruction(\"ROR\", 0x6e, ROR, CPU6502Instruction.ABSOLUTE, 6));\r\n addInstruction(new CPU6502Instruction(\"ROR\", 0x6a, ROR, CPU6502Instruction.ACCUMULATOR, 2));\r\n addInstruction(new CPU6502Instruction(\"ROR\", 0x7e, ROR, CPU6502Instruction.ABSOLUTE_X, 7));\r\n addInstruction(new CPU6502Instruction(\"ROR\", 0x66, ROR, CPU6502Instruction.ZERO, 5));\r\n addInstruction(new CPU6502Instruction(\"ROR\", 0x76, ROR, CPU6502Instruction.ZERO_X, 6));\r\n addInstruction(new CPU6502Instruction(\"RTI\", 0x40, RTI, CPU6502Instruction.IMPLIED, 6));\r\n addInstruction(new CPU6502Instruction(\"RTS\", 0x60, RTS, CPU6502Instruction.IMPLIED, 6));\r\n addInstruction(new CPU6502Instruction(\"SBC\", 0xed, SBC, CPU6502Instruction.ABSOLUTE, 4));\r\n addInstruction(new CPU6502Instruction(\"SBC\", 0xe9, SBC, CPU6502Instruction.IMMEDIATE, 2));\r\n addInstruction(new CPU6502Instruction(\"SBC\", 0xe1, SBC, CPU6502Instruction.INDIRECT_X, 6));\r\n addInstruction(new CPU6502Instruction(\"SBC\", 0xf1, SBC, CPU6502Instruction.INDIRECT_Y, 5, true));\r\n addInstruction(new CPU6502Instruction(\"SBC\", 0xfd, SBC, CPU6502Instruction.ABSOLUTE_X, 4, true));\r\n addInstruction(new CPU6502Instruction(\"SBC\", 0xf9, SBC, CPU6502Instruction.ABSOLUTE_Y, 4, true));\r\n addInstruction(new CPU6502Instruction(\"SBC\", 0xe5, SBC, CPU6502Instruction.ZERO, 3));\r\n addInstruction(new CPU6502Instruction(\"SBC\", 0xf5, SBC, CPU6502Instruction.ZERO_X, 4));\r\n addInstruction(new CPU6502Instruction(\"SEC\", 0x38, SEC, CPU6502Instruction.IMPLIED, 2));\r\n addInstruction(new CPU6502Instruction(\"SED\", 0xf8, SED, CPU6502Instruction.IMPLIED, 2));\r\n addInstruction(new CPU6502Instruction(\"SEI\", 0x78, SEI, CPU6502Instruction.IMPLIED, 2));\r\n addInstruction(new CPU6502Instruction(\"STA\", 0x8d, STA, CPU6502Instruction.ABSOLUTE, 4));\r\n addInstruction(new CPU6502Instruction(\"STA\", 0x81, STA, CPU6502Instruction.INDIRECT_X, 6));\r\n addInstruction(new CPU6502Instruction(\"STA\", 0x91, STA, CPU6502Instruction.INDIRECT_Y, 6));\r\n addInstruction(new CPU6502Instruction(\"STA\", 0x9d, STA, CPU6502Instruction.ABSOLUTE_X, 5));\r\n addInstruction(new CPU6502Instruction(\"STA\", 0x99, STA, CPU6502Instruction.ABSOLUTE_Y, 5));\r\n addInstruction(new CPU6502Instruction(\"STA\", 0x85, STA, CPU6502Instruction.ZERO, 3));\r\n addInstruction(new CPU6502Instruction(\"STA\", 0x95, STA, CPU6502Instruction.ZERO_X, 4));\r\n addInstruction(new CPU6502Instruction(\"STX\", 0x8e, STX, CPU6502Instruction.ABSOLUTE, 4));\r\n addInstruction(new CPU6502Instruction(\"STX\", 0x86, STX, CPU6502Instruction.ZERO, 3));\r\n addInstruction(new CPU6502Instruction(\"STX\", 0x96, STX, CPU6502Instruction.ZERO_Y, 4));\r\n addInstruction(new CPU6502Instruction(\"STY\", 0x8c, STY, CPU6502Instruction.ABSOLUTE, 4));\r\n addInstruction(new CPU6502Instruction(\"STY\", 0x84, STY, CPU6502Instruction.ZERO, 3));\r\n addInstruction(new CPU6502Instruction(\"STY\", 0x94, STY, CPU6502Instruction.ZERO_X, 4));\r\n addInstruction(new CPU6502Instruction(\"TAX\", 0xaa, TAX, CPU6502Instruction.IMPLIED, 2));\r\n addInstruction(new CPU6502Instruction(\"TAY\", 0xa8, TAY, CPU6502Instruction.IMPLIED, 2));\r\n addInstruction(new CPU6502Instruction(\"TSX\", 0xba, TSX, CPU6502Instruction.IMPLIED, 2));\r\n addInstruction(new CPU6502Instruction(\"TXA\", 0x8a, TXA, CPU6502Instruction.IMPLIED, 2));\r\n addInstruction(new CPU6502Instruction(\"TXS\", 0x9a, TXS, CPU6502Instruction.IMPLIED, 2));\r\n addInstruction(new CPU6502Instruction(\"TYA\", 0x98, TYA, CPU6502Instruction.IMPLIED, 2));\r\n // undocumentated instructions\r\n addInstruction(new CPU6502Instruction(\"ALR\", 0x4b, ALR, CPU6502Instruction.IMMEDIATE, 2));\r\n addInstruction(new CPU6502Instruction(\"ANC\", 0x0b, ANC, CPU6502Instruction.IMMEDIATE, 2));\r\n addInstruction(new CPU6502Instruction(this.instructions[ 0x0b], 0x2b));\r\n addInstruction(new CPU6502Instruction(\"ARR\", 0x6b, ARR, CPU6502Instruction.IMMEDIATE, 2));\r\n addInstruction(new CPU6502Instruction(\"ASO\", 0x0F, ASO, CPU6502Instruction.ABSOLUTE, 6));\r\n addInstruction(new CPU6502Instruction(\"ASO\", 0x03, ASO, CPU6502Instruction.INDIRECT_X, 8));\r\n addInstruction(new CPU6502Instruction(\"ASO\", 0x13, ASO, CPU6502Instruction.INDIRECT_Y, 8));\r\n addInstruction(new CPU6502Instruction(\"ASO\", 0x1f, ASO, CPU6502Instruction.ABSOLUTE_X, 7));\r\n addInstruction(new CPU6502Instruction(\"ASO\", 0x1b, ASO, CPU6502Instruction.ABSOLUTE_Y, 7));\r\n addInstruction(new CPU6502Instruction(\"ASO\", 0x07, ASO, CPU6502Instruction.ZERO, 5));\r\n addInstruction(new CPU6502Instruction(\"ASO\", 0x17, ASO, CPU6502Instruction.ZERO_X, 6));\r\n addInstruction(new CPU6502Instruction(\"AXS\", 0x8F, AXS, CPU6502Instruction.ABSOLUTE, 4));\r\n addInstruction(new CPU6502Instruction(\"AXS\", 0x83, AXS, CPU6502Instruction.INDIRECT_X, 6));\r\n addInstruction(new CPU6502Instruction(\"AXS\", 0x87, AXS, CPU6502Instruction.ZERO, 3));\r\n addInstruction(new CPU6502Instruction(\"AXS\", 0x97, AXS, CPU6502Instruction.ZERO_Y, 4));\r\n addInstruction(new CPU6502Instruction(\"DCM\", 0xCF, DCM, CPU6502Instruction.ABSOLUTE, 6));\r\n addInstruction(new CPU6502Instruction(\"DCM\", 0xC3, DCM, CPU6502Instruction.INDIRECT_X, 8));\r\n addInstruction(new CPU6502Instruction(\"DCM\", 0xD3, DCM, CPU6502Instruction.INDIRECT_Y, 8));\r\n addInstruction(new CPU6502Instruction(\"DCM\", 0xdf, DCM, CPU6502Instruction.ABSOLUTE_X, 7));\r\n addInstruction(new CPU6502Instruction(\"DCM\", 0xdb, DCM, CPU6502Instruction.ABSOLUTE_Y, 7));\r\n addInstruction(new CPU6502Instruction(\"DCM\", 0xC7, DCM, CPU6502Instruction.ZERO, 5));\r\n addInstruction(new CPU6502Instruction(\"DCM\", 0xD7, DCM, CPU6502Instruction.ZERO_X, 6));\r\n addInstruction(new CPU6502Instruction(\"INS\", 0xEF, INS, CPU6502Instruction.ABSOLUTE, 6));\r\n addInstruction(new CPU6502Instruction(\"INS\", 0xE3, INS, CPU6502Instruction.INDIRECT_X, 8));\r\n addInstruction(new CPU6502Instruction(\"INS\", 0xF3, INS, CPU6502Instruction.INDIRECT_Y, 8));\r\n addInstruction(new CPU6502Instruction(\"INS\", 0xff, INS, CPU6502Instruction.ABSOLUTE_X, 7));\r\n addInstruction(new CPU6502Instruction(\"INS\", 0xfb, INS, CPU6502Instruction.ABSOLUTE_Y, 7));\r\n addInstruction(new CPU6502Instruction(\"INS\", 0xE7, INS, CPU6502Instruction.ZERO, 5));\r\n addInstruction(new CPU6502Instruction(\"INS\", 0xF7, INS, CPU6502Instruction.ZERO_X, 6));\r\n addInstruction(new CPU6502Instruction(\"LAS\", 0xbb, LAS, CPU6502Instruction.ABSOLUTE_Y, 4, true));\r\n addInstruction(new CPU6502Instruction(\"LAX\", 0xAF, LAX, CPU6502Instruction.ABSOLUTE, 4));\r\n addInstruction(new CPU6502Instruction(\"LAX\", 0xA3, LAX, CPU6502Instruction.INDIRECT_X, 6));\r\n addInstruction(new CPU6502Instruction(\"LAX\", 0xB3, LAX, CPU6502Instruction.INDIRECT_Y, 5, true));\r\n addInstruction(new CPU6502Instruction(\"LAX\", 0xbf, LAX, CPU6502Instruction.ABSOLUTE_Y, 4));\r\n addInstruction(new CPU6502Instruction(\"LAX\", 0xA7, LAX, CPU6502Instruction.ZERO, 3));\r\n addInstruction(new CPU6502Instruction(\"LAX\", 0xB7, LAX, CPU6502Instruction.ZERO_Y, 4));\r\n addInstruction(new CPU6502Instruction(\"LSE\", 0x4F, LSE, CPU6502Instruction.ABSOLUTE, 6));\r\n addInstruction(new CPU6502Instruction(\"LSE\", 0x43, LSE, CPU6502Instruction.INDIRECT_X, 8));\r\n addInstruction(new CPU6502Instruction(\"LSE\", 0x53, LSE, CPU6502Instruction.INDIRECT_Y, 8));\r\n addInstruction(new CPU6502Instruction(\"LSE\", 0x5f, LSE, CPU6502Instruction.ABSOLUTE_X, 7));\r\n addInstruction(new CPU6502Instruction(\"LSE\", 0x5b, LSE, CPU6502Instruction.ABSOLUTE_Y, 7));\r\n addInstruction(new CPU6502Instruction(\"LSE\", 0x47, LSE, CPU6502Instruction.ZERO, 5));\r\n addInstruction(new CPU6502Instruction(\"LSE\", 0x57, LSE, CPU6502Instruction.ZERO_X, 6));\r\n addInstruction(new CPU6502Instruction(this.instructions[ 0xea], 0x1a));\r\n addInstruction(new CPU6502Instruction(this.instructions[ 0xea], 0x3a));\r\n addInstruction(new CPU6502Instruction(this.instructions[ 0xea], 0x5a));\r\n addInstruction(new CPU6502Instruction(this.instructions[ 0xea], 0x7a));\r\n addInstruction(new CPU6502Instruction(this.instructions[ 0xea], 0xda));\r\n addInstruction(new CPU6502Instruction(this.instructions[ 0xea], 0xfa));\r\n addInstruction(new CPU6502Instruction(\"OAL\", 0xab, OAL, CPU6502Instruction.IMMEDIATE, 2));\r\n addInstruction(new CPU6502Instruction(\"RLA\", 0x2F, RLA, CPU6502Instruction.ABSOLUTE, 6));\r\n addInstruction(new CPU6502Instruction(\"RLA\", 0x23, RLA, CPU6502Instruction.INDIRECT_X, 8));\r\n addInstruction(new CPU6502Instruction(\"RLA\", 0x33, RLA, CPU6502Instruction.INDIRECT_Y, 8));\r\n addInstruction(new CPU6502Instruction(\"RLA\", 0x3f, RLA, CPU6502Instruction.ABSOLUTE_X, 7));\r\n addInstruction(new CPU6502Instruction(\"RLA\", 0x3b, RLA, CPU6502Instruction.ABSOLUTE_Y, 7));\r\n addInstruction(new CPU6502Instruction(\"RLA\", 0x27, RLA, CPU6502Instruction.ZERO, 5));\r\n addInstruction(new CPU6502Instruction(\"RLA\", 0x37, RLA, CPU6502Instruction.ZERO_X, 6));\r\n addInstruction(new CPU6502Instruction(\"RRA\", 0x6F, RRA, CPU6502Instruction.ABSOLUTE, 6));\r\n addInstruction(new CPU6502Instruction(\"RRA\", 0x63, RRA, CPU6502Instruction.INDIRECT_X, 8));\r\n addInstruction(new CPU6502Instruction(\"RRA\", 0x73, RRA, CPU6502Instruction.INDIRECT_Y, 8));\r\n addInstruction(new CPU6502Instruction(\"RRA\", 0x7f, RRA, CPU6502Instruction.ABSOLUTE_X, 7));\r\n addInstruction(new CPU6502Instruction(\"RRA\", 0x7b, RRA, CPU6502Instruction.ABSOLUTE_Y, 7));\r\n addInstruction(new CPU6502Instruction(\"RRA\", 0x67, RRA, CPU6502Instruction.ZERO, 5));\r\n addInstruction(new CPU6502Instruction(\"RRA\", 0x77, RRA, CPU6502Instruction.ZERO_X, 6));\r\n addInstruction(new CPU6502Instruction(\"SAX\", 0xcb, SAX, CPU6502Instruction.IMMEDIATE, 2));\r\n addInstruction(new CPU6502Instruction(\"SAY\", 0x9c, SAY, CPU6502Instruction.ABSOLUTE_X, 5));\r\n addInstruction(new CPU6502Instruction(this.instructions[ 0xe9], 0xeb));\r\n addInstruction(new CPU6502Instruction(\"AXA\", 0x93, AXA, CPU6502Instruction.INDIRECT_Y, 6));\r\n addInstruction(new CPU6502Instruction(\"AXA\", 0x9f, AXA, CPU6502Instruction.ABSOLUTE_Y, 5));\r\n addInstruction(new CPU6502Instruction(\"SKB\", 0x80, SKB, CPU6502Instruction.IMMEDIATE, 3));\r\n addInstruction(new CPU6502Instruction(this.instructions[ 0x80], 0x82));\r\n addInstruction(new CPU6502Instruction(this.instructions[ 0x80], 0xc2));\r\n addInstruction(new CPU6502Instruction(this.instructions[ 0x80], 0xe2));\r\n addInstruction(new CPU6502Instruction(this.instructions[ 0x80], 0x04));\r\n addInstruction(new CPU6502Instruction(this.instructions[ 0x80], 0x14));\r\n addInstruction(new CPU6502Instruction(this.instructions[ 0x80], 0x34));\r\n addInstruction(new CPU6502Instruction(this.instructions[ 0x80], 0x44));\r\n addInstruction(new CPU6502Instruction(this.instructions[ 0x80], 0x54));\r\n addInstruction(new CPU6502Instruction(this.instructions[ 0x80], 0x64));\r\n addInstruction(new CPU6502Instruction(this.instructions[ 0x80], 0x74));\r\n addInstruction(new CPU6502Instruction(this.instructions[ 0x80], 0xd4));\r\n addInstruction(new CPU6502Instruction(this.instructions[ 0x80], 0xf4));\r\n addInstruction(new CPU6502Instruction(\"SKB\", 0x89, SKB, CPU6502Instruction.IMMEDIATE, 2));\r\n addInstruction(new CPU6502Instruction(\"SKW\", 0x0c, SKW, CPU6502Instruction.ABSOLUTE, 4));\r\n addInstruction(new CPU6502Instruction(\"SKW\", 0x1c, SKW, CPU6502Instruction.INDIRECT_X, 4, true));\r\n addInstruction(new CPU6502Instruction(this.instructions[ 0x1c], 0x3c));\r\n addInstruction(new CPU6502Instruction(this.instructions[ 0x1c], 0x5c));\r\n addInstruction(new CPU6502Instruction(this.instructions[ 0x1c], 0x7c));\r\n addInstruction(new CPU6502Instruction(this.instructions[ 0x1c], 0xdc));\r\n addInstruction(new CPU6502Instruction(this.instructions[ 0x1c], 0xfc));\r\n addInstruction(new CPU6502Instruction(\"TAS\", 0x9b, TAS, CPU6502Instruction.ABSOLUTE_Y, 5));\r\n addInstruction(new CPU6502Instruction(\"XAA\", 0x8b, XAA, CPU6502Instruction.IMMEDIATE, 2));\r\n addInstruction(new CPU6502Instruction(\"XAS\", 0x9e, XAS, CPU6502Instruction.ABSOLUTE_Y, 5));\r\n }",
"private static Computer[] loadComputers(ArrayList<String> OSList, int infect) {\n Computer[] computers = new Computer[OSList.size()];\n\n for (int i = 0; i < OSList.size(); i++) {\n computers[i] = new Computer(OSList.get(i), random);\n }\n computers[infect - 1].infect();\n\n return computers;\n }",
"private void loadInstructions(int count, byte... codes) {\r\n\t\tint instructionLocation = instructionBase;\r\n\t\tfor (int i = 0; i < count; i++) {\r\n\t\t\tfor (byte code : codes) {\r\n\t\t\t\tcpuBuss.write(instructionLocation++, code);\r\n\t\t\t} // for codes\r\n\t\t} // for\r\n\t\twrs.setProgramCounter(instructionBase);\r\n\t}",
"static void loadProgram(String assemblyProgramFile)\n\t{\n\t\t\n\t\tMainMemory mainmemory = Simulator.processor.getMainMemory();\n\t int currMemLocation=0;\n\t \n\t\ttry\n\t\t {\n\t\t DataInputStream instr = \n\t\t new DataInputStream(\n\t\t new BufferedInputStream(\n\t\t new FileInputStream( assemblyProgramFile ) ) );\n\t\t \t\n\t\t int instruction;\n\t\t Boolean pcSet=false;\n\t\t processor.getRegisterFile().setValue(0, 0);\n\t\t processor.getRegisterFile().setValue(1, 65535);\n\t\t processor.getRegisterFile().setValue(2, 65535);\n\n\t\t \n\t\t while(true) {\n\t\t\t try {\n\t\t\t \t instruction = instr.readInt();\n\t\t\t \t if(pcSet==false) {\n\t\t\t \t\t processor.getRegisterFile().setProgramCounter(instruction);\n\t\t\t \t\t processor.getEX_IF_Latch().setBranchPC(instruction);\n\t\t\t \t\t System.out.println(\"Simulator - pc set to \"+instruction);\n\t\t\t \t\t pcSet=true;\n\t\t\t \t }else {\n\t\t\t \t\t mainmemory.setWord(currMemLocation, instruction);\n\t\t\t \t\t currMemLocation++;\n\t\t\t \t }\n\t\t\t \t \n\t\t\t }\n\t\t\t catch(EOFException e) {\n\t\t\t \t break;\n\t\t\t }\n\t\t }\n\t\t \n\t\t instr.close();\n\t\t }\n\t\t catch ( IOException iox )\n\t\t {\n\t\t System.out.println(\"Problem reading \" + assemblyProgramFile );\n\t\t }\n\t\t\n\t\tSystem.out.println(mainmemory.getContentsAsString(0,currMemLocation+10));\n\t}",
"public void initFromResource() {\n String[] hwStrings = Resources.getSystem().getStringArray(17236074);\n if (hwStrings != null) {\n for (String hwString : hwStrings) {\n HardwareConfig hw = new MtkHardwareConfig(hwString);\n if (hw.type == 0) {\n updateOrInsert(hw, mModems);\n } else if (hw.type == 1) {\n updateOrInsert(hw, mSims);\n }\n }\n }\n }",
"private static void Initialize()\n\t{\n\t\tcurrentPC = 3996;\n\t\tcurrentFilePointer = 0;\n\t\tmemoryBlocks = new int[4000];\n\t\tregisterFile = new HashMap<String, Integer>();\n\t\tstages = new HashMap<String, Instruction>();\n\t\tlatches = new HashMap<String, Instruction>();\n\t\tspecialRegister = 0;\n\t\tisComplete = false;\n\t\tisValidSource = true;\n\t\tSystem.out.println(\"-----Initialization Completed------\");\n\t}",
"public static void main(String... strings) {\n\t\t\n\t\tfinal MipsComputer comp = new MipsComputer();\n\t\t\n\t\tFile f = new File(filePath);\n\t\tif (f.exists() && !f.isDirectory()) {\n\t\t\tcomp.setFromMars(true);\n\t\t\treadInstructionsFromFile(f, comp);\n\t\t} else {\n\t\t\tcomp.setFromMars(false);\n\t\t\treadInstructionsFromArray(comp);\n\t\t}\n\t\t\n\t\tcomp.execute();\n\t\tcomp.print();\n\t}",
"public void loadMemory() {\n Converter c = new Converter(); //object to help with binary to decimal conversions and vice-versa\n \n int midpoint = (int) Math.floor(size/2); //divide memory into two haves\n \n //variables that will be needed\n int opcode;\n int address = midpoint;\n int index=0;\n\n //Initial instructions\n opcode = c.convertDecToBin(3); //0011\n instruction = new Instruction(opcode, c.convertDecToBin(address)); //load AC from stdin\n Memory.memloc.set(index, instruction); //saving instruction to memory\n\n opcode = c.convertDecToBin(7); //0111;\n instruction = new Instruction(opcode, c.convertDecToBin(address)); //store AC to stdout\n Memory.memloc.set(index+1, instruction);\n\n opcode = c.convertDecToBin(2); //0010\n instruction = new Instruction(opcode, c.convertDecToBin(address)); //store AC to memory\n Memory.memloc.set(index+2, instruction); //saving instruction to memory\n\n opcode = c.convertDecToBin(3); //0011\n instruction = new Instruction(opcode, c.convertDecToBin(address)); //load AC from stdin\n Memory.memloc.set(index+3, instruction); //saving instruction to memory\n\n opcode = c.convertDecToBin(2); //0010\n instruction = new Instruction(opcode, c.convertDecToBin(address+1)); //store AC to memory\n Memory.memloc.set(index+4, instruction); //saving instruction to memory\n\n\n //The rest of the instructions\n for (int i = 5; i < midpoint; i = i + 6) {\n index = i;\n\n if ((index + 5) < midpoint-1) { //if index + 5 is not greater than the midpoint-1\n\n opcode = c.convertDecToBin(1); //0001\n instruction = new Instruction(opcode, c.convertDecToBin(address)); //load AC from memory\n Memory.memloc.set(index, instruction); //saving instruction to memory\n \n opcode = c.convertDecToBin(5); //0101;\n address++;\n instruction = new Instruction(opcode, c.convertDecToBin(address)); //add to AC from memory\n Memory.memloc.set(index + 1, instruction);\n\n opcode = c.convertDecToBin(7); //0111;\n instruction = new Instruction(opcode, c.convertDecToBin(address)); //store AC to stdout\n Memory.memloc.set(index + 2, instruction);\n\n opcode = c.convertDecToBin(2); //0010;\n address++;\n instruction = new Instruction(opcode, c.convertDecToBin(address)); //store AC to memory\n Memory.memloc.set(index + 3, instruction);\n\n opcode = c.convertDecToBin(4); //0100;\n address--;\n instruction = new Instruction(opcode, c.convertDecToBin(address)); //subtract from AC from memory\n Memory.memloc.set(index + 4, instruction);\n\n opcode = c.convertDecToBin(2); //0010;\n address = address + 2;\n instruction = new Instruction(opcode, c.convertDecToBin(address)); //store AC to memory\n Memory.memloc.set(index + 5, instruction);\n\n address--;\n } \n }\n\n //Loading the final intsruction in memory\n opcode = c.convertDecToBin(15); //1111;\n address++;\n instruction = new Instruction(opcode, c.convertDecToBin(address)); //halt\n Memory.memloc.set(index++, instruction);\n\n\n }",
"public Computer() {\n\t\tmPC = new BitString();\n\t\tmPC.setValue(0);\n\t\tmIR = new BitString();\n\t\tmIR.setValue(0);\n\t\tmCC = new BitString();\n\t\tmCC.setBits(new char[] { '0', '0', '0' });\n\t\tmRegisters = new BitString[MAX_REGISTERS];\n\t\tfor (int i = 0; i < MAX_REGISTERS; i++) {\n\t\t\tmRegisters[i] = new BitString();\n\t\t\tmRegisters[i].setValue(i);\n\t\t}\n\n\t\tmMemory = new BitString[MAX_MEMORY];\n\t\tfor (int i = 0; i < MAX_MEMORY; i++) {\n\t\t\tmMemory[i] = new BitString();\n\t\t\tmMemory[i].setValue(0);\n\t\t}\n\t}",
"public void readInstFromFile(int exeCycle, String fileName){\n\t\ttry (FileReader fp = new FileReader(fileName)) {\n\t\t\tBufferedReader lineReader = new BufferedReader(fp);\n\t\t\tinstructions = new ArrayList<>();\n\t\t\textraCycle += exeCycle;\n\t\t\tint instrCount = 0;\n\t\t\tString line;\n\t\t\t//readline untill new line found\n\t\t\tfor(int i=0; (line = lineReader.readLine()) != null; i++){\n\t\t\t\tline = line.replaceAll(\"[\\\\,\\\\#]\",\"\"); //regex to remove commas in the instructions\n\t\t\t\tString[] instParts = line.split(\" \");\n\t\t\t\tInstructionStructure inst = new InstructionStructure();\n\t\t\t\tinst.setInst_number(instrCount); //set the instruction number which helps in execution order \n\t\t\t\tinstrCount += 1;\n\t\t\t\tinstructions.add(inst);\n\t\t\t\tinst.setLogicOpSign(instParts[0]);\n\t\t\t\tinst.setStage(\"Read\"); \n\t\t\t\t//Based on the operation available instructions \n\t\t\t\t// the instructions is split and assign to the Instruction structure POJO\n\t\t\t\tswitch(instParts[0]){\n\t\t\t\t\tcase \"ADD\":\n\t\t\t\t\tcase \"SUB\":\n\t\t\t\t\tcase \"AND\":\n\t\t\t\t\tcase \"OR\":\n\t\t\t\t\tcase \"EXOR\":\n\t\t\t\t\tcase \"MUL\":\n\t\t\t\t\t\tinst.setDest(instParts[1]);\n\t\t\t\t\t\tinst.setSrc1(instParts[2]);\n\t\t\t\t\t\tinst.setSrc2(instParts[3]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"MOVC\":\n\t\t\t\t\t\tinst.setDest(instParts[1]);\n\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\tint literal = Integer.parseInt(instParts[2]);\n\t\t\t\t\t\t\tinst.setLiteral(literal);\n\t\t\t\t\t\t\tinst.decodedSrc1 = literal;\n\t\t\t\t\t\t}catch(Exception e){\n\t\t\t\t\t\t\tinst.setSrc1(instParts[2]);\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"BZ\":\n\t\t\t\t\tcase \"BNZ\":\n\t\t\t\t\t\tInstructionStructure lastInst = instructions.get(i-1); // getting the previous instruction in pipeline\n\t\t\t\t\t\tif(lastInst != null){\n\t\t\t\t\t\t\tint literal2 = Integer.parseInt(instParts[1]);\n\t\t\t\t\t\t\tinst.setSrc1(lastInst.getDest()); // set previous instruction destination register as source\n\t\t\t\t\t\t\tinst.setLiteral(literal2);\n\t\t\t\t\t\t\tinst.decodedSrc2 = literal2;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tSystem.out.println(\"Branch without any last Instruction\");\n\t\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"JUMP\":\n\t\t\t\t\t\tinst.setSrc1(instParts[1]);\n\t\t\t\t\t\tint literal3 = Integer.parseInt(instParts[2]);\n\t\t\t\t\t\tinst.setLiteral(literal3);\n\t\t\t\t\t\tinst.decodedSrc2 = literal3;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"STORE\":\n\t\t\t\t\t\tinst.setSrc1(instParts[1]);\n\t\t\t\t\t\tinst.setSrc2(instParts[2]);\n\t\t\t\t\t\tint literal = Integer.parseInt(instParts[3]);\n\t\t\t\t\t\tinst.setLiteral(literal);\n\t\t\t\t\t\tinst.decodedDest = literal;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"LOAD\":\n\t\t\t\t\t\tinst.setDest(instParts[1]);\n\t\t\t\t\t\tinst.setSrc1(instParts[2]);\n\t\t\t\t\t\tint literal1 = Integer.parseInt(instParts[3]);\n\t\t\t\t\t\tinst.setLiteral(literal1);\n\t\t\t\t\t\tinst.decodedSrc2 = literal1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlineReader.close();\n\t\t\t//check the looping cycle(extracycle) with in cycle limit\n\t\t\twhile (extraCycle >= cycles){\n\t\t\t\tInstructionExecution instructionExecution = new InstructionExecution();\n\t\t\t\tMap<String, InstructionStructure> pipelineStatus = ApexSimulatorHelper.INSTANCE.getPipelineStatus();\n\t\t\t\tnew StageExecution().ExeInstructionInStages();\n\n\t\t\t\tif(pipelineStatus.get(\"WB\") != null ){\n\t\t\t\t\tInstructionStructure instr = pipelineStatus.get(\"WB\");\n\t\t\t\t\tString destRegister = instr.getDest();\n\t\t\t\t\tRegisterHandler registerOp = ApexSimulatorHelper.INSTANCE.getRegister(destRegister);\n\t\t\t\t\tRegisterHandler PSWreg = ApexSimulatorHelper.INSTANCE.getRegister(\"PSW\");\n\n\t\t\t\t\tif(registerOp != null){\n\t\t\t\t\t\tregisterOp.setStatus(false);\n\t\t\t\t\t}\n\t\t\t\t\tif(instr.isCurrentValue()){\n\t\t\t\t\t\tregisterOp.setValue(instr.getResult());\n\t\t\t\t\t\tif(!instr.getLogicOpSign().equals(\"MOVC\")){\n\t\t\t\t\t\t\tif(instr.getResult() == 0){\n\t\t\t\t\t\t\t\tPSWreg.setValue(1); // set psw zero flag because the computed result is 0.\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tPSWreg.setValue(0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(pipelineStatus.get(\"MEM\") != null){\n\t\t\t\t\tInstructionStructure instr = pipelineStatus.get(\"MEM\");\n\t\t\t\t\tinstructionExecution.ExecuteInstr(instr);\n\t\t\t\t\tswitch(instr.getLogicOpSign()){\n\t\t\t\t\t\tcase \"LOAD\":\n\t\t\t\t\t\t\tif(instr.getDest() != null){\n\t\t\t\t\t\t\t\tRegisterHandler destination = ApexSimulatorHelper.INSTANCE.getRegister(instr.getDest());\n\t\t\t\t\t\t\t\tdestination.setStatus(true);\n\t\t\t\t\t\t\t\tint src1 = instr.decodedSrc1;\n\t\t\t\t\t\t\t\tint literal = instr.decodedSrc2;\n\t\t\t\t\t\t\t\tint address = src1 + literal;\n\t\t\t\t\t\t\t\tdestination.setValue(memoryOp.get(address));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"STORE\":\n\t\t\t\t\t\t\tif(instr.getSrc2()!=null){\n\t\t\t\t\t\t\t\tint lit = instr.decodedDest;\n\t\t\t\t\t\t\t\tint src1 = instr.decodedSrc1;\n\t\t\t\t\t\t\t\tint dest1 = instr.decodedSrc2;\n\t\t\t\t\t\t\t\tint address = dest1 + lit;\n\t\t\t\t\t\t\t\tmemoryOp.set(address, src1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(pipelineStatus.get(\"MUL1\") != null){\n\t\t\t\t\tInstructionStructure instr = pipelineStatus.get(\"MUL1\");\n\t\t\t\t\tinstructionExecution.ExecuteInstr(instr);\n\t\t\t\t\tinstructionExecution.Mul1Execution(instr);\n\t\t\t\t}\n\t\t\t\tif(pipelineStatus.get(\"MUL2\") != null){\n\t\t\t\t\tInstructionStructure instr = pipelineStatus.get(\"MUL2\");\n\t\t\t\t\tinstructionExecution.ExecuteInstr(instr);\n\t\t\t\t\tinstructionExecution.Mul2Execution(instr);\n\t\t\t\t}\n\t\t\t\tif(pipelineStatus.get(\"IFU\") != null){\n\t\t\t\t\tInstructionStructure instr = pipelineStatus.get(\"IFU\");\n\t\t\t\t\tinstructionExecution.ExecuteInstr(instr);\n\t\t\t\t\tinstructionExecution.IntegerFUExecution(instr);\n\t\t\t\t}\n\t\t\t\tif(pipelineStatus.get(\"DECODE\") != null){\n\t\t\t\t\tInstructionStructure instr = pipelineStatus.get(\"DECODE\");\n\t\t\t\t\tString src1 = instr.getSrc1();\n\t\t\t\t\tString src2 = instr.getSrc2();\n\t\t\t\t\tif(src1 != null){\n\t\t\t\t\t\tif(!ApexSimulatorHelper.INSTANCE.getRegister(src1).isStatus()){\n\t\t\t\t\t\t\tinstr.decode_source1();\n\t\t\t\t\t\t\tif(src2 != null){\n\t\t\t\t\t\t\t\tif(!ApexSimulatorHelper.INSTANCE.getRegister(src2).isStatus()){\n\t\t\t\t\t\t\t\t\tinstr.setStage(\"ready\");\n\t\t\t\t\t\t\t\t\tinstr.decode_source2();\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\tinstr.setStage(\"stalled\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tinstr.setStage(\"ready\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tinstr.setStage(\"stalled\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\tinstr.setStage(\"ready\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tApexSimulatorHelper.INSTANCE.printState();\n\t\t\t\tcycles += 1;\n\t\t\t\tStageExecution stageExecution = new StageExecution();\n\t\t\t\tif(!stageExecution.allInstructionsExecuted()){\n\t\t\t\t\tif(cycles > extraCycle){\n\t\t\t\t\t\tApexSimulatorHelper.INSTANCE.printArchState();\n\t\t\t\t\t\tSystem.out.println(\"Do you want to Simulate for some more cycles?Y/N\");\n\t\t\t\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\t\t\t\tif(br.readLine().equalsIgnoreCase(\"Y\")){\n\t\t\t\t\t\t\tSystem.out.println(\"Please enter the number of cycles you want to simulate more\");\n\t\t\t\t\t\t\textraCycle = extraCycle + Integer.parseInt(br.readLine());\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tApexSimulatorHelper.INSTANCE.actualCycle = cycles;\n\t\t\t\t\t\t\tcycles = 1;\n\t\t\t\t\t\t\tStageExecution.pc = 4000;\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tApexSimulatorHelper.INSTANCE.actualCycle = cycles; \n\t\t\t\t\tApexSimulatorHelper.INSTANCE.printArchState();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}catch (Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"void loadExperiment();",
"private synchronized void fetch() throws RuntimeException\n {\n clockTick();\n mLastInstructionAddress = mPC;\n if (mPC >= PROGRAM_MEMORY_SIZE)\n throw new RuntimeException(Constants.Error(Constants.UPPER_MEMORY_LIMIT)); \n\n mMBR = program_memory[mPC++];\n mPC %= mMaxPCValue;\n // These instructions are 32bits wide\n // If the current instruction matches these, read the second word\n if (InstructionDecoder.InstructionLength(mMBR) == 32)\n {\n if (mPC >= PROGRAM_MEMORY_SIZE)\n throw new RuntimeException(Constants.Error(Constants.UPPER_MEMORY_LIMIT));\n mMBR2 = program_memory[mPC++];\n mPC %= mMaxPCValue;\n clockTick();\n }\n else\n mMBR2 = 0; \n }",
"private static void load(){\n }",
"public static void load(){\n\t\trobot=new BufferedImage[5];\n\t\ttry {\n\t\t\tfor(int i=0;i<5;i++)\n\t\t\t\trobot[i]=ImageIO.read(new File(\"robot\" + i +\".png\"));\n\t\t\t\n\t\t\tminiRobot=ImageIO.read(new File(\"miniRobot.png\"));\n\t\t\toil=ImageIO.read(new File(\"oil.png\"));\n\t\t\tslime=ImageIO.read(new File(\"slime.png\"));\n\t\t\tmap=ImageIO.read(new File(\"map.png\"));\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(e + \"Failed to load images\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t}",
"public void initializeSubScenes(){\n paycheckController.attachInterpreters(controllerInterpreter, userInterpreter, offlineInfo);\n c00Controller.attachInterpreters(controllerInterpreter, userInterpreter, offlineInfo);\n c10Controller.attachInterpreters(controllerInterpreter, userInterpreter, offlineInfo);\n c20Controller.attachInterpreters(controllerInterpreter, userInterpreter, offlineInfo);\n c01Controller.attachInterpreters(controllerInterpreter, userInterpreter, offlineInfo);\n c11Controller.attachInterpreters(controllerInterpreter, userInterpreter, offlineInfo);\n c21Controller.attachInterpreters(controllerInterpreter, userInterpreter, offlineInfo);\n c02Controller.attachInterpreters(controllerInterpreter, userInterpreter, offlineInfo);\n c12Controller.attachInterpreters(controllerInterpreter, userInterpreter, offlineInfo);\n c22Controller.attachInterpreters(controllerInterpreter, userInterpreter, offlineInfo);\n c03Controller.attachInterpreters(controllerInterpreter, userInterpreter, offlineInfo);\n c13Controller.attachInterpreters(controllerInterpreter, userInterpreter, offlineInfo);\n c23Controller.attachInterpreters(controllerInterpreter, userInterpreter, offlineInfo);\n\n c00Controller.setPositionInGrid(1, 1);\n c10Controller.setPositionInGrid(2, 1);\n c20Controller.setPositionInGrid(3, 1);\n c01Controller.setPositionInGrid(1, 2);\n c11Controller.setPositionInGrid(2, 2);\n c21Controller.setPositionInGrid(3, 2);\n c02Controller.setPositionInGrid(1, 3);\n c12Controller.setPositionInGrid(2, 3);\n c22Controller.setPositionInGrid(3, 3);\n c03Controller.setPositionInGrid(1, 4);\n c13Controller.setPositionInGrid(2, 4);\n c23Controller.setPositionInGrid(3, 4);\n }",
"private void loadRack() {\n buildRack();\n for (LetterTile tile : rack)\n add(tile);\n }",
"public static void load(){\r\n\t \ttry {\r\n\t \t\t// load and set all sprites\r\n\t\t\t\tsetBlueGarbage(ImageIO.read(classPath.getResourceAsStream(\"/images/blueGarbage.png\")));\r\n\t\t\t\tsetRank(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/rank.png\")));\r\n\t\t\t\tsetRedGarbage(ImageIO.read(classPath.getResourceAsStream(\"/images/redGarbage.png\")));\r\n\t\t\t\tsetYellowGarbage(ImageIO.read(classPath.getResourceAsStream(\"/images/yellowGarbage.png\")));\r\n\t\t\t\tsetGreenGarbage(ImageIO.read(classPath.getResourceAsStream(\"/images/greenGarbage.png\")));\r\n\t\t\t\tsetBlueSnakeBodyPart(ImageIO.read(classPath.getResourceAsStream(\"/images/blueSnakeBodyPart.png\")));\r\n\t\t\t\tsetRedSnakeBodyPart(ImageIO.read(classPath.getResourceAsStream(\"/images/redSnakeBodyPart.png\")));\r\n\t\t\t\tsetYellowSnakeBodyPart(ImageIO.read(classPath.getResourceAsStream(\"/images/yellowSnakeBodyPart.png\")));\r\n\t\t\t\tsetGreenSnakeBodyPart(ImageIO.read(classPath.getResourceAsStream(\"/images/greenSnakeBodyPart.png\")));\r\n\t\t\t\tsetHeart(ImageIO.read(classPath.getResourceAsStream(\"/images/heart.png\")));\r\n\t\t\t\tsetGameScreenBackground(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/gameScreenBackground.png\")));\r\n\t\t\t\tsetGameScreenHeader(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/gameScreenHeader.png\")));\r\n\t\t\t\tsetGameOver(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/gameOver.png\")));\r\n\t\t\t\tsetHitsOwnBody(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/hitsOwnBody.png\")));\r\n\t\t\t\tsetHitsWall(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/hitsWall.png\")));\r\n\t\t\t\tsetWrongColor(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/wrongColor.png\")));\r\n\t\t\t\tsetHelpScreenBackground(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/helpScreenBackground.png\")));\r\n\t\t\t \tsetWarningScreenBackground(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/warningScreenBackground.png\")));\r\n\t\t\t \tsetOkButton(ImageIO.read(classPath.getClass().getResource(\"/images/okButton.png\")));\r\n\t\t\t \tsetMenuScreenBackground(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/menuScreenBackground.png\")));\r\n\t\t\t\tsetStartButton(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/startButton.png\")));\r\n\t\t\t\tsetExitButton(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/exitButton.png\")));\r\n\t\t\t\tsetHelpButton(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/helpButton.png\")));\r\n\t\t\t\t\r\n\t \t} \r\n\t \tcatch (Exception e) {\r\n\t\t\t\tJOptionPane.showMessageDialog(null, e.getStackTrace(), \"Erro ao carregar imagens\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t\tSystem.exit(0);\r\n\t\t\t\r\n\t\t\t}\t\r\n \t\r\n \t}",
"private void LoadCoreValues()\n\t{\n\t\tString[] reservedWords = \t{\"program\",\"begin\",\"end\",\"int\",\"if\",\"then\",\"else\",\"while\",\"loop\",\"read\",\"write\"};\n\t\tString[] specialSymbols = {\";\",\",\",\"=\",\"!\",\"[\",\"]\",\"&&\",\"||\",\"(\",\")\",\"+\",\"-\",\"*\",\"!=\",\"==\",\"<\",\">\",\"<=\",\">=\"};\n\t\t\n\t\t//Assign mapping starting at a value of 1 for reserved words\n\t\tfor (int i=0;i<reservedWords.length;i++)\n\t\t{\n\t\t\tcore.put(reservedWords[i], i+1);\n\t\t}\n\t\t//Assign mapping for special symbols\n\t\tfor (int i=0; i<specialSymbols.length; i++)\n\t\t{\t\n\t\t\tcore.put(specialSymbols[i], reservedWords.length + i+1 );\n\t\t}\n\t}",
"private int loadProgram(Program program, int start) throws MemoryFault {\n int address = start;\n for (int i : program.getCode()) {\n machine.memory.store(address++, i);\n }\n return address;\n }",
"public Instruction getInstruction(String label) {\n int s1; // Possible operands of the instruction\n int s2;\n String s3;\n int r;\n int x;\n\n if (line.equals(\"\"))\n return null;\n\n //Get the first word as a string\n String ins = scan();\n\n // Generate the instruction classname that corresponds with the label\n String instructionName = ins.substring(0, 1).toUpperCase() + ins.substring(1).toLowerCase() + \"Instruction\" ;\n\n //System.out.println(\"The scanned label is: \" + ins);\n //System.out.println(\"Use instruction class: \" + instructionName);\n\n // Make a list of the remaining words\n List<String> wordList = new ArrayList<>();\n List<Class> paramTypes = new ArrayList<>();\n\n //The first constructor param is always the label string\n wordList.add(label);\n paramTypes.add(String.class);\n\n String nextWord;\n\n /*\n if (!nextWord.equals(\"\")){\n wordList.add(nextWord);\n paramTypes.add(nextWord.getClass());\n }\n */\n\n while (!(nextWord = scan()).equals(\"\")){\n wordList.add(nextWord);\n }\n\n //System.out.println(\"The next word is: \" + instructionName);\n\n Object wordArray [] = wordList.toArray();\n Class<?> paramArray [] = new Class<?> [wordArray.length];\n\n try {\n for (int i = 0; i < wordArray.length; i++){\n String str = wordArray[i].toString();\n\n if (Pattern.matches((\"-?[0-9]+\"), str)){\n paramArray [i] = Integer.TYPE;\n wordArray [i] = Integer.parseInt((String) wordArray[i]);\n } else {\n paramArray [i] = String.class;\n\n }\n }\n\n //System.out.println(\"My word array contains: \" + Arrays.asList(wordArray));\n //System.out.println(\"My parameter array contains: \" + Arrays.asList(paramArray));\n //System.out.println(\"Instruction name is: \" + instructionName);\n\n //Reflect class\n Class reflectionClass = Class.forName(\"sml.\" + instructionName);\n\n //System.out.println(\"My reflection is: \" + reflectionClass);\n\n Constructor con = reflectionClass.getConstructor(paramArray);\n\n // Cast return back to an Instruction\n return ((Instruction)con.newInstance(wordArray));\n\n } catch (ClassNotFoundException e) {\n //e.printStackTrace();\n System.err.println(\"Error\");\n } catch (NoSuchMethodException e) {\n //e.printStackTrace();\n System.err.println(\"Error\");\n } catch (InvocationTargetException e) {\n //e.printStackTrace();\n System.err.println(\"Error\");\n } catch (InstantiationException e) {\n //e.printStackTrace();\n System.err.println(\"Error\");\n } catch (IllegalAccessException e) {\n //e.printStackTrace();\n System.err.println(\"Error\");\n }\n\n/*\n // Commented out switch statement\n\n switch (ins) {\n case \"add\":\n r = scanInt();\n s1 = scanInt();\n s2 = scanInt();\n return new AddInstruction(label, r, s1, s2);\n case \"lin\":\n r = scanInt();\n s1 = scanInt();\n return new LinInstruction(label, r, s1);\n case \"out\":\n r = scanInt();\n return new OutInstruction(label, r);\n case \"sub\":\n r = scanInt();\n s1 = scanInt();\n s2 = scanInt();\n return new SubInstruction(label, r, s1, s2);\n case \"mul\":\n r = scanInt();\n s1 = scanInt();\n s2 = scanInt();\n return new MulInstruction(label, r, s1, s2);\n case \"div\":\n r = scanInt();\n s1 = scanInt();\n s2 = scanInt();\n return new DivInstruction(label, r, s1, s2);\n case \"bnz\":\n r = scanInt();\n s3 = scan();\n return new BnzInstruction(label, r, s3);\n }\n\n // You will have to write code here for the other instructions.\n*/\n\n return null;\n }",
"@Override protected void fetch() throws MainMemory.InvalidAddressException {\n int pcVal = pc.get();\n UnsignedByte[] ins = mem.read (pcVal, 2);\n byte opCode = (byte) (ins[0].value() >>> 4);\n insOpCode.set (opCode);\n insOp0.set (ins[0].value() & 0x0f);\n insOp1.set (ins[1].value() >>> 4);\n insOp2.set (ins[1].value() & 0x0f);\n insOpImm.set (ins[1].value());\n pcVal += 2;\n switch (opCode) {\n case 0x0:\n case 0xb:\n\tlong opExt = mem.readIntegerUnaligned (pcVal);\n\tpcVal += 4;\n\tinsOpExt.set (opExt);\n\tinstruction.set (ins[0].value() << 40 | ins[1].value() << 32 | opExt);\n\tbreak;\n default:\n\tinsOpExt.set (0);\n\tinstruction.set (ins[0].value() << 40 | ins[1].value() << 32);\n }\n pc.set (pcVal);\n }",
"public static void load() {\n }",
"public Instructions() {\n\n\t\t// String code = codeIn.trim();\n\t\t// code = code.replaceAll(\"\\\\s+\", \"\");\n\t\t// System.out.println(\"Code In:\\n\" + code);\n\t\t//\n\t\t// int len = code.length();\n\t\t// int chunkLength = 2; // the length of each chunk of code\n\t\t// int i = 0;\n\n\t\t// Create new Memory Array\n\t\tMA = new MemoryArray();\n\n\t\t// traverse entered code and split into 2 digit chunks\n\t\t// for (i = 0; i < len; i += chunkLength) {\n\t\t//\n\t\t// String chunk = code.substring(i, Math.min(len, i + chunkLength));\n\t\t// System.out.println(\"code chunk no. \" + (i / 2) + \" \" + chunk);\n\t\t//\n\t\t// opCode(chunk); // TODO - need to call this from the memory class I\n\t\t// think\n\n\t\tmem = new Memory();\n\n\t\tmemDispalyString();\n\n\t\tproc = new ProcessorLoop();\n\n\t\t// set the memory address and OpCode\n\t\t// mem.setAddress(addr);\n\t\t// // convert to decimal\n\t\t// mem.setOpCode(Integer.parseInt(chunk, 16));\n\t\t// System.out.println(\"oc = \" + (Integer.parseInt(chunk, 16)));\n\t\t//\n\t\t// // add the memory object to the memory array\n\t\t// MA.addMemoryObjects(addr, mem);\n\t\t// System.out.println(\"New memory = \" + mem.getAddress() + \" \"\n\t\t// + mem.getOpCode());\n\t\t// addr++;\n\t\t// }\n\n\t}",
"private void loadAssembly () {\r\n Factory assemblyFactory = new AssemblyFactory(mySimulation);\r\n int response = INPUT_CHOOSER.showDialog(null, \"Assembly file\");\r\n if (response == JFileChooser.APPROVE_OPTION) {\r\n assemblyFactory.loadFile(INPUT_CHOOSER.getSelectedFile());\r\n }\r\n }",
"public SimpleRuntimeMachine(String fileName) {\n\t\tram = new int[RAM_CAPACITY];\n\t\tprogramStack = new Stack<String>();\n\t\tprocessCommands(fileName);\n\t}",
"private void initHardware(){\n }",
"public static void main(String[] args) {\n Computer computer = new Computer();\n computer.description();\n for (int i = 0; i != computer.resource; i++) {\n computer.on();\n computer.off();\n }\n }",
"public void cpu() {\n\n\t\tint bytecode;\n\t\tint v1, v2;\n\t\tint address;\n\t\twhile (true) {\n\t\t\tbytecode = code[ip++]; // fetch\n\t\t\t\n\t\t\t//Decode\n\t\t\tswitch (bytecode) {\n\t\t\t\n\t\t\tcase VMParser.PUSH:\n\t\t\t\t//System.out.println(\"PUSH\");\n\t\t\t\tpush(code[ip++]);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase VMParser.POP:\n\t\t\t\t//System.out.println(\"POP\");\n\t\t\t\tpop();\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase VMParser.ADD:\n\t\t\t\t//System.out.println(\"ADD\");\n\t\t\t\tv2 = pop();\n\t\t\t\tv1 = pop();\n\t\t\t\tpush(v1 + v2);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase VMParser.SUB:\n\t\t\t\t//System.out.println(\"SUB\");\n\t\t\t\tv2 = pop();\n\t\t\t\tv1 = pop();\n\t\t\t\tpush(v1 - v2);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase VMParser.MULT:\n\t\t\t\t//System.out.println(\"MULT\");\n\t\t\t\tv2 = pop();\n\t\t\t\tv1 = pop();\n\t\t\t\tpush(v1 * v2);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase VMParser.DIV:\n\t\t\t\t//System.out.println(\"DIV\");\n\t\t\t\tv2 = pop();\n\t\t\t\tv1 = pop();\n\t\t\t\tpush(v1 / v2);\n\t\t\t\tbreak;\n\n\t\t\tcase VMParser.SW:\n\t\t\t\t//System.out.println(\"SW\");\n\t\t\t\taddress = pop();\n\t\t\t\tv2 = pop();\n\t\t\t\tmemory[address] = v2;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase VMParser.LW:\n\t\t\t\t//System.out.println(\"LW\");\n\t\t\t\taddress = pop();\n\t\t\t\tpush(memory[address]);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase VMParser.BRANCHEQUAL:\n\t\t\t\t//System.out.println(\"BRANCHEQUAL\");\n\t\t\t\taddress = code[ip++];\n\t\t\t\tv2 = pop();\n\t\t\t\tv1 = pop();\n\t\t\t\tif (v1 == v2)\n\t\t\t\t\tip = address;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase VMParser.JS:\n\t\t\t\t//System.out.println(\"JS\");\n\t\t\t\tra = ip;\n\t\t\t\taddress = pop();\n\t\t\t\tip = address;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase VMParser.LRA:\n\t\t\t\t//System.out.println(\"LRA\");\n\t\t\t\tpush(ra);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase VMParser.SRA:\n\t\t\t\t//System.out.println(\"SRA\");\n\t\t\t\tra = pop();\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase VMParser.LRV:\n\t\t\t\t//System.out.println(\"LRV\");\n\t\t\t\tpush(rv);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase VMParser.SRV:\n\t\t\t\t//System.out.println(\"SRV\");\n\t\t\t\trv = pop();\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase VMParser.LHP:\n\t\t\t\t//System.out.println(\"LHP\");\n\t\t\t\tpush(hp);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase VMParser.SHP:\n\t\t\t\t//System.out.println(\"SHP\");\n\t\t\t\thp = pop();\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase VMParser.LFP:\n\t\t\t\t//System.out.println(\"LFP\");\n\t\t\t\tpush(fp);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase VMParser.SFP:\n\t\t\t\t//System.out.println(\"SFP\");\n\t\t\t\tfp = pop();\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase VMParser.CFP:\n\t\t\t\t//System.out.println(\"CFP\");\n\t\t\t\tfp = sp;\n\t\t\t\tbreak;\n\n\n\t\t\tcase VMParser.BRANCH:\n\t\t\t\t//System.out.println(\"BRANCH\");\n\t\t\t\taddress = code[ip++];\n\t\t\t\tip = address;\n\t\t\t\tbreak;\n\n\t\t\tcase VMParser.BRANCHLESS:\n\t\t\t\t//System.out.println(\"BRANCHLESS\");\n\t\t\t\taddress = code[ip++];\n\t\t\t\tv2 = pop();\n\t\t\t\tv1 = pop();\n\t\t\t\tif (v1 <= v2)\n\t\t\t\t\tip = address;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase VMParser.BRANCHGREAT:\n\t\t\t\t//System.out.println(\"BRANCHGREAT\");\n\t\t\t\taddress = code[ip++];\n\t\t\t\tv2 = pop();\n\t\t\t\tv1 = pop();\n\t\t\t\tif (v1 >= v2)\n\t\t\t\t\tip = address;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase VMParser.PRINT:\n\t\t\t\t//System.out.println(\"PRINT\");\n\t\t\t\tSystem.out.println(memory[sp]);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t\n\t\t\tcase VMParser.HALT:\n\t\t\t\t//System.out.println(\"HALT\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}",
"public static void main(String args[]) throws IOException{\n\t\tscan = new BufferedReader(new InputStreamReader(System.in));\n\t\tregisters = new HashMap<Character,String>();\n\t\tmemory = new HashMap<Integer , String>();//Memory location 0 will remain unused\n\t\tlabels = new HashMap<String , Integer>();\n\t\thexa = \"0123456789ABCDEF\".toCharArray();\n\t\tpossible_codes = \"HLT RST MOV MVI LXI LDA STA LHLD SHLD LDAX STAX XCHG ADD ADC ADI ACI DAD SUB SBB SUI INR DCR INX DCX ANA ANI ORA ORI XRA XRI CMA CMC STC CMP CPI RLC RRC RAL RAR JMP JZ JNZ JC JNC JP JM JPE JPO CALL CZ CNZ CC CNC CP CM CPE CPO RET RZ RNZ RC RNC RP RM RPE RPO PCHL IN OUT PUSH POP XTHL SPHL\".split(\" \");\n\t\tgeneral_registers = new HashSet<Character>();\n\t\tAC=CS=Z=P=S=false;\n\t\tSP = 65536;\n\t\tPC = 0;\n\t\tmodified = false;\n\t\tadd_the_general_registers();\n\n\t\tSystem.out.println(\"SIMULATOR FOR 8085 MICROPROCESSOR\\n\");\n\t\t//Take the input of code\n\t\tSystem.out.println(\"ENTER THE CODE :-\\n\");\n\t\ttake_the_input();\n\t\t//Take the input of memory values\n\t\tSystem.out.println(\"ENTER THE MEMORY VALUES :-\");\n\t\tSystem.out.println(\"IF NO VALUE HAS TO BE ENTERED PRESS N ELSE WRITE THE ADDRESS.\\n\");\n\t\ttake_memory_values();\n\t\t//Execution starts\n\t\tSystem.out.println(\"\\nNOW EXECUTION WILL BEGIN...\");\n\t\texecute();\n\t\t//Providing the output to the user\n\t\tSystem.out.println(\"\\nENTER THE MEMORY LOCATIONS AND REGISTER VALUES YOU WANT TO CHECK : \");\n\t\tSystem.out.println(\"(WHEN YOU ARE DONE CHECKING TYPE N)\\n\");\n\t\toutput_process();\n\t}",
"public void loadCompliments(){\n compliments = getResources().getStringArray(R.array.compliments_array);\n }",
"public Allocated_computers() {\n initComponents();\n }",
"public void loadHotels();",
"public static void readInstructionsFromFile(final File file, final MipsComputer comp) {\n\t\tSystem.out.println(\"Loading instructions from file...\");\n\t\tfinal Scanner s;\n\t\ttry {\n\t\t\ts = new Scanner(file);\n\t\t\twhile(s.hasNextLine()){\n\t\t\t\tcomp.loadInstruction(convertToBitString(s.nextLine().replaceAll(\"\\\\s\", \"\")));\n\t\t\t}\n\t\t} catch (final IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"private void load() {\r\n\t\tswitch (this.stepPanel.getStep()) {\r\n\t\tcase StepPanel.STEP_HOST_GRAPH:\r\n\t\t\tloadGraph(StepPanel.STEP_HOST_GRAPH);\r\n\t\t\tbreak;\r\n\t\tcase StepPanel.STEP_STOP_GRAPH:\r\n\t\t\tloadGraph(StepPanel.STEP_STOP_GRAPH);\r\n\t\t\tbreak;\r\n\t\tcase StepPanel.STEP_CRITICAL_PAIRS:\r\n\t\t\tloadPairs();\r\n\t\t\tbreak;\r\n\t\tcase StepPanel.STEP_FINISH:\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}",
"public void IPL(){ \r\n \r\n this.io.resetIOController();\r\n this.memory.resetMemory();\r\n \r\n /*** Pseudocode for ROM bootloader \r\n * Reads a file to memory starting at M(64) to EOF\r\n * \r\n * ADDR=64, X1=0\r\n * L1: R0 = io.readLine()\r\n * memory.set(ADDR+X1, R0)\r\n * X1++\r\n * checkForMore = io.checkStatus()\r\n * test checkForMore\r\n * jcc checkForMore to L1\r\n * jmp 64\r\n */ \r\n HashMap<Integer,String> ROM = new HashMap<>(); \r\n /************* Assembly for bootloader **************/\r\n ROM.put(00, \"00000000000000101111\"); // Trap Handler Table Start Position -> 47\r\n ROM.put(01, \"00000000000000101011\"); // Machine Fault Handler -> 42\r\n ROM.put( 9, \"11001100110011001100\"); // SECTION_TAG (Used for finding sections)\r\n ROM.put(10, \"000011 00 10 0 0 00000000\"); //10: LDA(2,0,0,0) -- reset ECX to 0 (index value) \r\n ROM.put(11, \"000011 00 11 0 0 00000000\"); //11: LDA(3,0,0,0) -- reset EDX to 0 (IO Status Ready) \r\n ROM.put(12, \"000001 00 01 0 0 00001001\"); //12: LDR(1,0,9) -- LOAD M(9) to EBX (SECTION_TAG)\r\n ROM.put(13, \"000010 00 10 0 0 00000110\" ); //13: STR(2,0,6) -- set M(6) to ECX \r\n ROM.put(14, \"101001 00 10 0 0 00000110\" ); //14: LDX(0, 2, 6) -- Set X(2) from M(6) (copied from ECX/0) \r\n ROM.put(15, \"101001 00 01 0 0 00000110\" ); //15: LDX(0, 1, 6) -- Set X(1) from M(6) (copied from ECX) \r\n ROM.put(16, \"111101 00 00 000000 0010\" ); //16: L1: IN(0, 2) -- read word from CardReader to EAX \r\n ROM.put(17, \"010110 00 01 0 0 00000000\" ); //17: TRR(0, 1) -- Test EAX against EBX (SECTION_TAG) \r\n ROM.put(18, \"001100 00 11 0 0 00011001\" ); //18: JCC(3,x, L2) -- JMP to L2 if EAX=EBX --- L2=25 \r\n ROM.put(19, \"000010 01 00 0 0 01000000\" ); //19: L3: STR(0,1,64i1) -- store EAX to ADDR+X1 (ADDR=64) \r\n ROM.put(20, \"101011 00 01 0 0 00000000\" ); //20: INX(1) -- X(1)++\r\n ROM.put(21, \"111111 00 00 000000 0010\" ); //21: CHK(0, 2) -- Check status of Card Reader to EAX \r\n ROM.put(22, \"010110 00 11 0 0 00000000\" ); //22: TRR(0, 3) -- Test EAX against EDX (IO Status Ready -- not done) \r\n ROM.put(23, \"001100 00 11 0 0 00010000\" ); //23: JCC(3,x, L1) -- JMP to L1 if EAX=EDX --- L1=16 \r\n ROM.put(24, \"001101 00 00 0 0 01000000\" ); //24: JMP(64) -- else: launch program by transferring control to 64 \r\n ROM.put(25, \"000011 01 10 0 0 01000000\" ); //25: L2: LDA(1,1,64i1) -- Load ADDR+X1 to ECX\r\n ROM.put(26, \"000010 10 10 0 0 00001000\" ); //26: STR(1,2,8) -- Store ECX to 8+X2\r\n ROM.put(27, \"101011 00 10 0 0 00000000\" ); //27: INX(2) -- X(2)++\r\n ROM.put(28, \"001101 00 00 0 0 00010011\" ); //28: JMP(19) -- JMP(L3) \r\n /***************** Error Handler ************************************/ \r\n ROM.put(32, \"000001 00 11 0 0 00000010\"); //32: LDR(3, 0, 2) -- restore PC to EDX (used on 41) \r\n ROM.put(33, \"000011 00 00 0 0 01000101\"); //33: LDA(0,72) -- Set EAX to 69 ('E')\r\n ROM.put(34, \"000011 00 01 0 0 01110010\"); //34: LDA(1,105) -- Set EBX to 114 ('r')\r\n ROM.put(35, \"000011 00 10 0 0 01101111\"); //35: LDA(2,13) -- Set ECX to 111 ('o')\r\n ROM.put(36, \"111110 00 00 000000 0001\"); //36: OUT(0,1) -- Output EAX ('E')\r\n ROM.put(37, \"111110 00 01 000000 0001\"); //37: OUT(1,1) -- Output EBX ('r')\r\n ROM.put(38, \"111110 00 01 000000 0001\"); //38: OUT(1,1) -- Output EBX ('r')\r\n ROM.put(39, \"111110 00 10 000000 0001\"); //39: OUT(2,1) -- Output ECX ('o')\r\n ROM.put(40, \"111110 00 01 000000 0001\"); //40: OUT(1,1) -- Output EBX ('r')\r\n ROM.put(41, \"000010 00 11 0 0 00000110\"); //41: STR(3,0,6) -- Store EDX to M(6)\r\n ROM.put(42, \"001101 00 00 1 0 00000110\"); //42: JMP(0,6) -- JMP to c(M(6))\r\n // Machine error entry point\r\n ROM.put(43, \"000001 00 11 0 0 00000100\"); // 43: LDR(3, 0, 4) -- restore PC to EDX (used on 41) \r\n ROM.put(44, \"000011 00 00 0 0 01001101\"); //44: LDA(0,72) -- Set EAX to 77 ('M') \r\n ROM.put(45, \"111110 00 00 000000 0001\"); //45: OUT(0,1) -- Output EAX ('M') \r\n ROM.put(46, \"001101 00 00 0 0 00100001\" ); //46: JMP(33) -- Jump to 33 \"MError\"\r\n // Create Trap Table Defaults\r\n for(int i=47;i<=63;i++){\r\n ROM.put(i, \"001101 00 00 0 0 00100000\"); // Set TRAP table locs all to 32 by default\r\n }\r\n \r\n // Read ROM contents into memory\r\n for (Map.Entry romEntry : ROM.entrySet()) { \r\n try {\r\n this.getMemory().engineerSetMemoryLocation(new Unit(13, (int)romEntry.getKey()), Word.WordFromBinaryString((String)romEntry.getValue()));\r\n } catch (MachineFaultException ex) {\r\n Logger.getLogger(Computer.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }\r\n \r\n try {\r\n this.getCpu().getBranchPredictor().scanMemory();\r\n } catch (MachineFaultException ex) {\r\n Logger.getLogger(Computer.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n \r\n //Transfer Control to ROM Bootloader\r\n this.getCpu().getControlUnit().setProgramCounter(new Unit(13, 10)); // Start at 10 \r\n this.cpu.setRunning(true); \r\n }",
"public static void load(){\n\t\tinbattle=true;\n\t\ttry{\n\t\t\tFile f=new File(Constants.PATH+\"\\\\InitializeData\\\\battlesavefile.txt\");\n\t\t\tScanner s=new Scanner(f);\n\t\t\tturn=s.nextInt();\n\t\t\ts.nextLine();\n\t\t\tString curr=s.next();\n\t\t\tif(curr.equals(\"WildTrainer:\"))\n\t\t\t\topponent=WildTrainer.readInTrainer(s);\n\t\t\telse if(curr.equals(\"EliteTrainer:\"))\n\t\t\t\topponent=EliteTrainer.readInTrainer(s);\n\t\t\telse if(curr.equals(\"Trainer:\"))\n\t\t\t\topponent=Trainer.readInTrainer(s);\n\t\t\tSystem.out.println(\"Initializing previous battle against \"+opponent.getName());\n\t\t\tcurr=s.next();\n\t\t\tallunits=new ArrayList<Unit>();\n\t\t\tpunits=new ArrayList<Unit>();\n\t\t\tounits=new ArrayList<Unit>();\n\t\t\twhile(!curr.equals(\"End\")){\n\t\t\t\tpunits.add(Unit.readInUnit(null,s));\n\t\t\t\tcurr=s.next();\n\t\t\t}\n\t\t\ts.nextLine();// Player Units\n\t\t\tcurr=s.next();\n\t\t\twhile(!curr.equals(\"End\")){\n\t\t\t\tounits.add(Unit.readInUnit(opponent,s));\n\t\t\t\tcurr=s.next();\n\t\t\t}\n\t\t\ts.nextLine();// Opponent Units\n\t\t\tallunits.addAll(punits);\n\t\t\tallunits.addAll(ounits);\n\t\t\tpriorities=new ArrayList<Integer>();\n\t\t\tint[] temp=GameData.readIntArray(s.nextLine());\n\t\t\tfor(int i:temp){\n\t\t\t\tpriorities.add(i);\n\t\t\t}\n\t\t\txpgains=GameData.readIntArray(s.nextLine());\n\t\t\tspikesplaced=s.nextBoolean();\n\t\t\tnumpaydays=s.nextInt();\n\t\t\tactiveindex=s.nextInt();\n\t\t\tactiveunit=getUnitByID(s.nextInt());\n\t\t\tweather=Weather.valueOf(s.next());\n\t\t\tweatherturn=s.nextInt();\n\t\t\ts.nextLine();\n\t\t\tbfmaker=new LoadExistingBattlefieldMaker(s);\n\t\t\tinitBattlefield();\n\t\t\tplaceExistingUnits();\n\t\t\tMenuEngine.initialize(new UnitMenu(activeunit));\n\t\t}catch(Exception e){e.printStackTrace();System.out.println(e.getCause().toString());}\n\t}",
"public static void main(String[] args) throws Exception\n {\n Machine machine = new Machine();\n OperatingSystem os = new OperatingSystem(machine);\n machine.powerUp(os);\n // create a program\n\n //grab a program from collection, add to list, schedule list of programs\n List<Program> programs = new LinkedList<>();\n\n////////Testing virtua/physical\n// programs.add(ProgramCollection.A2P1(0));\n// programs.add(ProgramCollection.A2P1(1));\n// programs.add(ProgramCollection.A2P1(2));\n// programs.add(ProgramCollection.A2P1(3));\n// programs.add(ProgramCollection.A2P1(4));\n///////////Testing expand\n// programs.add(ProgramCollection.miniProg(2));\n// programs.add(ProgramCollection.miniProg(3));\n// programs.add(ProgramCollection.moreMem2());\n/////////Testing Shift\n// programs.add(ProgramCollection.moreMem2());\n// programs.add(ProgramCollection.longProg());\n /*\tTesting Compaction\n this test will have two mini programs that finish before our more memory program\n asks for more memory. It will also have two additional wait processes that never finish\n (one that needs to shift left and one too shift right). Our moreMem3 prog will ask for \n more memory and then try storing into these memory locations.\n */\n// programs.add(ProgramCollection.mini(6));\n// programs.add(ProgramCollection.mini(6));\n// programs.add(ProgramCollection.waitProcess(6));\n// programs.add(ProgramCollection.moreMem3(240));\n// programs.add(ProgramCollection.waitProcess(6));\n// programs.add(ProgramCollection.testIt(1));\n// programs.add(ProgramCollection.testIt(2));\n// programs.add(ProgramCollection.testIt(3));\n// programs.add(ProgramCollection.writeConsole(1));\n// programs.add(ProgramCollection.writeConsole(2));\n// programs.add(ProgramCollection.writeConsole(3));\n// programs.add(ProgramCollection.pWriteDisk2(340));\n//TEST READ AND WRITE DISK\n //programs.add(ProgramCollection.WriteReadDisk());\n//TEST SSTF\n// programs.add(ProgramCollection.testSSTF(10, 46, 5));\n// programs.add(ProgramCollection.testSSTF(20, 71, 5));\n// programs.add(ProgramCollection.testSSTF(30, 51, 10));\n// programs.add(ProgramCollection.testSSTF(40, 26, 5));\n\n//TEST STARVATION\n programs.add(ProgramCollection.testSSTF(10, 31, 3));\n programs.add(ProgramCollection.testSSTF(340, 90, 3));\n programs.add(ProgramCollection.testSSTF(20, 51, 3));\n programs.add(ProgramCollection.testSSTF(30, 41, 3));\n programs.add(ProgramCollection.testSSTF(40, 51, 3));\n programs.add(ProgramCollection.testSSTF(50, 41, 3));\n programs.add(ProgramCollection.testSSTF(60, 51, 3));\n programs.add(ProgramCollection.testSSTF(70, 41, 3));\n programs.add(ProgramCollection.testSSTF(80, 51, 3));\n programs.add(ProgramCollection.testSSTF(90, 41, 3));\n\n os.schedule(programs);\n\n }",
"private void initComputerIndicator() throws SecurityException,\n\t\t\tNoSuchFieldException, IllegalArgumentException,\n\t\t\tIllegalAccessException {\n\t\tClass<id> idClass = R.id.class;\n\t\tfor (int rowIndex = 0; rowIndex < WordZapConstants.GRID_NUMROWS; rowIndex++) {\n\n\t\t\tField txtViewField = idClass.getField(\"txtViewComp\" + rowIndex);\n\t\t\tTextView aTxtView = (TextView) findViewById(txtViewField\n\t\t\t\t\t.getInt(null));\n\t\t\tthis.computerPlayerTxtViews[rowIndex] = aTxtView;\n\t\t\taTxtView.setText(\"\");\n\n\t\t}\n\n\t}",
"@Override\n\tpublic void setCpu() {\n\t\tcom.setCpu(\"i7\");\n\t}",
"public void initVariables() throws Exception {\n\n\t\tclockTomasulo = clockTomasulo.getInstance();\n\t\tclockTomasulo.ResetClock();\n\t\t// OperationFileParser file_parser = new OperationFileParser( data_file\n\t\t// );\n\n\t\t// Iniatialize containers for instructions and registers\n\t\t// operations = new OperationList();\n\t\tregistersTomasulo = new RegisterFiles();\n\n\t\t// file_parser.parseFile( operations );\n\n\t\t/*\n\t\t * // Create and intialize Reservation Stations alu_rsTomasulo = new\n\t\t * ALUStation[8];\n\t\t * \n\t\t * \n\t\t * alu_rsTomasulo[0] = new ALUStation(\"Int1\"); alu_rsTomasulo[1] = new\n\t\t * ALUStation(\"Add1\"); alu_rsTomasulo[2] = new ALUStation(\"Add2\");\n\t\t * alu_rsTomasulo[3] = new ALUStation(\"Mul1\"); alu_rsTomasulo[4] = new\n\t\t * ALUStation(\"Mul2\"); alu_rsTomasulo[5] = new ALUStation(\"Div1\");\n\t\t * alu_rsTomasulo[6] = new ALUStation(\"Div2\"); alu_rsTomasulo[7] = new\n\t\t * ALUStation(\"Div3\");\n\t\t */\n\t\t/*\n\t\t * MemReservationTomasulo[0] = new MemStation(\"Load1\");\n\t\t * MemReservationTomasulo[1] = new MemStation(\"Load2\");\n\t\t * MemReservationTomasulo[2] = new MemStation(\"Store1\");\n\t\t * MemReservationTomasulo[3] = new MemStation(\"Store2\");\n\t\t */\n\n\t\tinstruction_to_stationTomasulo = new HashMap<String, Integer[]>();\n\t\t// Memory Indices\n\t\tinstruction_to_stationTomasulo.put(\"LD\", new Integer[] { 0, 1 });\n\t\tinstruction_to_stationTomasulo.put(\"SD\", new Integer[] { 2, 3 });\n\n\t\t/*\n\t\t * // ALU Indices instruction_to_stationTomasulo.put(\"DADDI\", new\n\t\t * Integer[] { 0 }); instruction_to_stationTomasulo.put(\"ADDD\", new\n\t\t * Integer[] { 1, 2 }); instruction_to_stationTomasulo.put(\"SUBD\", new\n\t\t * Integer[] { 1, 2 }); instruction_to_stationTomasulo.put(\"MULD\", new\n\t\t * Integer[] { 3, 4, 5 }); instruction_to_stationTomasulo.put(\"DIVD\",\n\t\t * new Integer[] { 6, 7, 8, 9 });\n\t\t */\n\n\t\ttry {\n\t\t\t/*\n\t\t\t * [pipeline] PipeFPAddSub=1 PipeFPMult=1 PipeFPDivide=1\n\t\t\t * PipeIntDivide=1 [scorboard] ScoreInteger=1 ScoreAddSub=2\n\t\t\t * ScoreMult=10 ScoreDivide=40 [tomasulo] TomInteger=2 TomAddI=1\n\t\t\t * TomAddSub=4 TomMult=7 TomDivide=25\n\t\t\t */\n\t\t\tWini ini;\n\t\t\t/* Load the ini file. */\n\t\t\tini = new Wini(new File(\"config/settings.ini\"));\n\n\t\t\tint TomInteger = ini.get(\"tomasulo\", \"TomInteger\", int.class);\n\t\t\tint TomAddI = ini.get(\"tomasulo\", \"TomAddI\", int.class);\n\t\t\tint TomAddSub = ini.get(\"tomasulo\", \"TomAddSub\", int.class);\n\t\t\tint TomMult = ini.get(\"tomasulo\", \"TomMult\", int.class);\n\t\t\tint TomDivide = ini.get(\"tomasulo\", \"TomDivide\", int.class);\n\n\t\t\tint TomNumInteger = ini.get(\"tomasulo\", \"TomNumInteger\", int.class);\n\t\t\tint TomNumAddSub = ini.get(\"tomasulo\", \"TomNumAddSub\", int.class);\n\t\t\tint TomNumMult = ini.get(\"tomasulo\", \"TomNumMult\", int.class);\n\t\t\tint TomNumDiv = ini.get(\"tomasulo\", \"TomNumDiv\", int.class);\n\t\t\tint TomNumLoad = ini.get(\"tomasulo\", \"TomNumLoad\", int.class);\n\t\t\tint TomNumStore = ini.get(\"tomasulo\", \"TomNumStore\", int.class);\n\n\t\t\tInteger[] arrayTomNumInteger;\n\t\t\tInteger[] arrayTomNumAddSub;\n\t\t\tInteger[] arrayTomNumMult;\n\t\t\tInteger[] arrayTomNumDiv;\n\n\t\t\t// Create a mapping of instructions to execution time\n\t\t\tinstruction_to_timeTomasulo = new HashMap<String, Integer>();\n\t\t\t// Memory Instructions\n\t\t\tinstruction_to_timeTomasulo.put(\"LD\", new Integer(TomInteger));\n\t\t\tinstruction_to_timeTomasulo.put(\"SD\", new Integer(TomInteger));\n\n\t\t\t// ALU Instructions\n\t\t\tinstruction_to_timeTomasulo.put(\"DADDI\", new Integer(TomAddI));\n\t\t\tinstruction_to_timeTomasulo.put(\"DADD\", new Integer(TomAddSub));\n\t\t\tinstruction_to_timeTomasulo.put(\"ADDD\", new Integer(TomAddSub));\n\t\t\tinstruction_to_timeTomasulo.put(\"SUBD\", new Integer(TomAddSub));\n\t\t\tinstruction_to_timeTomasulo.put(\"MULD\", new Integer(TomMult));\n\t\t\tinstruction_to_timeTomasulo.put(\"DIVD\", new Integer(TomDivide));\n\n\t\t\t// Create and intialize Reservation Stations\n\t\t\talu_rsTomasulo = new ALUStation[TomNumInteger + TomNumAddSub + TomNumMult + TomNumDiv];\n\n\t\t\t// ALU Indices\n\t\t\tarrayTomNumInteger = new Integer[TomNumInteger];\n\t\t\tfor (int i = 0; i < TomNumInteger; i++) {\n\t\t\t\talu_rsTomasulo[i] = new ALUStation(\"Int\" + (i + 1));\n\t\t\t\tarrayTomNumInteger[i] = i;\n\t\t\t}\n\t\t\tif (arrayTomNumInteger.length > 0)\n\t\t\t\tinstruction_to_stationTomasulo.put(\"DADDI\", arrayTomNumInteger);\n\n\t\t\tarrayTomNumAddSub = new Integer[TomNumAddSub];\n\t\t\tfor (int i = TomNumInteger; i < TomNumInteger + TomNumAddSub; i++) {\n\t\t\t\talu_rsTomasulo[i] = new ALUStation(\"Add\" + (i - TomNumInteger + 1));\n\t\t\t\tarrayTomNumAddSub[i - TomNumInteger] = i;\n\t\t\t}\n\t\t\tif (arrayTomNumAddSub.length > 0) {\n\t\t\t\tinstruction_to_stationTomasulo.put(\"ADDD\", arrayTomNumAddSub);\n\t\t\t\tinstruction_to_stationTomasulo.put(\"SUBD\", arrayTomNumAddSub);\n\t\t\t}\n\n\t\t\tarrayTomNumMult = new Integer[TomNumMult];\n\t\t\tfor (int i = TomNumInteger + TomNumAddSub; i < TomNumInteger + TomNumAddSub + TomNumMult; i++) {\n\t\t\t\talu_rsTomasulo[i] = new ALUStation(\"Mul\" + (i - TomNumInteger - TomNumAddSub + 1));\n\t\t\t\tarrayTomNumMult[i - TomNumInteger - TomNumAddSub] = i;\n\t\t\t}\n\t\t\tif (arrayTomNumMult.length > 0)\n\t\t\t\tinstruction_to_stationTomasulo.put(\"MULD\", arrayTomNumMult);\n\n\t\t\tarrayTomNumDiv = new Integer[TomNumDiv];\n\t\t\tfor (int i = TomNumInteger + TomNumAddSub + TomNumMult; i < TomNumInteger + TomNumAddSub + TomNumMult\n\t\t\t\t\t+ TomNumDiv; i++) {\n\t\t\t\talu_rsTomasulo[i] = new ALUStation(\"Div\" + (i - TomNumInteger - TomNumAddSub - TomNumMult + 1));\n\t\t\t\tarrayTomNumDiv[i - TomNumInteger - TomNumAddSub - TomNumMult] = i;\n\t\t\t}\n\t\t\tif (arrayTomNumDiv.length > 0)\n\t\t\t\tinstruction_to_stationTomasulo.put(\"DIVD\", arrayTomNumDiv);\n\n\t\t\t/*\n\t\t\t * alu_rsTomasulo[0] = new ALUStation(\"Int1\"); alu_rsTomasulo[1] =\n\t\t\t * new ALUStation(\"Add1\"); alu_rsTomasulo[2] = new\n\t\t\t * ALUStation(\"Add2\"); alu_rsTomasulo[3] = new ALUStation(\"Mul1\");\n\t\t\t * alu_rsTomasulo[4] = new ALUStation(\"Mul2\"); alu_rsTomasulo[5] =\n\t\t\t * new ALUStation(\"Div1\"); alu_rsTomasulo[6] = new\n\t\t\t * ALUStation(\"Div2\"); alu_rsTomasulo[7] = new ALUStation(\"Div3\");\n\t\t\t */\n\n\t\t\t// array contain of number of load andstore units\n\t\t\tMemReservationTomasulo = new MemStation[TomNumLoad + TomNumStore];\n\t\t\tfor (int i = 0; i < TomNumLoad; i++) {\n\t\t\t\tMemReservationTomasulo[i] = new MemStation(\"Load\" + (i + 1));\n\n\t\t\t}\n\t\t\tfor (int i = TomNumLoad; i < TomNumLoad + TomNumStore; i++) {\n\t\t\t\tMemReservationTomasulo[i] = new MemStation(\"Store\" + (i - TomNumLoad + 1));\n\n\t\t\t}\n\t\t\t// MemReservationTomasulo[0] = new MemStation(\"Load1\");\n\t\t\t// MemReservationTomasulo[1] = new MemStation(\"Load2\");\n\t\t\t// MemReservationTomasulo[2] = new MemStation(\"Store1\");\n\t\t\t// MemReservationTomasulo[3] = new MemStation(\"Store2\");\n\n\t\t} catch (InvalidFileFormatException e) {\n\t\t\tSystem.out.println(\"Invalid file format.\");\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Problem reading file.\");\n\t\t}\n\n\t\t// Mapping of aliases to Registers\n\t\talias_to_registerTomasulo = new HashMap<String, String>();\n\n\t\t// Initalize the Memory Buffer\n\t\tMemoryBufferTomasulo = new HashMap<String, Integer>();\n\n\t\tCurrentInstTomasulo = 1;\n\n\t}",
"public void initPC() {\r\n\t\tthis.memoryTaken = 0;\r\n\t\tthis.cpuTaken = 0;\r\n\t\t\r\n\t\tObject[] args = getArguments();\r\n\r\n\t\tObject[] quirks = (Object[])args[1];\r\n\t\t\r\n\t\tthis.memory = (Integer)quirks[0];\r\n\t\tthis.cpu = (Integer)quirks[1];\r\n\t\tthis.pricePerMemoryUnit = (Double)quirks[2];\r\n\t\tthis.pricePerCpuUnit = (Double)quirks[3];\r\n\t\tthis.pricePerSecond = (Double)quirks[4];\r\n\t\tthis.discountPerWaitingSecond = (Double)quirks[5];\r\n\t\t\r\n\t\tSystem.out.println(this);\r\n\t}",
"public void actionPerformed(ActionEvent e){\n\t\t\tInputStream f = getClass().getResourceAsStream(\"/LoadTXT.txt\");\n\t\t\tboolean isFirst = true;\n\t\t\tBufferedReader reader = null;\n\t\t\ttry {\n\t\t\t\treader = new BufferedReader(new InputStreamReader(f));\n\t\t\t\tString Ins = null;\n\t\t\t\tint line = 1;\n\t\t\t\t//Read the file line by line and split the line into two parts by symbol \",\"\n\t\t\t\twhile ((Ins = reader.readLine()) != null) {\n\t\t\t\t\tString[] str = Ins.split(\",\");\n\t\t\t\t\tint index = Integer.parseInt(str[0]);\t\t\t\t\t\n\t\t\t\t\tShort con = Integer.valueOf(str[1],2).shortValue();\n\t\t\t\t\tif(isFirst){\n\t\t\t\t\t\tcpu.setPc((short) index);\n\t\t\t\t\t\tisFirst=false;\n\t\t\t\t\t}\n\t\t\t\t\tcpu.setMem(con, index);\t\t\t\t\t\n\t\t\t\t\tline++;\n\t\t\t\t}\n\t\t\t\treader.close();\n\t\t\t} catch (IOException ex) {\n\t\t\t\tex.printStackTrace();\n\t\t\t} finally {\n\t\t\t\tif (reader != null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\treader.close();\n\t\t\t\t\t} catch (IOException e1) {\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\tSystem.out.println(\"The PC value is: \");\n\t\t\tSystem.out.println(cpu.getPc());\n\t\t\t//Call the function to show the data on the screen\n\t\t\tShowData();\n\t\t}",
"public Computer() {\n\t\tparts = new ComputerPart[] { new Mouse(), new Keyboard(), new Monitor() };\n\t}",
"@Override\n public List<Machine.Instruction> emit() {\n ArrayList<Machine.Instruction> data = new ArrayList<>();\n data.add(new Machine.Load(name));\n return data;\n }",
"public void init(int index,JJITInstruction[] instructions,KRegister[] constants,KProcess process) throws Exception {\n c_memman = process.getMemoryManager();\n // *********[52] ILOAD(8)\n // *********[53] IF_ICMPLE(60)\n c_next = instructions[(index + 1)];\n c_label = instructions[21];\n }",
"public void load (){\n try{\n FileInputStream fis = new FileInputStream(\"game.data\");\n ObjectInputStream o = new ObjectInputStream(fis);\n for (int i = 0; i < 8; i++){\n for (int j = 0; j < 8; j++){\n String loaded = o.readUTF();\n if (loaded.equals(\"null\")){\n Tiles[i][j].removePiece();\n }else if (loaded.equals(\"WhiteLeftKnight\")){\n Tiles[i][j].setPiece(WhiteLeftKnight);\n }else if (loaded.equals(\"WhiteRightKnight\")){\n Tiles[i][j].setPiece(WhiteRightKnight);\n }else if (loaded.equals(\"WhiteLeftBishop\")){\n Tiles[i][j].setPiece(WhiteLeftBishop);\n }else if (loaded.equals(\"WhiteRightBishop\")){\n Tiles[i][j].setPiece(WhiteRightBishop);\n }else if (loaded.equals(\"WhiteLeftRook\")){\n Tiles[i][j].setPiece(WhiteLeftRook);\n }else if (loaded.equals(\"WhiteRightRook\")){\n Tiles[i][j].setPiece(WhiteRightRook);\n }else if (loaded.equals(\"WhiteQueen\")){\n Tiles[i][j].setPiece(WhiteQueen);\n }else if (loaded.equals(\"WhiteKing\")){\n Tiles[i][j].setPiece(WhiteKing);\n }else if (loaded.equals(\"WhitePromotedRookPawn\")){\n Rook WhitePromotedRookPawn = new Rook(\"WhitePromotedRookPawn\");\n WhitePromotedRookPawn.setIcon(WhiteRookImg);\n Tiles[i][j].setPiece(WhitePromotedRookPawn);\n }else if (loaded.equals(\"WhitePromotedBishopPawn\")){\n Bishop WhitePromotedBishopPawn = new Bishop(\"WhitePromotedBishopPawn\");\n WhitePromotedBishopPawn.setIcon(WhiteBishopImg);\n Tiles[i][j].setPiece(WhitePromotedBishopPawn);\n }else if (loaded.equals(\"WhitePromotedKnightPawn\")){\n Knight WhitePromotedKnightPawn = new Knight(\"WhitePromotedKnightPawn\");\n WhitePromotedKnightPawn.setIcon(WhiteKnightImg);\n Tiles[i][j].setPiece(WhitePromotedKnightPawn);\n }else if (loaded.equals(\"WhitePromotedQueenPawn\")){\n Queen WhitePromotedQueenPawn = new Queen(\"WhitePromotedQueenPawn\");\n WhitePromotedQueenPawn.setIcon(WhiteQueenImg);\n Tiles[i][j].setPiece(WhitePromotedQueenPawn);\n }else if (loaded.equals(\"BlackLeftKnight\")){\n Tiles[i][j].setPiece(BlackLeftKnight);\n }else if (loaded.equals(\"BlackRightKnight\")){\n Tiles[i][j].setPiece(BlackRightKnight);\n }else if (loaded.equals(\"BlackLeftBishop\")){\n Tiles[i][j].setPiece(BlackLeftBishop);\n }else if (loaded.equals(\"BlackRightBishop\")){\n Tiles[i][j].setPiece(BlackRightBishop);\n }else if (loaded.equals(\"BlackLeftRook\")){\n Tiles[i][j].setPiece(BlackLeftRook);\n }else if (loaded.equals(\"BlackRightRook\")){\n Tiles[i][j].setPiece(BlackRightRook);\n }else if (loaded.equals(\"BlackQueen\")){\n Tiles[i][j].setPiece(BlackQueen);\n }else if (loaded.equals(\"BlackKing\")){\n Tiles[i][j].setPiece(BlackKing);\n }else if (loaded.equals(\"BlackPromotedQueenPawn\")){\n Queen BlackPromotedQueenPawn = new Queen(\"BlackPromotedQueenPawn\");\n BlackPromotedQueenPawn.setIcon(BlackQueenImg);\n Tiles[i][j].setPiece(BlackPromotedQueenPawn);\n }else if (loaded.equals(\"BlackPromotedRookPawn\")){\n Rook BlackPromotedRookPawn = new Rook(\"BlackPromotedRookPawn\");\n BlackPromotedRookPawn.setIcon(BlackRookImg);\n Tiles[i][j].setPiece(BlackPromotedRookPawn);\n }else if (loaded.equals(\"BlackPromotedBishopPawn\")){\n Bishop BlackPromotedBishopPawn = new Bishop(\"BlackPromotedBishopPawn\");\n BlackPromotedBishopPawn.setIcon(BlackBishopImg);\n Tiles[i][j].setPiece(BlackPromotedBishopPawn);\n }else if (loaded.equals(\"BlackPromotedKnightPawn\")){\n Knight BlackPromotedKnightPawn = new Knight(\"BlackPromotedKnightPawn\");\n BlackPromotedKnightPawn.setIcon(BlackKnightImg);\n Tiles[i][j].setPiece(BlackPromotedKnightPawn);\n }else if (loaded.equals(\"WhitePawn0\")){\n Tiles[i][j].setPiece(WhitePawns[0]);\n }else if (loaded.equals(\"WhitePawn1\")){\n Tiles[i][j].setPiece(WhitePawns[1]);\n }else if (loaded.equals(\"WhitePawn2\")){\n Tiles[i][j].setPiece(WhitePawns[2]);\n }else if (loaded.equals(\"WhitePawn3\")){\n Tiles[i][j].setPiece(WhitePawns[3]);\n }else if (loaded.equals(\"WhitePawn4\")){\n Tiles[i][j].setPiece(WhitePawns[4]);\n }else if (loaded.equals(\"WhitePawn5\")){\n Tiles[i][j].setPiece(WhitePawns[5]);\n }else if (loaded.equals(\"WhitePawn6\")){\n Tiles[i][j].setPiece(WhitePawns[6]);\n }else if (loaded.equals(\"WhitePawn7\")){\n Tiles[i][j].setPiece(WhitePawns[7]);\n }else if (loaded.equals(\"BlackPawn0\")){\n Tiles[i][j].setPiece(BlackPawns[0]);\n }else if (loaded.equals(\"BlackPawn1\")){\n Tiles[i][j].setPiece(BlackPawns[1]);\n }else if (loaded.equals(\"BlackPawn2\")){\n Tiles[i][j].setPiece(BlackPawns[2]);\n }else if (loaded.equals(\"BlackPawn3\")){\n Tiles[i][j].setPiece(BlackPawns[3]);\n }else if (loaded.equals(\"BlackPawn4\")){\n Tiles[i][j].setPiece(BlackPawns[4]);\n }else if (loaded.equals(\"BlackPawn5\")){\n Tiles[i][j].setPiece(BlackPawns[5]);\n }else if (loaded.equals(\"BlackPawn6\")){\n Tiles[i][j].setPiece(BlackPawns[6]);\n }else if (loaded.equals(\"BlackPawn7\")){\n Tiles[i][j].setPiece(BlackPawns[7]);\n }\n }\n }\n player = o.readInt();\n if (player == 1){\n area.setText(\"\\t\\t\\tPlayer \"+player+\" (White)\");\n }else{\n area.setText(\"\\t\\t\\tPlayer \"+player+\" (Black)\");\n }\n o.close();\n OriginalColor();\n }catch (Exception ex){\n\n }\n }",
"public LookUpSwitchInstruction() {}",
"private void ini_Sprites()\r\n\t{\r\n\t\tLogger.DEBUG(\"ini_Sprites\");\r\n\t\tResourceCache.LoadSprites(false);\r\n\t}",
"void load();",
"void load();",
"public void cpu(int PC,int trace) throws IOException {\r\n\t\t//Initializing the required variables\r\n\t\tclock=0;\r\n\t\tNatureTermination=\"\";\r\n\t\r\n\t\t//writing job details to output file\r\n\t\tSYSTEM sys= new SYSTEM();\r\n\t\t//creating registers array\r\n\t\tString[] registers= new String[] {\"0000000000000000\",\r\n\t\t\t\t\"0000000000000000\",\r\n\t\t\t\t\"0000000000000000\",\r\n\t\t\t\t\"0000000000000000\",\r\n\t\t\t\t\"0000000000000000\",\r\n\t\t\t\t\"0000000000000000\",\r\n\t\t\t\t\"0000000000000000\",\r\n\t\t\t\t\"0000000000000000\"};\r\n\t\t\r\n\t\t//output trace file \r\n\t\tFile outputfile = new File(\"trace-file.txt\");\r\n Writer output1 = new BufferedWriter(new FileWriter(outputfile));\r\n if(trace==1) {\r\n output1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\", \"PC\", \"instruction\", \"R\", \"EA\",\"(R)\", \"(EA)\",\"(R)\",\"(EA)\"));\r\n }\r\n \r\n \r\n \r\n //invoking memory class\r\n MEMORY memory = new MEMORY();\r\n //looping through instructions\r\n while(true) {\r\n \t//segmenting the instructions\r\n \tString Z= MEMORY.Memory(\"READ\",PC, \"\");\r\n\t\t\tint source= Integer.parseInt(Z.substring(7)+MEMORY.Memory(\"READ\",PC+1, \"\").substring(0,2), 2);\r\n\t\t\tint dest=Integer.parseInt(Z.substring(4,7), 2);\r\n\t\t\tint target=Integer.parseInt(MEMORY.Memory(\"READ\",PC+1, \"\").substring(2,5), 2);\r\n\t\t\tint immed6,immed12;\t\r\n\t\t\tif(MEMORY.Memory(\"READ\",PC+1, \"\").substring(2).charAt(0)=='1') {\r\n\t\t\t\timmed6=(int)Long.parseLong((\"11111111111111111111111111\"+MEMORY.Memory(\"READ\",PC+1, \"\").substring(2)),2);\r\n\t\t\t}else {\r\n\t\t\t\timmed6=Integer.parseInt(MEMORY.Memory(\"READ\",PC+1, \"\").substring(2),2);\r\n\t\t\t}\r\n\t\t\tif((Z.substring(4)+MEMORY.Memory(\"READ\",PC+1, \"\")).charAt(0)=='1') {\r\n\t\t\t\timmed12=(int)Long.parseLong((\"11111111111111111111\"+Z.substring(4)+MEMORY.Memory(\"READ\",PC+1, \"\")),2);\r\n\t\t\t}else {\r\n\t\t\t\timmed12=Integer.parseInt(Z.substring(4)+MEMORY.Memory(\"READ\",PC+1, \"\"),2);\r\n\t\t\t}\r\n\t\t\tString instruction;\r\n\t\t\tString R1,R2,R3;\r\n\t\t\tString EA1,EA2,EA3;\r\n\t\t\tString before1,before2,before3,after1,after2,after3;\r\n\t\t\t//checking for the infinite loop\r\n\t\t\tif(clock>ClockMax) {\r\n\t\t\t\toutput1.close();\r\n\t\t\t\tERROR_HANDLER.errorHandler(5);\r\n\t\t\t}\r\n\t\t\t//reading the opcode and perrforming actions accordingly\r\n\t\t\tswitch(MEMORY.Read(PC).substring(0,4)) {\r\n\t\t\tcase \"0000\":\r\n\t\t\t\t//addition operation\r\n\t\t\t\tif(registers[source].charAt(0)=='1') {\r\n\t\t\t\t\tbefore2=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[source]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tbefore2=\"\"+Integer.parseInt((registers[source]),2);\r\n\t\t\t\t}\r\n\t\t\t\tif(registers[dest].charAt(0)=='1') {\r\n\t\t\t\t\tbefore1=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[dest]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tbefore1=\"\"+Integer.parseInt((registers[dest]),2);\r\n\t\t\t\t}\r\n\t\t\t\tif(registers[target].charAt(0)=='1') {\r\n\t\t\t\t\tbefore3=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[target]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tbefore3=\"\"+Integer.parseInt((registers[target]),2);\r\n\t\t\t\t}\r\n\t\t\t\tString s3=Integer.toBinaryString(Integer.parseInt((registers[source]),2)+Integer.parseInt((registers[target]),2));\r\n\t\t\t\tint l3=s3.length();\r\n\t\t\t\tif(l3>16) {\r\n\t\t\t\t\ts3=s3.substring(l3-16,l3);\r\n\t\t\t\t\tl3=16;\r\n\t\t\t\t}\r\n\t\t\t\tregisters[dest]=l3==16?s3:\"0000000000000000\".substring(0,16-l3) + s3;\r\n\t\t\t\tinstruction = \"add \"+\"r\"+dest+\",\"+\"r\"+source+\",\"+\"r\"+target;\r\n\t\t\t\tR1=\"r\"+dest;\r\n\t\t\t\tR2=\"r\"+source;\r\n\t\t\t\tR3=\"r\"+target;\r\n\t\t\t\tif(registers[source].charAt(0)=='1') {\r\n\t\t\t\t\tafter2=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[source]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tafter2=\"\"+Integer.parseInt((registers[source]),2);\r\n\t\t\t\t}\r\n\t\t\t\tif(registers[dest].charAt(0)=='1') {\r\n\t\t\t\t\tafter1=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[dest]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tafter1=\"\"+Integer.parseInt((registers[dest]),2);\r\n\t\t\t\t}\r\n\t\t\t\tif(registers[target].charAt(0)=='1') {\r\n\t\t\t\t\tafter3=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[target]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tafter3=\"\"+Integer.parseInt((registers[target]),2);\r\n\t\t\t\t}\r\n\t\t\t\t//writing to trace file\r\n\t\t\t\tif(trace == 1 ) {\r\n\t\t\t\toutput1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\", PC,instruction,R1,\"\",before1,\"\",after1,\"\"));\r\n\t\t\t\toutput1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\", \"\",\"\",R2,\"\",before2,\"\",after2,\"\"));\r\n\t\t\t\toutput1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\\n\\n\", \"\",\"\",R3,\"\",before3,\"\",after3,\"\"));\r\n\t\t\t \r\n\t\t\t\t}\r\n\t\t\t\tclock++;\r\n\t\t\t\tPC = PC + 2;\r\n\t\t\t\tbreak;\r\n\t\t\t\t//Addition immediate operation\r\n\t\t\tcase \"0001\":\r\n\t\t\t\tif(registers[source].charAt(0)=='1') {\r\n\t\t\t\t\tbefore2=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[source]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tbefore2=\"\"+Integer.parseInt((registers[source]),2);\r\n\t\t\t\t}\r\n\t\t\t\tif(registers[dest].charAt(0)=='1') {\r\n\t\t\t\t\tbefore1=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[dest]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tbefore1=\"\"+Integer.parseInt((registers[dest]),2);\r\n\t\t\t\t}\r\n\t\t\t\tbefore3=\"\"+immed6;\r\n\t\t\t\tString s8=Integer.toBinaryString(Integer.parseInt((registers[source]),2)+immed6);\r\n\t\t\t\tint l8 = s8.length();\r\n\t\t\t\t\r\n\t\t\t\tregisters[dest]= l8==16?s8:\"0000000000000000\".substring(0,16-l8) + s8;\r\n\t\t\t\tinstruction = \"addi \"+\"r\"+dest+\",\"+\"r\"+source+\",\"+immed6;\r\n\t\t\t\tR1=\"r\"+dest;\r\n\t\t\t\tR2=\"r\"+source;\r\n\t\t\t\tR3=\"r\"+immed6;\r\n\t\t\t\tif(registers[source].charAt(0)=='1') {\r\n\t\t\t\t\tafter2=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[source]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tafter2=\"\"+Integer.parseInt((registers[source]),2);\r\n\t\t\t\t}\r\n\t\t\t\tif(registers[dest].charAt(0)=='1') {\r\n\t\t\t\t\tafter1=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[dest]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tafter1=\"\"+Integer.parseInt((registers[dest]),2);\r\n\t\t\t\t}\r\n\t\t\t\tafter3=\"\"+immed6;\r\n\t\t\t\t//writing to trace file\r\n\t\t\t\tif(trace == 1 ) {\r\n\t\t\t\toutput1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\", PC,instruction,R1,\"\",before1,\"\",after1,\"\"));\r\n\t\t\t\toutput1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\\n\\n\", \"\",\"\",R2,\"\",before2,\"\",after2,\"\"));}\r\n\t\t\t\tclock++;\r\n\t\t\t\tPC = PC + 2;\r\n\t\t\t\tbreak;\r\n\t\t\t\t//subtraction operation\r\n\t\t\tcase \"0010\":\r\n\t\t\t\tif(registers[source].charAt(0)=='1') {\r\n\t\t\t\t\tbefore2=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[source]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tbefore2=\"\"+Integer.parseInt((registers[source]),2);\r\n\t\t\t\t}\r\n\t\t\t\tif(registers[dest].charAt(0)=='1') {\r\n\t\t\t\t\tbefore1=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[dest]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tbefore1=\"\"+Integer.parseInt((registers[dest]),2);\r\n\t\t\t\t}\r\n\t\t\t\tif(registers[target].charAt(0)=='1') {\r\n\t\t\t\t\tbefore3=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[target]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tbefore3=\"\"+Integer.parseInt((registers[target]),2);\r\n\t\t\t\t}\r\n\t\t\t\tString s4=Integer.toBinaryString(Integer.parseInt((registers[source]),2)-Integer.parseInt((registers[target]),2));\r\n\t\r\n\t\t\t\tint l4=s4.length();\r\n\t\t\t\tif(l4>16) {\r\n\t\t\t\t\ts4=s4.substring(l4-16,l4);\r\n\t\t\t\t\tl4=16;\r\n\t\t\t\t}\r\n\t\t\t\tregisters[dest]=l4==16?s4:\"0000000000000000\".substring(0,16-l4) + s4;\r\n\t\t\t\tinstruction = \"sub \"+\"r\"+dest+\",\"+\"r\"+source+\",\"+\"r\"+target;\r\n\t\t\t\tR1=\"r\"+dest;\r\n\t\t\t\tR2=\"r\"+source;\r\n\t\t\t\tR3=\"r\"+target;\r\n\t\t\t\tif(registers[source].charAt(0)=='1') {\r\n\t\t\t\t\tafter2=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[source]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tafter2=\"\"+Integer.parseInt((registers[source]),2);\r\n\t\t\t\t}\r\n\t\t\t\tif(registers[dest].charAt(0)=='1') {\r\n\t\t\t\t\tafter1=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[dest]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tafter1=\"\"+Integer.parseInt((registers[dest]),2);\r\n\t\t\t\t}\r\n\t\t\t\tif(registers[target].charAt(0)=='1') {\r\n\t\t\t\t\tafter3=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[target]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tafter3=\"\"+Integer.parseInt((registers[target]),2);\r\n\t\t\t\t}\r\n\t\t\t\t//writing to trace file\r\n\t\t\t\tif(trace == 1 ) {\r\n\t\t\t\toutput1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\", PC,instruction,R1,\"\",before1,\"\",after1,\"\"));\r\n\t\t\t\toutput1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\", \"\",\"\",R2,\"\",before2,\"\",after2,\"\"));\r\n\t\t\t\toutput1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\\n\\n\", \"\",\"\",R3,\"\",before3,\"\",after3,\"\"));}\r\n\t\t\t\tclock++;\r\n\t\t\t\tPC = PC + 2;\r\n\t\t\t\tbreak;\r\n\t\t\t\t//subtraction immediate operation\r\n\t\t\tcase \"0011\":\r\n\t\t\t\tif(registers[source].charAt(0)=='1') {\r\n\t\t\t\t\tbefore2=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[source]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tbefore2=\"\"+Integer.parseInt((registers[source]),2);\r\n\t\t\t\t}\r\n\t\t\t\tif(registers[dest].charAt(0)=='1') {\r\n\t\t\t\t\tbefore1=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[dest]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tbefore1=\"\"+Integer.parseInt((registers[dest]),2);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tbefore3=\"\"+immed6;\r\n\t\t\t\tString s7 = Integer.toBinaryString(Integer.parseInt((registers[source]),2)-immed6);\r\n\t\t\t\tint l7 = s7.length();\r\n\t\t\t\t\r\n\t\t\t\tif(l7>16) {\r\n\t\t\t\t\ts4=s7.substring(l7-16,l7);\r\n\t\t\t\t\tl7=16;\r\n\t\t\t\t}\r\n\t\t\t\tregisters[dest]= l7==16?s7:\"0000000000000000\".substring(0,16-l7) + s7;\r\n\t\t\t\t\r\n\t\t\t\tinstruction = \"subi \"+\"r\"+dest+\",\"+\"r\"+source+\",\"+immed6;\r\n\t\t\t\tR1=\"r\"+dest;\r\n\t\t\t\tR2=\"r\"+source;\r\n\t\t\t\tR3=\"r\"+immed6;\r\n\t\t\t\tif(registers[source].charAt(0)=='1') {\r\n\t\t\t\t\tafter2=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[source]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tafter2=\"\"+Integer.parseInt((registers[source]),2);\r\n\t\t\t\t}\r\n\t\t\t\tif(registers[dest].charAt(0)=='1') {\r\n\t\t\t\t\tafter1=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[dest]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tafter1=\"\"+Integer.parseInt((registers[dest]),2);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tafter3=\"\"+immed6;\r\n\t\t\t\t//writing to trace file\r\n\t\t\t\tif(trace == 1 ) {\r\n\t\t\t\toutput1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\", PC,instruction,R1,\"\",before1,\"\",after1,\"\"));\r\n\t\t\t\toutput1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\\n\\n\", \"\",\"\",R2,\"\",before2,\"\",after2,\"\"));\r\n\t\t\t\toutput1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\\n\\n\", \"\",\"\",\"\",R3,\"\",before3,\"\",after3));\r\n\t\t\t\t}\r\n\t\t\t\tclock++;\r\n\t\t\t\t\r\n\t\t\t\tPC = PC + 2;\r\n\t\t\t\tbreak;\r\n\t\t\t\t//trap operation\r\n\t\t\tcase \"0100\":\r\n\t\t\t\tif(registers[1].charAt(0)=='1') {\r\n\t\t\t\t\tbefore1=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[1]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tbefore1=\"\"+Integer.parseInt((registers[1]),2);\r\n\t\t\t\t}\r\n\t\t\t\tinstruction = \"trap \"+ immed12;\r\n\t\t\t\tR1=\"r1\";\r\n\t\t\t\tclock++;\r\n\t\t\t\t//HALT condition with trap =0\r\n\t\t\t\tif(immed12==0) {\r\n\t\t\t\t\toutput1.close();\r\n\t\t\t\t\t\r\n\t\t\t\t\tNatureTermination=NatureTermination+\"NORMAL\\n AND THE CLOCK VALUE is\"+Integer.toHexString(CPU.clock);\r\n\t\t\t\t\t\r\n\t\t\t\t\twriteOutput(NatureTermination, System.currentTimeMillis());\r\n\t\t\t\t\tSystem.exit(0);\r\n\t\t\t\t}else if(immed12==1){\r\n\t\t\t\t\t//output on console when trap equals 1\r\n\t\t\t\t\tclock = clock +10;\r\n\t\t\t\t\tSystem.out.println(Integer.toHexString(Integer.parseInt(registers[1], 2)));\r\n\t\t\t\t\tif(registers[1].charAt(0)=='1') {\r\n\t\t\t\t\t\tafter1=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[1]),2);\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tafter1=\"\"+Integer.parseInt((registers[1]),2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(trace == 1 ) {\r\n\t\t\t\t\toutput1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\\n\\n\", PC,instruction,R1,\"\",before1,\"\",after1,\"\"));}\r\n\t\t\t\t\t\r\n\t\t\t\t\toutput1.close();\r\n\t\t\t\t\tNatureTermination=NatureTermination+\"NORMAL\\n AND THE CLOCK VALUE is\"+Integer.toHexString(CPU.clock);\r\n\t\t\t\t\twriteOutput(NatureTermination, System.currentTimeMillis());\r\n\t\t\t\t\tSystem.exit(0);\r\n\t\t\t\t\t\r\n\t\t\t\t}else if(immed12==2) {\r\n\t\t\t\t\t//input when trap equals 2\r\n\t\t\t\t\tclock = clock +10;\r\n\t\t\t\t\tSystem.out.println(\"Enter value\");\r\n\t\t\t\t\tScanner sc1 = new Scanner(System.in);\r\n\t\t\t\t\tString s2=(Integer.toBinaryString(Integer.parseInt(sc1.next())));\r\n\t\t\t\t\tint l2=s2.length();\r\n\t\t\t\t\tif(l2>16) {\r\n\t\t\t\t\t\ts2=s2.substring(l2-16,l2);\r\n\t\t\t\t\t\tl2=16;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tregisters[1]=l2==16?s2:\"0000000000000000\".substring(0,16-l2) + s2;\r\n\t\t\t\t\tif(registers[1].charAt(0)=='1') {\r\n\t\t\t\t\t\tafter1=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[1]),2);\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tafter1=\"\"+Integer.parseInt((registers[1]),2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(trace == 1 ) {\r\n\t\t\t\t\t\t//writing to trace file\r\n\t\t\t\t\toutput1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\\n\\n\", PC,instruction,R1,\"\",before1,\"\",after1,\"\"));\r\n\t\t\t\t\t}\r\n\t\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t// checking for invalid trace bit\r\n\t\t\t\t\toutput1.close();\r\n\t\t\t\t\tERROR_HANDLER.errorHandler(1);\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t\tafter1=\"\"+immed12;\r\n\t\t\t\tPC = PC + 2;\r\n\t\t\t\tbreak;\r\n\t\t\t\t//locking memory through lockArray \r\n\t\t\tcase \"0101\":\r\n\t\t\t\tclock++;\r\n\t\t\t\tbefore1=\"\"+immed12;\r\n\t\t\t\tMEMORY.lock[immed12]=true;\r\n\t\t\t\tMEMORY.lock[immed12+1]=true;\r\n\t\t\t\tinstruction = \"lock \"+ immed12;\r\n\t\t\t\tR1=\"\"+immed12;\r\n\t\t\t\tafter1=\"\"+immed12;\r\n\t\t\t\tif(trace == 1 ) {\r\n\t\t\t\toutput1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\\n\\n\", PC,instruction,\"\",\"\",\"\",\"\",\"\",\"\"));\r\n\t\t\t\t}PC= PC+2;\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t\t//unlocking memory bytes through lockArray\r\n\t\t\tcase \"0110\":\r\n\t\t\t\tclock++;\r\n\t\t\t\tbefore1=\"\"+immed12;\r\n\t\t\t\tMEMORY.lock[immed12]= false;\r\n\t\t\t\tMEMORY.lock[immed12+1]= false;\r\n\t\t\t\tinstruction = \"unlock \"+ immed12;\r\n\t\t\t\tR1=\"\"+immed12;\r\n\t\t\t\tafter1=\"\"+immed12;\r\n\t\t\t\tif(trace == 1 ) {\r\n\t\t\t\toutput1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\\n\\n\", PC,instruction,\"\",\"\",\"\",\"\",\"\",\"\"));\r\n\t\t\t\t\r\n\t\t\t\t}PC= PC+2;\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t\t//Branching if equal to zero condition\r\n\t\t\tcase \"0111\":\r\n\t\t\t\tclock++;\r\n\t\t\t\tif(registers[source].charAt(0)=='1') {\r\n\t\t\t\t\tbefore1=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[source]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tbefore1=\"\"+Integer.parseInt((registers[source]),2);\r\n\t\t\t\t}\r\n\t\t\t\tbefore2=\"\"+immed6;\r\n\t\t\t\t//incrementing PC by immed6 if equal to 0\r\n\t\t\t\tif(registers[source].equals(\"0000000000000000\")) {\r\n\t\t\t\t\tinstruction = \"beqz \"+\"(\"+\"r\"+source+\")\"+\",\"+immed6;\r\n\t\t\t\t\tR1=\"(\"+\"r\"+source+\")\";\r\n\t\t\t\t\tR2=\"\"+immed6;\r\n\t\t\t\t\tif(registers[source].charAt(0)=='1') {\r\n\t\t\t\t\t\tafter1=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[source]),2);\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tafter1=\"\"+Integer.parseInt((registers[source]),2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//after1=\"\"+Integer.parseInt(findTwoscomplement(registers[source]),2);\r\n\t\t\t\t\tafter2=\"\"+immed6;\r\n\t\t\t\t\tif(trace == 1 ) {\r\n\t\t\t\t\toutput1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\\n\\n\", PC,instruction,R1,\"\",before1,\"\",after1,\"\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tPC = PC + immed6;\r\n\t\t\t\t}\r\n\t\t\t\t//incrementing PC by 2 if not equal to 0\r\n\t\t\t\telse if(!registers[source].equals(\"0000000000000000\")) {\r\n\t\t\t\t\tinstruction = \"beqz \"+\"(\"+\"r\"+source+\")\"+\",\"+immed6;\r\n\t\t\t\t\tR1=\"(\"+\"r\"+source+\")\";\r\n\t\t\t\t\tR2=\"\"+immed6;\r\n\t\t\t\t\tif(registers[source].charAt(0)=='1') {\r\n\t\t\t\t\t\tafter1=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[source]),2);\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tafter1=\"\"+Integer.parseInt((registers[source]),2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//after1=\"\"+Integer.parseInt(findTwoscomplement(registers[source]),2);\r\n\t\t\t\t\tafter2=\"\"+immed6;\r\n\t\t\t\t\tif(trace == 1 ) {\r\n\t\t\t\t\toutput1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\\n\\n\", PC,instruction,R1,\"\",before1,\"\",after1,\"\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tPC = PC + 2;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\t//loading from Memory\r\n\t\t\tcase \"1000\":\r\n\t\t\t\tclock++;\r\n\t\t\t\tif(registers[source].charAt(0)=='1') {\r\n\t\t\t\t\tbefore2=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[source]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tbefore2=\"\"+Integer.parseInt((registers[source]),2);\r\n\t\t\t\t}\r\n\t\t\t\tif(registers[dest].charAt(0)=='1') {\r\n\t\t\t\t\tbefore1=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[dest]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tbefore1=\"\"+Integer.parseInt((registers[dest]),2);\r\n\t\t\t\t}\r\n\t\t\t\tString s24;\r\n\t\t\t\ts24=MEMORY.Memory(\"READ\", Integer.parseInt(registers[source],2) + immed6,\"\")+\r\n\t\t\t\t\t\tMEMORY.Memory(\"READ\", Integer.parseInt(registers[source],2) + immed6+1,\"\");\r\n\t\t\t\tif(s24.charAt(0)=='1') {\r\n\t\t\t\t\tEA2=\"\"+(int)Long.parseLong((\"111111111111111111111111\"+s24),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tEA2=\"\"+Integer.parseInt((s24),2);\r\n\t\t\t\t}\r\n\t\t\t\t//EA2=\"\"+Integer.parseInt(Memory[Integer.parseInt(registers[source],2) + immed6]+Memory[Integer.parseInt(registers[source],2) + immed6+1],2);\r\n\t\t\t\t\r\n\t\t\t\tif(MEMORY.lock[Integer.parseInt(registers[source],2) + immed6]==false) {\r\n\t\t\t\t\t\tString st=s24;\r\n\t\t\t\t\t\t//System.out.println(st);\r\n\t\t\t\t\t\tint l1=st.length();\r\n\t\t\t\t\t\tregisters[dest]=l1==16?st:\"0000000000000000\".substring(0,16-l1) + st;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tERROR_HANDLER.errorHandler(8);\r\n\t\t\t\t}\r\n\t\t\t\tinstruction = \"load \"+\"r\"+dest+\",\"+immed6+\"(\"+\"r\"+source+\")\";\r\n\t\t\t\tR1 = \"r\"+dest;\r\n\t\t\t\tR2=\"r\"+source;\r\n\t\t\t\tEA1=\"\"+immed6;\r\n\t\t\t\tString s23;\r\n\t\t\t\tif((Integer.parseInt(registers[source],2) + immed6)>=LOADER.memStart&(Integer.parseInt(registers[source],2) + immed6)<2*LOADER.instr) {\r\n\t\t\t\t\toutput1.close();\r\n\t\t\t\t\tERROR_HANDLER.errorHandler(2);\r\n\t\t\t\t}else {\r\n\t\t\t\ts23=MEMORY.Memory(\"READ\", Integer.parseInt(registers[source],2) + immed6,\"\")+\r\n\t\t\t\t\t\tMEMORY.Memory(\"READ\", Integer.parseInt(registers[source],2) + immed6+1,\"\");\r\n\t\t\t\tif(s23.charAt(0)=='1') {\r\n\t\t\t\t\tEA3=\"\"+(int)Long.parseLong((\"111111111111111111111111\"+s23),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tEA3=\"\"+Integer.parseInt((s23),2);\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t\tif(registers[source].charAt(0)=='1') {\r\n\t\t\t\t\tafter2=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[source]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tafter2=\"\"+Integer.parseInt((registers[source]),2);\r\n\t\t\t\t}\r\n\t\t\t\tif(registers[dest].charAt(0)=='1') {\r\n\t\t\t\t\tafter1=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[dest]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tafter1=\"\"+Integer.parseInt((registers[dest]),2);\r\n\t\t\t\t}\r\n\t\t\t\tif(trace == 1 ) {\r\n\t\t\t\toutput1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\", PC,instruction,R1,\"\",before1,\"\",after1,\"\"));\r\n\t\t\t\toutput1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\", \"\",\"\",R2,\"\",before2,\"\",after2,\"\"));\r\n\t\t\t\toutput1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\\n\\n\", \"\",\"\",\"\",EA1,\"\",EA2,\"\",EA3));\r\n\t\t\t\t}\r\n\t\t\t\tPC = PC + 2;}\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t\t//storing into memory\r\n\t\t\tcase \"1001\":\r\n\t\t\t\tclock++;\r\n\t\t\t\tif(registers[source].charAt(0)=='1') {\r\n\t\t\t\t\tbefore2=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[source]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tbefore2=\"\"+Integer.parseInt((registers[source]),2);\r\n\t\t\t\t}\r\n\t\t\t\tif(registers[dest].charAt(0)=='1') {\r\n\t\t\t\t\tbefore1=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[dest]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tbefore1=\"\"+Integer.parseInt((registers[dest]),2);\r\n\t\t\t\t}\r\n\t\t\t\tEA1= \"\"+immed6;\r\n\t\t\t\tString s22;\r\n\t\t\t\ts22=MEMORY.Read(Integer.parseInt(registers[dest],2) + immed6)+MEMORY.Read(Integer.parseInt(registers[dest],2) + immed6+1);\r\n\t\t\t\tif(s22.charAt(0)=='1') {\r\n\t\t\t\t\tEA2=\"\"+(int)Long.parseLong((\"1111111111111111\"+s22),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tEA2=\"\"+Integer.parseInt((s22),2);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(MEMORY.lock[Integer.parseInt(registers[dest],2) + immed6]==false) {\r\n\t\t\t\t\tif((Integer.parseInt(registers[dest],2) + immed6)<2*LOADER.instr&(Integer.parseInt(registers[dest],2) + immed6)>=2*LOADER.memStart) {\r\n\t\t\t\t\t\toutput1.close();\r\n\t\t\t\t\t\tERROR_HANDLER.errorHandler(2);\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tif(registers[source].length()>16) {\r\n\t\t\t\t\t\t\toutput1.close();\r\n\t\t\t\t\t\t\tERROR_HANDLER.errorHandler(4);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tMEMORY.write(Integer.parseInt(registers[dest],2) + immed6, registers[source].substring(0,8));\r\n\t\t\t\t\t\t//[Integer.parseInt(registers[dest],2) + immed6]) = registers[source].substring(0,8);\r\n\t\t\t\t\t\tMEMORY.write(Integer.parseInt(registers[dest],2) + immed6+1, registers[source].substring(8,16)); \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\telse {\r\n\t\t\t\t\t//throwing error if memory is locked\t\r\n\t\t\t\t\tERROR_HANDLER.errorHandler(8);\r\n\t\t\t\t}\r\n\t\t\t\tinstruction = \"store \"+immed6+\"(\"+\"r\"+dest+\")\"+\",\"+\"r\"+source;\r\n\t\t\t\tR1=\"r\"+dest;\r\n\t\t\t\tR2=\"r\"+source;\r\n\t\t\t\tif(registers[source].charAt(0)=='1') {\r\n\t\t\t\t\tafter2=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[source]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tafter2=\"\"+Integer.parseInt((registers[source]),2);\r\n\t\t\t\t}\r\n\t\t\t\tif(registers[dest].charAt(0)=='1') {\r\n\t\t\t\t\tafter1=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[dest]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tafter1=\"\"+Integer.parseInt((registers[dest]),2);\r\n\t\t\t\t}\r\n\t\t\t\tString s21;\r\n\t\t\t\ts21=MEMORY.Read(Integer.parseInt(registers[dest],2) + immed6)+MEMORY.Read(Integer.parseInt(registers[dest],2) + immed6+1);\r\n\t\t\t\tif(s21.charAt(0)=='1') {\r\n\t\t\t\t\tEA3=\"\"+(int)Long.parseLong((\"111111111111111111111111\"+s21),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tEA3=\"\"+Integer.parseInt((s21),2);\r\n\t\t\t\t}\r\n\t\t\t\tif(trace == 1 ) {\r\n\t\t\t\t\t//writing to trace file\r\n\t\t\t\toutput1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\", PC,instruction,R1,\"\",before1,\"\",after1,\"\"));\r\n\t\t\t\toutput1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\", \"\",\"\",R2,\"\",before2,\"\",after2,\"\"));\r\n\t\t\t\toutput1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\\n\\n\", \"\",\"\",\"\",EA1,\"\",EA2,\"\",EA3));\r\n\t\t\t\t}PC = PC + 2;\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t\t//Move values from one register to anotherr\r\n\t\t\tcase \"1010\":\r\n\t\t\t\tclock++;\r\n\t\t\t\tif(registers[source].charAt(0)=='1') {\r\n\t\t\t\t\tbefore2=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[source]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tbefore2=\"\"+Integer.parseInt((registers[source]),2);\r\n\t\t\t\t}\r\n\t\t\t\tif(registers[dest].charAt(0)=='1') {\r\n\t\t\t\t\tbefore1=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[dest]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tbefore1=\"\"+Integer.parseInt((registers[dest]),2);\r\n\t\t\t\t}\r\n\t\t\t\tString s6=registers[source];\r\n\t\t\t\tint l6=s6.length();\r\n\t\t\t\tregisters[dest]= l6==16?s6:\"0000000000000000\".substring(0,16-l6) + s6;\r\n\t\t\t\tinstruction = \"move \"+\"r\"+dest+\",\"+\"r\"+source;\r\n\t\t\t\tR1=\"r\"+dest;\r\n\t\t\t\tR2=\"r\"+source;\r\n\t\t\t\tif(registers[source].charAt(0)=='1') {\r\n\t\t\t\t\tafter2=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[source]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tafter2=\"\"+Integer.parseInt((registers[source]),2);\r\n\t\t\t\t}\r\n\t\t\t\tif(registers[dest].charAt(0)=='1') {\r\n\t\t\t\t\tafter1=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[dest]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tafter1=\"\"+Integer.parseInt((registers[dest]),2);\r\n\t\t\t\t}\r\n\t\t\t\tif(trace == 1 ) {\r\n\t\t\t\t\t//writing to trace file\r\n\t\t\t\toutput1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\", PC,instruction,R1,\"\",before1,\"\",after1,\"\"));\r\n\t\t\t\toutput1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\\n\\n\", \"\",\"\",R2,\"\",before2,\"\",after2,\"\"));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tPC = PC + 2;\r\n\t\t\t\tbreak;\r\n\t\t\t\t//Move immediate value to register\r\n\t\t\tcase \"1011\":\r\n\t\t\t\tclock++;\r\n\t\t\t\tif(registers[source].charAt(0)=='1') {\r\n\t\t\t\t\tbefore2=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[source]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tbefore2=\"\"+Integer.parseInt((registers[source]),2);\r\n\t\t\t\t}\r\n\t\t\t\tif(registers[dest].charAt(0)=='1') {\r\n\t\t\t\t\tbefore1=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[dest]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tbefore1=\"\"+Integer.parseInt((registers[dest]),2);\r\n\t\t\t\t}\r\n\t\t\t\tint l=Integer.toBinaryString(immed6).length();\r\n\t\t\t\tregisters[dest] = l==16?Integer.toBinaryString(immed6):\"0000000000000000\".substring(0,16-l) + Integer.toBinaryString(immed6);\r\n\t\t\t\t\r\n\t\t\t\tregisters[source] = \"0000000000000000\";\r\n\t\t\t\tinstruction = \"movei \"+\"r\"+dest+\",\"+immed6;\r\n\t\t\t\tR1=\"r\"+dest;\r\n\t\t\t\tR2=\"r\"+source;\r\n\t\t\t\tif(registers[source].charAt(0)=='1') {\r\n\t\t\t\t\tafter2=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[source]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tafter2=\"\"+Integer.parseInt((registers[source]),2);\r\n\t\t\t\t}\r\n\t\t\t\tif(registers[dest].charAt(0)=='1') {\r\n\t\t\t\t\tafter1=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[dest]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tafter1=\"\"+Integer.parseInt((registers[dest]),2);\r\n\t\t\t\t}\r\n\t\t\t\tif(trace == 1 ) {\r\n\t\t\t\t\t//writing to trace file\r\n\t\t\t\toutput1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\", PC,instruction,R1,\"\",before1,\"\",after1,\"\"));\r\n\t\t\t\toutput1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\", \"\",\"\",R2,\"\",before2,\"\",after2,\"\"));\r\n\t\t\t\toutput1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\\n\\n\", \"\",\"\",\"\",immed6,\"\",immed6,\"\",immed6));\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tPC = PC + 2;\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t\t//Branching if not equal to zero\r\n\t\t\tcase \"1100\":\r\n\t\t\t\tclock++;\r\n\t\t\t\tif(registers[dest].charAt(0)=='1') {\r\n\t\t\t\t\tbefore1=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[dest]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tbefore1=\"\"+Integer.parseInt((registers[dest]),2);\r\n\t\t\t\t}\r\n\t\t\t\t//incrementing PC by immed6 if not equal to zero\r\n\t\t\t\tif(!registers[source].equals(\"0000000000000000\") ) {\r\n\t\t\t\t\tinstruction = \"bnez \"+\"r\"+source+\",\"+immed6;\r\n\t\t\t\t\tR1=\"r\"+source;\r\n\t\t\t\t\tif(registers[dest].charAt(0)=='1') {\r\n\t\t\t\t\t\tafter1=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[dest]),2);\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tafter1=\"\"+Integer.parseInt((registers[dest]),2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(trace == 1 ) {\r\n\t\t\t\t\toutput1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\\n\\n\", PC,instruction,R1,\"\",before1,\"\",after1,\"\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tPC = PC + immed6;\r\n\t\t\t\t}\r\n\t\t\t\t//incrementing PC by 2 if equal to zero\r\n\t\t\t\telse if(registers[source].equals(\"0000000000000000\")) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tinstruction = \"bnez \"+\"r\"+source+\",\"+immed6;\r\n\t\t\t\t\tR1=\"r\"+source;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(registers[dest].charAt(0)=='1') {\r\n\t\t\t\t\t\tafter1=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[dest]),2);\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tafter1=\"\"+Integer.parseInt((registers[dest]),2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(trace == 1 ) {\r\n\t\t\t\t\toutput1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\\n\\n\", PC,instruction,R1,\"\",before1,\"\",after1,\"\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tPC=PC+2;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t\t//Shifting if equal to zero\r\n\t\t\tcase \"1101\":\r\n\t\t\t\tclock++;\r\n\t\t\t\tif(registers[source].charAt(0)=='1') {\r\n\t\t\t\t\tbefore2=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[source]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tbefore2=\"\"+Integer.parseInt((registers[source]),2);\r\n\t\t\t\t}\r\n\t\t\t\tif(registers[dest].charAt(0)=='1') {\r\n\t\t\t\t\tbefore1=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[dest]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tbefore1=\"\"+Integer.parseInt((registers[dest]),2);\r\n\t\t\t\t}\r\n\t\t\t\tif(registers[target].charAt(0)=='1') {\r\n\t\t\t\t\tbefore3=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[target]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tbefore3=\"\"+Integer.parseInt((registers[target]),2);\r\n\t\t\t\t}\r\n\t\t\t\tregisters[dest]= Integer.parseInt(registers[source])==Integer.parseInt(registers[target])? \"0000000000000001\":\"0000000000000000\";\r\n\t\t\t\tinstruction = \"seq \"+\"r\"+dest+\",\"+\"r\"+source+\",\"+\"r\"+target;\r\n\t\t\t\tR1=\"r\"+dest;\r\n\t\t\t\tR2=\"r\"+source;\r\n\t\t\t\tR3=\"r\"+target;\r\n\t\t\t\tif(registers[source].charAt(0)=='1') {\r\n\t\t\t\t\tafter2=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[source]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tafter2=\"\"+Integer.parseInt((registers[source]),2);\r\n\t\t\t\t}\r\n\t\t\t\tif(registers[dest].charAt(0)=='1') {\r\n\t\t\t\t\tafter1=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[dest]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tafter1=\"\"+Integer.parseInt((registers[dest]),2);\r\n\t\t\t\t}\r\n\t\t\t\tif(registers[target].charAt(0)=='1') {\r\n\t\t\t\t\tafter3=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[target]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tafter3=\"\"+Integer.parseInt((registers[target]),2);\r\n\t\t\t\t}\r\n\t\t\t\tif(trace == 1 ) {\r\n\t\t\t\t\t//writing to trace file\r\n\t\t\t\toutput1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\", PC,instruction,R1,\"\",before1,\"\",after1,\"\"));\r\n\t\t\t\toutput1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\", \"\",\"\",R2,\"\",before2,\"\",after2,\"\"));\r\n\t\t\t\toutput1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\\n\\n\", \"\",\"\",R3,\"\",before3,\"\",after3,\"\"));\r\n\t\t\t\t}\r\n\t\t\t\tPC = PC + 2;\r\n\t\t\t\tbreak;\r\n\t\t\t\t//\r\n\t\t\t\t//shifting if greater than zero\r\n\t\t\tcase \"1110\":\r\n\t\t\t\tclock++;\r\n\t\t\t\tif(registers[source].charAt(0)=='1') {\r\n\t\t\t\t\tbefore2=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[source]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tbefore2=\"\"+Integer.parseInt((registers[source]),2);\r\n\t\t\t\t}\r\n\t\t\t\tif(registers[dest].charAt(0)=='1') {\r\n\t\t\t\t\tbefore1=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[dest]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tbefore1=\"\"+Integer.parseInt((registers[dest]),2);\r\n\t\t\t\t}\r\n\t\t\t\tif(registers[target].charAt(0)=='1') {\r\n\t\t\t\t\tbefore3=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[target]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tbefore3=\"\"+Integer.parseInt((registers[target]),2);\r\n\t\t\t\t}\r\n\t\t\t\tregisters[dest]= Integer.parseInt(registers[source])>Integer.parseInt(registers[target])? \"0000000000000001\":\"0000000000000000\";\r\n\t\t\t\tinstruction = \"sgt \"+\"r\"+dest+\",\"+\"r\"+source+\",\"+\"r\"+target;\r\n\t\t\t\tR1=\"r\"+dest;\r\n\t\t\t\tR2=\"r\"+source;\r\n\t\t\t\tR3=\"r\"+target;\r\n\t\t\t\tif(registers[source].charAt(0)=='1') {\r\n\t\t\t\t\tafter2=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[source]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tafter2=\"\"+Integer.parseInt((registers[source]),2);\r\n\t\t\t\t}\r\n\t\t\t\tif(registers[dest].charAt(0)=='1') {\r\n\t\t\t\t\tafter1=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[dest]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tafter1=\"\"+Integer.parseInt((registers[dest]),2);\r\n\t\t\t\t}\r\n\t\t\t\tif(registers[target].charAt(0)=='1') {\r\n\t\t\t\t\tafter3=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[target]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tafter3=\"\"+Integer.parseInt((registers[target]),2);\r\n\t\t\t\t}\r\n\t\t\t\tif(trace == 1 ) {\r\n\t\t\t\t\t//writing to trace file\r\n\t\t\t\toutput1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\", PC,instruction,R1,\"\",before1,\"\",after1,\"\"));\r\n\t\t\t\toutput1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\", \"\",\"\",R2,\"\",before2,\"\",after2,\"\"));\r\n\t\t\t\toutput1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\\n\\n\", \"\",\"\",R3,\"\",before3,\"\",after3,\"\"));\r\n\t\t\t\t}\r\n\t\t\t\tPC = PC + 2;\r\n\t\t\t\tbreak;\r\n\t\t\t\t//\r\n\t\t\t\t//shift if not equal to zero\r\n\t\t\tcase \"1111\":\r\n\t\t\t\tclock++;\r\n\t\t\t\tif(registers[source].charAt(0)=='1') {\r\n\t\t\t\t\tbefore2=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[source]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tbefore2=\"\"+Integer.parseInt((registers[source]),2);\r\n\t\t\t\t}\r\n\t\t\t\tif(registers[dest].charAt(0)=='1') {\r\n\t\t\t\t\tbefore1=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[dest]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tbefore1=\"\"+Integer.parseInt((registers[dest]),2);\r\n\t\t\t\t}\r\n\t\t\t\tif(registers[target].charAt(0)=='1') {\r\n\t\t\t\t\tbefore3=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[target]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tbefore3=\"\"+Integer.parseInt((registers[target]),2);\r\n\t\t\t\t}\r\n\t\t\t\tregisters[dest]= Integer.parseInt(registers[source])!=Integer.parseInt(registers[target])? \"0000000000000001\":\"0000000000000000\";\r\n\t\t\t\tinstruction = \"sne \"+\"r\"+dest+\",\"+\"r\"+source+\",\"+\"r\"+target;\r\n\t\t\t\tR1=\"r\"+dest;\r\n\t\t\t\tR2=\"r\"+source;\r\n\t\t\t\tR3=\"r\"+target;\r\n\t\t\t\tif(registers[source].charAt(0)=='1') {\r\n\t\t\t\t\tafter2=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[source]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tafter2=\"\"+Integer.parseInt((registers[source]),2);\r\n\t\t\t\t}\r\n\t\t\t\tif(registers[dest].charAt(0)=='1') {\r\n\t\t\t\t\tafter1=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[dest]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tafter1=\"\"+Integer.parseInt((registers[dest]),2);\r\n\t\t\t\t}\r\n\t\t\t\tif(registers[target].charAt(0)=='1') {\r\n\t\t\t\t\tafter3=\"\"+(int)Long.parseLong((\"1111111111111111\"+registers[target]),2);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tafter3=\"\"+Integer.parseInt((registers[target]),2);\r\n\t\t\t\t}\r\n\t\t\t\tif(trace == 1 ) {\r\n\t\t\t\t\t//writing to trace file\r\n\t\t\t\toutput1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\", PC,instruction,R1,\"\",before1,\"\",after1,\"\"));\r\n\t\t\t\toutput1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\", \"\",\"\",R2,\"\",before2,\"\",after2,\"\"));\r\n\t\t\t\toutput1.write(String.format(\"%20s %20s %20s %20s %20s %20s %20s %20s \\r\\n\\n\\n\", \"\",\"\",R3,\"\",before3,\"\",after3,\"\"));\r\n\t\t\t\t}\r\n\t\t\t\tPC = PC + 2;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n }\r\n\t}",
"private void loadRegistredCommands() {\n ServiceLoader<Command> loader = ServiceLoader.load(Command.class);\n for (Command command : loader) {\n addCommand(command);\n }\n }",
"public interface IInstruction {\r\n /**\r\n * Returns how many cycles this instruction needs to execute.\r\n * \r\n * @return The number of cycles this instruction takes.\r\n */\r\n public int getCycles();\r\n \r\n /**\r\n * Executes the instruction under a given environment.\r\n * \r\n * @param cpu The UCPU16 instance.\r\n * @param a The second parameter of a binary instruction as an addressing mode,\r\n * or the only parameter of an unary instruction.\r\n * @param b The first parameter of a binary instruction as an addressing mode.\r\n * @param am The additional argument for a.\r\n * @param bm The additional argument for b.\r\n */\r\n public void execute(UCPU16 cpu, IAddressingMode a, IAddressingMode b, int am, int bm);\r\n \r\n /**\r\n * Returns the symbolic name of this operation for the debugger\r\n * and disassembler.\r\n * \r\n * @return The symbolic name of this instruction operation.\r\n */\r\n public String getName();\r\n}",
"public static void main(String[] args) throws IOException {\n\t\tLineOfCode[] inputProgram = new LineOfCode[32];\n\t\t// Initialize an array of type LineOfMachineCode\n\t\tLineOfMachineCode[] instructions = new LineOfMachineCode[32];\n\t\tString[] opcodes = {\"LDA\", \"ADD\", \"SUB\", \"STA\", \"MPY\", \"DIV\", \n\t\t\t\t\"INP\", \"OUT\", \"JMP\", \"JMI\" }; \n\t\tString[] tokens = new String[80];\n\t\tString line = \"\";\n\t\t\n\t\t// prepare to read program from file\n\t\tFile filename = new File(\"MysteryProgram_0.txt\");\n\t\tScanner filescan = new Scanner(filename);\n\t\tScanner input = new Scanner(System.in);\n\t\tint numOfLines = 0; \n\t\t\n\t\t// Read the file containing the program one line at a time.\n\t\t// instantiate a LineOfCode Object for each line read in\n\t\t// and assign line tokens to the fields of the new object.\n\t\twhile(filescan.hasNext()){\n\t\t\tline = filescan.nextLine();\n\t\t\tString comments = \" \";\n\t\t\t// instantiate a LineOfCode object with empty fields\n\t\t\tinputProgram[numOfLines] = new LineOfCode();\n\t\t\t\n\t\t\tif(!line.isEmpty()){\n\t\t\ttokens = line.split(\"\\\\s+\");\n\t\t\t\n\t\t\t// if comments exits, create a comments string to holed them\n\t\t\t// and assign the comments to the appropriate instance variable\n\t\t\t\tif(tokens.length > 3 ){\n\t\t\t\t\tfor(int i = 3; i < tokens.length; i++ )\t\t\t\t\t\t\n\t\t\t\t\tcomments += tokens[i] + \" \";\t\n\t\t\t\t}else{\n\t\t\t\t\tcomments = \" \"; \n\t\t\t\t}\n\t\t\tinputProgram[numOfLines].setComments(comments);\n\t\t\t\n\t\t\t// check each token from the line and assign it to \n\t\t\t// its appropriate instance variable\n\t\t\tif(tokens[1].equals(\"DC\")){\n\t\t\t\tinputProgram[numOfLines].setOpcode(tokens[1]);\n\t\t\t\tinputProgram[numOfLines].setLabel(tokens[0]);\n\t\t\t\tinputProgram[numOfLines].setOperand(tokens[2]);\n\t\t\t}else if(tokens[1].equals(\"DL\")){\n\t\t\t\tinputProgram[numOfLines].setOpcode(tokens[1]);\n\t\t\t\tinputProgram[numOfLines].setLabel(tokens[0]);\n\t\t\t}else{// Big Else\t\t\t\n\t\t\t\t\n\t\t\t\t\tfor(int x = 0;x < opcodes.length; x++){\n\t\t\t\t\t\tif(opcodes[x].equals(tokens[0])){\n\t\t\t\t\t\tinputProgram[numOfLines].setOpcode(tokens[0]);\n\t\t\t\t\t\tinputProgram[numOfLines].setOperand(tokens[1]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(opcodes[x].equals(tokens[1])){\n\t\t\t\t\t\t\tinputProgram[numOfLines].setOpcode(tokens[1]);\n\t\t\t\t\t\t\tinputProgram[numOfLines].setLabel(tokens[0]);\n\t\t\t\t\t\t\tinputProgram[numOfLines].setOperand(tokens[2]);\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t} //for loop\n\t\t\t\n\t\t\t} //Big Else\n\t\t\t\t\n\t\t\t\n\t\t\t\tnumOfLines++;\n\t\t\t} \t//Super If\t\n\t\t\t\n\t\t} // while, \n\t\t\n\t\t\n\t\t// finished reading the file\n\t\tfilescan.close();\n\t\t\n\t\t// Assemble machine code out of each LineOfCode object \n\t\t// from the inputProgram array. \n\t\tfor(int i = 0; i < numOfLines; i++){\n\t\t\tinstructions[i] = new LineOfMachineCode();\n\t\t\t// handle pseudo-opcodes if they are present in the line\n\t\t\tif(inputProgram[i].getOpcode().equals(\"DL\"))\n\t\t\t\tinstructions[i].setOperand(0);\n\t\t\telse if(inputProgram[i].getOpcode().equals(\"DC\"))\n\t\t\t\t\tinstructions[i].setOperand(Integer.parseInt(inputProgram[i].getOperand()));\n\t\t\telse{\n\t\t\t\t// helper variables \n\t\t\t\tint opc = 0;\n\t\t\t\tint op = 0;\n\t\t\t\tfor(int j = 0; j < opcodes.length;j++){\n\t\t\t\t\tif(inputProgram[i].getOpcode().equals(opcodes[j])){\n\t\t\t\t\t\t// assign opcode in program to correct index of opcode array\n\t\t\t\t\t\topc = j; \n\t\t\t\t\t\tinstructions[i].setOpcode(opc);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfor(int k = 0; k < numOfLines; k++){\n\t\t\t\t\tif(inputProgram[k].getLabel().equals(inputProgram[i].getOperand()))\n\t\t\t\t\t{\n\t\t\t\t\t\t// assign memory location of label to operand\n\t\t\t\t\t\top = k; \n\t\t\t\t\t\tinstructions[i].setOperand(op);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//if opcode == 0 which is LDA how to handle it\n\t\t\t\t// handle operand greater than 9 ex. 12\n\t\t\t\tif(opc == 0 && op > 9)\n\t\t\t\t\t//System.out.print(opc + \"\" + op );\n\t\t\t\t\tinstructions[i].setOpcode(opc);\n\t\t\t\t\n\t\t\t\t//else if(opc == 0 && op < 10)\n\t\t\t\t\t//System.out.print(opc + \"0\" + op + \"\\n\");\n\t\t\telse{\t\n\t\t\t\t//System.out.print( (opc * 100 + op) + \"\\n\");\n\t\t\t\tinstructions[i].setOpcode(opc);\n\t\t\t\tinstructions[i].setOperand(op);\n\t\t\t\t}\n\t\t\t} // Big else\n\t\t\t\n\t\t\t\n\t\t\t// At this point we have everything converted to machine code\n\t\t\t// Option I - have another for loop start here to begin execution of lineOfMachineCode\n\t\t}// outer for \n\t\t\n\t\t// Vars used during execution Execute the program\n\t\tint pc = 0; \t\t\t\t\n\t\tint store = 0; \n\t\tint opcode = 0;\t\t \n\t\tint value = 0; \n\t\tint accumulator = 0; \t\t\t\n\t\t// Program execution\n\t\twhile( pc < numOfLines){\n\n\t\t\t\topcode = instructions[pc].getOpcode();\n\t\t\t\n\t\t\t\tif(opcode == 8){\n\t\t\t\tpc = instructions[pc].getOperand();\n\t\t\t\topcode = instructions[pc].getOpcode();\n\t\t\t\t}else if(opcode == 9 && accumulator < 0 ){\n\t\t\t\t\tpc = instructions[pc].getOperand();\n\t\t\t\t\topcode = instructions[pc].getOpcode();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\tswitch(opcode){\n\t\t\tcase 0: // LDA \n\t\t\t\tif(inputProgram[pc].getOpcode().equals(\"DC\"))\n\t\t\t\taccumulator = instructions[pc].getOperand();\n\t\t\t\telse if(inputProgram[pc].getOpcode().equals(\"DL\"))\n\t\t\t\t\taccumulator = instructions[pc].getOperand();\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 1: //ADD\n\t\t\t\t\taccumulator += value;\n\t\t\t\tbreak;\n\t\t\tcase 2: //SUB\n\t\t\t\t\taccumulator -= value;\n\t\t\t\tbreak;\n\t\t\tcase 3: // STA\n\t\t\t\tstore = accumulator; \n\t\t\t\tbreak;\n\t\t\tcase 4: // MPY\n\t\t\t\t\taccumulator *= value;\n\t\t\t\tbreak;\n\t\t\tcase 5: // DIV\n\t\t\t\t\taccumulator /= value;\n\t\t\t\tbreak;\n\t\t\tcase 6: //INP\n\t\t\t\tSystem.out.println(\"Enter an Integer\");\n\t\t\t\tvalue = input.nextInt();\n\t\t\t\tbreak;\n\t\t\tcase 7: // OUT\n\t\t\t\tSystem.out.println(store);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tSystem.out.println(\"Invalid opcode\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tpc++;\n\t\t}// while\n\t\tSystem.out.println(\"Total Lines: \" + numOfLines);\n\t}",
"public void run() {\n\t\tAlgorithm[] algorithm; // jMetal algorithms to be executed\n\n\t\tString experimentName = (String) map_.get(\"name\");\n\t\texperimentBaseDirectory_ = (String) map_.get(\"experimentDirectory\");\n\t\talgorithmNameList_ = (String[]) map_.get(\"algorithmNameList\");\n\t\tproblemList_ = (String[]) map_.get(\"problemList\");\n\t\tindicatorList_ = (String[]) map_.get(\"indicatorList\");\n\t\tparetoFrontDirectory_ = (String) map_.get(\"paretoFrontDirectory\");\n\t\tparetoFrontFile_ = (String[]) map_.get(\"paretoFrontFile\");\n\t\tindependentRuns_ = (Integer) map_.get(\"independentRuns\");\n\t\t// algorithm_ = (Algorithm[]) map_.get(\"algorithm\");\n\t\toutputParetoFrontFile_ = (String) map_.get(\"outputParetoFrontFile\");\n\t\toutputParetoSetFile_ = (String) map_.get(\"outputParetoSetFile\");\n\n\t\tinstances_ = (Integer) map_.get(\"instances\"); // number of different\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// instances of the\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// problem to run\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Added to allow\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// executing several\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// instances per problem\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// class\n\n\t\trunID_ = (Integer) map_.get(\"runID\"); // Identifier to add to the\n\t\t\t\t\t\t\t\t\t\t\t\t// filename with the results\n\t\ttime_ = (TimeEstimation) map_.get(\"timeEstimation\"); // For computing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// the run time\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// and the run\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// time left\n\n\t\tString timmingFileName_ = (String) map_.get(\"timmingFileName\");\n\n\t\tint instanceCounter = 0; // To keep track of the instance to solve\n\n\t\tint numberOfAlgorithms = algorithmNameList_.length;\n\t\tSystem.out.println(\"Experiment: Number of algorithms: \"\n\t\t\t\t+ numberOfAlgorithms);\n\t\tSystem.out.println(\"Experiment: runs: \" + independentRuns_);\n\t\talgorithm = new Algorithm[numberOfAlgorithms];\n\n\t\tSystem.out.println(\"Name: \" + experimentName);\n\t\tSystem.out.println(\"experimentDirectory: \" + experimentBaseDirectory_);\n\t\tSystem.out.println(\"numberOfThreads_: \" + numberOfThreads_);\n\t\tSystem.out.println(\"numberOfProblems_: \" + numberOfProblems_);\n\t\tSystem.out.println(\"numberOfInstancesPerProblems_: \" + instances_);\n\t\tSystem.out.println(\"first: \" + first_);\n\t\tSystem.out.println(\"last: \" + last_);\n\n\t\tSolutionSet resultFront = null;\n\n\t\tdouble[][] timmings = new double[problemList_.length][numberOfAlgorithms];\n\n\t\tfor (int problemId = first_; problemId <= last_; problemId++) {\n\n\t\t\t// long[] accTime = new\n\t\t\t// long[algorithmNameList_.length*instances_.intValue()];\n\t\t\tfor (int i = 0; i < numberOfAlgorithms; i++)\n\t\t\t\ttimmings[problemId][i] = 0;\n\n\t\t\tfor (int inst = 0; inst < instances_.intValue(); inst++) {\n\t\t\t\tif (instances_ > 1) {\n\t\t\t\t\tObject ob = params_[0];\n\t\t\t\t\tparams_ = new Object[2];\n\t\t\t\t\tparams_[0] = ob;\n\t\t\t\t\tparams_[1] = new Integer(inst);\n\t\t\t\t}\n\n\t\t\t\tProblem problem; // The problem to solve\n\n\t\t\t\tproblem = null;\n\t\t\t\t// STEP 2: get the problem from the list\n\t\t\t\t// Object[] params = { \"Real\" }; // Parameters of the problem\n\t\t\t\ttry {\n\t\t\t\t\t// Parameters of the problem\n\t\t\t\t\tproblem = (new ProblemFactory()).getProblem(\n\t\t\t\t\t\t\tproblemList_[problemId], params_);\n\t\t\t\t} catch (JMException ex) {\n\t\t\t\t\tLogger.getLogger(ExperimentNoPareto.class.getName()).log(\n\t\t\t\t\t\t\tLevel.SEVERE, null, ex);\n\t\t\t\t}\n\n\t\t\t\t// STEP 3: check the file containing the Pareto front of the\n\t\t\t\t// problem\n\t\t\t\tsynchronized (experiment_) {\n\t\t\t\t\tif (indicatorList_.length > 0) {\n\t\t\t\t\t\tFile pfFile = null;\n\t\t\t\t\t\tif (instances_ > 1)\n\t\t\t\t\t\t\tpfFile = new File(paretoFrontDirectory_ + \"/\"\n\t\t\t\t\t\t\t\t\t+ paretoFrontFile_[problemId] + \".\" + inst);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tpfFile = new File(paretoFrontDirectory_ + \"/\"\n\t\t\t\t\t\t\t\t\t+ paretoFrontFile_[problemId]);\n\n\t\t\t\t\t\t// pfFile = new File(paretoFrontFile_[problemId]);\n\n\t\t\t\t\t\tif (!pfFile.exists()) {\n\t\t\t\t\t\t\t// if (instances_ > 1)\n\t\t\t\t\t\t\t// paretoFrontFile_[problemId] =\n\t\t\t\t\t\t\t// paretoFrontDirectory_\n\t\t\t\t\t\t\t// + \"/\" + paretoFrontFile_[problemId] + \".\" + inst;\n\t\t\t\t\t\t\t// else\n\t\t\t\t\t\t\t// paretoFrontFile_[problemId] =\n\t\t\t\t\t\t\t// paretoFrontDirectory_\n\t\t\t\t\t\t\t// + \"/\" + paretoFrontFile_[problemId];\n\t\t\t\t\t\t\t// } else {\n\t\t\t\t\t\t\t// CREATE IT!\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tpfFile.createNewFile();\n\t\t\t\t\t\t\t} catch (IOException ex) {\n\t\t\t\t\t\t\t\t// Logger.getLogger(ExperimentNoPareto.class.getName()).log(Level.SEVERE,\n\t\t\t\t\t\t\t\t// null, ex);\n\t\t\t\t\t\t\t\tLogger.getLogger(\n\t\t\t\t\t\t\t\t\t\tExperimentNoPareto.class.getName())\n\t\t\t\t\t\t\t\t\t\t.log(Level.SEVERE,\n\t\t\t\t\t\t\t\t\t\t\t\t\"Error creating file: \"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ paretoFrontFile_[problemId],\n\t\t\t\t\t\t\t\t\t\t\t\tex);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// paretoFrontFile_[problemId] = \"\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} // if\n\t\t\t\t}\n\t\t\t\texperiment_.algorithmSettings(problem, problemId, algorithm);\n\n\t\t\t\tfor (int runs = 0; runs < independentRuns_; runs++) {\n\t\t\t\t\tSystem.out.println(\"Iruns: \" + runs);\n\t\t\t\t\t// STEP 4: configure the algorithms\n\n\t\t\t\t\t// STEP 5: run the algorithms\n\t\t\t\t\tfor (int i = 0; i < numberOfAlgorithms; i++) {\n\t\t\t\t\t\tSystem.out.println(algorithm[i].getClass());\n\t\t\t\t\t\t// STEP 6: create output directories\n\t\t\t\t\t\tFile experimentDirectory;\n\t\t\t\t\t\tString directory;\n\n\t\t\t\t\t\tif (instances_ > 1)\n\t\t\t\t\t\t\tdirectory = experimentBaseDirectory_ + \"/data/\"\n\t\t\t\t\t\t\t\t\t+ algorithmNameList_[i] + \"/\"\n\t\t\t\t\t\t\t\t\t+ problemList_[problemId] + \".\" + inst;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdirectory = experimentBaseDirectory_ + \"/data/\"\n\t\t\t\t\t\t\t\t\t+ algorithmNameList_[i] + \"/\"\n\t\t\t\t\t\t\t\t\t+ problemList_[problemId];\n\n\t\t\t\t\t\texperimentDirectory = new File(directory);\n\t\t\t\t\t\tif (!experimentDirectory.exists()) {\n\t\t\t\t\t\t\tboolean result = new File(directory).mkdirs();\n\t\t\t\t\t\t\tSystem.out.println(\"Creating \" + directory);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// STEP 7: run the algorithm\n\t\t\t\t\t\tlong startTime = 0, endTime = 0;\n\n\t\t\t\t\t\tif (instances_ > 1)\n\t\t\t\t\t\t\tSystem.out.println(\"Running algorithm: \"\n\t\t\t\t\t\t\t\t\t+ algorithmNameList_[i] + \", problem: \"\n\t\t\t\t\t\t\t\t\t+ problemList_[problemId] + \", run: \"\n\t\t\t\t\t\t\t\t\t+ runs + \", instance: \" + inst);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tSystem.out.println(\"Running algorithm: \"\n\t\t\t\t\t\t\t\t\t+ algorithmNameList_[i] + \", problem: \"\n\t\t\t\t\t\t\t\t\t+ problemList_[problemId] + \", run: \"\n\t\t\t\t\t\t\t\t\t+ runs);\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tstartTime = System.currentTimeMillis();\n\t\t\t\t\t\t\tresultFront = algorithm[i].execute();\n\t\t\t\t\t\t\tendTime = System.currentTimeMillis();\n\t\t\t\t\t\t} catch (JMException ex) {\n\t\t\t\t\t\t\tLogger.getLogger(ExperimentNoPareto.class.getName())\n\t\t\t\t\t\t\t\t\t.log(Level.SEVERE, null, ex);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttime_.iteration();\n\t\t\t\t\t\tSystem.out.print(resultFront.size() + \" sols found, \"\n\t\t\t\t\t\t\t\t+ (endTime - startTime) + \" ms. (\"\n\t\t\t\t\t\t\t\t+ time_.getPercentageDone() + \"% done, \");\n\t\t\t\t\t\tSystem.out.println(time_.getRemainingHumanReadable()\n\t\t\t\t\t\t\t\t+ \" remaining)\");\n\t\t\t\t\t\t// accTime_[i] += (endTime-startTime);\n\t\t\t\t\t\ttimmings[problemId][i] += (endTime - startTime);\n\n\t\t\t\t\t\t// STEP 8: put the results in the output directory\n\n\t\t\t\t\t\tif (runID_ == null) {\n\t\t\t\t\t\t\tresultFront.printObjectivesToFile(directory + \"/\"\n\t\t\t\t\t\t\t\t\t+ outputParetoFrontFile_ + \".\" + runs);\n\t\t\t\t\t\t\tresultFront.printVariablesToFile(directory + \"/\"\n\t\t\t\t\t\t\t\t\t+ outputParetoSetFile_ + \".\" + runs);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresultFront.printObjectivesToFile(directory + \"/\"\n\t\t\t\t\t\t\t\t\t+ outputParetoFrontFile_ + \".\"\n\t\t\t\t\t\t\t\t\t+ runID_.intValue());\n\t\t\t\t\t\t\tresultFront.printVariablesToFile(directory + \"/\"\n\t\t\t\t\t\t\t\t\t+ outputParetoSetFile_ + \".\"\n\t\t\t\t\t\t\t\t\t+ runID_.intValue());\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Print the run time after every execution\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tFileWriter os = null;\n\t\t\t\t\t\t\tif (instances_ > 1)\n\t\t\t\t\t\t\t\tos = new FileWriter(experimentBaseDirectory_\n\t\t\t\t\t\t\t\t\t\t+ \"/data/\" + algorithmNameList_[i]\n\t\t\t\t\t\t\t\t\t\t+ \"/\" + problemList_[problemId] + \".\"\n\t\t\t\t\t\t\t\t\t\t+ inst + \"/\" + timmingFileName_\n\t\t\t\t\t\t\t\t\t\t+ \".AVG\", true);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tos = new FileWriter(experimentBaseDirectory_\n\t\t\t\t\t\t\t\t\t\t+ \"/data/\" + algorithmNameList_[i]\n\t\t\t\t\t\t\t\t\t\t+ \"/\" + problemList_[problemId] + \"/\"\n\t\t\t\t\t\t\t\t\t\t+ timmingFileName_ + \".AVG\", true);\n\n\t\t\t\t\t\t\tos.write(\"\" + (endTime - startTime) + \"\\n\");\n\t\t\t\t\t\t\tos.close();\n\t\t\t\t\t\t\t// timmings[problemId][i]=(accTime[i]/independentRuns_);\n\t\t\t\t\t\t} catch (IOException ex) {\n\t\t\t\t\t\t\tLogger.getLogger(ExperimentNoPareto.class.getName())\n\t\t\t\t\t\t\t\t\t.log(Level.SEVERE, null, ex);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// // STEP 9: calculate quality indicators\n\t\t\t\t\t\t// if (indicatorList_.length > 0) {\n\t\t\t\t\t\t// QualityIndicator indicators;\n\t\t\t\t\t\t// // System.out.println(\"PF file: \" +\n\t\t\t\t\t\t// // paretoFrontFile_[problemId]);\n\t\t\t\t\t\t// indicators = new QualityIndicator(problem,\n\t\t\t\t\t\t// paretoFrontFile_[problemId]);\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// for (int j = 0; j < indicatorList_.length; j++) {\n\t\t\t\t\t\t// if (indicatorList_[j].equals(\"HV\")) {\n\t\t\t\t\t\t// double value = indicators\n\t\t\t\t\t\t// .getHypervolume(resultFront);\n\t\t\t\t\t\t// FileWriter os;\n\t\t\t\t\t\t// try {\n\t\t\t\t\t\t// os = new FileWriter(experimentDirectory\n\t\t\t\t\t\t// + \"/HV\", true);\n\t\t\t\t\t\t// os.write(\"\" + value + \"\\n\");\n\t\t\t\t\t\t// os.close();\n\t\t\t\t\t\t// } catch (IOException ex) {\n\t\t\t\t\t\t// Logger\n\t\t\t\t\t\t// .getLogger(\n\t\t\t\t\t\t// ExperimentNoPareto.class.getName())\n\t\t\t\t\t\t// .log(Level.SEVERE, null, ex);\n\t\t\t\t\t\t// }\n\t\t\t\t\t\t// }\n\t\t\t\t\t\t// if (indicatorList_[j].equals(\"SPREAD\")) {\n\t\t\t\t\t\t// FileWriter os = null;\n\t\t\t\t\t\t// try {\n\t\t\t\t\t\t// double value = indicators\n\t\t\t\t\t\t// .getSpread(resultFront);\n\t\t\t\t\t\t// os = new FileWriter(experimentDirectory\n\t\t\t\t\t\t// + \"/SPREAD\", true);\n\t\t\t\t\t\t// os.write(\"\" + value + \"\\n\");\n\t\t\t\t\t\t// os.close();\n\t\t\t\t\t\t// } catch (IOException ex) {\n\t\t\t\t\t\t// Logger\n\t\t\t\t\t\t// .getLogger(\n\t\t\t\t\t\t// ExperimentNoPareto.class.getName())\n\t\t\t\t\t\t// .log(Level.SEVERE, null, ex);\n\t\t\t\t\t\t// } finally {\n\t\t\t\t\t\t// try {\n\t\t\t\t\t\t// os.close();\n\t\t\t\t\t\t// } catch (IOException ex) {\n\t\t\t\t\t\t// Logger.getLogger(\n\t\t\t\t\t\t// ExperimentNoPareto.class.getName())\n\t\t\t\t\t\t// .log(Level.SEVERE, null, ex);\n\t\t\t\t\t\t// }\n\t\t\t\t\t\t// }\n\t\t\t\t\t\t// }\n\t\t\t\t\t\t// if (indicatorList_[j].equals(\"IGD\")) {\n\t\t\t\t\t\t// FileWriter os = null;\n\t\t\t\t\t\t// try {\n\t\t\t\t\t\t// double value = indicators\n\t\t\t\t\t\t// .getIGD(resultFront);\n\t\t\t\t\t\t// os = new FileWriter(experimentDirectory\n\t\t\t\t\t\t// + \"/IGD\", true);\n\t\t\t\t\t\t// os.write(\"\" + value + \"\\n\");\n\t\t\t\t\t\t// os.close();\n\t\t\t\t\t\t// } catch (IOException ex) {\n\t\t\t\t\t\t// Logger\n\t\t\t\t\t\t// .getLogger(\n\t\t\t\t\t\t// ExperimentNoPareto.class.getName())\n\t\t\t\t\t\t// .log(Level.SEVERE, null, ex);\n\t\t\t\t\t\t// } finally {\n\t\t\t\t\t\t// try {\n\t\t\t\t\t\t// os.close();\n\t\t\t\t\t\t// } catch (IOException ex) {\n\t\t\t\t\t\t// Logger.getLogger(\n\t\t\t\t\t\t// ExperimentNoPareto.class.getName())\n\t\t\t\t\t\t// .log(Level.SEVERE, null, ex);\n\t\t\t\t\t\t// }\n\t\t\t\t\t\t// }\n\t\t\t\t\t\t// }\n\t\t\t\t\t\t// if (indicatorList_[j].equals(\"EPSILON\")) {\n\t\t\t\t\t\t// FileWriter os = null;\n\t\t\t\t\t\t// try {\n\t\t\t\t\t\t// double value = indicators\n\t\t\t\t\t\t// .getEpsilon(resultFront);\n\t\t\t\t\t\t// os = new FileWriter(experimentDirectory\n\t\t\t\t\t\t// + \"/EPSILON\", true);\n\t\t\t\t\t\t// os.write(\"\" + value + \"\\n\");\n\t\t\t\t\t\t// os.close();\n\t\t\t\t\t\t// } catch (IOException ex) {\n\t\t\t\t\t\t// Logger\n\t\t\t\t\t\t// .getLogger(\n\t\t\t\t\t\t// ExperimentNoPareto.class.getName())\n\t\t\t\t\t\t// .log(Level.SEVERE, null, ex);\n\t\t\t\t\t\t// } finally {\n\t\t\t\t\t\t// try {\n\t\t\t\t\t\t// os.close();\n\t\t\t\t\t\t// } catch (IOException ex) {\n\t\t\t\t\t\t// Logger.getLogger(\n\t\t\t\t\t\t// ExperimentNoPareto.class.getName())\n\t\t\t\t\t\t// .log(Level.SEVERE, null, ex);\n\t\t\t\t\t\t// }\n\t\t\t\t\t\t// }\n\t\t\t\t\t\t// }\n\t\t\t\t\t\t// } // for\n\t\t\t\t\t\t// } // if\n\t\t\t\t\t} // for\n\t\t\t\t} // for\n\t\t\t} // for\n\n\t\t\t// Print the computational time\n\t\t\t// STEP 11: Write The run times in a latex file\n\t\t\ttry {\n\t\t\t\tfor (int i = 0; i < numberOfAlgorithms; ++i) {\n\t\t\t\t\tFileWriter os = new FileWriter(experimentBaseDirectory_\n\t\t\t\t\t\t\t+ \"/data/\" + algorithmNameList_[i] + \"/\"\n\t\t\t\t\t\t\t+ problemList_[problemId] + \".AvgTime\");\n\n\t\t\t\t\t// os.write( \"\" + (accTime[i]/independentRuns_) + \"\\n\" );\n\t\t\t\t\tos.write(\"\"\n\t\t\t\t\t\t\t+ (timmings[problemId][i] / (independentRuns_ * instances_))\n\t\t\t\t\t\t\t+ \"\\n\");\n\t\t\t\t\tos.close();\n\t\t\t\t\t// timmings[problemId][i]=(accTime[i]/independentRuns_);\n\t\t\t\t\ttimmings[problemId][i] = (timmings[problemId][i] / (independentRuns_ * instances_));\n\t\t\t\t} // for\n\t\t\t} catch (IOException ex) {\n\t\t\t\tLogger.getLogger(ExperimentNoPareto.class.getName()).log(\n\t\t\t\t\t\tLevel.SEVERE, null, ex);\n\t\t\t}\n\n\t\t} // for\n\t}",
"private static void init () {\r\n\t\t// make sure they all have non-null entries\r\n\t\tName undef = new Name(\"undef\", 'u');\r\n\t\tArrays.fill(op_names, undef);\r\n\t\tArrays.fill(fn_names, undef);\r\n\t\tArrays.fill(cfn_names, undef);\r\n\t\tArrays.fill(rs_names, undef);\r\n\t\tArrays.fill(rt_names, undef);\r\n\r\n\t\tfor (int n = 0; n < 32; n++)\r\n\t\t\treg_nums[n] = \"$\".concat(Integer.toString(n));\r\n\r\n\t\top_names[OP_SPECIAL] = new Name(\"**spec\");\r\n\t\top_names[OP_REGIMM] = new Name(\"**regimm\");\r\n\t\top_names[OP_J] = new Name(\"j\", 'J');\r\n\t\top_names[OP_JAL] = new Name(\"jal\", 'J');\r\n\t\top_names[OP_BEQ] = new Name(\"beq\", 'r');\r\n\t\top_names[OP_BNE] = new Name(\"bne\", 'r');\r\n\t\top_names[OP_BLEZ] = new Name(\"blez\", 'r');\r\n\t\top_names[OP_BGTZ] = new Name(\"bgtz\", 'r');\r\n\t\top_names[OP_ADDIU] = new Name(\"addiu\", 'b');\r\n\t\top_names[OP_SLTI] = new Name(\"slti\", 'b');\r\n\t\top_names[OP_SLTIU] = new Name(\"sltiu\", 'b');\r\n\t\top_names[OP_ANDI] = new Name(\"andi\", 'b');\r\n\t\top_names[OP_ORI] = new Name(\"ori\", 'b');\r\n\t\top_names[OP_XORI] = new Name(\"xori\", 'b');\r\n\t\top_names[OP_LUI] = new Name(\"lui\", 'I');\r\n\t\top_names[OP_COP1] = new Name(\"**cop1\");\r\n\t\top_names[OP_SPEC2] = new Name(\"**spec2\");\r\n\t\top_names[OP_LB] = new Name(\"lb\", 'l');\r\n\t\top_names[OP_LH] = new Name(\"lh\", 'l');\r\n\t\top_names[OP_LWL] = new Name(\"lwl\", 'l');\r\n\t\top_names[OP_LW] = new Name(\"lw\", 'l');\r\n\t\top_names[OP_LBU] = new Name(\"lbu\", 'l');\r\n\t\top_names[OP_LHU] = new Name(\"lhu\", 'l');\r\n\t\top_names[OP_LWR] = new Name(\"lwr\", 'l');\r\n\t\top_names[OP_SB] = new Name(\"sb\", 's');\r\n\t\top_names[OP_SH] = new Name(\"sh\", 's');\r\n\t\top_names[OP_SWL] = new Name(\"swl\", 's');\r\n\t\top_names[OP_SW] = new Name(\"sw\", 's');\r\n\t\top_names[OP_SWR] = new Name(\"swr\", 's');\r\n\t\top_names[OP_LWC1] = new Name(\"lwc1\", 'L');\r\n\t\top_names[OP_SWC1] = new Name(\"swc1\", 'S');\r\n\r\n\t\tfn_names[FN_SLL] = new Name(\"sll\");\r\n\t\tfn_names[FN_SRL] = new Name(\"srl\");\r\n\t\tfn_names[FN_SRA] = new Name(\"sra\");\r\n\t\tfn_names[FN_SLLV] = new Name(\"sllv\");\r\n\t\tfn_names[FN_SRLV] = new Name(\"srlv\");\r\n\t\tfn_names[FN_SRAV] = new Name(\"srav\");\r\n\t\tfn_names[FN_JR] = new Name(\"jr\", 'j');\r\n\t\tfn_names[FN_JALR] = new Name(\"jalr\", 'j');\r\n\t\tfn_names[FN_MOVN] = new Name(\"movn\", 'u');\r\n\t\tfn_names[FN_SYSCALL] = new Name(\"**sys\");\r\n\t\tfn_names[FN_BREAK] = new Name(\"**break\");\r\n\t\tfn_names[FN_MFHI] = new Name(\"mfhi\");\r\n\t\tfn_names[FN_MFLO] = new Name(\"mflo\");\r\n\t\tfn_names[FN_MULT] = new Name(\"mult\");\r\n\t\tfn_names[FN_MULTU] = new Name(\"multu\");\r\n\t\tfn_names[FN_DIV] = new Name(\"div\");\r\n\t\tfn_names[FN_DIVU] = new Name(\"divu\");\r\n\t\tfn_names[FN_ADDU] = new Name(\"addu\", 'B');\r\n\t\tfn_names[FN_SUBU] = new Name(\"subu\", 'B');\r\n\t\tfn_names[FN_AND] = new Name(\"and\", 'B');\r\n\t\tfn_names[FN_OR] = new Name(\"or\", 'B');\r\n\t\tfn_names[FN_XOR] = new Name(\"xor\", 'B');\r\n\t\tfn_names[FN_NOR] = new Name(\"nor\", 'B');\r\n\t\tfn_names[FN_SLT] = new Name(\"slt\", 'B');\r\n\t\tfn_names[FN_SLTU] = new Name(\"sltu\", 'B');\r\n\r\n\t\trs_names[RS_MF] = new Name(\"mfc1\", '6');\r\n\t\trs_names[RS_CF] = new Name(\"cfc1\", '4');\r\n\t\trs_names[RS_MT] = new Name(\"mtc1\", '5');\r\n\t\trs_names[RS_CT] = new Name(\"ctc1\");\r\n\t\trs_names[RS_BC] = new Name(\"bc1\");\r\n\t\trs_names[RS_FMT_SINGLE] = new Name(\"**fmts\");\r\n\t\trs_names[RS_FMT_DOUBLE] = new Name(\"**fmtd\");\r\n\t\trs_names[RS_FMT_WORD] = new Name(\"**fmtw\");\r\n\r\n\t\tcfn_names[CFN_ADD_D] = new Name(\"add\", '3');\r\n\t\tcfn_names[CFN_SUB_D] = new Name(\"sub\", '3');\r\n\t\tcfn_names[CFN_MUL_D] = new Name(\"mul\", '3');\r\n\t\tcfn_names[CFN_DIV_D] = new Name(\"div\", '3');\r\n\t\tcfn_names[CFN_MOV_D] = new Name(\"mov\", '2'); // 2?\r\n\t\tcfn_names[CFN_NEG_D] = new Name(\"neg\", '2');\r\n\t\tcfn_names[CFN_CVTS] = new Name(\"cvts\", '2'); // all type 2\r\n\t\tcfn_names[CFN_CVTD] = new Name(\"cvtd\", '2');\r\n\t\tcfn_names[CFN_CVTW] = new Name(\"cvtw\", '2');\r\n\t\tcfn_names[CFN_FC_ULT] = new Name(\"ult\", 'c');\r\n\t\tcfn_names[CFN_FC_EQ] = new Name(\"eq\", 'c'); // all type c\r\n\t\tcfn_names[CFN_FC_LT] = new Name(\"lt\", 'c');\r\n\t\tcfn_names[CFN_FC_LE] = new Name(\"le\", 'c');\r\n\r\n\t\trt_names[RT_BLTZ] = new Name(\"bltz\", 'v');\r\n\t\trt_names[RT_BGEZ] = new Name(\"bgez\", 'v');\r\n\t\trt_names[RT_BLTZAL] = new Name(\"bltzal\", 'v');\r\n\t\trt_names[RT_BGEZAL] = new Name(\"bgezal\", 'v');\r\n\t}",
"public void load() {\n\t}",
"public void initializeEngines() {\n\t\tfor (int i=0; i < _engineNumber; i++) {\n\t\t\tengineList.add(new Engine(\"Engine_\" + i, \"\", 0.0, 0.0, 0.0, _theAircraft));\n\t\t}\n\t}",
"public static void load() {\n\t\tspritesheet = new Spritesheet(\"src/de/kaffeeliebhaber/assets/pyxel/voland_spritesheet_new.png\", 32, 32);\n\t\tspritesheet.load();\n\t\t\n\t\t// load player\n\t\tAssetsLoader.loadPlayerAssets();\n\t\t\n\t\t// load crate\n\t\tAssetsLoader.loadCrates();\n\t\t\n\t\t// load item spritesheet \n\t\tspritesheetInventory = new Spritesheet(Config.ITEM_SPRITESHEET, Config.ITEM_SIZE, Config.ITEM_SIZE);\n\t\tspritesheetInventory.load();\n\t\t\n\t\t// load font \n\t\tloadFonts();\n\t\t\n\t\t// ui\n\t\timageUI = ImageLoader.loadImage(\"src/de/kaffeeliebhaber/assets/ui/ui.png\");\n\t\t\n\t\tAssetsLoader.loadInfoPaneAssets();\n\t\t\n\t\t// npc\n\t\tspritesheetNPC = new Spritesheet(\"src/de/kaffeeliebhaber/assets/AH_SpriteSheet_People1.png\", 16, 16);\n\t\tspritesheetNPC.load();\n\t\t\n\t\t// fox\n\t\tspritesheetNPCFox = new Spritesheet(\"src/de/kaffeeliebhaber/assets/imgs/72c68863962b7a6b5a9f5f5bcc5afb16.png\", 32, 32);\n\t\tspritesheetNPCFox.load();\n\n\t\t// *** LOAD NPCs\n\t\tAssetsLoader.loadFoxAssets();\n\t\t\n\t\tAssetsLoader.loadNPCs();\n\t\t\n\t\tspritesheetFemale = new Spritesheet(\"src/de/kaffeeliebhaber/assets/imgs/Female 01-1.png\", 32, 32);\n\t\tspritesheetFemale.load();\n\t}",
"protected void load(SpriteInfo[] arr) {\n\t\tassert arr != null;\n\t\tassert arr.length > 0;\n\n\t\tfor (SpriteInfo s : arr) {\n\t\t\tassert s != null;\n\t\t\tsprites.put(s.name, sheet.getSubimage(s.getX(), s.getY(), s.getWidth(), s.getHeight()));\n\t\t}\n\t}",
"public void insertLoadsAndStores() {\n for (com.debughelper.tools.r8.ir.code.BasicBlock block : code.blocks) {\n com.debughelper.tools.r8.ir.code.InstructionListIterator it = block.listIterator();\n while (it.hasNext()) {\n com.debughelper.tools.r8.ir.code.Instruction current = it.next();\n current.insertLoadAndStores(it, this);\n }\n }\n }",
"static void loadCardIcons()\n {\n if(iconsLoaded == false)\n {\n //arrays for suits and ranks\n String[] suits = {\"C\", \"D\", \"H\", \"S\"};\n String[] ranks = {\"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \n \"T\", \"A\", \"J\", \"Q\", \"K\", \"X\"};\n //load iconCards array\n for(int i = 0; i < suits.length; i++)\n {\n for(int k = 0; k < ranks.length; k++)\n {\n iconCards[i][k] = new ImageIcon(\"images/\" + ranks[k] + suits[i] + \".gif\");\n }\n }\n //set iconsLoaded to true\n iconsLoaded = true;\n }\n else //do nothing if icons have already been loaded\n {\n return;\n }\n }",
"public abstract void load();",
"private static void loadSprites(){\n \t\tshipSprites.put(\"SCOUT_BLUE\", new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/blue/scout.png\"), 0, 0.5f));\n \t\tshipSprites.put(\"HUNTER_BLUE\", new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/blue/hunter.png\"), 0, 0.5f));\n \t\tshipSprites.put(\"DESTROYER_BLUE\", new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/blue/destroyer.png\"), 0, 0.5f));\n \t\tshipSprites.put(\"COLONIZER_BLUE\", new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/blue/colonizer.png\"), 0.5f, 0.5f));\n \t\t\n \t\t/*\n \t\t * Ships Red Player\n \t\t */\n \t\tshipSprites.put(\"SCOUT_RED\", new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/red/scout.png\"), 0, 0.5f));\n \t\tshipSprites.put(\"HUNTER_RED\", new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/red/hunter.png\"), 0, 0.5f));\n \t\tshipSprites.put(\"DESTROYER_RED\", new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/red/destroyer.png\"), 0, 0.5f));\n \t\tshipSprites.put(\"COLONIZER_RED\", new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/red/colonizer.png\"), 0.5f, 0.5f));\n \n \t\t/*\n \t\t * Path Arrows\n \t\t */\n\t\tpathTextures.put(\"HEAD\", Toolkit.getDefaultToolkit().getImage(\"res/path/head.png\"));\n\t\tpathTextures.put(\"START\", Toolkit.getDefaultToolkit().getImage(\"res/path/start.png\"));\n\t\tpathTextures.put(\"STRAIGHT\", Toolkit.getDefaultToolkit().getImage(\"res/path/straight.png\"));\n\t\tpathTextures.put(\"TURN\", Toolkit.getDefaultToolkit().getImage(\"res/path/turn.png\"));\n \t\t\n \t\t/*\n \t\t * Planets\n \t\t */\n \t\tmetalplanets.put(0, new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/planets/metalplanet_0.png\"), 0.5f, 0));\n \t\tmetalplanets.put(1, new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/planets/metalplanet_1.png\"), 0.5f, 0));\n \t\tmetalplanets.put(2, new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/planets/metalplanet_2.png\"), 0.5f, 0));\n \t\tmetalplanets.put(3, new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/planets/metalplanet_3.png\"), 0.5f, 0));\n \t\tgasplanets.put(0, new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/planets/gasplanet_0.png\"), 0.5f, 0));\n \t\tgasplanets.put(1, new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/planets/gasplanet_1.png\"), 0.5f, 0));\n \t\tgasplanets.put(2, new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/planets/gasplanet_2.png\"), 0.5f, 0));\n \t\t\n \t\t/*\n \t\t * Colony Sprite\n \t\t */\n \t\tloadColonySprites(Color.RED, \"RED\");\n \t\tloadColonySprites(Color.BLUE, \"BLUE\");\n \t}",
"public void loadMemory(String inputFile){\n\t\tint pc = 0;\n\t\ttry{\n\t\t\tRandomAccessFile raf = new RandomAccessFile(new File(inputFile),\"rw\");\n\t\t\tString strLine;\n\t\t\tint decimalNumber;\n\t\t\twhile ((strLine = raf.readLine())!=null){\n\t\t\t\tstrLine = strLine.substring(0, 8); //get the first 8 char(hex instruction)\n\t\t\t\tdecimalNumber = new BigInteger(strLine, 16).intValue(); //decode the hex into integer\n\t\t\t\tloadInstructionInMemory(pc, decimalNumber);\n\t\t\t\tpc += 4;\n\t\t\t}\n\t\t\traf.close();\n\t\t}\n\t\tcatch (Exception e){\n\t\t\tSystem.out.println(\"Error:\");\n\t\t\tSystem.out.println(e.getMessage());\n\t\t\tSystem.exit(0);\n\t\t}\n\t}",
"private void initBoard() {\n initCommands();\n setBackground(Color.BLACK);\n setPreferredSize(new Dimension((int) (W * Application.scale), (int) (H * Application.scale)));\n\n commandClasses.forEach((cmdstr) -> {\n try {\n Object obj = Class.forName(cmdstr).getDeclaredConstructor().newInstance();\n Command cmd = (Command) obj;\n connectCommand(cmd);\n System.out.println(\"Loaded \" + cmdstr);\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n });\n\n Particle.heatmap.addColor(0, Color.GREEN);\n Particle.heatmap.addColor(50, Color.YELLOW);\n Particle.heatmap.addColor(100, Color.RED);\n\n Particle.slopemap.addColor(-5, Color.RED);\n Particle.slopemap.addColor(0, Color.WHITE);\n Particle.slopemap.addColor(5, Color.GREEN);\n\n setFocusable(true);\n }",
"@Override\n public void onMachineAssembled()\n {\n \n }",
"public void load(String code) {\n\n\t\tEngine.console.write(\"load method echo\");\n\t\tif (!code.matches(\"(\\\\d){4}\")) {\n\t\t\tEngine.console.write(\"code does not match regex for map ID\");\n\t\t\treturn;\n\t\t} else {\n\t\t\tEngine.console.write(\"code matches regex\");\n\t\t\ttry {\n\t\t\t\tFileInputStream fis = new FileInputStream(\"/boards/\" + code + \".map\");\n\t\t\t\tObjectInputStream ois = new ObjectInputStream(fis);\n\t\t\t\tBoard loaded = (Board) ois.readObject();\n\t\t\t\tEngine.activeBoard = loaded;\n\t\t\t\tEngine.console.write(\"loaded and assigned\");\n\t\t\t\tSystem.out.println(Engine.activeBoard);\n\t\t\t} catch (IOException ex) {\n\t\t\t\tEngine.console.write(\"File \" + code + \".map not found\", Console.ERROR);\n\t\t\t} catch (ClassNotFoundException ex) {\n\t\t\t\tEngine.console.write(\"Class not found\", Console.ERROR);\n\t\t\t}\n\t\t}\n\t}",
"void loadResourceLocator() {\r\n\t\tfinal BackgroundProgress bgp = new BackgroundProgress();\r\n\t\tbgp.setLocationRelativeTo(this);\r\n\t\tSwingWorker<Void, Void> worker = new SwingWorker<Void, Void>() {\r\n\t\t\t/** The resource locator. */\r\n\t\t\tprivate ResourceLocator rl;\r\n\t\t\t/** The galaxy model. */\r\n\t\t\tprivate GalaxyModel galaxyMap;\r\n\t\t\t/** The building model. */\r\n\t\t\tprivate BuildingModel buildingMap;\r\n\t\t\t/** The colony graphics. */\r\n\t\t\tprivate ColonyGFX colonyGraphics;\r\n\t\t\t/** Surface list. */\r\n\t\t\tprivate List<TileEntry> surfaces = JavaUtils.newArrayList();\r\n\t\t\t/** Buildings list. */\r\n\t\t\tprivate List<TileEntry> buildings = JavaUtils.newArrayList();\r\n\t\t\t/** Races. */\r\n\t\t\tprivate Set<String> races = JavaUtils.newHashSet();\r\n\t\t\t/** The loaded text renderer. */\r\n\t\t\tTextRenderer txt;\r\n\t\t\t@Override\r\n\t\t\tprotected Void doInBackground() throws Exception {\r\n\t\t\t\ttry {\r\n\t\t\t\t\trl = config.newResourceLocator();\r\n\t\t\t\t\tfinal ResourceLocator rl0 = rl;\r\n\t\t\t\t\tSwingUtilities.invokeLater(new Runnable() {\r\n\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\tMapEditor.this.rl = rl0;\r\n\t\t\t\t\t\t\tsetLabels(deferredLanguage);\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\tfinal ExecutorService exec = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());\r\n\t\t\t\t\tfinal WipPort wip = new WipPort(3);\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\texec.execute(new Runnable() {\r\n\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\tgalaxyMap = new GalaxyModel();\r\n\t\t\t\t\t\t\t\t\tgalaxyMap.processGalaxy(rl, \"en\", \"campaign/main/galaxy\", exec, wip);\r\n\t\t\t\t\t\t\t\t} finally {\r\n\t\t\t\t\t\t\t\t\twip.dec();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\texec.execute(new Runnable() {\r\n\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\tbuildingMap = new BuildingModel();\r\n\t\t\t\t\t\t\t\t\tbuildingMap.processBuildings(rl, \"en\", \"campaign/main/buildings\", exec, wip);\r\n\t\t\t\t\t\t\t\t} finally {\r\n\t\t\t\t\t\t\t\t\twip.dec();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t} finally {\r\n\t\t\t\t\t\twip.dec();\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\twip.await();\r\n\t\t\t\t\t\t\texec.shutdown();\r\n\t\t\t\t\t\t\texec.awaitTermination(Long.MAX_VALUE, TimeUnit.MILLISECONDS);\r\n\t\t\t\t\t\t} catch (InterruptedException ex) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcolonyGraphics = new ColonyGFX(rl);\r\n\t\t\t\t\tcolonyGraphics.load(\"en\");\r\n\t\t\t\t\t\r\n\t\t\t\t\ttxt = new TextRenderer(rl);\r\n\t\t\t\t\tlabels.load(rl, \"en\", \"campaign/main\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tprepareLists(galaxyMap, buildingMap, surfaces, buildings, races);\r\n\t\t\t\t} catch (Throwable t) {\r\n\t\t\t\t\tt.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t\t@Override\r\n\t\t\tprotected void done() {\r\n\t\t\t\tbgp.dispose();\r\n\t\t\t\tMapEditor.this.galaxyModel = galaxyMap;\r\n\t\t\t\tMapEditor.this.buildingModel = buildingMap;\r\n\t\t\t\trenderer.colonyGFX = colonyGraphics;\r\n\t\t\t\t\r\n\t\t\t\trenderer.selection = new Tile(1, 1, ImageUtils.recolor(colonyGraphics.tileEdge, 0xFFFFFF00), null);\r\n\t\t\t\trenderer.areaAccept = new Tile(1, 1, ImageUtils.recolor(colonyGraphics.tileEdge, 0xFF00FFFF), null);\r\n\t\t\t\trenderer.areaEmpty = new Tile(1, 1, ImageUtils.recolor(colonyGraphics.tileEdge, 0xFF808080), null);\r\n\t\t\t\trenderer.areaDeny = new Tile(1, 1, ImageUtils.recolor(colonyGraphics.tileCrossed, 0xFFFF0000), null);\r\n\t\t\t\trenderer.areaCurrent = new Tile(1, 1, ImageUtils.recolor(colonyGraphics.tileCrossed, 0xFFFFCC00), null);\r\n\t\t\t\t\r\n\t\t\t\trenderer.selection.alpha = 1.0f;\r\n\t\t\t\trenderer.areaAccept.alpha = 1.0f;\r\n\t\t\t\trenderer.areaDeny.alpha = 1.0f;\r\n\t\t\t\trenderer.areaCurrent.alpha = 1.0f;\r\n\t\t\t\r\n\t\t\t\trenderer.txt = this.txt;\r\n\t\t\t\trenderer.txt.setUseStandardFonts(ui.viewStandardFonts.isSelected());\r\n\t\t\t\tbuildTables(surfaces, buildings, races);\r\n\t\t\t}\r\n\t\t};\r\n\t\tworker.execute();\r\n\t\tbgp.setVisible(true);\r\n\t}",
"private SimInstruction getInstruction(Addr address) {\n var inst = decodedInstructions.get(address);\n\n if (inst != null) {\n return inst;\n }\n\n // Try to decode instruction\n var rawInstruction = program.get(address);\n\n // System.out.println(\"INSTRUC: \" + instructions);\n SpecsCheck.checkNotNull(rawInstruction,\n () -> \"No program instruction found at address \" + address.toNumber() + \" (\" +\n address + \")\");\n\n var microCodeInstruction = decoder.decode(rawInstruction, this);\n decodedInstructions.put(address, microCodeInstruction);\n\n return microCodeInstruction;\n }",
"private static void initResources() {\n\t\tString[] res = new String[4];\r\n\t\tres[0] = \"res/entity/spaceshipv1.png\";\r\n\t\tres[1] = \"res/entity/prob.png\";\r\n\t\tres[2] = \"res/dot.png\";\r\n\t\tres[3] = \"res/entity/spaceshipv2.png\";\r\n\t\tSResLoader.addSpriteArray(res);\r\n\t}",
"void loadNext();",
"private void load() {\n\t\ttry {\r\n\t\t\tA a = new A();\r\n\t\t\ta.action();\r\n\t\t\tSystem.out.println(\"********下面为静态*********\");\r\n\t\t\tString name = a.getClass().getName();\r\n//\t\t\tClass aClass = Class.forName(\"com.guonl.dynamic.A\");\r\n\t\t\tClass<?> aClass = Class.forName(name);\r\n\t\t\tIC ic = (IC)aClass.newInstance();\r\n\t\t\tic.action();\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t}",
"private static void init() {\n /*\n r1 = 1;\n r3 = 0;\n r5 = getNumberOfCPUCores();\n if (r5 != 0) goto L_0x0143;\n L_0x0008:\n r4 = new java.io.FileReader;\t Catch:{ IOException -> 0x008c, all -> 0x00a1 }\n r0 = \"/proc/cpuinfo\";\n r4.<init>(r0);\t Catch:{ IOException -> 0x008c, all -> 0x00a1 }\n r2 = new java.io.BufferedReader;\t Catch:{ IOException -> 0x013c, all -> 0x0135 }\n r2.<init>(r4);\t Catch:{ IOException -> 0x013c, all -> 0x0135 }\n L_0x0014:\n r0 = r2.readLine();\t Catch:{ IOException -> 0x0140 }\n if (r0 == 0) goto L_0x0025;\n L_0x001a:\n r6 = \"processor\";\n r0 = r0.startsWith(r6);\t Catch:{ IOException -> 0x0140 }\n if (r0 == 0) goto L_0x0014;\n L_0x0022:\n r5 = r5 + 1;\n goto L_0x0014;\n L_0x0025:\n if (r2 == 0) goto L_0x002a;\n L_0x0027:\n r2.close();\t Catch:{ IOException -> 0x0104 }\n L_0x002a:\n if (r4 == 0) goto L_0x0143;\n L_0x002c:\n r4.close();\t Catch:{ IOException -> 0x0089 }\n r0 = r5;\n L_0x0030:\n if (r0 != 0) goto L_0x0033;\n L_0x0032:\n r0 = r1;\n L_0x0033:\n r2 = 0;\n r6 = \"\";\n r5 = new java.io.FileReader;\t Catch:{ IOException -> 0x00ae, NumberFormatException -> 0x00c4, all -> 0x00f6 }\n r4 = \"/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq\";\n r5.<init>(r4);\t Catch:{ IOException -> 0x00ae, NumberFormatException -> 0x00c4, all -> 0x00f6 }\n r4 = new java.io.BufferedReader;\t Catch:{ IOException -> 0x012d, NumberFormatException -> 0x0124, all -> 0x011b }\n r4.<init>(r5);\t Catch:{ IOException -> 0x012d, NumberFormatException -> 0x0124, all -> 0x011b }\n r3 = r4.readLine();\t Catch:{ IOException -> 0x0130, NumberFormatException -> 0x0128 }\n if (r3 == 0) goto L_0x004c;\n L_0x0048:\n r2 = java.lang.Integer.parseInt(r3);\t Catch:{ IOException -> 0x0130, NumberFormatException -> 0x012b }\n L_0x004c:\n if (r4 == 0) goto L_0x0051;\n L_0x004e:\n r4.close();\t Catch:{ IOException -> 0x010d }\n L_0x0051:\n if (r5 == 0) goto L_0x0056;\n L_0x0053:\n r5.close();\t Catch:{ IOException -> 0x0110 }\n L_0x0056:\n mInitialized = r1;\n mProcessors = r0;\n mFrequency = r2;\n r0 = \"abc\";\n r1 = new java.lang.StringBuilder;\n r1.<init>();\n r2 = \"++++++++++\";\n r1 = r1.append(r2);\n r2 = mProcessors;\n r1 = r1.append(r2);\n r2 = \" \";\n r1 = r1.append(r2);\n r2 = mFrequency;\n r1 = r1.append(r2);\n r2 = \"++++++++++\";\n r1 = r1.append(r2);\n r1 = r1.toString();\n android.util.Log.d(r0, r1);\n return;\n L_0x0089:\n r0 = move-exception;\n r0 = r5;\n goto L_0x0030;\n L_0x008c:\n r0 = move-exception;\n r2 = r3;\n r4 = r3;\n L_0x008f:\n r0.printStackTrace();\t Catch:{ all -> 0x0138 }\n if (r2 == 0) goto L_0x0097;\n L_0x0094:\n r2.close();\t Catch:{ IOException -> 0x0107 }\n L_0x0097:\n if (r4 == 0) goto L_0x0143;\n L_0x0099:\n r4.close();\t Catch:{ IOException -> 0x009e }\n r0 = r5;\n goto L_0x0030;\n L_0x009e:\n r0 = move-exception;\n r0 = r5;\n goto L_0x0030;\n L_0x00a1:\n r0 = move-exception;\n r4 = r3;\n L_0x00a3:\n if (r3 == 0) goto L_0x00a8;\n L_0x00a5:\n r3.close();\t Catch:{ IOException -> 0x0109 }\n L_0x00a8:\n if (r4 == 0) goto L_0x00ad;\n L_0x00aa:\n r4.close();\t Catch:{ IOException -> 0x010b }\n L_0x00ad:\n throw r0;\n L_0x00ae:\n r4 = move-exception;\n r4 = r3;\n L_0x00b0:\n r5 = TAG;\t Catch:{ all -> 0x0120 }\n r6 = \"Could not find maximum CPU frequency!\";\n android.util.Log.w(r5, r6);\t Catch:{ all -> 0x0120 }\n if (r3 == 0) goto L_0x00bc;\n L_0x00b9:\n r3.close();\t Catch:{ IOException -> 0x0113 }\n L_0x00bc:\n if (r4 == 0) goto L_0x0056;\n L_0x00be:\n r4.close();\t Catch:{ IOException -> 0x00c2 }\n goto L_0x0056;\n L_0x00c2:\n r3 = move-exception;\n goto L_0x0056;\n L_0x00c4:\n r4 = move-exception;\n r4 = r3;\n r5 = r3;\n r3 = r6;\n L_0x00c8:\n r6 = TAG;\t Catch:{ all -> 0x011e }\n r7 = \"Could not parse maximum CPU frequency!\";\n android.util.Log.w(r6, r7);\t Catch:{ all -> 0x011e }\n r6 = TAG;\t Catch:{ all -> 0x011e }\n r7 = new java.lang.StringBuilder;\t Catch:{ all -> 0x011e }\n r7.<init>();\t Catch:{ all -> 0x011e }\n r8 = \"Failed to parse: \";\n r7 = r7.append(r8);\t Catch:{ all -> 0x011e }\n r3 = r7.append(r3);\t Catch:{ all -> 0x011e }\n r3 = r3.toString();\t Catch:{ all -> 0x011e }\n android.util.Log.w(r6, r3);\t Catch:{ all -> 0x011e }\n if (r4 == 0) goto L_0x00ec;\n L_0x00e9:\n r4.close();\t Catch:{ IOException -> 0x0115 }\n L_0x00ec:\n if (r5 == 0) goto L_0x0056;\n L_0x00ee:\n r5.close();\t Catch:{ IOException -> 0x00f3 }\n goto L_0x0056;\n L_0x00f3:\n r3 = move-exception;\n goto L_0x0056;\n L_0x00f6:\n r0 = move-exception;\n r4 = r3;\n r5 = r3;\n L_0x00f9:\n if (r4 == 0) goto L_0x00fe;\n L_0x00fb:\n r4.close();\t Catch:{ IOException -> 0x0117 }\n L_0x00fe:\n if (r5 == 0) goto L_0x0103;\n L_0x0100:\n r5.close();\t Catch:{ IOException -> 0x0119 }\n L_0x0103:\n throw r0;\n L_0x0104:\n r0 = move-exception;\n goto L_0x002a;\n L_0x0107:\n r0 = move-exception;\n goto L_0x0097;\n L_0x0109:\n r1 = move-exception;\n goto L_0x00a8;\n L_0x010b:\n r1 = move-exception;\n goto L_0x00ad;\n L_0x010d:\n r3 = move-exception;\n goto L_0x0051;\n L_0x0110:\n r3 = move-exception;\n goto L_0x0056;\n L_0x0113:\n r3 = move-exception;\n goto L_0x00bc;\n L_0x0115:\n r3 = move-exception;\n goto L_0x00ec;\n L_0x0117:\n r1 = move-exception;\n goto L_0x00fe;\n L_0x0119:\n r1 = move-exception;\n goto L_0x0103;\n L_0x011b:\n r0 = move-exception;\n r4 = r3;\n goto L_0x00f9;\n L_0x011e:\n r0 = move-exception;\n goto L_0x00f9;\n L_0x0120:\n r0 = move-exception;\n r5 = r4;\n r4 = r3;\n goto L_0x00f9;\n L_0x0124:\n r4 = move-exception;\n r4 = r3;\n r3 = r6;\n goto L_0x00c8;\n L_0x0128:\n r3 = move-exception;\n r3 = r6;\n goto L_0x00c8;\n L_0x012b:\n r6 = move-exception;\n goto L_0x00c8;\n L_0x012d:\n r4 = move-exception;\n r4 = r5;\n goto L_0x00b0;\n L_0x0130:\n r3 = move-exception;\n r3 = r4;\n r4 = r5;\n goto L_0x00b0;\n L_0x0135:\n r0 = move-exception;\n goto L_0x00a3;\n L_0x0138:\n r0 = move-exception;\n r3 = r2;\n goto L_0x00a3;\n L_0x013c:\n r0 = move-exception;\n r2 = r3;\n goto L_0x008f;\n L_0x0140:\n r0 = move-exception;\n goto L_0x008f;\n L_0x0143:\n r0 = r5;\n goto L_0x0030;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: qsbk.app.ye.videotools.utils.SystemUtils.init():void\");\n }",
"public static void viewLoadLandRegistryFromBackUp() {\n\t\tArrayList<Property> prop_list = rc.loadFromFile(PROPERTIES_FILE);\r\n\t\tArrayList<Registrant> reg_list = rc.loadFromFile(REGISTRANTS_FILE);\r\n\t}",
"public void pc(int pc) {\n this.pc = pc;\n this.nPC = pc + INST_SIZE;\n }",
"public void load();",
"public void load();",
"public void load() ;",
"private void loadInterpreter() throws IOException {\n tflite = new Interpreter(loadModelFile(activity));\n\n labelList = loadLabelList(activity);\n // the image as ByteBuffer\n imgData = ByteBuffer.allocateDirect((int)(4 *\n parameter.get(\"dimBatchSize\") *\n parameter.get(\"tensorImageWidth\") *\n parameter.get(\"tensorImageHeight\") *\n parameter.get(\"dimPixelSize\")));\n imgData.order(ByteOrder.nativeOrder());\n labelProbArray = new float[1][labelList.size()];\n filterLabelProbArray = new float[Math.round(parameter.get(\"filterStages\"))][labelList.size()];\n }",
"private void loadMemory() {\n try {\n File varTmpDir = new File(\"data/\" + brainLocation + \".ser\");\n if (varTmpDir.exists()) {\n FileInputStream fileIn = new FileInputStream(varTmpDir);\n ObjectInputStream in = new ObjectInputStream(fileIn);\n longTermMemory = (HashMap<String, BoardRecord>) in.readObject();\n in.close();\n fileIn.close();\n }\n } catch (IOException i) {\n i.printStackTrace();\n return;\n } catch (ClassNotFoundException c) {\n System.out.println(\"File not found\");\n c.printStackTrace();\n return;\n }\n\n System.out.println(\"RECALLED LONG TERM MEMORIES FROM \" + brainLocation + \": \" + longTermMemory.toString());\n }",
"public synchronized void schedule(List<Program> programs) throws MemoryFault, Exception { //Creating a process control block\n\n for (Program program : programs) {\n\n int programLength = program.getDataSize() + program.getCode().length;\n freeSpace freeblock = findFree(programLength);\n machine.memory.setBase(0);\n machine.memory.setLimit(Machine.MEMORY_SIZE);\n loadProgram(program, freeblock.start);\n //acc , x register, PC, base, limit\n PCB newPCB = new PCB(freeblock.start, programLength);\n\n freeblock.start = programLength + freeblock.start;\n freeblock.size = freeblock.size - programLength;\n\n for (int i = 0; i < Process_Table.length; i++) {\n // If the spot is null in the process table then add the Process control block into the table\n if (Process_Table[i] == null) {\n Process_Table[i] = newPCB;\n break;\n }\n }\n }\n\n // diag();\n // leave this as the last line\n machine.cpu.runProg = true;\n }",
"public void load() {\n }",
"public Loader(String spaceObjects, String neighbours) {\n\t\tloadSpaceObjects(spaceObjects);\n\t\tloadNeighbours(neighbours);\n\t\tloadInformation();\n\t}",
"public void createCards(String fileWorker, String fileBuilder, String fileMachine) {\n\t\tint id = 0;\n\t\ttry{\n\t\t\tFileReader file = new FileReader (fileWorker);\n\t\t\tScanner in = new Scanner(file);\n\t\t\twhile(in.hasNext()) {\n\t\t\t\tid++;\n\t\t\t\tString line = in.nextLine();\n\t\t\t\tline.trim();\n\t\t\t\tScanner scan = new Scanner(line).useDelimiter(\";\");\n\t\t\t\tString name = scan.next();\n\t\t\t\tint cost = scan.nextInt();\n\t\t\t\tint stone = scan.nextInt();\n\t\t\t\tint wood = scan.nextInt();\n\t\t\t\tint knowledge = scan.nextInt();\n\t\t\t\tint tiles = scan.nextInt();\n\t\t\t\tthis.worker.add(new Worker(id, name, cost, stone, wood, knowledge, tiles));\n\t\t\t}\n\t\t\tin.close();\n\t\t}\n\t\tcatch(FileNotFoundException e){\n\t\t\tSystem.out.println(fileWorker + \" not found\");\n\t\t}\n\n\t\ttry{\n\t\t\tFileReader file = new FileReader (fileBuilder);\n\t\t\tScanner in = new Scanner(file);\n\t\t\twhile (in.hasNext()) {\n\t\t\t\tid++;\n\t\t\t\tString line = in.nextLine();\n\t\t\t\tline.trim();\n\t\t\t\tScanner scan = new Scanner(line).useDelimiter(\";\");\n\t\t\t\tString name = scan.next();\n\t\t\t\tint cost = scan.nextInt();\n\t\t\t\tint point = scan.nextInt();\n\t\t\t\tint stone = scan.nextInt();\n\t\t\t\tint wood = scan.nextInt();\n\t\t\t\tint knowledge = scan.nextInt();\n\t\t\t\tint tiles = scan.nextInt();\n\t\t\t\tthis.building.add(new Building(id, name, cost, point, stone, wood, knowledge, tiles));\n\t\t\t}\n\t\t\tin.close();\n\t\t}\n\t\tcatch(FileNotFoundException e){\n\t\t\tSystem.out.println(fileBuilder + \" not found\");\n\t\t}\n\n\t\ttry{\n\t\t\tFileReader file = new FileReader (fileMachine);\n\t\t\tScanner in = new Scanner(file);\n\t\t\twhile (in.hasNextLine()) {\n\t\t\t\tid++;\n\t\t\t\tString line = in.nextLine();\n\t\t\t\tline.trim();\n\t\t\t\tScanner scan = new Scanner(line).useDelimiter(\";\");\n\t\t\t\tString name = scan.next().trim();\n\t\t\t\tint stoneProd = scan.nextInt();\n\t\t\t\tint woodProd = scan.nextInt();\n\t\t\t\tint knowledgeProd = scan.nextInt();\n\t\t\t\tint tileProd = scan.nextInt();\n\t\t\t\tint point = scan.nextInt();\n\t\t\t\tint stone = scan.nextInt();\n\t\t\t\tint wood = scan.nextInt();\n\t\t\t\tint knowledge = scan.nextInt();\n\t\t\t\tint tiles = scan.nextInt();\n\t\t\t\tthis.machine.add(new Machine(id, name, point, stone, wood, knowledge, tiles, stoneProd, woodProd, knowledgeProd, tileProd));\n\t\t\t}\n\t\t\tin.close();\n\t\t}\n\t\tcatch(FileNotFoundException e){\n\t\t\tSystem.out.println(fileMachine + \" not found\");\n\t\t}\n\t}",
"public CPU (String name, AbstractMainMemory memory) {\n super (name, memory);\n }",
"public Interpreter() {\n super();\n instructionsStack.push(new ArrayList<>());\n }",
"public static void program(Map<Integer, String[]> codeValues){\n String currentByteCodeIn;\n for (int i = 1; i <= codeValues.size(); i++) {\n\n currentByteCodeIn = \"bytecode.\"+ CodeTable.getCode(codeValues.get(i)[0]);\n\n try {\n ByteCode newCode = (ByteCode) (Class.forName(currentByteCodeIn).getDeclaredConstructor().newInstance());\n\n byteCodeVector.add(newCode);\n if(currentByteCodeIn.equals(\"bytecode.LabelByteCode\")){\n newCode.setAddrs(i);\n }\n newCode.init(codeValues.get(i));\n programMap.put(i, codeValues.get(i));\n }catch(ClassNotFoundException e){\n System.err.println(\"Class \" + currentByteCodeIn+ \" not found.\");\n e.printStackTrace();\n }catch(InstantiationException e){\n System.err.println(\"Error creating \" + currentByteCodeIn+ \" instance.\");\n e.printStackTrace();\n }catch(IllegalAccessException e){\n System.err.println(\"Error accessing \" + currentByteCodeIn+ \" instance.\");\n e.printStackTrace();\n } catch (NoSuchMethodException e) {\n System.err.println(\"Method does not exist\");\n } catch (InvocationTargetException e) {\n e.printStackTrace();\n }\n }\n addAddresses();\n\n }",
"private void init()\r\n\t{\r\n\t\ttry {\r\n\t\t\tThread.currentThread().getContextClassLoader().getResourceAsStream(\"d\").read(board);\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tzp = 0;\r\n\t\txp = 0.5f;\r\n\t\typ = 0.5f;\r\n\t\tvx = 0;\r\n\t\tvy = 0;\r\n\t\tstarted = false;\r\n\t\tmsg = \"PRESS ENTER\";\r\n\t\tint[] levelTimes = {80,80,99,99,99};\r\n\t\ttimers[0] = levelTimes[l]*1000;\r\n\t\ttoggles = 0;\r\n\t\t\r\n\t\tif (complete) {\r\n\t\t\tl++;\r\n\t\t\t// LEVELS\r\n\t\t\tif (l >= 5) {\r\n\t\t\t\tl = 0;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//ports.clear();\r\n\t\tports[99][0] = 0;\r\n\t\tfor (int x=0;x<30;x++) {\r\n\t\t\tfor (int y=0;y<30;y++) {\r\n\t\t\t\tint tile = getTile(x,y);\r\n\t\t\t\t\r\n\t\t\t\tif (tile == 3) {\r\n\t\t\t\t\txp = x+0.5;\r\n\t\t\t\t\typ = y+0.5;\r\n\t\t\t\t}\r\n\t\t\t\tif (tile == 14) {\r\n\t\t\t\t\ttoggles++;\r\n\t\t\t\t}\r\n\t\t\t\tif (tile == 12) {\r\n\t\t\t\t\tports[ports[99][0]][0] = x;\r\n\t\t\t\t\tports[ports[99][0]][1] = y;\r\n\t\t\t\t\tports[99][0]++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tcomplete = false;\r\n\t}",
"void executaInstrucoes (){\n\n /* Executa uma instrução da memoria */\n for (opReg.getPC() ; opReg.getPC() < 0x0fff; opReg.setPC(opReg.getPC()+4)) { //verificar se esta contando de 4 em 4\n\n /* Salva as instruções de 4 bytes (32 bits) em uma string\n * a partir do endereço do PC */ \n String instrucao = null;\n instrucao = separaDados.separaInstrucao(instrucao, opReg.getPC(), memoria.memory);\n decodifica.separaInstrucao(instrucao, opReg.getPC(), opReg, memoria, sc);\n }\n sc.close();\n }",
"public void executeLDR(){\n\t\tBitString destBS = mIR.substring(4, 3);\n\t\tBitString sourceBS = mIR.substring(7, 3);\n\t\tBitString offset6 = mIR.substring(10, 6);\n\n\t\tBitString wantedVal = mMemory[mRegisters[sourceBS.getValue()].getValue2sComp() + offset6.getValue2sComp()];\n\t\tmRegisters[destBS.getValue()] = wantedVal;\n\n\t\tsetConditionalCode(wantedVal);\n\t}",
"public void hardwareResources() {\n\t\tSystem.out.println(\"I am the Hardware implemented through Multiple inheritence in Desktop class\");\r\n\r\n\t}",
"void loadSimpleCodesFromFile() {\n\t\tReader reader;\r\n\t\ttry {\r\n\t\t\t//reader = new FileReader(pathStr + \"/../pt.iscte.pidesco.codegenerator/Settings/Code.cg\");\r\n\t\t\treader = new FileReader(\"Code.cg\");\r\n\t\t\tint data = reader.read();\r\n\t\t\tString output = \"\";\r\n\t\t\twhile (data != -1) {\r\n\t\t\t\tchar dataChar = (char) data;\r\n\t\t\t\toutput += dataChar;\r\n\t\t\t\tdata = reader.read();\r\n\t\t\t}\r\n\t\t\tString[] Codes = output.split(\"-CGCodeSeparator-\");\r\n\t\t\tfor (String code : Codes) {\r\n\t\t\t\tString[] Code = code.split(\"-CGSeparator-\");\r\n\t\t\t\tif (Code.length > 1)\r\n\t\t\t\t\tSimpleCodeMap.put(Code[0], new SimpleCode(Code[0], Code[1]));\r\n\t\t\t}\r\n\r\n\t\t\treader.close();\r\n\t\t\trefreshList();\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t} catch (IOException e) {\r\n\t\t}\r\n\t}",
"private void initComponents() {\r\n\t\temulator = new Chip8();\r\n\t\tpanel = new DisplayPanel(emulator);\r\n\t\tregisterPanel = new EmulatorInfoPanel(emulator);\r\n\t\t\r\n\t\tcontroller = new Controller(this, emulator, panel, registerPanel);\r\n\t}"
] | [
"0.6006972",
"0.58888984",
"0.57816994",
"0.5749469",
"0.57266605",
"0.56051636",
"0.5576413",
"0.5320868",
"0.5310349",
"0.5308396",
"0.5301354",
"0.5297015",
"0.52719927",
"0.5266544",
"0.5241954",
"0.51618874",
"0.51054347",
"0.50802004",
"0.5078704",
"0.5075079",
"0.5057972",
"0.503332",
"0.5026714",
"0.5025827",
"0.50110346",
"0.49575508",
"0.49469757",
"0.49386358",
"0.48938382",
"0.4883771",
"0.4874066",
"0.48623815",
"0.48522246",
"0.48424488",
"0.48317206",
"0.48239776",
"0.48173827",
"0.4812231",
"0.480055",
"0.4795682",
"0.4793955",
"0.4789337",
"0.4777978",
"0.47507972",
"0.47394022",
"0.47254044",
"0.4723748",
"0.4707957",
"0.46999776",
"0.46977913",
"0.46922106",
"0.46860904",
"0.4670016",
"0.4650123",
"0.46499896",
"0.46499896",
"0.46407217",
"0.4621699",
"0.4621347",
"0.46160787",
"0.46108806",
"0.4602527",
"0.46005377",
"0.4599603",
"0.4588206",
"0.45817056",
"0.45814973",
"0.45729887",
"0.45729387",
"0.4571948",
"0.4571025",
"0.45671985",
"0.4563106",
"0.45616925",
"0.4558353",
"0.45573688",
"0.45521605",
"0.45501018",
"0.45467663",
"0.453868",
"0.45370048",
"0.45348716",
"0.45328972",
"0.45328972",
"0.45301577",
"0.45287925",
"0.4521524",
"0.45129424",
"0.4512022",
"0.45114776",
"0.4505725",
"0.45029",
"0.45010263",
"0.4499758",
"0.4491272",
"0.44900838",
"0.44874588",
"0.44862938",
"0.44851652",
"0.44689715"
] | 0.59227586 | 1 |
/////////////////////////////////////////////////// ///////////////// Accessors /////////////////////// /////////////////////////////////////////////////// | public Long getId() {
return id;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private stendhal() {\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\n void init() {\n }",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n public void init() {\n }",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n protected void init() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"private Rekenhulp()\n\t{\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\n public void init() {}",
"@Override\n protected void prot() {\n }",
"@Override\n public void init() {\n\n }",
"@Override\n public void init() {\n\n }",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"private TMCourse() {\n\t}",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"private void init() {\n\n\t}",
"public contrustor(){\r\n\t}",
"private MApi() {}",
"private RESTBackend()\n\t\t{\n\t\t\t\n\t\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"@Override\n\t\tpublic void init() {\n\t\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n public void init() {\n }",
"private MetallicityUtils() {\n\t\t\n\t}",
"@Override\n\tprotected void GetDataFromNative() {\n\t\t\n\t}",
"@Override\n\tprotected void GetDataFromNative() {\n\t\t\n\t}",
"@Override\n public void initialize() { \n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init()\n\t{\n\n\t}",
"@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}",
"private void init() {\n\n\n\n }",
"@Override\n\tpublic void init() {\n\t}",
"@Override\n public void get() {}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t}",
"@Override\n\tprotected void initialize() {\n\t}",
"private Singletion3() {}",
"@Override\n public void initialize() {}",
"@Override\n public void initialize() {}",
"@Override\n public void initialize() {}",
"public String getName () { return this.name; }",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"protected MetadataUGWD() {/* intentionally empty block */}",
"@Override\r\n\tpublic final void init() {\r\n\r\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"private OMUtil() { }",
"private IndexBitmapObject() {\n\t}",
"protected void init() {\n // to override and use this method\n }",
"private void init() {\n }",
"@Override\n public void initialize() {\n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"public void init() {\n\t\t\n\t}",
"public void init() {\r\n\t\t// to override\r\n\t}",
"private void getStatus() {\n\t\t\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n public void load() {\n }",
"@Override\n public void init() {\n\n super.init();\n\n }",
"@Override\n public void initialize() {\n }",
"@Override\n public void initialize() {\n }",
"@Override\n public void initialize() {\n }"
] | [
"0.644737",
"0.6362254",
"0.6319382",
"0.62872803",
"0.625894",
"0.6236339",
"0.6227045",
"0.6220644",
"0.621739",
"0.62006336",
"0.62006336",
"0.62006336",
"0.62006336",
"0.62006336",
"0.62006336",
"0.6197319",
"0.616872",
"0.6162864",
"0.6119834",
"0.61016506",
"0.61007375",
"0.60775083",
"0.6063893",
"0.6063893",
"0.605932",
"0.605932",
"0.605932",
"0.605932",
"0.605932",
"0.6050979",
"0.60420865",
"0.60420865",
"0.60395396",
"0.603159",
"0.60308564",
"0.60308564",
"0.60308564",
"0.602414",
"0.60203594",
"0.6018483",
"0.5994394",
"0.59782654",
"0.59782654",
"0.59782654",
"0.5972017",
"0.5969105",
"0.5940684",
"0.593663",
"0.59364843",
"0.59350866",
"0.59336615",
"0.59152144",
"0.5912986",
"0.58983475",
"0.58925474",
"0.58925474",
"0.58920825",
"0.588709",
"0.588294",
"0.588294",
"0.588294",
"0.58789235",
"0.5873352",
"0.5873352",
"0.5861167",
"0.5850111",
"0.58490384",
"0.58464754",
"0.58464754",
"0.58460164",
"0.5844128",
"0.5844128",
"0.58388263",
"0.58283496",
"0.58250695",
"0.58250695",
"0.5792434",
"0.57792455",
"0.57792455",
"0.57792455",
"0.57787204",
"0.5776696",
"0.57765156",
"0.5775214",
"0.57729113",
"0.57720286",
"0.57523286",
"0.57405615",
"0.5736222",
"0.5733372",
"0.5730295",
"0.5724686",
"0.5715908",
"0.5712364",
"0.57085705",
"0.5706242",
"0.5700568",
"0.57005244",
"0.57004046",
"0.57004046",
"0.57004046"
] | 0.0 | -1 |
/////////////////////////////////////////////////// ///////////// API Implementation/////////////////// /////////////////////////////////////////////////// | @Override
public String getCommandName() {
return s_name;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n\tprotected void interr() {\n\t}",
"private stendhal() {\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"private void getStatus() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n\n \n }",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n protected void init() {\n }",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\n public void init() {\n }",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\n void init() {\n }",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"private Rekenhulp()\n\t{\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"private void init() {\n\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void init() {}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\n public void init() {}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"private RESTBackend()\n\t\t{\n\t\t\t\n\t\t}",
"@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"protected MetadataUGWD() {/* intentionally empty block */}",
"@Override\r\n \tpublic void process() {\n \t\t\r\n \t}",
"@Override\n\tprotected void initialize() {\n\t}",
"@Override\n\tprotected void initialize() {\n\t}",
"public final void mo51373a() {\n }",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"private void initialize() {\n\t\t\n\t}",
"private void kk12() {\n\n\t}",
"private void init() {\n\n\n\n }",
"protected void mo6255a() {\n }",
"@Override\n public void memoria() {\n \n }",
"@Override\n\tprotected void GetDataFromNative() {\n\t\t\n\t}",
"@Override\n\tprotected void GetDataFromNative() {\n\t\t\n\t}",
"@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void init()\n\t{\n\n\t}",
"@Override\n public void initialize() { \n }",
"public abstract void mo70713b();",
"private Singletion3() {}",
"@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"public void mo38117a() {\n }",
"@Override\n\t\tpublic void init() {\n\t\t}",
"private TMCourse() {\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initdata() {\n\n\t}",
"public void mo4359a() {\n }",
"@Override\n public void init() {\n }"
] | [
"0.6435311",
"0.64057505",
"0.6368641",
"0.6303162",
"0.6243861",
"0.62225485",
"0.6085387",
"0.6036507",
"0.6036507",
"0.60160315",
"0.5996769",
"0.59933645",
"0.59924936",
"0.5991928",
"0.5991928",
"0.5991928",
"0.5991928",
"0.5991928",
"0.5991928",
"0.5974011",
"0.5972177",
"0.59711266",
"0.59711266",
"0.59674025",
"0.5965875",
"0.59389305",
"0.59389305",
"0.5924813",
"0.5921751",
"0.58911294",
"0.5882176",
"0.58775276",
"0.5876215",
"0.5876215",
"0.5876215",
"0.5876215",
"0.5876215",
"0.58751655",
"0.5872488",
"0.5867277",
"0.58661157",
"0.5855732",
"0.58390343",
"0.5838538",
"0.5838538",
"0.58358693",
"0.58330745",
"0.58296114",
"0.5824646",
"0.58226264",
"0.5822587",
"0.5821411",
"0.5819763",
"0.5819763",
"0.5819763",
"0.58174706",
"0.5803488",
"0.5798222",
"0.57924724",
"0.57885975",
"0.57885975",
"0.57885975",
"0.57784903",
"0.5772766",
"0.5765391",
"0.5765391",
"0.57647926",
"0.5748972",
"0.57437575",
"0.57437575",
"0.5723801",
"0.5719901",
"0.5717393",
"0.57121205",
"0.57121205",
"0.57105535",
"0.5708542",
"0.5707392",
"0.5701412",
"0.5701378",
"0.56985515",
"0.56886154",
"0.5686011",
"0.5686011",
"0.56845546",
"0.56818086",
"0.567441",
"0.56723523",
"0.5669885",
"0.56663775",
"0.5664522",
"0.5654666",
"0.5654666",
"0.5654666",
"0.56507504",
"0.56466573",
"0.5637682",
"0.5622304",
"0.56201655",
"0.5619825",
"0.56196415"
] | 0.0 | -1 |
Creates the underlying database table. | public static void createTable(SQLiteDatabase db, boolean ifNotExists) {
String constraint = ifNotExists ? "IF NOT EXISTS " : "";
db.execSQL("CREATE TABLE " + constraint + "'District' (" + //
"'districtID' INTEGER PRIMARY KEY NOT NULL ," + // 0: districtID
"'districtName' TEXT," + // 1: districtName
"'cityID' INTEGER NOT NULL );"); // 2: cityID
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"TABLE createTABLE();",
"public void create(Connection db) throws SQLException {\n if (tableName == null) {\n throw new SQLException(\"Table Name not specified\");\n }\n\n Statement st = db.createStatement();\n\n if (dbType == DatabaseUtils.POSTGRESQL) {\n if (hasSequence()) {\n st.executeUpdate(\"CREATE SEQUENCE \" + sequenceName);\n }\n }\n\n StringBuffer sql = new StringBuffer();\n sql.append(\"CREATE TABLE \" + tableName + \" (\");\n\n String primaryKey = \"\";\n Iterator fields = columns.iterator();\n while (fields.hasNext()) {\n DatabaseColumn thisColumn = (DatabaseColumn) fields.next();\n if (thisColumn.isPrimaryKey()) {\n primaryKey = thisColumn.getName();\n sql.append(thisColumn.getCreateSQL(dbType, sequenceName));\n } else {\n sql.append(thisColumn.getCreateSQL(dbType));\n }\n if (fields.hasNext()) {\n sql.append(\",\");\n }\n }\n if (dbType == DatabaseUtils.ORACLE) {\n sql.append(\", PRIMARY KEY (\" + primaryKey + \")\");\n }\n sql.append(\");\");\n st.executeUpdate(sql.toString());\n st.close();\n }",
"Table createTable();",
"public void createTable() throws LRException\n\t{\n\t\tgetBackground();\n\t\tDataHRecordData myData=(DataHRecordData)getData();\n\t\t// Create a new (empty) record\n\t\tcreate(new Hashtable(),myData);\n\t\tif (myData.record==null) throw new LRException(DataRMessages.nullRecord(getName()));\n\t\ttry\n\t\t{\n\t\t\tbackground.newTransaction();\n\t\t\tmyData.record.createNewTable(background.getClient(),true);\n\t\t}\n\t\tcatch (LDBException e) { setStatus(e); }\n\t}",
"public void doCreateTable();",
"private void createTables() throws SQLException\r\n {\r\n createTableMenuItems();\r\n createTableOrdersWaiting();\r\n }",
"public void createTable()\n throws DBException\n {\n try {\n DBProvider.createTable(this);\n } catch (SQLException sqe) {\n throw new DBException(\"Table creation\", sqe);\n }\n }",
"@Override\r\n public Db_db createTable (Db_table table)\r\n {\r\n Db_db db = null;\r\n String query = \"CREATE TABLE IF NOT EXISTS \"+ table.getName() + \" (\"; \r\n String primaryKeyName = null;\r\n Set<Map.Entry<String, Db_tableColumn>> tableEntries;\r\n List<String> listOfUniqueKey = Lists.newArrayList();\r\n \r\n if(curConnection_ != null)\r\n {\r\n try\r\n {\r\n tableEntries = table.getEntrySet();\r\n for(Map.Entry<String, Db_tableColumn> entry: tableEntries)\r\n {\r\n Db_tableColumn entryContent = entry.getValue();\r\n \r\n if(entryContent.isPrimary() && primaryKeyName == null)\r\n {\r\n primaryKeyName = entryContent.getName();\r\n }\r\n else if(entryContent.isPrimary() && primaryKeyName != null)\r\n {\r\n throw new NumberFormatException();\r\n }\r\n \r\n if(itsAttributeMapper_ == null)\r\n {\r\n throw new NumberFormatException();\r\n }\r\n \r\n if(entryContent.isUnique())\r\n {\r\n listOfUniqueKey.add(entryContent.getName());\r\n }\r\n \r\n String mappedAttribute = this.itsAttributeMapper_.MapAttribute(entryContent.getAttributeName());\r\n if(entryContent.getAttribute().isEnum())\r\n {\r\n mappedAttribute += entryContent.getAttribute().buildEnumValueListString();\r\n }\r\n query += entryContent.getName() + \" \" + mappedAttribute \r\n + (entryContent.isAutoIncreasmnet()?\" AUTO_INCREMENT \":\" \")\r\n + (entryContent.isUnique()?\" UNIQUE, \": \", \");\r\n }\r\n \r\n query += \"PRIMARY KEY (\" + primaryKeyName + \"));\";\r\n try (Statement sm = curConnection_.createStatement()) {\r\n sm.executeUpdate(query);\r\n db = this.curDb_;\r\n }\r\n \r\n }catch(NumberFormatException e){System.out.print(e);}\r\n catch(SQLException e){System.out.print(query);this.CurConnectionFailed();}\r\n }\r\n return db;\r\n }",
"public String createTable() {\n\n String statement = \"CREATE TABLE \" + tableName + \"( \";\n\n //go through INTEGER, FLOAT, TEXT columns\n Iterator iterator = Iterables.filter(columns.entrySet(), entry -> entry.getValue().getType() instanceof String).iterator();\n\n while (iterator.hasNext()) {\n Map.Entry<Element, FieldData> fieldDataEntry = (Map.Entry<Element, FieldData>) iterator.next();\n statement += fieldDataEntry.getValue().createColumn() + \",\";\n }\n\n return (new StringBuilder(statement).replace(statement.length() - 1, statement.length(), \"\").toString() + \")\").toUpperCase();\n }",
"private void createDataTable() {\n jdbcTemplate.update(\"CREATE TABLE \" + IDaoEditors.TABLE + \" (ID INT IDENTITY PRIMARY KEY, NAME VARCHAR(150) NOT NULL UNIQUE)\");\n jdbcTemplate.update(\"CREATE TABLE \" + IDaoBooks.TABLE + \" (ID INT IDENTITY PRIMARY KEY, TITLE VARCHAR(150) NOT NULL UNIQUE, YEAR INT, ISBN10 VARCHAR(20), ISBN13 VARCHAR(13), NOTE INT, PAGES_NUMBER INT, RESUME VARCHAR(2000), THE_EDITOR_FK INT, THE_KIND_FK INT, THE_LANGUAGE_FK INT, THE_LENDING_FK INT, THE_SAGA_FK INT, THE_TYPE_FK INT)\");\n jdbcTemplate.update(\"CREATE TABLE \" + IDaoBooks.BOOKS_AUTHOR_TABLE + \" (THE_BOOK_FK INT NOT NULL, THE_AUTHOR_FK INT NOT NULL)\");\n\n jdbcTemplate.update(\"CREATE INDEX BOOK_EDITOR_IDX ON \" + IDaoEditors.TABLE + \"(ID)\");\n jdbcTemplate.update(\"CREATE INDEX BOOKS_IDX ON \" + IDaoBooks.TABLE + \"(ID)\");\n }",
"public static void createTable() {\n\n // Create statement\n Statement statement = null;\n try {\n statement = Database.getDatabase().getConnection().createStatement();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n // Attempt to create table\n try {\n statement.execute(\n \"CREATE TABLE \" + Constants.SANITATION_TABLE + \"(\" +\n \"requestID INT PRIMARY KEY GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),\" +\n \"nodeID VARCHAR(100) References \" + Constants.LOCATION_TABLE + \" (nodeID), \" +\n \"priority VARCHAR(10), \" +\n \"status VARCHAR(100), \" +\n \"description VARCHAR(100), \" +\n \"requesterID INT REFERENCES \" + Constants.USERS_TABLE + \"(userID), \" +\n \"requestTime TIMESTAMP, \" +\n \"servicerID INT REFERENCES \" + Constants.USERS_TABLE + \"(userID), \" +\n \"claimedTime TIMESTAMP, \" +\n \"completedTime TIMESTAMP, \" +\n \"CONSTRAINT priority_enum CHECK (priority in ('LOW', 'MEDIUM', 'HIGH')), \" +\n \"CONSTRAINT status_enum CHECK (status in ('INCOMPLETE', 'COMPLETE')))\"\n );\n } catch (SQLException | NullPointerException e) {\n e.printStackTrace();\n }\n }",
"TableInstance createTableInstance();",
"public void testCreateTable() {\n LOG.info(\"Entering testCreateTable.\");\n\n // Specify the table descriptor.\n HTableDescriptor htd = new HTableDescriptor(tableName);\n\n // Set the column family name to info.\n HColumnDescriptor hcd = new HColumnDescriptor(\"info\");\n\n // Set data encoding methods,HBase provides DIFF,FAST_DIFF,PREFIX\n // and PREFIX_TREE\n hcd.setDataBlockEncoding(DataBlockEncoding.FAST_DIFF);\n\n // Set compression methods, HBase provides two default compression\n // methods:GZ and SNAPPY\n // GZ has the highest compression rate,but low compression and\n // decompression effeciency,fit for cold data\n // SNAPPY has low compression rate, but high compression and\n // decompression effeciency,fit for hot data.\n // it is advised to use SANPPY\n hcd.setCompressionType(Compression.Algorithm.SNAPPY);\n\n htd.addFamily(hcd);\n\n Admin admin = null;\n try {\n // Instantiate an Admin object.\n admin = conn.getAdmin();\n if (!admin.tableExists(tableName)) {\n LOG.info(\"Creating table...\");\n admin.createTable(htd);\n LOG.info(admin.getClusterStatus());\n LOG.info(admin.listNamespaceDescriptors());\n LOG.info(\"Table created successfully.\");\n } else {\n LOG.warn(\"table already exists\");\n }\n } catch (IOException e) {\n LOG.error(\"Create table failed.\");\n } finally {\n if (admin != null) {\n try {\n // Close the Admin object.\n admin.close();\n } catch (IOException e) {\n LOG.error(\"Failed to close admin \", e);\n }\n }\n }\n LOG.info(\"Exiting testCreateTable.\");\n }",
"public void createTable() {\n\t\tString QUERY = \"CREATE TABLE person (id INT PRIMARY KEY, name VARCHAR(32) NOT NULL, phoneNumber VARCHAR(18) NOT NULL)\";\n\t\ttry (Connection con = DriverManager.getConnection(URL, USER, PASSWORD);\n\t\t\t\tStatement stmt = con.createStatement();) {\n\t\t\tstmt.executeUpdate(QUERY);\n\t\t} catch (SQLException e) {\n\t\t\tSystem.err.println(\"SQL Exception\");\n\t\t}\n\n\t}",
"@Override\n\tpublic void createTable(Object connectionHandle, DataTable table) throws DataSourceException\n\t{\n\t\tList<DataField> fields = new LinkedList<DataField>();\n\t\tList<String> indexes = new LinkedList<String>();\n\t\t\n\t\tList<String> keys = table.getFields();\n\t\tIterator<String> it = keys.iterator();\n\t\twhile(it.hasNext()){\n\t\t\tString fld = it.next();\n\t\t\tDataField df = table.getDataField(fld);\n\t\t\t\n\t\t\tfields.add(df);\n\t\t\t\n\t\t//\tif(df.isPrimary()){\n\t\t//\t\tindexes.add(fld);\n\t\t//\t}\n\t\t}\n\t\t\n\t\tIterator<DataField> primaryIt = table.getPrimaryKeys().iterator();\n\t\twhile(primaryIt.hasNext()){\n\t\t\tDataField pf = primaryIt.next();\n\t\t\t\n\t\t\tindexes.add(pf.getName());\n\t\t}\n\t\t\n\t\t\n\t\t// Make SQL String\n\t\tStringBuffer sqlString = new StringBuffer();\n\t\tsqlString.append(\"CREATE TABLE \");\n\t\tsqlString.append(table.getName());\n\t\tsqlString.append(\" ( \\n\");\n\t\t\n\t\tboolean first = true;\n\t\tIterator<DataField> itDf = fields.iterator();\n\t\twhile(itDf.hasNext()){\n\t\t\tDataField fld = itDf.next();\n\t\t\t\n\t\t\tif(first){\n\t\t\t\tfirst = false;\n\t\t\t}else{\n\t\t\t\tsqlString.append(\",\\n\");\n\t\t\t}\n\t\t\t\n\t\t\tsqlString.append(fld.getName());\n\t\t\tsqlString.append(\" \");\n\t\t\tsqlString.append(getSQLType(fld.getType()));\n\t\t\t\n\t\t\t// not null\n\t\t\tif(fld.isNotnull()){\n\t\t\t\tsqlString.append(\" NOT NULL\");\n\t\t\t}\n\t\t\t\n\t\t\t// unique\n\t\t\tif(fld.isUnique()){\n\t\t\t\tsqlString.append(\" UNIQUE\");\n\t\t\t}\n\t\t\t\n\t\t\t// default\n\t\t\tif(fld.getDefaultValue() != null){\n\t\t\t\tsqlString.append(\" \");\n\t\t\t\tsqlString.append(fld.getDefaultString());\n\t\t\t}\n\t\t\t\n\t\t\t// check\n\t\t\tif(fld.getCheck() != null){\n\t\t\t\tsqlString.append(\" \");\n\t\t\t\ttry {\n\t\t\t\t\tsqlString.append(fld.getCheck().extract(null, null, null, null, null));\n\t\t\t\t} catch (ExecutionException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\tthrow new DataSourceException(e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// check\n\t\tIterator<CheckDefinition> checkIt = table.getCheck().iterator();\n\t\twhile(checkIt.hasNext()){\n\t\t\tCheckDefinition def = checkIt.next();\n\t\t\t\n\t\t\tsqlString.append(\",\\n\");\n\t\t\ttry {\n\t\t\t\tsqlString.append(def.extract(null, null, null, null, null));\n\t\t\t} catch (ExecutionException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\tthrow new DataSourceException(e);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// foreign key\n\t\tIterator<ForeignKey> foreignIt = table.getForeignKey().iterator();\n\t\twhile(foreignIt.hasNext()){\n\t\t\tForeignKey fkey = foreignIt.next();\n\t\t\t\n\t\t\tsqlString.append(\",\\n\");\n\t\t\ttry {\n\t\t\t\tsqlString.append(fkey.extract(null, null, null, null, null));\n\t\t\t} catch (ExecutionException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\tthrow new DataSourceException(e);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// primary key\n\t\tif(indexes.size() > 0){\n\t\t\tsqlString.append(\",\\n\");\n\t\t\tsqlString.append(\"PRIMARY KEY(\");\n\t\t\t\n\t\t\tfirst = true;\n\t\t\tit = indexes.iterator();\n\t\t\twhile(it.hasNext()){\n\t\t\t\tString idxFld = it.next();\n\t\t\t\t\n\t\t\t\tif(first){\n\t\t\t\t\tfirst = false;\n\t\t\t\t}else{\n\t\t\t\t\tsqlString.append(\", \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tsqlString.append(idxFld);\n\t\t\t}\n\n\t\t\tsqlString.append(\")\");\n\t\t}\n\t\t\n\t\t// unique\n\t\tIterator<Unique> itU = table.getUnique().iterator();\n\t\twhile(itU.hasNext()){\n\t\t\tUnique unique = itU.next();\n\t\t\t\n\t\t\tsqlString.append(\",\\n\");\n\t\t\tsqlString.append(\"UNIQUE(\");\n\t\t\t\n\t\t\tfirst = true;\n\t\t\tIterator<String> itUnique = unique.getKey().iterator();\n\t\t\twhile(itUnique.hasNext()){\n\t\t\t\tString col = itUnique.next();\n\t\t\t\t\n\t\t\t\tif(first){\n\t\t\t\t\tfirst = false;\n\t\t\t\t}else{\n\t\t\t\t\tsqlString.append(\",\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tsqlString.append(col);\n\t\t\t}\n\t\t\t\n\t\t\tsqlString.append(\")\");\n\t\t}\n\t\t\n\t\tsqlString.append(\"\\n)\\n\");\n\t\t\n\t\tif(this.logger != null && this.outSql){\n\t\t\tthis.logger.reportInfo(sqlString.toString());\n\t\t}\n\t\t\n\t\t// \n\t\tAlinousDebug.debugOut(core, sqlString.toString());\n\t\t\n\t\texecuteUpdateSQL(connectionHandle, sqlString.toString(), false);\n\n\t}",
"public TableCreation(Table table) {\n this.table = table;\n }",
"private void createTable() throws Exception{\n Statement stm = this.con.createStatement();\n\n String query = \"CREATE TABLE IF NOT EXISTS \" + tableName +\n \"(name VARCHAR( 15 ) CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL ,\" +\n \" city VARCHAR( 15 ) CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL ,\" +\n \" phone VARCHAR( 15 ) NOT NULL, \" +\n \"PRIMARY KEY (phone) )\";\n stm.execute(query);\n }",
"private void createTransactionsTable() {\n\t\ttry {\n\t\t\tStatement stmt = this.conn.createStatement();\n\t\t\tstmt.executeUpdate(\"CREATE TABLE transactions \"\n\t\t\t\t\t+ \"(id BIGINT GENERATED ALWAYS AS IDENTITY, \"\n\t\t\t\t\t+ \"owner INT, amount DOUBLE, source BIGINT, sourceType VARCHAR(20), target BIGINT, targetType VARCHAR(20), comment VARCHAR(255), time BIGINT)\");\n\t\t\tconn.commit();\n\t\t\tSystem.out.println(\"Created table transactions\");\n\t\t} catch (SQLException sqle) {\n\t\t\tSystem.err.println(\"Creation of transactions table FAILED\");\n\t\t\tSystem.err.println(sqle);\n\t\t}\n\t}",
"protected void createTable() throws Exception {\n startService();\n assertEquals(true, sqlDbManager.isReady());\n\n Connection conn = sqlDbManager.getConnection();\n assertNotNull(conn);\n assertFalse(sqlDbManager.tableExists(conn, \"testtable\"));\n assertTrue(sqlDbManager.createTableIfMissing(conn, \"testtable\",\n\t\t\t\t\t TABLE_CREATE_SQL));\n assertTrue(sqlDbManager.tableExists(conn, \"testtable\"));\n sqlDbManager.logTableSchema(conn, \"testtable\");\n assertFalse(sqlDbManager.createTableIfMissing(conn, \"testtable\",\n\t\t\t\t\t TABLE_CREATE_SQL));\n }",
"private void CreatTable() {\n String sql = \"CREATE TABLE IF NOT EXISTS \" + TABLE_NAME\n + \" (name varchar(30) primary key,password varchar(30));\";\n try{\n db.execSQL(sql);\n }catch(SQLException ex){}\n }",
"private void createStressTestControlTable() {\n Column runId = new Column(\"RUN_ID\");\n runId.setMappedType(\"INTEGER\");\n runId.setPrimaryKey(true);\n runId.setRequired(true);\n Column clientCommitSleepMs = new Column(\"CLIENT_COMMIT_SLEEP_MS\");\n clientCommitSleepMs.setMappedType(\"BIGINT\");\n Column clientCommitRows = new Column(\"CLIENT_COMMIT_ROWS\");\n clientCommitRows.setMappedType(\"BIGINT\");\n Column serverCommitSleepMs = new Column(\"SERVER_COMMIT_SLEEP_MS\");\n serverCommitSleepMs.setMappedType(\"BIGINT\");\n Column serverCommitRows = new Column(\"SERVER_COMMIT_ROWS\");\n serverCommitRows.setMappedType(\"BIGINT\");\n Column payloadColumns = new Column(\"PAYLOAD_COLUMNS\");\n payloadColumns.setMappedType(\"INTEGER\");\n Column initialSeedSize = new Column(\"INITIAL_SEED_SIZE\");\n initialSeedSize.setMappedType(\"BIGINT\");\n Column duration = new Column(\"DURATION_MINUTES\");\n duration.setMappedType(\"BIGINT\");\n\n Table table = new Table(STRESS_TEST_CONTROL, runId, clientCommitSleepMs, clientCommitRows, serverCommitSleepMs, serverCommitRows,\n payloadColumns, initialSeedSize, duration);\n engine.getDatabasePlatform().createTables(true, true, table);\n }",
"public void createTable() {\r\n\t\tclient.createTable();\r\n\t}",
"private void createTable() {\n try (Statement st = this.conn.createStatement()) {\n st.execute(\"CREATE TABLE IF NOT EXISTS users (user_id SERIAL PRIMARY KEY, name VARCHAR(100) NOT NULL, \"\n + \"login VARCHAR(100) UNIQUE NOT NULL, email VARCHAR(100) NOT NULL, createDate TIMESTAMP NOT NULL);\");\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }",
"public void createTables(){\n Map<String, String> name_type_map = new HashMap<>();\n List<String> primaryKey = new ArrayList<>();\n try {\n name_type_map.put(KEY_SINK_NAME, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_SINK_ADDRESS, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_SINK_DETAIL, MyDatabase.TYPE_VARCHAR);\n primaryKey.add(KEY_SINK_ADDRESS);\n myDatabase.createTable(TABLE_SINK, name_type_map, primaryKey, null);\n }catch (MySQLException e){ //数据表已存在\n e.print();\n }\n try {\n name_type_map.clear();\n name_type_map.put(KEY_NODE_NAME, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_NODE_PARENT, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_NODE_DETAIL, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_NODE_ADDRESS,MyDatabase.TYPE_VARCHAR);\n primaryKey.clear();\n primaryKey.add(KEY_NODE_PARENT);\n primaryKey.add(KEY_NODE_ADDRESS);\n myDatabase.createTable(TABLE_NODE, name_type_map, primaryKey, null);\n }catch (MySQLException e){\n e.print();\n }\n\n try {\n name_type_map.clear();\n name_type_map.put(KEY_NODE_ADDRESS, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_NODE_PARENT, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_DATA_TIME, MyDatabase.TYPE_TIMESTAMP);\n name_type_map.put(KEY_DATA_VAL, MyDatabase.TYPE_FLOAT);\n primaryKey.clear();\n primaryKey.add(KEY_DATA_TIME);\n primaryKey.add(KEY_NODE_ADDRESS);\n primaryKey.add(KEY_NODE_PARENT);\n myDatabase.createTable(TABLE_DATA, name_type_map, primaryKey, null);\n }catch (MySQLException e) {\n e.print();\n }\n }",
"public void CreateTable(String nameTable) throws SQLException {\n\n String FEATURE_DB_SQL = \"CREATE TABLE IF NOT EXISTS \" + nameTable + \"(id INT NOT NULL AUTO_INCREMENT, \"\n + FEATURE_DB_TEXTFEATURE + \" VARCHAR(255), \" + FEATURE_DB_ELO + \" INT, \" + FEATURE_DB_MMR + \" INT,\"\n + FEATURE_DB_AUTHOR + \" VARCHAR(255),\"\n +\" PRIMARY KEY ( id ))\";\n\n statement = conn.createStatement();\n statement.executeUpdate(FEATURE_DB_SQL);\n }",
"tbls createtbls();",
"private void createTable() {\n\t\t// Tao dataModel & table \n\t\tdataModel = new DefaultTableModel(headers, 0);\n\t\ttable.setModel(dataModel);\n\t\t\n\t\tnapDuLieuChoBang();\n\t}",
"public void createTable() throws DatabaseException\n\t{\n\t\tConnection connection = DatabaseManager.getSingleton().getConnection();\n\t\ttry\n\t\t{\n\t\t\tClosingPreparedStatement stmt = new ClosingPreparedStatement(connection,\n\t\t\t\t\t\"DROP TABLE IF EXISTS QuestStates\");\n\t\t\tstmt.executeUpdate();\n\t\t\tstmt.close();\n\n\t\t\tstmt = new ClosingPreparedStatement(connection,\n\t\t\t\t\t\"Create TABLE QuestStates (playerID INT NOT NULL, questID INT NOT NULL , questState INT NOT NULL, needingNotification BOOLEAN NOT NULL)\");\n\t\t\tstmt.executeUpdate();\n\t\t} catch (SQLException e)\n\t\t{\n\t\t\tthrow new DatabaseException(\"Unable to create the Quest table\", e);\n\t\t}\n\t}",
"public void createNewTable() throws WoodsException{\n\t\t\tuserTable = new Table(tableName);\n\t\t\tDatabase.get().storeTable(tableName, userTable);\n\t\t}",
"public void createTable(DBTableDescriptor desc)\n throws IOException {\n createTable(desc, null);\n }",
"@Override\r\n public void createTable() {\n String sql = \"create table \" + TABLE_NAME + \"(\";\r\n sql += ID + \" INTEGER primary key,\";\r\n sql += NAME + \" VARCHAR(50),\";\r\n sql += LON + \" FLOAT(10,6),\";\r\n sql += LAT + \" FLOAT(10,6)\";\r\n sql += \")\";\r\n database.execSQL(sql);\r\n }",
"public void createTable(Table table) throws SQLException {\n mysql.update(table.getCreateTableString());\n }",
"public String createTable(){\r\n return \"CREATE TABLE Doctor \" +\r\n \"(idDoctor decimal primary key, \" +\r\n \"firstNameDoctor char(14), \" +\r\n \"lastNameDoctor char(14), \" +\r\n \"costPerVisit integer,\" +\r\n \"qualification varchar(32))\";\r\n }",
"public interface TableCreator {\n\t\tpublic void createTable(SQLiteDatabase db, String tableName);\n\t}",
"@Override\n public void setUp() throws SQLException {\n connection.createStatement().executeUpdate(\n \"CREATE TABLE IF NOT EXISTS \\\"ENTRY\\\" (\" +\n \"\\\"SHARED_ID\\\" SERIAL PRIMARY KEY, \" +\n \"\\\"TYPE\\\" VARCHAR, \" +\n \"\\\"VERSION\\\" INTEGER DEFAULT 1)\");\n\n connection.createStatement().executeUpdate(\n \"CREATE TABLE IF NOT EXISTS \\\"FIELD\\\" (\" +\n \"\\\"ENTRY_SHARED_ID\\\" INTEGER REFERENCES \\\"ENTRY\\\"(\\\"SHARED_ID\\\") ON DELETE CASCADE, \" +\n \"\\\"NAME\\\" VARCHAR, \" +\n \"\\\"VALUE\\\" TEXT)\");\n\n connection.createStatement().executeUpdate(\n \"CREATE TABLE IF NOT EXISTS \\\"METADATA\\\" (\"\n + \"\\\"KEY\\\" VARCHAR,\"\n + \"\\\"VALUE\\\" TEXT)\");\n }",
"private void createTables() throws DatabaseAccessException {\n\t\tStatement stmt = null;\n\t\tPreparedStatement prepStmt = null;\n\n\t\ttry {\n\t\t\tstmt = this.connection.createStatement();\n\n\t\t\t// be sure to drop all tables in case someone manipulated the database manually\n\t\t\tstmt.executeUpdate(\"DROP TABLE IF EXISTS DynamicConstraints;\");\n\t\t\tstmt.executeUpdate(\"DROP TABLE IF EXISTS Features;\");\n\t\t\tstmt.executeUpdate(\"DROP TABLE IF EXISTS Groups;\");\n\t\t\tstmt.executeUpdate(\"DROP TABLE IF EXISTS Metadata;\");\n\t\t\tstmt.executeUpdate(\"DROP TABLE IF EXISTS Objects;\");\n\t\t\tstmt.executeUpdate(\"DROP TABLE IF EXISTS StaticConstraints;\");\n\t\t\tstmt.executeUpdate(\"DROP TABLE IF EXISTS Subspaces;\");\n\n\t\t\t// populate database with tables.. by using ugly sql\n\t\t\tstmt.executeUpdate(\"CREATE TABLE DynamicConstraints(Id INTEGER PRIMARY KEY AUTOINCREMENT,\"\n\t\t\t\t\t+ \" Operator INTEGER, FeatureReference INTEGER,\"\n\t\t\t\t\t+ \" GroupReference INTEGER, Value FLOAT, Active BOOLEAN);\");\n\t\t\tstmt.executeUpdate(\"CREATE TABLE Features(Id INTEGER PRIMARY KEY AUTOINCREMENT,\" + \" Name VARCHAR(\"\n\t\t\t\t\t+ DatabaseConfiguration.VARCHARLENGTH + \"), OutlierFlag BOOLEAN, Min FLOAT, Max FLOAT);\");\n\t\t\tstmt.executeUpdate(\"CREATE TABLE Groups(Id INTEGER PRIMARY KEY AUTOINCREMENT, Name VARCHAR(\"\n\t\t\t\t\t+ DatabaseConfiguration.VARCHARLENGTH + \"),\"\n\t\t\t\t\t+ \" Visibility BOOLEAN, Color INTEGER, ColorCalculatedByFeature INTEGER, Description TEXT);\");\n\t\t\tstmt.executeUpdate(\"CREATE TABLE Metadata(Version INTEGER);\");\n\n\t\t\t// Object table is created in initFeatures, to boost performance\n\n\t\t\tstmt.executeUpdate(\"CREATE TABLE StaticConstraints(Id INTEGER, GroupReference INTEGER,\"\n\t\t\t\t\t+ \" ObjectReference INTEGER, Active BOOLEAN);\");\n\t\t\tstmt.executeUpdate(\"CREATE TABLE Subspaces(Id INTEGER, FeatureReference INTEGER,\" + \" Name VARCHAR(\"\n\t\t\t\t\t+ DatabaseConfiguration.VARCHARLENGTH + \"));\");\n\n\t\t\tstmt.close();\n\n\t\t\t// after creating the tables, write the layout version\n\t\t\tprepStmt = this.connection.prepareStatement(\"INSERT INTO Metadata VALUES(?);\");\n\t\t\tprepStmt.setInt(1, DatabaseConfiguration.LAYOUTVERSION);\n\t\t\tprepStmt.execute();\n\n\t\t\tprepStmt.close();\n\n\t\t} catch (SQLException e) {\n\t\t\tthrow new DatabaseAccessException(Failure.LAYOUT);\n\t\t}\n\t}",
"public void createTable(Database database) throws SQLException{\n\t\tdatabase.createTable(PEOPLE_TABLE_NAME, PEOPLE_TABLE_CREATION_ARGS);\n\t}",
"@Override\n public void createUsersTable() {\n\n\n Session session = sessionFactory.openSession();\n Transaction transaction = session.beginTransaction();\n session.createSQLQuery(\"CREATE TABLE IF NOT EXISTS Users \" +\n \"(Id BIGINT PRIMARY KEY AUTO_INCREMENT, FirstName TINYTEXT , \" +\n \"LastName TINYTEXT , Age TINYINT)\").executeUpdate();\n transaction.commit();\n session.close();\n\n\n }",
"public void createNewTable(String dbName, String tableName) {\r\n\t\t// SQL statement for creating a new table\r\n\t\tString sql = \"CREATE TABLE IF NOT EXISTS \" + tableName + \" (\\n\"\r\n\t\t\t\t+ \"id integer PRIMARY KEY,\\n\"\r\n\t\t\t\t+ \"first_name VARCHAR(20) NOT NULL,\\n\"\r\n\t\t\t\t+ \"last_name VARCHAR(20) NOT NULL,\\n\"\r\n\t\t\t\t+ \"manager_id integer NOT NULL,\\n\"\r\n\t\t\t\t+ \"join_date DATE NOT NULL,\\n\"\r\n\t\t\t\t+ \"billable_hours double NOT NULL);\";\r\n\t\t\r\n\t\ttry {\r\n\t\t\tConnection conn = this.connect(dbName);\t\t\t// open connection\r\n\t\t\t\r\n\t\t\tStatement stmt = conn.createStatement();\r\n\t\t\t\r\n\t\t\t// create a new table using prepared sql statement\r\n\t\t\tstmt.execute(sql);\r\n\t\t\tSystem.out.println(\"Executed create table statement\");\r\n\t\t\t\r\n\t\t\tconn.close();\t\t\t\t\t\t\t\t\t// close connection\r\n\t\t} catch (SQLException e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t}",
"@Override\n public void createTable(final Connection _con, final String _table,\n final String _parentTable) throws SQLException {\n\n final Statement stmt = _con.createStatement();\n\n try {\n\n // create table itself\n final StringBuilder cmd = new StringBuilder();\n cmd.append(\"create table \").append(_table).append(\" (\")\n .append(\" ID bigint not null\");\n\n // autoincrement\n if (_parentTable == null) {\n cmd.append(\" generated always as identity (start with 1, increment by 1)\");\n }\n\n cmd.append(\",\")\n .append(\" constraint \").append(_table).append(\"_UK_ID unique(ID)\");\n\n // foreign key to parent sql table\n if (_parentTable != null) {\n cmd.append(\",\")\n .append(\"constraint \").append(_table).append(\"_FK_ID \")\n .append(\" foreign key(ID) \")\n .append(\" references \").append(_parentTable).append(\"(ID)\");\n }\n\n cmd.append(\")\");\n stmt.executeUpdate(cmd.toString());\n\n } finally {\n stmt.close();\n }\n }",
"private void createTables() {\n\n\t\tAutoDao.createTable(db, true);\n\t\tAutoKepDao.createTable(db, true);\n\t\tMunkaDao.createTable(db, true);\n\t\tMunkaEszkozDao.createTable(db, true);\n\t\tMunkaKepDao.createTable(db, true);\n\t\tMunkaTipusDao.createTable(db, true);\n\t\tPartnerDao.createTable(db, true);\n\t\tPartnerKepDao.createTable(db, true);\n\t\tProfilKepDao.createTable(db, true);\n\t\tSoforDao.createTable(db, true);\n\t\tTelephelyDao.createTable(db, true);\n\t\tPushMessageDao.createTable(db, true);\n\n\t}",
"public void createTable(Class<?> clz) {\n\t\tcreateTable(getWritableDatabase(), clz);\n\t}",
"public void createNewTable() {\n String dropOld = \"DROP TABLE IF EXISTS card;\";\n\n // SQL statement for creating a new table\n String sql = \"CREATE TABLE IF NOT EXISTS card (\\n\"\n + \"id INTEGER PRIMARY KEY AUTOINCREMENT, \\n\"\n + \"number TEXT, \\n\"\n + \"pin TEXT,\\n\"\n + \"balance INTEGER DEFAULT 0\"\n + \");\";\n\n try (Connection connection = connect();\n Statement stmt = connection.createStatement()) {\n\n //drop old table\n stmt.execute(dropOld);\n\n //create a new table\n stmt.execute(sql);\n } catch (SQLException e) {\n System.out.println(\"Exception3: \" + e.getMessage());\n }\n }",
"private void createStocksTable() {\n\t\ttry {\n\t\t\tStatement stmt = this.conn.createStatement();\n\t\t\tstmt.executeUpdate(\"CREATE TABLE stocks \"\n\t\t\t\t\t+ \"(id BIGINT GENERATED ALWAYS AS IDENTITY, \" + \"owner INT, \"\n\t\t\t\t\t+ \"shareAmount INT, \" + \"purchasePrice DOUBLE, \" + \"symb VARCHAR(10), \"\n\t\t\t\t\t+ \"timePurchased BIGINT)\");\n\t\t\tconn.commit();\n\t\t\tSystem.out.println(\"Created table stocks\");\n\t\t} catch (SQLException sqle) {\n\t\t\tSystem.err.println(\"Creation of stocks table FAILED\");\n\t\t\tSystem.err.println(sqle);\n\t\t}\n\t}",
"@Override\n public void createMetaTable(Connection conn) throws PersistenceException {\n String sql = String.format(\"CREATE TABLE %1$s (%2$s %3$s NOT NULL)\", metaTableName, META_TABLE_DATA_COLUMN, config.dataColumnType());\n executeUpdateSql(conn, sql);\n updateMetaTable(conn);\n }",
"@Override\n\tpublic String createTable() {\n\t\t\t\treturn \"CREATE TABLE history_table_view(id number(8) primary key not null ,sqltext text, pointid varchar2(1024), type varchar2(100))\";\n\t}",
"private void createStressTestStatusTable() {\n Column runId = new Column(\"RUN_ID\");\n runId.setMappedType(\"INTEGER\");\n runId.setPrimaryKey(true);\n runId.setRequired(true);\n Column nodeId = new Column(\"NODE_ID\");\n nodeId.setMappedType(\"VARCHAR\");\n nodeId.setPrimaryKey(true);\n nodeId.setRequired(true);\n nodeId.setSize(\"50\");\n Column status = new Column(\"STATUS\");\n status.setMappedType(\"VARCHAR\");\n status.setSize(\"10\");\n status.setRequired(true);\n status.setDefaultValue(\"NEW\");\n Column startTime = new Column(\"START_TIME\");\n startTime.setMappedType(\"TIMESTAMP\");\n Column endTime = new Column(\"END_TIME\");\n endTime.setMappedType(\"TIMESTAMP\");\n\n Table table = new Table(STRESS_TEST_STATUS, runId, nodeId, status, startTime, endTime);\n\n engine.getDatabasePlatform().createTables(true, true, table);\n }",
"@Override\n\tpublic void onCreate(SQLiteDatabase sdb) {\n\t\tsdb.execSQL(CREATE_QUERY);\n\t\tLog.d(\"DB ops: \", \"Table Created \");\n\t}",
"@Override\n public void createTable() throws Exception {\n }",
"public MonthlyValuesTable(Database database) \n {\n //Constructor calls DbTable's constructor\n super(database);\n setTableName(\"monthlyvalues\");\n }",
"public void createTables()\n {\n String[] sqlStrings = createTablesStatementStrings();\n String sqlString;\n Statement statement;\n\n System.out.println(\"Creating table(s):\" +\n Arrays.toString(tableNames));\n for (int i=0; i<sqlStrings.length; i++)\n try\n {\n statement = connect.createStatement();\n\n sqlString = sqlStrings[i];\n\n System.out.println(\"SQL: \" + sqlString);\n\n statement.executeUpdate(sqlString);\n }\n catch (SQLException ex)\n {\n System.out.println(\"Error creating table: \" + ex);\n Logger.getLogger(DatabaseManagementDAO.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"protected abstract void initialiseTable();",
"@Override\n\tpublic void onCreate(SQLiteDatabase db, ConnectionSource source) {\n\n\t\ttry {\n\t\t\tTableUtils.createTable(source, Priority.class);\n\t\t\tTableUtils.createTable(source, Category.class);\n\t\t\tTableUtils.createTable(source, Task.class);\n\t\t} catch (SQLException ex) {\n\t\t\tLog.e(LOG, \"error creating tables\", ex);\n\t\t}\n\n\t}",
"protected void createInitialTables() throws SQLException {\n\t\n\t\t// create one table per type with the corresponding attributes\n\t\tfor (String type: entityType2attributes.keySet()) {\n\t\t\tcreateTableForEntityType(type);\n\t\t}\n\t\t\n\t\t// TODO indexes !\n\t\t\n\t}",
"public void setupDB()\r\n\t{\n\tjdbcTemplateObject.execute(\"DROP TABLE IF EXISTS employee1 \");\r\n\r\n\tjdbcTemplateObject.\r\n\texecute(\"CREATE TABLE employee1\"\r\n\t+ \"(\" + \"name VARCHAR(255), id SERIAL)\");\r\n\t}",
"public void createNewDataBase() {\n try (Connection conn = DriverManager.getConnection(url)) {\n if (conn != null) {\n DatabaseMetaData meta = conn.getMetaData();\n createNewTable();\n }\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }",
"@Override\n public void createTable() {\n String[] TABLE_COLUMNS_ATLAS = {\n TableColumn.ChecklistTable.CID + \" INTEGER PRIMARY KEY AUTOINCREMENT\",\n TableColumn.ChecklistTable.PID + \" INTEGER NOT NULL\",\n TableColumn.ChecklistTable.REAL + \" INTEGER DEFAULT 0\",\n TableColumn.ChecklistTable.UNIT_ID + \" INTEGER\",\n TableColumn.ChecklistTable.WAREHOUSE_ID + \" INTEGER\",\n TableColumn.ChecklistTable.QUEUE_ID + \" INTEGER\",\n TableColumn.ChecklistTable.CATEGORIES_ID + \" INTEGER\",\n TableColumn.ChecklistTable.DATE + \" DATE\",\n TableColumn.ChecklistTable.RECORDTIME + \" DATE\",\n TableColumn.ChecklistTable.CONFIRM + \" INTEGER DEFAULT 0\"\n };\n\n //TODO: create table\n database.execSQL(makeSQLCreateTable(TABLE_NAME, TABLE_COLUMNS_ATLAS));\n\n addColumn(TableColumn.ChecklistTable.CONFIRM, \" INTEGER DEFAULT 0\");\n\n //TODO: show table\n XCursor cursor = selectTable();\n printData(TABLE_NAME, cursor);\n cursor.close();\n }",
"public void creatTable(String tableName,LinkedList<String> columnsName,LinkedList<String> columnsType );",
"public void createNewTable() {\n // SQL statement for creating a new table\n String sql = \"CREATE TABLE IF NOT EXISTS card (\\n\"\n + \" id INTEGER PRIMARY KEY AUTOINCREMENT,\\n\"\n + \" number TEXT,\\n\"\n + \" pin TEXT,\\n\"\n + \" balance INTEGER DEFAULT 0\\n\"\n + \");\";\n\n try (Connection conn = DriverManager.getConnection(url);\n Statement stmt = conn.createStatement()) {\n // create a new table\n stmt.execute(sql);\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }",
"public static String getSQLForUserTableCreation() {\n return \"CREATE TABLE \" + USER_TABLE + \"(\" +\n USER_ID + \" varchar(8) PRIMARY KEY, \" +\n USER_LAST_NAME + \" varchar(32), \" +\n USER_FIRST_NAME + \" varchar(32), \" +\n USER_EMAIL + \" varchar(256), \" +\n USER_PASSWORD + \" varchar(64), \" +\n USER_IS_TEACHER + \" bool, \" +\n USER_GROUP + \" varchar(32))\";\n\n }",
"@Override\n public SqlDatabaseTable createTable(String tableName, int columnCount, boolean dropExist) {\n StringBuilder sql = new StringBuilder();\n if (dropExist) {\n sql.append(\"DROP TABLE IF EXISTS `\").append(tableName).append(\"`;\");\n executeSql(sql.toString());\n sql.setLength(0);\n }\n\n // Ignored check because only one statement is executed\n // if (!dropExist && SqlStorageEngine.getInstance().checkTableExist(tableName))\n\n sql.append(\"CREATE TEMPORARY TABLE\");\n if (!dropExist) {\n sql.append(\" IF NOT EXISTS\");\n }\n sql.append(\" `\").append(tableName).append(\"`\");\n sql.append(\" ( `id` INT NOT NULL AUTO_INCREMENT, `uniq` CHAR(32) NOT NULL UNIQUE,\");\n for (int i = 0; i < columnCount; i++) {\n sql.append(\" `_\").append(i).append(\"` VARCHAR(32) NULL,\");\n sql.append(\"INDEX (`_\").append(i).append(\"`),\");\n }\n sql.append(\" PRIMARY KEY (`id`)) ENGINE = MEMORY;\");\n executeSql(sql.toString());\n\n // Ignore this, we use create clause to create index\n // createIndexes(tableName, columnCount);\n\n return new SqlDatabaseRefTable(tableName, columnCount);\n }",
"FromTable createFromTable();",
"@Override\n\t\tpublic void onCreate(SQLiteDatabase database) {\n\t\t\tcreateTable(database);\n\n\t\t}",
"@Override\n\tpublic void createTable() {\n\t\tSystem.out.println(\"++++++++++++++++++++++++++++++++++++++++++++++\");\n\t\ttry {\n\t\t\tTableUtils.createTable(connectionSource, UserEntity.class);\n\t\t\tTableUtils.createTable(connectionSource, Downloads.class);\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\");\n\t\t}\n\t}",
"@Override\n\tpublic void onCreate(SQLiteDatabase sdb) {\n\t\tsdb.execSQL(CREATE_QUERY);\n\t\tLog.d(\"Database operations\", \"table created\");\n\t}",
"@Override\n\tpublic void onCreate(SQLiteDatabase db, ConnectionSource connectionSource) {\n\t\tthis.connectionSource = connectionSource;\n\t\tcreateTable();\n\t}",
"public void createTable(String tableName) {\n db.execSQL(\"create table if not exists '\" + tableName.replaceAll(\"\\\\s\", \"_\") + \"' (\"\n + KEY_ROWID + \" integer primary key autoincrement, \"\n + KEY_QUESTION + \" string not null, \"\n + KEY_ANSWER + \" string not null);\");\n }",
"public static void createTable(SQLiteDatabase db) {\n String sql = \"CREATE TABLE \" + TABLE_NAME + \"(\"\n + _ID + \" INTEGER PRIMARY KEY, \"\n + COL_DATE + \" DATETIME, \"\n + COL_RESULT + \" TEXT, \"\n + COL_UNIT + \" TEXT, \"\n + COL_ROW + \" TEXT\"\n + \");\";\n\n db.execSQL(sql);\n }",
"public void createDepartamentoTable() throws SQLException {\n\t\tString sql = \"create table departamento (piso int, depto varchar(100), expensas double,\ttitular varchar(100))\";\n\t\tConnection c = DBManager.getInstance().connect();\n\t\tStatement s = c.createStatement();\n\t\ts.executeUpdate(sql);\n\t\tc.commit();\n\t\t\t\n\t}",
"public static void createTable() throws SQLException, UserExceptionClass {\n\t\tfinal String query = Constants.CREATE_QUERY;\n\t\tDBOperation.updateQueries(query);\n\t}",
"private void statsTable() {\n try (Connection connection = hikari.getConnection()) {\n try (PreparedStatement statement = connection.prepareStatement(\"CREATE TABLE IF NOT EXISTS `\" + TABLE_STATS + \"` \" +\n \"(id INT NOT NULL AUTO_INCREMENT UNIQUE, \" +\n \"uuid varchar(255) PRIMARY KEY, \" +\n \"name varchar(255), \" +\n \"kitSelected varchar(255), \" +\n \"points INT, \" +\n \"kills INT, \" +\n \"deaths INT, \" +\n \"killstreaks INT, \" +\n \"currentKillStreak INT, \" +\n \"inGame BOOLEAN)\")) {\n statement.execute();\n statement.close();\n connection.close();\n }\n } catch (SQLException e) {\n LogHandler.getHandler().logException(\"TableCreator:statsTable\", e);\n }\n }",
"public TableCreate tableCreate(String tableName, String primaryKey, Durability durability, String datacenter) {\n OptionalArguments optionalArguments = new OptionalArguments()\n .with(\"datacenter\", datacenter)\n .with(\"primary_key\", primaryKey)\n .with(\"durability\", durability == null ? null : durability.toString());\n\n return new TableCreate(this, new Arguments(tableName), optionalArguments);\n }",
"private void createDB() {\n try {\n Statement stat = conn.createStatement();\n stat.execute(\"CREATE TABLE settings (name TEXT, state);\");\n stat.execute(\"CREATE TABLE expressions (id INTEGER PRIMARY KEY ASC AUTOINCREMENT, expression TEXT);\");\n stat.execute(\"CREATE TABLE summaries (id INTEGER PRIMARY KEY ASC, expression_id INTEGER, title TEXT, abstract TEXT);\");\n stat.execute(\"CREATE TABLE history (id INTEGER PRIMARY KEY ASC AUTOINCREMENT, expression TEXT);\");\n } catch (SQLException e) {\n System.err.println(e.getClass().getName() + \": \" + e.getMessage());\n System.exit(0);\n }\n }",
"public void createVirtualTable(){\n\n\t\t\n\t\tif(DBHandler.getConnection()==null){\n\t\t\treturn;\n\t\t}\n\n\t\tif(DBHandler.tableExists(name())){\n\t\t\treturn;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tStatement s = DBHandler.getConnection().createStatement();\n\t\t\ts.execute(\"create virtual table \"+name()+\" using fts4(\"+struct()+\")\");\n\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\tMainFrame.print(e.getMessage());\n\t\t}\n\t}",
"@Override\n\t\t\tpublic void onCreate(SQLiteDatabase arg0) {\n\t\t\t\tString CREATE_TABLE = \"create table \" +TB_NAME +\n\t\t\t\t\t\"( \" +\n\t\t\t\t\tT_SID+\" integer,\" +\n\t\t\t\t\tT_PID+\" integer,\" +\n\t\t\t\t\tT_VALUE+\" text not null,\" +\n\t\t\t\t\t\")\";\n\t\t\t\targ0.execSQL(CREATE_TABLE);\n\t\t\t}",
"public static void CreateTable(Supermarket supermarket) throws SQLException {\r\n\t\tPreparedStatement statement = null;\r\n\t\tString market_name = supermarket.getSuper_name();\r\n\t\ttry {\r\n\t\t\tString query = \"CREATE TABLE CS_\"+market_name+\"(\"\r\n\t\t\t\t\t+ \"PRODUCT_NAME VARCHAR(30) NOT NULL,\"\r\n\t\t\t\t\t+ \"PRODUCT_COMPANY VARCHAR(30) NOT NULL,\"\r\n\t\t\t\t\t+ \"PRODUCT_EXIST BOOLEAN DEFAULT FALSE,\"\r\n\t\t\t\t\t+ \"PRODUCT_PRICE DOUBLE DEFAULT 0,\"\r\n\t\t\t\t\t+ \"PRODUCT_CATEGORY VARCHAR(30) NOT NULL\"\r\n\t\t\t\t\t+ \");\";\r\n\t\t\tstatement = JdbcCommon.connection.prepareStatement(query);\r\n\t\t\tstatement.executeUpdate();\r\n\t\t} catch (SQLException e) {e.printStackTrace();}\r\n\t\tstatement.close();\r\n\t}",
"private void createTableOrdersWaiting() throws SQLException\r\n {\r\n String sqlQuery = \r\n \"CREATE TABLE orders \" +\r\n \"(id auto_increment INT NOT NULL PRIMARY KEY, \" +\r\n \"custname VARCHAR(25) NOT NULL, \" +\r\n \"tablenumber INT NOT NULL, \" +\r\n \"foodname VARCHAR(100) NOT NULL, \" + \r\n \"beveragename VARCHAR(100) NOT NULL, \" + \r\n \"served BOOLEAN NOT NULL, \" + \r\n \"billed BOOLEAN NOT NULL, \" + \r\n \"time DATETIME DEFAULT CURRENT_TIMESTAMP)\";\r\n myStmt.executeUpdate(sqlQuery);\r\n }",
"BTable createBTable();",
"@Override\r\n\tpublic void createTable(Connection con) throws SQLException {\r\n\t\tString sql = \"CREATE TABLE \" + tableName\r\n\t\t\t\t+ \"(pc_id integer, class_id varchar(20), level integer,\"\r\n\t\t\t\t+ \" PRIMARY KEY (pc_id,class_id,level) )\";\r\n\r\n\t\tif (DbUtils.doesTableExist(con, tableName)) {\r\n\r\n\t\t} else {\r\n\t\t\ttry (PreparedStatement ps = con.prepareStatement(sql);) {\r\n\t\t\t\tps.execute();\r\n\t\t\t}\r\n \r\n\t\t}\r\n\r\n\r\n\r\n\t\tString[] newInts = new String[] { \r\n\t\t\t\t\"hp_Increment\",};\r\n\t\tDAOUtils.createInts(con, tableName, newInts);\r\n\r\n\t}",
"public void createTableIfAbsent() {\n try (Statement statement = connection.createStatement()) {\n\n statement.executeUpdate(\"CREATE TABLE IF NOT EXISTS `BookReview`(\" +\n \" id INTEGER PRIMARY KEY AUTOINCREMENT,\" +\n \" title VARCHAR(100),\" +\n \" author_id INTEGER,\" +\n \" FOREIGN KEY (`author_id`) REFERENCES `authors`(`id`)\" +\n \")\");\n\n } catch (SQLException e) {\n throw new BookDaoException(e);\n }\n }",
"public void createAccountTable() throws SQLException {\r\n\t\tConnection connection = dbAdministration.getConnection();\r\n\t\t// Prüfung, ob Tabelle bereits besteht\r\n\t\tResultSet resultSet = connection.getMetaData().getTables(\"%\", \"%\", \"%\", new String[] { \"TABLE\" });\r\n\t\tboolean shouldCreateTable = true;\r\n\t\twhile (resultSet.next() && shouldCreateTable) {\r\n\t\t\tif (resultSet.getString(\"TABLE_NAME\").equalsIgnoreCase(\"ACCOUNT\")) {\r\n\t\t\t\tshouldCreateTable = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\tresultSet.close();\r\n\r\n\t\tif (shouldCreateTable) {\r\n\t\t\tStatement statement = connection.createStatement();\r\n\t\t\tString sql = \"CREATE table account (id int not null primary key, owner varchar(\"\r\n\t\t\t\t\t+ DatabaseAdministration.ownerLength + \") not null, number varchar(4) not null)\";\r\n\t\t\t// Tabelle wird erstellt\r\n\t\t\tstatement.execute(sql);\r\n\t\t\tstatement.close();\r\n\t\t\tlogger.info(\"SQL-Statement ausgeführt: \" + sql);\r\n\t\t\tlogger.info(\"Tabelle \\\"Account\\\" wurde erstellt.\");\r\n\t\t\tbankAccountExists = false;\r\n\t\t\t// Das Bank-Konto wird angelegt\r\n\t\t\taddAccount(\"0000\", \"BANK\", BigDecimal.ZERO);\r\n\t\t\tbankAccountExists = true;\r\n\t\t}\r\n\t\tconnection.close();\r\n\t}",
"public static void createTable(SQLiteDatabase db, Class<?> clz) {\n// StringBuilder builder=new StringBuilder();\n// Field[] fields=clz.getDeclaredFields();\n// for (int i=0;i<fields.length;i++){\n// Field field=fields[i];\n// builder.append(getOneColumnStmt(field));\n// if (i!=fields.length-1)\n// builder.append(\",\");\n// }\n// String sql=\"create table \"+getTableName(clz)+\"(\"+builder+\")\";\n// db.execSQL(sql);\n ArrayList<String> stmts=getCreateTableStmt(clz);\n for (String stmt:stmts) {\n db.execSQL(stmt);\n }\n }",
"public static void createTable(Database db, boolean ifNotExists) {\n String constraint = ifNotExists? \"IF NOT EXISTS \": \"\";\n db.execSQL(\"CREATE TABLE \" + constraint + \"\\\"FITTING_TABLE\\\" (\" + //\n \"\\\"NAME\\\" TEXT PRIMARY KEY NOT NULL ,\" + // 0: name\n \"\\\"DB_NAME\\\" TEXT,\" + // 1: dbName\n \"\\\"CATEGORY\\\" TEXT,\" + // 2: category\n \"\\\"DES\\\" TEXT,\" + // 3: des\n \"\\\"LAYOUT_RESOURCE_ID\\\" INTEGER);\"); // 4: layoutResourceID\n }",
"@Override\n\tpublic void onCreate(SQLiteDatabase database) {\n\t\tAppDBTableCreation.onCreate(database);\n\t}",
"private void processCreateTable(int type) throws HsqlException {\n\n String token = tokenizer.getName();\n HsqlName schemaname =\n session.getSchemaHsqlNameForWrite(tokenizer.getLongNameFirst());\n\n database.schemaManager.checkUserTableNotExists(session, token,\n schemaname.name);\n\n boolean isnamequoted = tokenizer.wasQuotedIdentifier();\n int[] pkCols = null;\n int colIndex = 0;\n boolean constraint = false;\n Table t = newTable(type, token, isnamequoted, schemaname);\n\n tokenizer.getThis(Token.T_OPENBRACKET);\n\n while (true) {\n token = tokenizer.getString();\n\n switch (Token.get(token)) {\n\n case Token.CONSTRAINT :\n case Token.PRIMARY :\n case Token.FOREIGN :\n case Token.UNIQUE :\n case Token.CHECK :\n\n // fredt@users : check for quoted reserved words used as column names\n constraint = !tokenizer.wasQuotedIdentifier()\n && !tokenizer.wasLongName();\n }\n\n tokenizer.back();\n\n if (constraint) {\n break;\n }\n\n Column newcolumn = processCreateColumn();\n\n t.addColumn(newcolumn);\n\n if (newcolumn.isPrimaryKey()) {\n Trace.check(pkCols == null, Trace.SECOND_PRIMARY_KEY,\n newcolumn.columnName.name);\n\n pkCols = new int[]{ colIndex };\n }\n\n token = tokenizer.getSimpleToken();\n\n if (token.equals(Token.T_COMMA)) {\n colIndex++;\n\n continue;\n }\n\n if (token.equals(Token.T_CLOSEBRACKET)) {\n break;\n }\n\n throw Trace.error(Trace.UNEXPECTED_TOKEN, token);\n }\n\n HsqlArrayList tempConstraints = processCreateConstraints(t,\n constraint, pkCols);\n\n if (tokenizer.isGetThis(Token.T_ON)) {\n if (!t.isTemp) {\n throw Trace.error(Trace.UNEXPECTED_TOKEN, Token.T_ON);\n }\n\n tokenizer.getThis(Token.T_COMMIT);\n\n token = tokenizer.getSimpleToken();\n\n if (token.equals(Token.T_DELETE)) {}\n else if (token.equals(Token.T_PRESERVE)) {\n t.onCommitPreserve = true;\n } else {\n throw Trace.error(Trace.UNEXPECTED_TOKEN, token);\n }\n\n tokenizer.getThis(Token.T_ROWS);\n }\n\n try {\n session.commit();\n\n Constraint primaryConst = (Constraint) tempConstraints.get(0);\n\n t.createPrimaryKey(null, primaryConst.core.mainColArray, true);\n\n if (primaryConst.core.mainColArray != null) {\n if (primaryConst.constName == null) {\n primaryConst.constName = t.makeSysPKName();\n }\n\n Constraint newconstraint =\n new Constraint(primaryConst.constName, t,\n t.getPrimaryIndex(),\n Constraint.PRIMARY_KEY);\n\n t.addConstraint(newconstraint);\n database.schemaManager.registerConstraintName(\n primaryConst.constName.name, t.getName());\n }\n\n for (int i = 1; i < tempConstraints.size(); i++) {\n Constraint tempConst = (Constraint) tempConstraints.get(i);\n\n if (tempConst.constType == Constraint.UNIQUE) {\n TableWorks tableWorks = new TableWorks(session, t);\n\n tableWorks.createUniqueConstraint(\n tempConst.core.mainColArray, tempConst.constName);\n\n t = tableWorks.getTable();\n }\n\n if (tempConst.constType == Constraint.FOREIGN_KEY) {\n TableWorks tableWorks = new TableWorks(session, t);\n\n tableWorks.createForeignKey(tempConst.core.mainColArray,\n tempConst.core.refColArray,\n tempConst.constName,\n tempConst.core.refTable,\n tempConst.core.deleteAction,\n tempConst.core.updateAction);\n\n t = tableWorks.getTable();\n }\n\n if (tempConst.constType == Constraint.CHECK) {\n TableWorks tableWorks = new TableWorks(session, t);\n\n tableWorks.createCheckConstraint(tempConst,\n tempConst.constName);\n\n t = tableWorks.getTable();\n }\n }\n\n database.schemaManager.linkTable(t);\n } catch (HsqlException e) {\n\n// fredt@users 20020225 - comment\n// if a HsqlException is thrown while creating table, any foreign key that has\n// been created leaves it modification to the expTable in place\n// need to undo those modifications. This should not happen in practice.\n database.schemaManager.removeExportedKeys(t);\n database.schemaManager.removeIndexNames(t.tableName);\n database.schemaManager.removeConstraintNames(t.tableName);\n\n throw e;\n }\n }",
"public void createDataTable() {\r\n Log.d(TAG, \"creating table\");\r\n String queryStr = \"\";\r\n String[] colNames = {Constants.COLUMN_NAME_ACC_X, Constants.COLUMN_NAME_ACC_Y, Constants.COLUMN_NAME_ACC_Z};\r\n queryStr += \"create table if not exists \" + Constants.TABLE_NAME;\r\n queryStr += \" ( id INTEGER PRIMARY KEY AUTOINCREMENT, \";\r\n for (int i = 1; i <= 50; i++) {\r\n for (int j = 0; j < 3; j++)\r\n queryStr += colNames[j] + \"_\" + i + \" real, \";\r\n }\r\n queryStr += Constants.COLUMN_NAME_ACTIVITY + \" text );\";\r\n execute(queryStr);\r\n Log.d(TAG, \"created table\");\r\n try {\r\n ContentValues values = new ContentValues();\r\n values.put(\"id\", 0);\r\n insertRowInTable(Constants.TABLE_NAME, values);\r\n Log.d(TAG,\"created hist table\");\r\n }catch (Exception e){\r\n Log.d(TAG,Constants.TABLE_NAME + \" table already exists\");\r\n }\r\n }",
"public static void createItemTable() {\n\n\t\ttry {\n\t\t\tconnection = DBConnectionUtil.getDBConnection();\n\t\t\tstatement = connection.createStatement();\n\t\t\t// Drop table if already exists and as per SQL query available in\n\t\t\t// Query.xml\n\t\t\tstatement.executeUpdate(QueryUtil.queryByID(CommonConstants.QUERY_ID_DROP_ITEM_TABLE));\n\t\t\t// Create new items table as per SQL query available in\n\t\t\t// Query.xml\n\t\t\tstatement.executeUpdate(QueryUtil.queryByID(CommonConstants.QUERY_ID_CREATE_ITEM_TABLE));\n\t\t\t// Insert records into item table in the beginning as per SQL query available in\n\t\t\t// Query.xml\t\t\t\n\t\t\tstatement.executeUpdate(QueryUtil.queryByID(CommonConstants.QUERY_ID_INSERT_BEGIN_ITEM_TABLE));\n\t\t\t\n\t\t} catch (SQLException | SAXException | IOException | ParserConfigurationException | ClassNotFoundException e) {\n\t\t\tlog.log(Level.SEVERE, e.getMessage());\n\t\t}\n\t}",
"public static void createItemTable() {\n\n\t\ttry {\n\t\t\tconnection = DBConnectionUtil.getDBConnection();\n\t\t\tstatement = connection.createStatement();\n\t\t\t// Drop table if already exists and as per SQL query available in\n\t\t\t// Query.xml\n\t\t\tstatement.executeUpdate(QueryUtil.queryByID(CommonConstants.QUERY_ID_DROP_ITEM_TABLE));\n\t\t\t// Create new items table as per SQL query available in\n\t\t\t// Query.xml\n\t\t\tstatement.executeUpdate(QueryUtil.queryByID(CommonConstants.QUERY_ID_CREATE_ITEM_TABLE));\n\t\t\t// Insert records into item table in the beginning as per SQL query available in\n\t\t\t// Query.xml\t\t\t\n\t\t\tstatement.executeUpdate(QueryUtil.queryByID(CommonConstants.QUERY_ID_INSERT_BEGIN_ITEM_TABLE));\n\t\t\t\n\t\t} catch (SQLException | SAXException | IOException | ParserConfigurationException | ClassNotFoundException e) {\n\t\t\tlog.log(Level.SEVERE, e.getMessage());\n\t\t}\n\t}",
"public void createTable(String tableName) {\n //SQL Statement\n String query = \"call aTable\";\n\n try {\n //connection\n stmt = con.createStatement();\n //execute query\n stmt.executeUpdate(query);\n System.out.println(\"\\n--Table \" + tableName + \" created--\");\n } catch (SQLException ex) {\n System.out.println(\"\\n--Query did not execute--\");\n ex.printStackTrace();\n }\n }",
"private void createCDAccountsTable() {\n\t\ttry {\n\t\t\tStatement stmt = this.conn.createStatement();\n\t\t\tstmt.executeUpdate(\"CREATE TABLE cdAccounts \"\n\t\t\t\t\t+ \"(id BIGINT GENERATED ALWAYS AS IDENTITY ( START WITH 3000000001, INCREMENT BY 1 ), \" + \"owner INT, \"\n\t\t\t\t\t+ \"term INT, \" + \"balance DOUBLE, \" + \"intRate DOUBLE, \"\n\t\t\t\t\t+ \"timeCreated BIGINT, \" + \"lastPaidInterest DOUBLE, \"\n\t\t\t\t\t+ \"dateOfLastPaidInterest BIGINT)\");\n\t\t\tconn.commit();\n\t\t\tSystem.out.println(\"Created table cdAccounts\");\n\t\t} catch (SQLException sqle) {\n\t\t\tSystem.err.println(\"Creation of cdAccounts table FAILED\");\n\t\t\tSystem.err.println(sqle);\n\t\t}\n\t}",
"void create(DataTableDef def) throws IOException;",
"@Override\n\tpublic void onCreate(SQLiteDatabase db, ConnectionSource connectionSource) {\n\t\ttry {\n\t\t\tLog.i(DatabaseHelper.class.getName(), \"onCreate\");\n\t\t\tTableUtils.createTable(connectionSource, Place.class);\n\t\t\tTableUtils.createTable(connectionSource, Lock.class);\n\t\t\tTableUtils.createTable(connectionSource, User.class);\n\t\t\tTableUtils.createTable(connectionSource, Locator.class);\n\t\t} catch (SQLException e) {\n\t\t\tLog.e(DatabaseHelper.class.getName(), \"Can't create database\", e);\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t}",
"private void createCheckingAccountsTable() {\n\t\ttry {\n\t\t\tStatement stmt = this.conn.createStatement();\n\t\t\tstmt.executeUpdate(\"CREATE TABLE checkingAccounts \"\n\t\t\t\t\t+ \"(id BIGINT GENERATED ALWAYS AS IDENTITY ( START WITH 1000000001, INCREMENT BY 1 ), \" + \"owner INT, \"\n\t\t\t\t\t+ \"balance DOUBLE, \" + \"intRate DOUBLE, \"\n\t\t\t\t\t+ \"timeCreated BIGINT, \" + \"lastPaidInterest DOUBLE, \"\n\t\t\t\t\t+ \"dateOfLastPaidInterest BIGINT)\");\n\t\t\tconn.commit();\n\t\t\tSystem.out.println(\"Created table checkingAccounts\");\n\t\t} catch (SQLException sqle) {\n\t\t\tSystem.err.println(\"Creation of checkingAccounts table FAILED\");\n\t\t\tSystem.err.println(sqle);\n\t\t}\n\t}",
"public synchronized void criarTabela(){\n \n String sql = \"CREATE TABLE IF NOT EXISTS CPF(\\n\"\n + \"id integer PRIMARY KEY AUTOINCREMENT,\\n\"//Autoincrement\n// + \"codDocumento integer,\\n\"\n + \"numCPF integer\\n\"\n + \");\";\n \n try (Connection c = ConexaoJDBC.getInstance();\n Statement stmt = c.createStatement()) {\n // create a new table\n stmt.execute(sql);\n stmt.close();\n c.close();\n } catch (SQLException e) {\n System.err.println(e.getClass().getName() + \": \" + e.getMessage()); \n// System.out.println(e.getMessage());\n }\n System.out.println(\"Table created successfully\");\n }",
"public void CreateTables() {\n\t\ttry {\n\t\t\tString schema = Schema.META;\n\t\t\tInstall_DBMS_MetaData(schema.getBytes(),0);\n\n\t\t\t// load and install QEPs\n\t\t\tClass<?>[] executionPlans = new Class[] { QEP.class };\n\t\t\tQEPng.loadExecutionPlans(TCell_QEP_IDs.class, executionPlans);\n\t\t\tQEPng.installExecutionPlans(db);\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"private String createTableSQL()\n\t{\n\t\tStringBuffer str = new StringBuffer();\n\n\t\t// Keep track of the list of fields\n\t\tList<String> listFields = new ArrayList<String>();\n\n\t\t// Table command\n\t\tstr.append(\"CREATE TABLE \" + getFullPath() + \"( \");\n\t\tstr.append(createStandardGZFields());\n\n\t\t// Loop through all InputFields\n\t\tfor (InputFieldSet fieldSet : function.getInputFieldSets())\n\t\t{\n\t\t\tfor (InputField inputField : fieldSet.getInputFields())\n\t\t\t{\n\t\t\t\t// Phase 2 does not support repeating fields being journalled\n\t\t\t\tif (!Field.isRepeating(inputField))\n\t\t\t\t{\n\t\t\t\t\t// Field\n\t\t\t\t\tString fieldName = SQLToolbox.cvtToSQLFieldName(inputField.getId());\n\n\t\t\t\t\t// add if not yet existing\n\t\t\t\t\tif (listFields.indexOf(fieldName) == -1)\n\t\t\t\t\t{\n\t\t\t\t\t\tstr.append(\", \");\n\t\t\t\t\t\tString fieldDataType = inputField.getDataType();\n\t\t\t\t\t\tString fieldType = SQLToolbox.cvtToSQLFieldType(fieldDataType, inputField.getSize(), inputField\n\t\t\t\t\t\t\t\t\t\t.getDecimals());\n\t\t\t\t\t\tString fieldDefault = SQLToolbox.cvtToSQLDefault(fieldDataType);\n\t\t\t\t\t\tstr.append(fieldName + \" \" + fieldType + \" \" + \" not null default \" + fieldDefault);\n\t\t\t\t\t\tlistFields.add(fieldName);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// End\n\t\tstr.append(\" ) \");\n\t\t// RCDFMT \" + getJournalRcdName());\n\n\t\treturn str.toString();\n\t}",
"private void createLoginTable() {\r\n jdbcExecutor.executeQuery(new Work() {\r\n @Override\r\n public void execute(Connection connection) throws SQLException {\r\n connection.createStatement().executeUpdate(\"CREATE TABLE login ( id numeric(19,0), user_id numeric(19,0), timestamp TIMESTAMP )\");\r\n }\r\n });\r\n }",
"final public SqlStatement CreateTableStatement() throws ParseException {Token tk = null, tk2 = null;\n String tableName;\n CreateTableDefinition definition = null;\n List<CreateTableOption> options = null;\n switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {\n case TEMPORARY:{\n tk = jj_consume_token(TEMPORARY);\n break;\n }\n default:\n jj_la1[16] = jj_gen;\n ;\n }\n jj_consume_token(TABLE);\n switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {\n case IF:{\n tk2 = jj_consume_token(IF);\n jj_consume_token(NOT);\n jj_consume_token(EXISTS);\n break;\n }\n default:\n jj_la1[17] = jj_gen;\n ;\n }\n tableName = DbObjectName();\n switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {\n case 118:{\n definition = CreateTableDefinition();\n break;\n }\n default:\n jj_la1[18] = jj_gen;\n ;\n }\n switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {\n case K_DEFAULT:\n case AUTO_INCREMENT:\n case COMMENT:\n case S_IDENTIFIER:{\n options = CreateTableOptions();\n break;\n }\n default:\n jj_la1[19] = jj_gen;\n ;\n }\nreturn new CreateTableStatement(tk != null, tk2 != null, tableName, definition, options);\n}",
"public static void createTable() throws SQLException\n {\n Statement statement = ConnectionManager.getConnection()\n .createStatement();\n\n statement.executeUpdate(\"DROP TABLE IF EXISTS Account\");\n statement\n .executeUpdate(\"CREATE TABLE Account(accountId INTEGER PRIMARY KEY AUTOINCREMENT, name, address, manager)\");\n\n statement.close();\n\n insertAccount(new Account(0, \"Administrator\", \"\", true));\n\n PreparedStatement ps = ConnectionManager\n .getConnection()\n .prepareStatement(\n \"UPDATE sqlite_sequence SET seq = ? WHERE name = 'Account'\");\n ps.setInt(1, Account.LOW_ACCOUNT_ID - 1);\n ps.executeUpdate();\n ps.close();\n }",
"public static void createEmployees() {\n Connection con = getConnection();\n\n String createString;\n createString = \"create table Employees (\" +\n \"Employee_ID INTEGER, \" +\n \"Name VARCHAR(30))\";\n try {\n stmt = con.createStatement();\n stmt.executeUpdate(createString);\n stmt.close();\n con.close();\n\n } catch (SQLException ex) {\n System.err.println(\"SQLException: \" + ex.getMessage());\n }\n JOptionPane.showMessageDialog(null, \"Employees Table Created\");\n }",
"private void createSavingsAccountsTable() {\n\t\ttry {\n\t\t\tStatement stmt = this.conn.createStatement();\n\t\t\tstmt.executeUpdate(\"CREATE TABLE savingsAccounts \"\n\t\t\t\t\t+ \"(id BIGINT GENERATED ALWAYS AS IDENTITY ( START WITH 2000000001, INCREMENT BY 1), \" + \"owner INT, \"\n\t\t\t\t\t+ \"balance DOUBLE, \" + \"intRate DOUBLE, \"\n\t\t\t\t\t+ \"timeCreated BIGINT, \" + \"lastPaidInterest DOUBLE, \"\n\t\t\t\t\t+ \"dateOfLastPaidInterest BIGINT)\");\n\t\t\tconn.commit();\n\t\t\tSystem.out.println(\"Created table SavingsAccounts\");\n\t\t} catch (SQLException sqle) {\n\t\t\tSystem.err.println(\"Creation of SavingsAccounts table FAILED\");\n\t\t\tSystem.err.println(sqle);\n\t\t}\n\t}"
] | [
"0.79101866",
"0.7793976",
"0.743263",
"0.7322325",
"0.7319247",
"0.7311423",
"0.72925323",
"0.7260437",
"0.7250569",
"0.71505904",
"0.7139253",
"0.712509",
"0.7106536",
"0.7105378",
"0.70643353",
"0.70631653",
"0.70609426",
"0.70266443",
"0.70199645",
"0.7007978",
"0.7001975",
"0.69832605",
"0.69706064",
"0.69399315",
"0.6930801",
"0.6926974",
"0.6888287",
"0.68590975",
"0.6853247",
"0.6828229",
"0.6822193",
"0.6821001",
"0.6806918",
"0.6806905",
"0.68043447",
"0.6793844",
"0.6791307",
"0.67784023",
"0.67780614",
"0.67602575",
"0.67560524",
"0.675113",
"0.67463934",
"0.67429894",
"0.6740357",
"0.67363477",
"0.6729956",
"0.6729198",
"0.67193013",
"0.66980433",
"0.6696216",
"0.667911",
"0.667351",
"0.66614753",
"0.66459113",
"0.66340417",
"0.66286653",
"0.66259694",
"0.6615493",
"0.6610127",
"0.6607078",
"0.66007656",
"0.6581332",
"0.65732366",
"0.6572775",
"0.6564321",
"0.6557039",
"0.6543812",
"0.6533262",
"0.6530646",
"0.6528423",
"0.6516073",
"0.65156215",
"0.65053385",
"0.65049106",
"0.6502288",
"0.650138",
"0.6501122",
"0.6495153",
"0.64843315",
"0.6481704",
"0.64799374",
"0.64652896",
"0.64644605",
"0.6464184",
"0.64560735",
"0.6449573",
"0.6449573",
"0.644265",
"0.6441636",
"0.6441091",
"0.64342064",
"0.642802",
"0.64219534",
"0.63953745",
"0.6394319",
"0.63930184",
"0.6390392",
"0.63891023",
"0.6386972",
"0.6386612"
] | 0.0 | -1 |
Drops the underlying database table. | public static void dropTable(SQLiteDatabase db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "'District'";
db.execSQL(sql);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void dropTable();",
"@Override\r\n public void dropTable() {\n if(tableIsExist(TABLE_NAME)){\r\n String sql = \"drop table \" + TABLE_NAME;\r\n database.execSQL(sql);\r\n }\r\n }",
"public void wipeTable() {\n SqlStorage.wipeTable(db, TABLE_NAME);\n }",
"public void doDropTable();",
"@Override\n public void dropTable(String table_name) {\n\n // silently return if connection is closed\n if (!is_open) {\n return;\n }\n\n // try to delete the table\n try {\n String drop_table = \"DROP TABLE \" + table_name;\n statement.execute(drop_table);\n connection.commit();\n } catch (SQLException e) {\n System.out.println(\"Could not delete table \" + table_name);\n e.printStackTrace();\n }\n\n //System.out.println(\"Deleted table \" + table_name);\n\n }",
"public void cleanTable() throws ClassicDatabaseException;",
"public void dropTable()\n throws DBException\n {\n try {\n DBProvider.dropTable(this.getUntranslatedTableName());\n } catch (SQLException sqe) {\n throw new DBException(\"Drop table\", sqe);\n }\n }",
"public void dropTable() {\n }",
"abstract void dropTable() throws SQLException;",
"@Override\n\tpublic void dropTable() {\n\t\ttry {\n\t\t\tTableUtils.dropTable(connectionSource, UserEntity.class, true);\n\t\t\tTableUtils.dropTable(connectionSource, Downloads.class, true);\n\t\t} catch (SQLException e) {\n\t\t}\n\t}",
"public void dropTable(String tableName);",
"public void dropDB() throws SQLException {\n\t \t\tStatement stmt = cnx.createStatement();\n\t \t\tString[] tables = {\"account\", \"consumer\", \"transaction\"};\n\t \t\tfor (int i=0; i<3;i++) {\n\t \t\t\tString query = \"DELETE FROM \" + tables[i];\n\t \t\t\tstmt.executeUpdate(query);\n\t \t\t}\n\t \t}",
"boolean dropTable();",
"public void drop() {\n SQLiteDatabase db = this.getWritableDatabase();\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_NAME);\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_NAME1);\n onCreate(db);\n }",
"public void dropTable(String tableName) throws SQLException {\n mysql.update(\"DROP TABLE ` \" + tableName + \" `\");\n }",
"public void dropTable(DropTableQuery query);",
"void removeTable(String tableName) throws SQLException {\n\t\tstmt = con.createStatement();\n\t\tString sql = (new StringBuilder(\"drop table \")).append(tableName)\n\t\t\t\t.toString();\n\t\tstmt.executeUpdate(sql);\n\t\tstmt.close();\n\t}",
"public void dropTable(String table) {\n SQLiteDatabase db = openConnection();\n db.execSQL(\"DROP TABLE IF EXISTS \" + table);\n closeConnection();\n }",
"@Override\r\n\tpublic boolean dropTable() {\n\t\treturn false;\r\n\t}",
"@Override\n public void dropUsersTable() {\n\n Session session = sessionFactory.openSession();\n Transaction tx = session.beginTransaction();\n session.createSQLQuery(\"DROP TABLE IF EXISTS Users\").executeUpdate();\n tx.commit();\n session.close();\n\n }",
"@Override\n public void clearTable() {\n final var query = \"TRUNCATE TABLE piano_project.pianos\";\n try(final var statement = connection.createStatement()) {\n statement.executeUpdate(query);\n } catch (SQLException throwables) {\n throwables.printStackTrace();\n }\n }",
"private void dropDBProcedure() {\r\n try {\r\n Class.forName(myDriver);\r\n Connection conn = DriverManager.getConnection(myUrl, myUser, myPass);\r\n DatabaseMetaData md = conn.getMetaData();\r\n String[] types = {\"TABLE\"};\r\n ResultSet rs = md.getTables(null, \"USERTEST\", \"%\", types);\r\n while (rs.next()) {\r\n String queryDrop\r\n = \"DROP TABLE \" + rs.getString(3);\r\n Statement st = conn.createStatement();\r\n st.executeQuery(queryDrop);\r\n System.out.println(\"TABLE \" + rs.getString(3).toLowerCase() + \" DELETED\");\r\n st.close();\r\n }\r\n rs.close();\r\n conn.close();\r\n } catch (ClassNotFoundException | SQLException ex) {\r\n System.out.println(ex.toString());\r\n }\r\n }",
"public void deleteTable(String tableName) {\n try {\n connectToDB(\"jdbc:mysql://localhost/EmployeesProject\");\n } catch (Exception e) {\n System.out.println(\"The EmployeesProject db does not exist!\\n\"\n + e.getMessage());\n }\n String sqlQuery = \"drop table \" + tableName;\n try {\n stmt.executeUpdate(sqlQuery);\n } catch (SQLException ex) {\n System.err.println(\"Failed to delete '\" + tableName + \n \"' table.\\n\" + ex.getMessage());\n }\n }",
"public int dropTable() \n throws InterruptedException, IOException \n {\n return dropTable(false);\n }",
"public void drop(Connection db) throws SQLException {\n drop(db, true);\n }",
"void dropDatabase();",
"public void removetable(Connection connection) throws SQLException\n {\n\tStringBuffer sbremove = new StringBuffer();\n\tsbremove.append(\" DROP TABLE Credit CASCADE CONSTRAINTS \");\n\tStatement statement =null;\n\ttry {\n\t statement = connection.createStatement();\n\t statement.executeUpdate (sbremove.toString());\n\t}catch (SQLException e) {\n\t throw e;\n\t}finally{\n\t statement.close();\n\t}\n }",
"private static void removeDB()\n {\n if(getStatus().equals(\"no database\"))\n return;\n\n dropTable(\"myRooms\");\n dropTable(\"myReservations\");\n }",
"private void truncateTable() throws SQLException {\n trace(\"truncateTable\");\n String command = \"TRUNCATE TABLE \" + _tableName;\n Statement stmt = _connection.createStatement();\n stmt.executeUpdate(command);\n stmt.close();\n }",
"private static void dropTablesFromDatabase (Statement statement) throws SQLException {\n //Удаление таблиц из БД\n statement.execute(\"DROP TABLE IF EXISTS payment;\");\n statement.execute(\"DROP TABLE IF EXISTS account;\");\n statement.execute(\"DROP TABLE IF EXISTS users;\");\n statement.execute(\"DROP TABLE IF EXISTS role;\");\n }",
"@Override\n public void clearDB() throws Exception {\n hBaseOperation.deleteTable(this.dataTableNameString);\n hBaseOperation.createTable(this.dataTableNameString, this.columnFamily, numRegion);\n }",
"private void clearTable(String tableName) throws SQLException {\n Connection conn = getConnection();\n String setStatement = \"DELETE FROM \" + tableName;\n Statement stm = conn.createStatement();\n stm.execute(setStatement);\n }",
"void dropAllTables();",
"public void dropTable(Class<?> clz) {\n\t\tdropTable(getTableName(clz));\n\t}",
"void delete_table(String table_name) {\n //table does not exist\n if (!get_table_names().contains(table_name) && !table_name.equals(\"relationship\")) {\n throw new RuntimeException(\"Table does not exists and can therefore not be deleted.\");\n }\n\n String sql = \"drop table if exists \" + table_name;\n\n execute_statement(sql, false);\n }",
"@Override\r\n\tpublic void deleteDatabase() {\r\n\t\tlog.info(\"Enter deleteDatabase\");\r\n\r\n\t\t\r\n\t\tConnection connection = null;\t\t\r\n\t\ttry {\r\n\t\t\tconnection = jndi.getConnection(\"jdbc/libraryDB\");\t\t\r\n\t\t\t\r\n\r\n\t\t\t \r\n\t\t\t\tPreparedStatement pstmt = connection.prepareStatement(\"Drop Table Users_Table; \"); \r\n\t\t\t\tpstmt.executeUpdate();\r\n\t\t\t\t\r\n\t\t\t\tpstmt = connection.prepareStatement(\"Drop Table Cams_Table; \"); \r\n\t\t\t\tpstmt.executeUpdate();\r\n\t\t\t\t\r\n\t\t\t\tpstmt = connection.prepareStatement(\"Drop Table User_Cam_Mapping_Table; \"); \r\n\t\t\t\tpstmt.executeUpdate();\r\n\t\t\t\t\r\n\t\t\t\tpstmt = connection.prepareStatement(\"Drop Table Cam_Images_Table; \"); \r\n\t\t\t\tpstmt.executeUpdate();\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(\"Datenbank wurde erfolgreich zurueckgesetzt!\");\t\t\t\t\r\n\t\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(\"Fehler: \"+e.getMessage());\r\n\t\t\tlog.error(\"Error: \"+e.getMessage());\r\n\t\t} finally {\r\n\t\t\tcloseConnection(connection);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}",
"public static void dropTable(SQLiteDatabase db, boolean ifExists) {\n String sql = \"DROP TABLE \" + (ifExists ? \"IF EXISTS \" : \"\") + \"\\\"STOCK\\\"\";\n db.execSQL(sql);\n }",
"private void deleteOldTables(){\n jdbcTemplate.execute(\"DROP TABLE OLDcompetence\");\n jdbcTemplate.execute(\"DROP TABLE OLDrole\");\n jdbcTemplate.execute(\"DROP TABLE OLDperson\");\n jdbcTemplate.execute(\"DROP TABLE OLDavailability\");\n jdbcTemplate.execute(\"DROP TABLE OLDcompetence_profile\");\n }",
"public void dropTables()\n {\n String tableName;\n\n for (int i=0; i<tableNames.length; i++)\n {\n tableName = tableNames[i];\n System.out.println(\"Dropping table: \" + tableName);\n try\n {\n Statement statement = connect.createStatement();\n\n String sql = \"DROP TABLE \" + tableName;\n\n statement.executeUpdate(sql);\n }\n catch (SQLException e)\n {\n System.out.println(\"Error dropping table: \" + e);\n }\n }\n }",
"public void rollbackCreateTable(Table table) throws MetaException {\n commitDropTable(table, true);\n }",
"public int dropTable(boolean quiet) \n throws InterruptedException, IOException \n {\n // if (! tablecreated) \n // System.err.println(\"Warning: table not created yet?\");\n\n Process client = startDbClient();\n PrintWriter w = \n new PrintWriter(new OutputStreamWriter(client.getOutputStream()));\n w.print(\"DROP TABLE \");\n w.print(tbl);\n w.println(\";\");\n w.close();\n\n client.waitFor();\n if (! quiet) {\n if (client.exitValue() > 0) {\n for (String line : emsgs) \n System.err.println(line);\n }\n else {\n tablecreated = false;\n System.err.println(\"Existing table \"+tbl+\" dropped\");\n }\n }\n\n return client.exitValue();\n }",
"public static void dropTable(SQLiteDatabase db, Class<?> clz) {\n ArrayList<String> stmts=getDropTableStatms(clz);\n for (String stmt : stmts) {\n db.execSQL(stmt);\n }\n }",
"public static void dropTable(SQLiteDatabase db, boolean ifExists) {\n String sql = \"DROP TABLE \" + (ifExists ? \"IF EXISTS \" : \"\") + \"'P5P10'\";\n db.execSQL(sql);\n }",
"@Test\n public void testDropTable() throws Exception {\n String tableName = createTable(true, true, false);\n\n assertTableIsRegistered(DEFAULT_DB, tableName);\n assertColumnIsRegistered(HiveMetaStoreBridge.getColumnQualifiedName(HiveMetaStoreBridge.getTableQualifiedName(CLUSTER_NAME, DEFAULT_DB, tableName), \"id\"));\n assertColumnIsRegistered(HiveMetaStoreBridge.getColumnQualifiedName(HiveMetaStoreBridge.getTableQualifiedName(CLUSTER_NAME, DEFAULT_DB, tableName), NAME));\n\n String query = String.format(\"drop table %s \", tableName);\n\n runCommandWithDelay(query, 3000);\n\n assertColumnIsNotRegistered(HiveMetaStoreBridge.getColumnQualifiedName(HiveMetaStoreBridge.getTableQualifiedName(CLUSTER_NAME, DEFAULT_DB, tableName), \"id\"));\n assertColumnIsNotRegistered(HiveMetaStoreBridge.getColumnQualifiedName(HiveMetaStoreBridge.getTableQualifiedName(CLUSTER_NAME, DEFAULT_DB, tableName), NAME));\n assertTableIsNotRegistered(DEFAULT_DB, tableName);\n }",
"void cleanupTable(TableName tablename) throws Exception {\n if (tbl != null) {\n tbl.close();\n tbl = null;\n }\n\n ((ClusterConnection) connection).clearRegionCache();\n deleteTable(TEST_UTIL, tablename);\n }",
"public void drop(Connection db, boolean dropSequence) throws SQLException {\n Statement st = db.createStatement();\n\n //drop the table\n st.executeUpdate(\"DROP TABLE \" + tableName);\n\n if (dbType == DatabaseUtils.POSTGRESQL) {\n if (hasSequence() && dropSequence) {\n //TODO: Not all versions of postgres supported by centric, supports IF EXISTS. Need a better solution\n //drop the sequence\n st.executeUpdate(\"DROP SEQUENCE IF EXISTS \" + sequenceName);\n }\n }\n st.close();\n }",
"public static void dropTable(SQLiteDatabase db, boolean ifExists) {\n String sql = \"DROP TABLE \" + (ifExists ? \"IF EXISTS \" : \"\") + \"'ORDER_BATCH'\";\n db.execSQL(sql);\n }",
"public void closeAndDeleteDB() {\n\t\tboolean gotSQLExc = false;\n\t\ttry {\n\t\t\tthis.deleteAllTable();\n\t\t\tconn.close();\n //DriverManager.getConnection(\"jdbc:derby:;shutdown=true\"); \n \n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tif (e.getSQLState().equals(\"XJ015\") ) {\t\t\n\t gotSQLExc = true;\n\t } else e.printStackTrace();\n\t\t}\n//\t\t\n//\t\tif (!gotSQLExc) {\n//\t \t System.out.println(\"Database did not shut down normally\");\n//\t } else {\n//\t System.out.println(\"Database shut down normally\");\t\n//\t }\n\t\t\n\t}",
"public static void dropTable(SQLiteDatabase db, boolean ifExists) {\n String sql = \"DROP TABLE \" + (ifExists ? \"IF EXISTS \" : \"\") + \"\\\"\" + TABLENAME + \"\\\"\";\n db.execSQL(sql);\n }",
"public static void dropTable(SQLiteDatabase db, boolean ifExists) {\n String sql = \"DROP TABLE \" + (ifExists ? \"IF EXISTS \" : \"\") + \"'ENTITY_COMMAND'\";\n db.execSQL(sql);\n }",
"public void dropTableIfExists(String tableName) throws SQLException{\n\t\tStatement stmt = connection.createStatement();\n\t\tstmt.execute(\"DROP TABLE IF EXISTS \\\"\" + tableName + \"\\\"\"); \n\t\tstmt.close();\n\t}",
"public static void dropTable(SQLiteDatabase db, Class clazz) {\n final TypeAdapter adapter = getAdapter(clazz);\n db.execSQL(String.format(\"DROP TABLE IF EXISTS %s\", adapter.getTableName()));\n }",
"public void dropTable(AccumuloTable table)\n {\n SchemaTableName stName = new SchemaTableName(table.getSchema(), table.getTable());\n String tableName = table.getFullTableName();\n\n // Drop cardinality cache from index lookup\n sIndexLookup.dropCache(stName.getSchemaName(), stName.getTableName());\n\n // Remove the table metadata from Presto\n if (metaManager.getTable(stName) != null) {\n metaManager.deleteTableMetadata(stName);\n }\n\n if (!table.isExternal()) {\n // delete the table and index tables\n if (tableManager.exists(tableName)) {\n tableManager.deleteAccumuloTable(tableName);\n }\n\n if (table.isIndexed()) {\n String indexTableName = Indexer.getIndexTableName(stName);\n if (tableManager.exists(indexTableName)) {\n tableManager.deleteAccumuloTable(indexTableName);\n }\n\n String metricsTableName = Indexer.getMetricsTableName(stName);\n if (tableManager.exists(metricsTableName)) {\n tableManager.deleteAccumuloTable(metricsTableName);\n }\n }\n }\n }",
"public static void dropTable(SQLiteDatabase db, boolean ifExists) {\n String sql = \"DROP TABLE \" + (ifExists ? \"IF EXISTS \" : \"\") + \"'SELLER'\";\n db.execSQL(sql);\n }",
"public static void dropTable(Database db, boolean ifExists) {\n String sql = \"DROP TABLE \" + (ifExists ? \"IF EXISTS \" : \"\") + \"\\\"BIG_MONSTERS\\\"\";\n db.execSQL(sql);\n }",
"public static void dropTable(SQLiteDatabase db, boolean ifExists) {\n String sql = \"DROP TABLE \" + (ifExists ? \"IF EXISTS \" : \"\") + \"'P7P4'\";\n db.execSQL(sql);\n }",
"public static void dropTable(Connection c, String tableName) throws SQLException {\r\n\t\tStatement s = c.createStatement();\r\n\t\ts.executeUpdate(\"drop table \"+quote(tableName));\r\n\t\ts.close();\r\n\t}",
"public static void dropTable(Database db, boolean ifExists) {\n String sql = \"DROP TABLE \" + (ifExists ? \"IF EXISTS \" : \"\") + \"\\\"PAYMENT_RECORD\\\"\";\n db.execSQL(sql);\n }",
"public static void dropTable(SQLiteDatabase db, boolean ifExists) {\n String sql = \"DROP TABLE \" + (ifExists ? \"IF EXISTS \" : \"\") + \"\\\"TRUCK\\\"\";\n db.execSQL(sql);\n }",
"public static void dropTable(SQLiteDatabase db, boolean ifExists) {\n String sql = \"DROP TABLE \" + (ifExists ? \"IF EXISTS \" : \"\") + \"'DISTRIBUTOR_ORDERS'\";\n db.execSQL(sql);\n }",
"public static void dropTable(Database db, boolean ifExists) {\n String sql = \"DROP TABLE \" + (ifExists ? \"IF EXISTS \" : \"\") + \"\\\"GAME_FILL_ITEM\\\"\";\n db.execSQL(sql);\n }",
"public void removeLifeloggingTables() throws SQLException {\n\n\t\tString sqlCommand1 = \"DROP TABLE IF EXISTS minute\";\n\t\tString sqlCommand2 = \"DROP TABLE IF EXISTS image\";\n\t\tStatement stmt = this.connection.createStatement();\n\n\t\tstmt.execute(sqlCommand2);\n\t\tstmt.execute(sqlCommand1);\n\t\tstmt.close();\n\t}",
"public static void dropTable(SQLiteDatabase db, boolean ifExists) {\n String sql = \"DROP TABLE \" + (ifExists ? \"IF EXISTS \" : \"\") + \"\\\"HEALTH_RECORD__STATUS\\\"\";\n db.execSQL(sql);\n }",
"public static void dropTable(Database db, boolean ifExists) {\n String sql = \"DROP TABLE \" + (ifExists ? \"IF EXISTS \" : \"\") + \"\\\"ORDER_PAY\\\"\";\n db.execSQL(sql);\n }",
"public void clear() throws DBException\n {\n String sqlString = \"DELETE FROM user\";\n try(Statement statement = conn.createStatement())\n {\n statement.executeUpdate(sqlString);\n }\n catch(SQLException ex)\n {\n throw new DBException(\"Error while clearing user table\");\n }\n\n\n }",
"public static void dropTable(Database db, boolean ifExists) {\n String sql = \"DROP TABLE \" + (ifExists ? \"IF EXISTS \" : \"\") + \"\\\"LOCAL_BEAN\\\"\";\n db.execSQL(sql);\n }",
"public void deleteAll() throws SQLException {\n\t\tfinal String sql = \"DELETE FROM \" + table_name;\n\t\tPreparedStatement statement = null;\n\n\t\ttry {\n\t\t\tfinal Connection connection = _database.getConnection();\n\t\t\tstatement = connection.prepareStatement(sql);\n\t\t\t@SuppressWarnings(\"unused\")\n\t\t\tfinal int rowcount = update(statement);\n\t\t} finally {\n\t\t\tif (statement != null) {\n\t\t\t\tstatement.close();\n\t\t\t}\n\t\t}\n\t}",
"public void dropTables() {\n \t\ttry {\n \t\t\tdbManager.executeUpdate(\"DROP TABLE REVISION\");\n \t\t} catch (Exception e) {\n \t\t\t// e.printStackTrace();\n \t\t}\n \n \t\ttry {\n \t\t\tdbManager.executeUpdate(\"DROP TABLE VCS_COMMIT\");\n \t\t} catch (Exception e) {\n \t\t\t// e.printStackTrace();\n \t\t}\n \n \t\ttry {\n \t\t\tdbManager.executeUpdate(\"DROP TABLE FILE\");\n \t\t} catch (Exception e) {\n \t\t\t// e.printStackTrace();\n \t\t}\n \n \t\ttry {\n \t\t\tdbManager.executeUpdate(\"DROP TABLE CODE_FRAGMENT\");\n \t\t} catch (Exception e) {\n \t\t\t// e.printStackTrace();\n \t\t}\n \n \t\ttry {\n \t\t\tdbManager.executeUpdate(\"DROP TABLE CLONE_SET\");\n \t\t} catch (Exception e) {\n \t\t\t// e.printStackTrace();\n \t\t}\n \n \t\ttry {\n \t\t\tdbManager.executeUpdate(\"DROP TABLE CODE_FRAGMENT_LINK\");\n \t\t} catch (Exception e) {\n \t\t\t// e.printStackTrace();\n \t\t}\n \n \t\ttry {\n \t\t\tdbManager.executeUpdate(\"DROP TABLE CLONE_SET_LINK\");\n \t\t} catch (Exception e) {\n \t\t\t// e.printStackTrace();\n \t\t}\n \n \t\ttry {\n \t\t\tdbManager.executeUpdate(\"DROP TABLE CLONE_GENEALOGY\");\n \t\t} catch (Exception e) {\n \t\t\t// e.printStackTrace();\n \t\t}\n \n \t\ttry {\n \t\t\tdbManager.executeUpdate(\"DROP TABLE CODE_FRAGMENT_GENEALOGY\");\n \t\t} catch (Exception e) {\n \t\t\t// e.printStackTrace();\n \t\t}\n \n \t\ttry {\n \t\t\tdbManager.executeUpdate(\"DROP TABLE CRD\");\n \t\t} catch (Exception e) {\n \t\t\t// e.printStackTrace();\n \t\t}\n \n \t\ttry {\n \t\t\tdbManager.executeUpdate(\"VACUUM\");\n \t\t} catch (Exception e) {\n \t\t\t// e.printStackTrace();\n \t\t}\n \t}",
"public static void dropTable(Database db, boolean ifExists) {\n String sql = \"DROP TABLE \" + (ifExists ? \"IF EXISTS \" : \"\") + \"\\\"COUNT_DATA_BEAN\\\"\";\n db.execSQL(sql);\n }",
"public static void dropTable(Database db, boolean ifExists) {\n String sql = \"DROP TABLE \" + (ifExists ? \"IF EXISTS \" : \"\") + \"\\\"RECORD\\\"\";\n db.execSQL(sql);\n }",
"public static void dropTable(Database db, boolean ifExists) {\n String sql = \"DROP TABLE \" + (ifExists ? \"IF EXISTS \" : \"\") + \"\\\"RECORD\\\"\";\n db.execSQL(sql);\n }",
"public static void dropTable(SQLiteDatabase db, boolean ifExists) {\n String sql = \"DROP TABLE \" + (ifExists ? \"IF EXISTS \" : \"\") + \"'TABLE__STATUS'\";\n db.execSQL(sql);\n }",
"public static void dropTable(Database db, boolean ifExists) {\n String sql = \"DROP TABLE \" + (ifExists ? \"IF EXISTS \" : \"\") + \"\\\"DCPURCHASE_DATA\\\"\";\n db.execSQL(sql);\n }",
"public static void dropTable(Database db, boolean ifExists) {\n String sql = \"DROP TABLE \" + (ifExists ? \"IF EXISTS \" : \"\") + \"\\\"SECURITY_ITEMS\\\"\";\n db.execSQL(sql);\n }",
"public static void dropTable(SQLiteDatabase db, boolean ifExists) {\n String sql = \"DROP TABLE \" + (ifExists ? \"IF EXISTS \" : \"\") + \"\\\"SHOP_RECEIVABLE_ENTITY\\\"\";\n db.execSQL(sql);\n }",
"public static void dropTable(Database db, boolean ifExists) {\n String sql = \"DROP TABLE \" + (ifExists ? \"IF EXISTS \" : \"\") + \"\\\"FITTING_TABLE\\\"\";\n db.execSQL(sql);\n }",
"public void removeAll()\r\n {\n db = this.getWritableDatabase(); // helper is object extends SQLiteOpenHelper\r\n db.execSQL(\"drop table \"+\"campaing\");\r\n db.execSQL(\"drop table \"+\"cafe\");\r\n db.execSQL(\"drop table \"+\"points\");\r\n\r\n db.close ();\r\n }",
"public static void dropTable(SQLiteDatabase db, boolean ifExists) {\n String sql = \"DROP TABLE \" + (ifExists ? \"IF EXISTS \" : \"\") + \"\\\"ANSWERS_QUESTION\\\"\";\n db.execSQL(sql);\n }",
"public static void dropTable(SQLiteDatabase db, boolean ifExists) {\n String sql = \"DROP TABLE \" + (ifExists ? \"IF EXISTS \" : \"\") + \"\\\"HINT\\\"\";\n db.execSQL(sql);\n }",
"public static void dropTable(SQLiteDatabase db, boolean ifExists) {\n String sql = \"DROP TABLE \" + (ifExists ? \"IF EXISTS \" : \"\") + \"'CUSTOMER'\";\n db.execSQL(sql);\n }",
"@Override\n public void cleanUsersTable() {\n\n Session session = sessionFactory.openSession();\n Transaction tx = session.beginTransaction();\n session.createQuery(\"delete from User\").executeUpdate();\n tx.commit();\n System.out.println(\"HibCleaning users table\");\n session.close();\n\n }",
"public static void dropTable(Database db, boolean ifExists) {\n String sql = \"DROP TABLE \" + (ifExists ? \"IF EXISTS \" : \"\") + \"\\\"LIVE_KIND_OBJ\\\"\";\n db.execSQL(sql);\n }",
"public static void dropTable(SQLiteDatabase db, boolean ifExists) {\n String sql = \"DROP TABLE \" + (ifExists ? \"IF EXISTS \" : \"\") + \"\\\"BUDGETS\\\"\";\n db.execSQL(sql);\n }",
"public static void dropTable(SQLiteDatabase db, boolean ifExists) {\n String sql = \"DROP TABLE \" + (ifExists ? \"IF EXISTS \" : \"\") + \"'RECYCLE_SCAN'\";\n db.execSQL(sql);\n }",
"@Override\n public void run() {\n\n String filename = \"PurgeTable\";\n\n PreparedStatement stmt1 = null;\n try {\n stmt1 = conn.prepareStatement(\"delete from \" + filename);\n stmt1.executeUpdate();\n System.out.println(\"Deletion successful\");\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n }",
"public static void dropTable(Database db, boolean ifExists) {\n String sql = \"DROP TABLE \" + (ifExists ? \"IF EXISTS \" : \"\") + \"\\\"SHEET\\\"\";\n db.execSQL(sql);\n }",
"public static void dropTable(SQLiteDatabase db, boolean ifExists) {\n String sql = \"DROP TABLE \" + (ifExists ? \"IF EXISTS \" : \"\") + \"'IdCard'\";\n db.execSQL(sql);\n }",
"public static void dropTable(SQLiteDatabase db, boolean ifExists) {\r\n String sql = \"DROP TABLE \" + (ifExists ? \"IF EXISTS \" : \"\") + \"'META'\";\r\n db.execSQL(sql);\r\n }",
"public static void dropTable(Database db, boolean ifExists) {\n String sql = \"DROP TABLE \" + (ifExists ? \"IF EXISTS \" : \"\") + \"\\\"kctBaseStation\\\"\";\n db.execSQL(sql);\n }",
"public static void dropTable(Database db, boolean ifExists) {\n String sql = \"DROP TABLE \" + (ifExists ? \"IF EXISTS \" : \"\") + \"\\\"BACK_ALARM_MODEL\\\"\";\n db.execSQL(sql);\n }",
"public static void dropTable(Database db, boolean ifExists) {\n String sql = \"DROP TABLE \" + (ifExists ? \"IF EXISTS \" : \"\") + \"\\\"EXAM_QUESTION\\\"\";\n db.execSQL(sql);\n }",
"public void dropDatabase(String dbName) throws Exception;",
"public synchronized void removeAll(SQLiteDatabase db) {\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_NAME);\n }",
"public static void dropTable(SQLiteDatabase db, boolean ifExists) {\n String sql = \"DROP TABLE \" + (ifExists ? \"IF EXISTS \" : \"\") + \"'BLACK_LIST'\";\n db.execSQL(sql);\n }",
"public void dropSQLtable(Connection conn, String dataid, String tablename) throws SQLException\n\t\t{\n\t\tStringBuffer dropTable=new StringBuffer();\n\t\tdropTable.append(\"drop table \"+tablename+\";\");\n\t\tPreparedStatement stmDropTable=conn.prepareStatement(dropTable.toString());\n\t\tstmDropTable.execute();\n\t\t}",
"public void DropTables() {\n\t\ttry {\n\t\t\tDesinstall_DBMS_MetaData();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"void dropTable(ObjectPath tablePath, boolean ignoreIfNotExists)\n throws TableNotExistException, CatalogException;",
"public static void dropTable(Database db, boolean ifExists) {\n String sql = \"DROP TABLE \" + (ifExists ? \"IF EXISTS \" : \"\") + \"\\\"STEP11_RESBEAN\\\"\";\n db.execSQL(sql);\n }",
"public static void dropTable(Database db, boolean ifExists) {\n String sql = \"DROP TABLE \" + (ifExists ? \"IF EXISTS \" : \"\") + \"\\\"HOT_SONG_LIST\\\"\";\n db.execSQL(sql);\n }",
"public static void dropTable(Database db, boolean ifExists) {\n String sql = \"DROP TABLE \" + (ifExists ? \"IF EXISTS \" : \"\") + \"\\\"USER_ENTITY\\\"\";\n db.execSQL(sql);\n }"
] | [
"0.77905864",
"0.7629071",
"0.7504763",
"0.74629456",
"0.7318787",
"0.7296518",
"0.72926134",
"0.7282501",
"0.7266185",
"0.7200686",
"0.7198106",
"0.71702343",
"0.71055806",
"0.7093738",
"0.70920646",
"0.7038983",
"0.6929047",
"0.6885167",
"0.6788234",
"0.6783074",
"0.6777363",
"0.6754577",
"0.6726359",
"0.6710291",
"0.6698646",
"0.6674433",
"0.66477424",
"0.66430706",
"0.66401106",
"0.6621803",
"0.6615776",
"0.6610433",
"0.6599147",
"0.6592485",
"0.65916526",
"0.657377",
"0.6565827",
"0.655269",
"0.65510494",
"0.65369684",
"0.65319836",
"0.65199155",
"0.6496944",
"0.64914715",
"0.64731306",
"0.6441084",
"0.6435138",
"0.64294064",
"0.64239216",
"0.64170486",
"0.64026606",
"0.63998353",
"0.6383767",
"0.6375905",
"0.6367872",
"0.63515097",
"0.6348723",
"0.63468283",
"0.6336912",
"0.633311",
"0.63314945",
"0.6329385",
"0.63242203",
"0.63240325",
"0.6323291",
"0.6310179",
"0.63009405",
"0.63008416",
"0.62961304",
"0.629463",
"0.629463",
"0.6287235",
"0.6286588",
"0.6286401",
"0.6286267",
"0.628303",
"0.6276095",
"0.6257166",
"0.6253247",
"0.6250002",
"0.62485534",
"0.62448114",
"0.6240322",
"0.62314177",
"0.62290967",
"0.6221411",
"0.62194145",
"0.621411",
"0.6211227",
"0.62054455",
"0.61987835",
"0.6180796",
"0.6178501",
"0.6176379",
"0.61754346",
"0.61705405",
"0.6140106",
"0.6135514",
"0.6132064",
"0.6130895"
] | 0.618127 | 91 |
Reads all available rows from the given cursor and returns a list of new ImageTO objects. | public List<District> loadAllDeepFromCursor(Cursor cursor) {
int count = cursor.getCount();
List<District> list = new ArrayList<District>(count);
if (cursor.moveToFirst()) {
if (identityScope != null) {
identityScope.lock();
identityScope.reserveRoom(count);
}
try {
do {
list.add(loadCurrentDeep(cursor, false));
}
while (cursor.moveToNext());
}
finally {
if (identityScope != null) {
identityScope.unlock();
}
}
}
return list;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public List<BigMonsters> loadAllDeepFromCursor(Cursor cursor) {\n int count = cursor.getCount();\n List<BigMonsters> list = new ArrayList<BigMonsters>(count);\n \n if (cursor.moveToFirst()) {\n if (identityScope != null) {\n identityScope.lock();\n identityScope.reserveRoom(count);\n }\n try {\n do {\n list.add(loadCurrentDeep(cursor, false));\n } while (cursor.moveToNext());\n } finally {\n if (identityScope != null) {\n identityScope.unlock();\n }\n }\n }\n return list;\n }",
"public List<Inmovilizacion> loadAllDeepFromCursor(Cursor cursor) {\n int count = cursor.getCount();\n List<Inmovilizacion> list = new ArrayList<Inmovilizacion>(count);\n \n if (cursor.moveToFirst()) {\n if (identityScope != null) {\n identityScope.lock();\n identityScope.reserveRoom(count);\n }\n try {\n do {\n list.add(loadCurrentDeep(cursor, false));\n } while (cursor.moveToNext());\n } finally {\n if (identityScope != null) {\n identityScope.unlock();\n }\n }\n }\n return list;\n }",
"public List<PxExtraDetails> loadAllDeepFromCursor(Cursor cursor) {\n int count = cursor.getCount();\n List<PxExtraDetails> list = new ArrayList<PxExtraDetails>(count);\n \n if (cursor.moveToFirst()) {\n if (identityScope != null) {\n identityScope.lock();\n identityScope.reserveRoom(count);\n }\n try {\n do {\n list.add(loadCurrentDeep(cursor, false));\n } while (cursor.moveToNext());\n } finally {\n if (identityScope != null) {\n identityScope.unlock();\n }\n }\n }\n return list;\n }",
"private void getImagesFromDatabase() {\n try {\n mCursor = mDbAccess.getPuzzleImages();\n\n if (mCursor.moveToNext()) {\n for (int i = 0; i < mCursor.getCount(); i++) {\n String imagetitle = mCursor.getString(mCursor.getColumnIndex(\"imagetitle\"));\n String imageurl = mCursor.getString(mCursor.getColumnIndex(\"imageurl\"));\n mImageModel.add(new CustomImageModel(imagetitle, imageurl));\n mCursor.moveToNext();\n }\n } else {\n Toast.makeText(getActivity(), \"databse not created...\", Toast.LENGTH_LONG).show();\n }\n } catch (Exception e) {\n e.printStackTrace();\n\n }\n\n }",
"Data<List<Pins>> getPinsCursor(String cursor, Integer limit, String fields);",
"public Cursor getCursorWithRows() {\n Cursor cursor = new SimpleCursor(Query.QueryResult.newBuilder()\n .addFields(Query.Field.newBuilder().setName(\"col1\").setType(Query.Type.INT8).build())\n .addFields(Query.Field.newBuilder().setName(\"col2\").setType(Query.Type.UINT8).build())\n .addFields(Query.Field.newBuilder().setName(\"col3\").setType(Query.Type.INT16).build())\n .addFields(Query.Field.newBuilder().setName(\"col4\").setType(Query.Type.UINT16).build())\n .addFields(Query.Field.newBuilder().setName(\"col5\").setType(Query.Type.INT24).build())\n .addFields(Query.Field.newBuilder().setName(\"col6\").setType(Query.Type.UINT24).build())\n .addFields(Query.Field.newBuilder().setName(\"col7\").setType(Query.Type.INT32).build())\n .addFields(Query.Field.newBuilder().setName(\"col8\").setType(Query.Type.UINT32).build())\n .addFields(Query.Field.newBuilder().setName(\"col9\").setType(Query.Type.INT64).build())\n .addFields(Query.Field.newBuilder().setName(\"col10\").setType(Query.Type.UINT64).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col11\").setType(Query.Type.FLOAT32).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col12\").setType(Query.Type.FLOAT64).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col13\").setType(Query.Type.TIMESTAMP).build())\n .addFields(Query.Field.newBuilder().setName(\"col14\").setType(Query.Type.DATE).build())\n .addFields(Query.Field.newBuilder().setName(\"col15\").setType(Query.Type.TIME).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col16\").setType(Query.Type.DATETIME).build())\n .addFields(Query.Field.newBuilder().setName(\"col17\").setType(Query.Type.YEAR).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col18\").setType(Query.Type.DECIMAL).build())\n .addFields(Query.Field.newBuilder().setName(\"col19\").setType(Query.Type.TEXT).build())\n .addFields(Query.Field.newBuilder().setName(\"col20\").setType(Query.Type.BLOB).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col21\").setType(Query.Type.VARCHAR).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col22\").setType(Query.Type.VARBINARY).build())\n .addFields(Query.Field.newBuilder().setName(\"col23\").setType(Query.Type.CHAR).build())\n .addFields(Query.Field.newBuilder().setName(\"col24\").setType(Query.Type.BINARY).build())\n .addFields(Query.Field.newBuilder().setName(\"col25\").setType(Query.Type.BIT).build())\n .addFields(Query.Field.newBuilder().setName(\"col26\").setType(Query.Type.ENUM).build())\n .addFields(Query.Field.newBuilder().setName(\"col27\").setType(Query.Type.SET).build())\n .addRows(Query.Row.newBuilder().addLengths(\"-50\".length()).addLengths(\"50\".length())\n .addLengths(\"-23000\".length()).addLengths(\"23000\".length())\n .addLengths(\"-100\".length()).addLengths(\"100\".length()).addLengths(\"-100\".length())\n .addLengths(\"100\".length()).addLengths(\"-1000\".length()).addLengths(\"1000\".length())\n .addLengths(\"24.52\".length()).addLengths(\"100.43\".length())\n .addLengths(\"2016-02-06 14:15:16\".length()).addLengths(\"2016-02-06\".length())\n .addLengths(\"12:34:56\".length()).addLengths(\"2016-02-06 14:15:16\".length())\n .addLengths(\"2016\".length()).addLengths(\"1234.56789\".length())\n .addLengths(\"HELLO TDS TEAM\".length()).addLengths(\"HELLO TDS TEAM\".length())\n .addLengths(\"HELLO TDS TEAM\".length()).addLengths(\"HELLO TDS TEAM\".length())\n .addLengths(\"N\".length()).addLengths(\"HELLO TDS TEAM\".length())\n .addLengths(\"1\".length()).addLengths(\"val123\".length())\n .addLengths(\"val123\".length()).setValues(ByteString\n .copyFromUtf8(\"-5050-2300023000-100100-100100-1000100024.52100.432016-02-06 \" +\n \"14:15:162016-02-0612:34:562016-02-06 14:15:1620161234.56789HELLO TDS TEAMHELLO TDS TEAMHELLO\"\n +\n \" TDS TEAMHELLO TDS TEAMNHELLO TDS TEAM1val123val123\"))).build());\n return cursor;\n }",
"public List<PhoneNumber> loadAllDeepFromCursor(Cursor cursor) {\n int count = cursor.getCount();\n List<PhoneNumber> list = new ArrayList<PhoneNumber>(count);\n \n if (cursor.moveToFirst()) {\n if (identityScope != null) {\n identityScope.lock();\n identityScope.reserveRoom(count);\n }\n try {\n do {\n list.add(loadCurrentDeep(cursor, false));\n } while (cursor.moveToNext());\n } finally {\n if (identityScope != null) {\n identityScope.unlock();\n }\n }\n }\n return list;\n }",
"public ArrayList<TEntity> getAll(){\n ArrayList<TEntity> list = new ArrayList<TEntity>();\n\n Cursor cursor = db.query(tableName, columns, null, null, null, null, null);\n\n cursor.moveToFirst();\n\n while (!cursor.isAfterLast()) {\n list.add(fromCursor(cursor));\n cursor.moveToNext();\n }\n\n return list;\n }",
"public List<Activo> loadAllDeepFromCursor(Cursor cursor) {\n int count = cursor.getCount();\n List<Activo> list = new ArrayList<Activo>(count);\n \n if (cursor.moveToFirst()) {\n if (identityScope != null) {\n identityScope.lock();\n identityScope.reserveRoom(count);\n }\n try {\n do {\n list.add(loadCurrentDeep(cursor, false));\n } while (cursor.moveToNext());\n } finally {\n if (identityScope != null) {\n identityScope.unlock();\n }\n }\n }\n return list;\n }",
"Data<List<Pins>> getPinsCursor(String cursor, Integer limit);",
"@Override\r\n\tpublic Map<String, Object> readAll() {\n\t\tsimpleJdbcCall = new SimpleJdbcCall(jdbcTemplate).withCatalogName(\"PKG_ESTADO_CIVIL\")\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t .withProcedureName(\"PR_LIS_ESTADO_CIVIL\")\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t .declareParameters(new SqlOutParameter(\"CUR_ESTADO_CIVIL\", OracleTypes.CURSOR,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t new ColumnMapRowMapper()));\r\n\t\treturn simpleJdbcCall.execute();\r\n\t}",
"public List<GroupInfoBean> loadAllDeepFromCursor(Cursor cursor) {\n int count = cursor.getCount();\n List<GroupInfoBean> list = new ArrayList<GroupInfoBean>(count);\n \n if (cursor.moveToFirst()) {\n if (identityScope != null) {\n identityScope.lock();\n identityScope.reserveRoom(count);\n }\n try {\n do {\n list.add(loadCurrentDeep(cursor, false));\n } while (cursor.moveToNext());\n } finally {\n if (identityScope != null) {\n identityScope.unlock();\n }\n }\n }\n return list;\n }",
"public abstract Cursor buildCursor();",
"@Override\n\tprotected Object[] readCursor(ResultSet rs, int currentRow)\n\t\t\tthrows SQLException {\n\t\treturn super.readCursor(rs, currentRow);\n\t}",
"public Cursor readAllData() {\n\n Cursor objCursor = readSQLite.query(TABLE_OFFICER, new String[]{COLUMN_ID_OFFICER, COLUMN_OFFICER, COLUMN_POSITION, COLUMN_IMAGE, COLUMN_VIDEO, COLUMN_SOUND}, null, null, null, null, null);\n\n if (objCursor != null) {\n objCursor.moveToFirst();\n }\n\n return objCursor;\n }",
"public Cursor getAllRows(){\n Cursor cursor = database.query(dbHelper.TABLE_USERS,allColumns,null,null,null,null,null);\n if (cursor != null){\n cursor.moveToNext();\n }\n return cursor;\n }",
"public static List<PolovniAutomobili> readAll() {\n List<PolovniAutomobili> listaUsera = new ArrayList<>();\n try {\n CONNECTION = DriverManager.getConnection(URL, USERNAME, PASSWORD);\n String query = \"SELECT * FROM polovni WHERE 1\";\n try (Statement st = (Statement) CONNECTION.createStatement()) {\n ResultSet rs = st.executeQuery(query);\n while (rs.next()) {\n String imgUrl = rs.getString(\"imgUrl\");\n String naziv = rs.getString(\"naziv\");\n int godiste = rs.getInt(\"godiste\");\n int cena = rs.getInt(\"cena\");\n String url = rs.getString(\"url\");\n listaUsera.add(new PolovniAutomobili(imgUrl, naziv, godiste,cena,url));\n }\n }\n CONNECTION.close();\n } catch (SQLException ex) {\n System.out.println(\"MySql Connection error...\");\n ex.printStackTrace();\n }\n return listaUsera;\n }",
"Data<List<Pins>> getLikeCursor(String cursor, Integer limit, String fields);",
"Data<List<Boards>> getSearchBoardsCursor(String query, String cursor, String fields);",
"public Cursor fetchAll() {\n\t\treturn db.query(tableName, fields, null, null, null, null, null);\n\t}",
"public Cursor getCursorWithRowsAsNull() {\n Cursor cursor = new SimpleCursor(Query.QueryResult.newBuilder()\n .addFields(Query.Field.newBuilder().setName(\"col1\").setType(Query.Type.INT8).build())\n .addFields(Query.Field.newBuilder().setName(\"col2\").setType(Query.Type.UINT8).build())\n .addFields(Query.Field.newBuilder().setName(\"col3\").setType(Query.Type.INT16).build())\n .addFields(Query.Field.newBuilder().setName(\"col4\").setType(Query.Type.UINT16).build())\n .addFields(Query.Field.newBuilder().setName(\"col5\").setType(Query.Type.INT24).build())\n .addFields(Query.Field.newBuilder().setName(\"col6\").setType(Query.Type.UINT24).build())\n .addFields(Query.Field.newBuilder().setName(\"col7\").setType(Query.Type.INT32).build())\n .addFields(Query.Field.newBuilder().setName(\"col8\").setType(Query.Type.UINT32).build())\n .addFields(Query.Field.newBuilder().setName(\"col9\").setType(Query.Type.INT64).build())\n .addFields(Query.Field.newBuilder().setName(\"col10\").setType(Query.Type.UINT64).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col11\").setType(Query.Type.FLOAT32).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col12\").setType(Query.Type.FLOAT64).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col13\").setType(Query.Type.TIMESTAMP).build())\n .addFields(Query.Field.newBuilder().setName(\"col14\").setType(Query.Type.DATE).build())\n .addFields(Query.Field.newBuilder().setName(\"col15\").setType(Query.Type.TIME).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col16\").setType(Query.Type.DATETIME).build())\n .addFields(Query.Field.newBuilder().setName(\"col17\").setType(Query.Type.YEAR).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col18\").setType(Query.Type.DECIMAL).build())\n .addFields(Query.Field.newBuilder().setName(\"col19\").setType(Query.Type.TEXT).build())\n .addFields(Query.Field.newBuilder().setName(\"col20\").setType(Query.Type.BLOB).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col21\").setType(Query.Type.VARCHAR).build())\n .addFields(\n Query.Field.newBuilder().setName(\"col22\").setType(Query.Type.VARBINARY).build())\n .addFields(Query.Field.newBuilder().setName(\"col23\").setType(Query.Type.CHAR).build())\n .addFields(Query.Field.newBuilder().setName(\"col24\").setType(Query.Type.BINARY).build())\n .addFields(Query.Field.newBuilder().setName(\"col25\").setType(Query.Type.BIT).build())\n .addFields(Query.Field.newBuilder().setName(\"col26\").setType(Query.Type.ENUM).build())\n .addFields(Query.Field.newBuilder().setName(\"col27\").setType(Query.Type.SET).build())\n .addRows(Query.Row.newBuilder().addLengths(\"-50\".length()).addLengths(\"50\".length())\n .addLengths(\"-23000\".length()).addLengths(\"23000\".length())\n .addLengths(\"-100\".length()).addLengths(\"100\".length()).addLengths(\"-100\".length())\n .addLengths(\"100\".length()).addLengths(\"-1000\".length()).addLengths(\"1000\".length())\n .addLengths(\"24.52\".length()).addLengths(\"100.43\".length())\n .addLengths(\"2016-02-06 14:15:16\".length()).addLengths(\"2016-02-06\".length())\n .addLengths(\"12:34:56\".length()).addLengths(\"2016-02-06 14:15:16\".length())\n .addLengths(\"2016\".length()).addLengths(\"1234.56789\".length())\n .addLengths(\"HELLO TDS TEAM\".length()).addLengths(\"HELLO TDS TEAM\".length())\n .addLengths(\"HELLO TDS TEAM\".length()).addLengths(\"HELLO TDS TEAM\".length())\n .addLengths(\"N\".length()).addLengths(\"HELLO TDS TEAM\".length())\n .addLengths(\"1\".length()).addLengths(\"val123\".length()).addLengths(-1).setValues(\n ByteString.copyFromUtf8(\n \"-5050-2300023000-100100-100100-1000100024.52100.432016-02-06 \" +\n \"14:15:162016-02-0612:34:562016-02-06 14:15:1620161234.56789HELLO TDS TEAMHELLO TDS \"\n +\n \"TEAMHELLO TDS TEAMHELLO TDS TEAMNHELLO TDS TEAM1val123\"))).build());\n return cursor;\n }",
"@SuppressLint(\"NewApi\")\n private ObjectNode getRowsResultFromQuery(Cursor cur) {\n ObjectNode rowsResult = objectMapper.createObjectNode();\n\n ArrayNode rowsArrayResult = rowsResult.putArray(\"rows\");\n\n if (cur.moveToFirst()) {\n // query result has rows\n int colCount = cur.getColumnCount();\n \n // Build up JSON result object for each row\n do {\n ObjectNode row = objectMapper.createObjectNode();\n for (int i = 0; i < colCount; ++i) {\n String key = cur.getColumnName(i);\n \n // for old Android SDK remove lines from HERE:\n if (android.os.Build.VERSION.SDK_INT >= 11) {\n putValueBasedOnType(cur, row, key, i);\n // to HERE.\n } else {\n row.put(key, cur.getString(i));\n }\n }\n \n rowsArrayResult.add(row);\n \n } while (cur.moveToNext());\n }\n\n return rowsResult;\n }",
"@Test\n\tpublic void cursorDirtyRead() throws IOException {\n\t\tfinal ArangoCursor<VPackSlice> cursor = arango.db().query(\"FOR i IN 1..4 RETURN i\",\n\t\t\tnew AqlQueryOptions().batchSize(1).allowDirtyRead(true), VPackSlice.class);\n\t\t// get the initial result\n\t\tassertThat(cursor.hasNext(), is(true));\n\t\tassertThat(cursor.next().isInteger(), is(true));\n\t\t// get the second batch\n\t\tassertThat(cursor.hasNext(), is(true));\n\t\tassertThat(cursor.next().isInteger(), is(true));\n\t\t// close the cursor before fetching the all batches\n\t\tcursor.close();\n\t}",
"@Nullable\n\tprotected abstract T readCursor(ResultSet rs, int currentRow) throws SQLException;",
"public List<Row> getRows(String TABLE_NAME){\n String query = \"SELECT * FROM \" + TABLE_NAME + \" ORDER BY ROWID\";\n SQLiteDatabase db = this.getWritableDatabase();\n Cursor cursor = db.rawQuery(query,null);\n List<Row> allRows = new ArrayList<>();\n while(cursor.moveToNext()){\n List<Double> values = new ArrayList<>();\n for(int i=0;i<150;i++){\n\n values.add(cursor.getDouble(i));\n }\n allRows.add(new Row((ArrayList<Double>) values,cursor.getString(150)));\n }\n cursor.close();\n db.close();\n return allRows;\n }",
"Data<List<Pins>> getLikeCursor(String cursor, Integer limit);",
"public List<DbComment> loadAllDeepFromCursor(Cursor cursor) {\n int count = cursor.getCount();\n List<DbComment> list = new ArrayList<DbComment>(count);\n \n if (cursor.moveToFirst()) {\n if (identityScope != null) {\n identityScope.lock();\n identityScope.reserveRoom(count);\n }\n try {\n do {\n list.add(loadCurrentDeep(cursor, false));\n } while (cursor.moveToNext());\n } finally {\n if (identityScope != null) {\n identityScope.unlock();\n }\n }\n }\n return list;\n }",
"public RowDataCursor(MysqlIO ioChannel, ServerPreparedStatement creatingStatement, Field[] metadata) {\n/* 112 */ this.currentPositionInEntireResult = -1;\n/* 113 */ this.metadata = metadata;\n/* 114 */ this.mysql = ioChannel;\n/* 115 */ this.statementIdOnServer = creatingStatement.getServerStatementId();\n/* 116 */ this.prepStmt = creatingStatement;\n/* 117 */ this.useBufferRowExplicit = MysqlIO.useBufferRowExplicit(this.metadata);\n/* */ }",
"Data<List<Pins>> getSearchPinsCursor(String query, String cursor, Integer limit, String fields);",
"public Cursor fetchAllPreg() {\n\n return mDb.query(DATABASE_TABLE, new String[] {KEY_ROWID, KEY_TITLE, KEY_TIME,\n KEY_BODY}, null, null, null, null, null);\n }",
"@Override\r\n\tprotected T doRead() throws Exception {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tif (cursor.hasNext()){\r\n\t\t\treturn converter.convert(cursor.next());\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"public getImageAsynch(Cursor cursor){\n\t\t cursorDB= cursor; \n\t }",
"private Cursor initilizeData(){\n\t String[] dataToAccess = new String[]{\n\t\t \tMediaStore.Images.Media._ID,\t\t\t// This is image file ID\n\t\t MediaStore.Images.Media.DISPLAY_NAME, // filename\n\t\t MediaStore.Images.Media.DATE_TAKEN\t\t// creation date\n\t\t };\n\t String limitSize = MediaStore.Images.Media.DATE_TAKEN + \" desc limit 25\"; // desc: says descending order (in reverse newest first), limit 5: 5, e.g., can also do: \"%s limit 5\"\n\t \n\t // Make the query.\n\t System.out.println(dataToAccess.toString());\n\t Context c = getActivity().getApplicationContext();\n\t mImageRef = c.getContentResolver().query(\n\t \t\tMediaStore.Images.Media.EXTERNAL_CONTENT_URI, // Get the base URI for all of the images\n\t dataToAccess, \t// Which columns to return\n\t \"\", \t// Which rows to return (all rows)\n\t null, \t// Selection arguments (none)\n\t limitSize // Ordering\n\t \t);\n\t \n\t\t// make sure there is something to move to! \n\t\t// \t(otherwise, this will crash if there are no photos) \n\t System.out.println(\"Count: \" + mImageRef.getCount());\n\t\tif (mImageRef.getCount() > 0)\n\t\t\tmImageRef.moveToFirst();\n\t\t\n\t\t\n\t\treturn mImageRef;\n\t}",
"public static List<TipoOpzioni> getListFromCursor(Cursor cursor) {\n List<TipoOpzioni> list = new ArrayList<>();\n if (cursor != null) {\n while (cursor.moveToNext()) {\n list.add(parseTipoOpzione(cursor));\n }\n }\n return list;\n }",
"Data<List<Pins>> getSearchPinsCursor(String query, String cursor, Integer limit);",
"Data<List<Boards>> getFollowersBoardsCursor(String cursor, Integer limit, String fields);",
"DataBaseReadStream createNewStream(Cursor beginCursor) throws SQLException;",
"Data<List<Boards>> getSearchBoardsCursor(String query, String cursor);",
"List<T> readAll();",
"public synchronized void getAllFromDbAndWriteIntoTempFiles() throws IOWrapperException, IOIteratorException{\r\n\r\n readFromDB = true;\r\n iow=new IOWrapper();\r\n iow.setupOutput(this.dbname,this.username,this.password,this.hostname,this.port);\r\n iow.setupInput(this.dbname,this.username,this.password,this.hostname,this.port);\r\n \r\n iter = iow.sendInputQuery(\"SELECT COUNT(*) FROM \"+nodetable);\r\n try {\r\n maxProgerss+=Integer.parseInt(((String[])iter.next())[0]); \r\n } catch (NullPointerException e) {maxProgerss+=100;}\r\n iter = iow.sendInputQuery(\"SELECT COUNT(*) FROM \"+edgetable);\r\n try {\r\n maxProgerss+=Integer.parseInt(((String[])iter.next())[0]);\r\n } catch (NullPointerException e) {maxProgerss+=100;}\r\n //iow.closeOutput();\r\n \r\n\r\n \r\n //nodelist\r\n iter = iow.select(nodetable,nodeCols);\r\n iow.setupOutput(Controller.NODES_TMP_FILENAME);\r\n while (iter.hasNext()) {\r\n singleProgress+=1;\r\n String[] data = (String[])iter.next();\r\n iow.writeLine(data[0]+\"\\t\"+data[1]);\r\n }\r\n iow.closeOutput();\r\n\t\r\n //edgelist\r\n iter=iow.select(edgetable,edgeCols);\r\n iow.setupOutput(Controller.EDGES_TMP_FILENAME);\r\n while (iter.hasNext()) {\r\n\t singleProgress+=1;\r\n String[] data = (String[])iter.next();\r\n iow.writeLine(data[0]+\"\\t\"+data[1]+\"\\t\"+data[2]);\r\n //System.out.println(\"wwsl: \"+data[0]+\"\\t\"+data[1]+\"\\t\"+data[2]);\r\n }\r\n iow.closeOutput();\r\n readFromDB=false;\r\n this.stillWorks=false;\r\n }",
"Data<List<Boards>> getFollowersBoardsCursor(String cursor, Integer limit);",
"@Override\n\tpublic List<Libro> readAll() {\n\t\treturn libroDao.readAll();\n\t}",
"@SuppressWarnings(\"unchecked\")\r\n\t@Override\r\n\tpublic <T> List<T> mapRowsFromQuery(List<Map<String, Object>> resultSet) {\n\t\tList<BaseIcon> baseIcons = new ArrayList<BaseIcon>();\r\n\t\t\r\n\t\tfor (Map<String, Object> result : resultSet) {\r\n\t\t\tint iconId = (int) result.get(\"iconId\");\r\n\t\t\tString iconName = (String) result.get(\"iconName\");\r\n\t\t\tint iconCounter = (int) result.get(\"iconCounter\");\r\n\t\t\tString iconStatus = (String) result.get(\"iconStatus\");\r\n\t\t\tint typeId = (int) result.get(\"typeId\");\r\n\t\t\tString typeName = (String) result.get(\"typeName\");\r\n\t\t\tint typeClass = (int) result.get(\"typeClass\");\r\n\t\t\t\r\n\t\t\tbaseIcons.add(new BaseIcon(iconId, iconName, iconCounter, iconStatus, new IconType(typeId, typeName, typeClass, 0)));\r\n\t\t}\r\n\t\t\r\n\t\treturn (List<T>) baseIcons;\r\n\t}",
"List<AliUserInfoDO> selectByExampleWithBLOBsWithRowbounds(AliUserInfoDOExample example, RowBounds rowBounds);",
"public List<T> selectAll() {\n Logger logger = getLogger();\n List<T> objectList = new ArrayList<>();\n try (Connection connection = getConnection();\n PreparedStatement preparedStatement = connection.prepareStatement(getSelectAll())) {\n\n logger.info(\"Executing statement: \" + preparedStatement);\n ResultSet rs = preparedStatement.executeQuery();\n\n while (rs.next()) {\n T object = setObjectParams(rs);\n setObjectId(rs, object);\n objectList.add(object);\n }\n } catch (SQLException e) {\n logger.error(e.getMessage());\n }\n logger.info(\"Select all: success\");\n return objectList;\n }",
"List<BufferedImage> listarHuellas(Integer fcdc_id) throws SQLException, IOException;",
"public List<Seller> loadAllDeepFromCursor(Cursor cursor) {\n int count = cursor.getCount();\n List<Seller> list = new ArrayList<Seller>(count);\n \n if (cursor.moveToFirst()) {\n if (identityScope != null) {\n identityScope.lock();\n identityScope.reserveRoom(count);\n }\n try {\n do {\n list.add(loadCurrentDeep(cursor, false));\n } while (cursor.moveToNext());\n } finally {\n if (identityScope != null) {\n identityScope.unlock();\n }\n }\n }\n return list;\n }",
"private List<String> getImages(String query, int id) {\n\t\tResultSet rs=null;\n\t\tList<String> imageList = new ArrayList<String>();\n\t\ttry {\n\t\t\t\n\t\t\t//pstmt = con.prepareStatement(query);\n\t\t\tPreparedStatement pstmt = dataSource.getConnection().prepareStatement(query);\n\t\t\tpstmt.setInt(1, id);\n\t\t\trs = pstmt.executeQuery();\n\t\t\twhile (rs.next()) \n\t\t\t{\n\t\t\t\timageList.add(rs.getString(1));\n\t\t\t}\n\t\t}catch (SQLException e) {\n\n\t\t\te.printStackTrace();\n\t\t\t\n\t\t}\n\t\t\treturn imageList;\n\t}",
"public Cursor getCursor()\n {\n// Object localObject1;\n// if (!this.mCursorValid)\n// {\n// this.mCursor = new EsMatrixCursor(PROJECTION);\n// this.mCursorValid = true;\n// if ((this.mLocalProfilesLoaded) && (this.mGaiaIdsAndCirclesLoaded))\n// {\n// localObject1 = new HashSet();\n// HashSet localHashSet = new HashSet();\n// Object localObject3 = this.mLocalProfiles.iterator();\n// while (true)\n// {\n// long l1;\n// if (!((Iterator)localObject3).hasNext())\n// {\n// localObject5 = this.mContacts.iterator();\n// while (true)\n// {\n// if (!((Iterator)localObject5).hasNext())\n// {\n// localObject2 = this.mPublicProfiles.iterator();\n// while (true)\n// {\n// if (!((Iterator)localObject2).hasNext())\n// {\n// localObject3 = this.mPublicProfiles.iterator();\n// while (true)\n// {\n// if (!((Iterator)localObject3).hasNext())\n// {\n// localObject1 = this.mCursor;\n// break;\n// }\n// localObject4 = (PublicProfile)((Iterator)localObject3).next();\n// localObject2 = ((PublicProfile)localObject4).gaiaId;\n// if (((HashSet)localObject1).contains(localObject2))\n// continue;\n// localObject5 = this.mCursor;\n// arrayOfObject = new Object[11];\n// l1 = this.mNextId;\n// this.mNextId = (1L + l1);\n// arrayOfObject[0] = Long.valueOf(l1);\n// arrayOfObject[1] = ((PublicProfile)localObject4).personId;\n// arrayOfObject[2] = null;\n// arrayOfObject[3] = localObject2;\n// arrayOfObject[4] = ((PublicProfile)localObject4).name;\n// arrayOfObject[5] = null;\n// arrayOfObject[6] = null;\n// arrayOfObject[7] = null;\n// arrayOfObject[8] = null;\n// arrayOfObject[9] = null;\n// arrayOfObject[10] = ((PublicProfile)localObject4).snippet;\n// ((EsMatrixCursor)localObject5).addRow(arrayOfObject);\n// }\n// }\n// localObject3 = (PublicProfile)((Iterator)localObject2).next();\n// localObject5 = ((PublicProfile)localObject3).gaiaId;\n// localObject4 = (String)this.mGaiaIdsAndCircles.get(localObject5);\n// if ((((HashSet)localObject1).contains(localObject5)) || (TextUtils.isEmpty((CharSequence)localObject4)))\n// continue;\n// ((HashSet)localObject1).add(localObject5);\n// localObject6 = this.mCursor;\n// Object[] arrayOfObject = new Object[11];\n// l1 = this.mNextId;\n// this.mNextId = (1L + l1);\n// arrayOfObject[0] = Long.valueOf(l1);\n// arrayOfObject[1] = ((PublicProfile)localObject3).personId;\n// arrayOfObject[2] = null;\n// arrayOfObject[3] = localObject5;\n// arrayOfObject[4] = ((PublicProfile)localObject3).name;\n// arrayOfObject[5] = localObject4;\n// arrayOfObject[6] = null;\n// arrayOfObject[7] = null;\n// arrayOfObject[8] = null;\n// arrayOfObject[9] = null;\n// arrayOfObject[10] = null;\n// ((EsMatrixCursor)localObject6).addRow(arrayOfObject);\n// }\n// }\n// localObject3 = (Contact)((Iterator)localObject5).next();\n// if (l1.contains(((Contact)localObject3).name))\n// continue;\n// localObject2 = this.mCursor;\n// localObject4 = new Object[11];\n// l2 = this.mNextId;\n// this.mNextId = (1L + l2);\n// localObject4[0] = Long.valueOf(l2);\n// localObject4[1] = ((Contact)localObject3).personId;\n// localObject4[2] = ((Contact)localObject3).lookupKey;\n// localObject4[3] = null;\n// localObject4[4] = ((Contact)localObject3).name;\n// localObject4[5] = null;\n// localObject4[6] = null;\n// localObject4[7] = ((Contact)localObject3).email;\n// localObject4[8] = ((Contact)localObject3).phoneNumber;\n// localObject4[9] = ((Contact)localObject3).phoneType;\n// localObject4[10] = null;\n// ((EsMatrixCursor)localObject2).addRow(localObject4);\n// }\n// }\n// Object localObject6 = (LocalProfile)((Iterator)localObject3).next();\n// Object localObject2 = ((LocalProfile)localObject6).gaiaId;\n// ((HashSet)localObject1).add(localObject2);\n// l1.add(((LocalProfile)localObject6).name);\n// Object localObject4 = this.mCursor;\n// Object localObject5 = new Object[11];\n// long l2 = this.mNextId;\n// this.mNextId = (1L + l2);\n// localObject5[0] = Long.valueOf(l2);\n// localObject5[1] = ((LocalProfile)localObject6).personId;\n// localObject5[2] = null;\n// localObject5[3] = localObject2;\n// localObject5[4] = ((LocalProfile)localObject6).name;\n// localObject5[5] = ((LocalProfile)localObject6).packedCircleIds;\n// localObject5[6] = ((LocalProfile)localObject6).email;\n// localObject5[7] = null;\n// localObject5[8] = ((LocalProfile)localObject6).phoneNumber;\n// localObject5[9] = ((LocalProfile)localObject6).phoneType;\n// localObject5[10] = null;\n// ((EsMatrixCursor)localObject4).addRow(localObject5);\n// }\n// }\n// localObject1 = this.mCursor;\n// }\n// else\n// {\n// localObject1 = this.mCursor;\n// }\n// return (Cursor)(Cursor)(Cursor)(Cursor)(Cursor)(Cursor)localObject1;\n return null;\n }",
"public static ArrayList<Product> selectAllPhotos() throws SQLException{\r\n try {\r\n Class.forName(\"com.mysql.jdbc.Driver\");\r\n }\r\n catch(ClassNotFoundException ex) {\r\n \r\n System.exit(1);\r\n }\r\n String URL = \"jdbc:mysql://localhost/phototest\";\r\n String USER = \"root\";\r\n String PASS = \"\";\r\n Connection connection = DriverManager.getConnection(URL, USER, PASS);\r\n PreparedStatement ps = null;\r\n ResultSet rs = null;\r\n \r\n String query = \"SELECT id,artistEmail,url,name,price,about FROM photos\";\r\n \r\n try{\r\n ps = connection.prepareStatement(query);\r\n \r\n ArrayList<Product> products = new ArrayList<Product>();\r\n rs = ps.executeQuery();\r\n while(rs.next())\r\n {\r\n Product p = new Product();\r\n p.setCode(rs.getString(\"id\"));\r\n p.setArtistEmail(rs.getString(\"artistEmail\"));\r\n p.setName(rs.getString(\"name\"));\r\n p.setImageURL(rs.getString(\"url\"));\r\n p.setPrice(rs.getDouble(\"price\"));\r\n p.setDescription(rs.getString(\"about\"));\r\n \r\n products.add(p);\r\n }\r\n return products;\r\n }\r\n catch(SQLException e){\r\n e.printStackTrace();\r\n return null;\r\n }\r\n finally\r\n {\r\n DBUtil.closeResultSet(rs);\r\n DBUtil.closePreparedStatement(ps);\r\n //pool.freeConnection(connection);\r\n }\r\n }",
"private List<T> createObjects(ResultSet rs){\n\t\tList<T> list = new ArrayList<T>();\n\t\t\n\t\ttry {\n\t\t\twhile(rs.next()) {\n\t\t\t\tT instance = type.newInstance();\n\t\t\t\tfor(Field field : type.getDeclaredFields()) {\n\t\t\t\t\tObject value = rs.getObject(field.getName());\n\t\t\t\t\tPropertyDescriptor pd = new PropertyDescriptor(field.getName(), type);\n\t\t\t\t\tMethod method = pd.getWriteMethod();\n\t\t\t\t\tmethod.invoke(instance, value);\n\t\t\t\t}\n\t\t\t\tlist.add(instance);\n\t\t\t}\n\t\t}catch(InstantiationException e) {\n\t\t\te.getStackTrace();\n\t\t} catch (java.beans.IntrospectionException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IllegalAccessException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IllegalArgumentException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (InvocationTargetException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn list;\n\t}",
"public static <T> List<T> getList(Cursor cursor, Class<? extends T> clazz) {\n if (cursor.moveToFirst()) {\n final List<T> result = new ArrayList<T>(cursor.getCount());\n final TypeAdapter adapter = getAdapter(clazz);\n do {\n final T newObject = (T) adapter.newObject();\n adapter.map(cursor, newObject);\n result.add(newObject);\n } while (cursor.moveToNext());\n return result;\n }\n return null;\n }",
"public ArrayList<UserModel> getEveryOne(){\n\n ArrayList <UserModel> returnList = new ArrayList<>();\n\n //get all the data from the database\n\n String queryString =\"SELECT * FROM \" + USER_TABLE;\n SQLiteDatabase db = this.getReadableDatabase();\n\n Cursor cursor = db.rawQuery(queryString , null);\n\n if(cursor.moveToFirst())\n {\n do{\n\n String name = cursor.getString(0);\n int id = cursor.getInt(4);\n String bluetoothaddress = cursor.getString(2);\n byte[] image = cursor.getBlob(1);\n String macaddress = cursor.getString(3);\n UserModel user = new UserModel(name,image,macaddress,bluetoothaddress,id);\n returnList.add(user);\n } while(cursor.moveToNext());\n }\n else {\n //failure\n }\n cursor.close();\n db.close();\n return returnList;\n\n }",
"public Cursor fetchAllEntries() {\n /*\n return database.query(\n DATABASE_TABLE, \n new String[] { ROWID, MAC_ADDRESS, LATITUDE, LONGITUDE, FREQUENCY, SIGNAL}, \n null,\n null, \n null,\n null, \n null);\n */\n \n // sql must NOT be ';' terminated\n String sql = \"SELECT \"+ ROWID + \", \" + MAC_ADDRESS + \", \" + LATITUDE + \", \" + LONGITUDE + \", \" \n + NETWORK_NAME + \", \" + CAPABILITIES + \", \" + FREQUENCY + \", \" + SIGNAL\n + \" FROM \" + DATABASE_TABLE;\n return database.rawQuery(sql, null);\n }",
"ArrayList<E> getAllObjects() throws DatabaseNotAccessibleException;",
"public Cursor fetchAll() {\n\t\tCursor cursor = db.query(UserConstants.DB_TABLE, UserConstants.fields(), null, null, null, null, null);\n\t\treturn cursor;\n\t}",
"private static Cursor makePoiCursor(int count) {\n Random random = new Random();\n long id, radius;\n double lat, lgt;\n String poi, poiType, cellTowers, connectedWifi, wifiSsid;\n final int maxRadius = 2000;\n // COL_ID, COL_POI, COL_LAT, COL_LGT, COL_RADIUS, COL_POI_TYPE, COL_CELL_TOWERS, COL_CONNECTED_WIFI, COL_WIFI_SSID\n MatrixCursor cursor = new MatrixCursor(PoiTuple.COLUMNS);\n for (int i = 0; i < count; i++) {\n id = random.nextLong();\n if (id < 0) {\n id = id * -1L;\n } else if (id == 0) {\n id = 1L;\n }\n poi = String.valueOf(random.nextGaussian());\n lat = random.nextDouble();\n lgt = random.nextDouble();\n radius = random.nextInt(maxRadius) + 1;\n poiType = String.valueOf(random.nextGaussian());\n cellTowers = String.valueOf(random.nextGaussian());\n connectedWifi = String.valueOf(random.nextGaussian());\n wifiSsid = String.valueOf(random.nextGaussian());\n cursor.newRow().add(id).add(poi).add(lat).add(lgt).add(radius).add(poiType)\n .add(cellTowers).add(connectedWifi).add(wifiSsid);\n }\n cursor.moveToFirst();\n\n return cursor;\n }",
"@Override\r\n\tpublic List<Libro> readAll() {\n\t\treturn libroRepository.findAll();\r\n\t}",
"List fetchAll() throws AdaptorException ;",
"@Override\n\tpublic Customer[] readAll() {\n\n\t\tString selectQuery = String.format(\"SELECT * FROM %s ;\", TABLE_NAME);\n\t\tCustomer[] result = null;\n\n\t\ttry (Statement s = dbCon.createStatement()) {\n\t\t\tResultSet rS = s.executeQuery(selectQuery);\n\n\t\t\tArrayList<Customer> resultTmp = new ArrayList<Customer>();\n\n\t\t\twhile (rS.next()) {\n\t\t\t\tresultTmp.add(\tresultTmp.size(),\n\t\t\t\t\t\t\t\tnew Customer(rS.getInt(COLUMN_NAME_ID),\n\t\t\t\t\t\t\t\t\t\t\trS.getString(COLUMN_NAME_FIRST_NAME),\n\t\t\t\t\t\t\t\t\t\t\trS.getString(COLUMN_NAME_LAST_NAME),\n\t\t\t\t\t\t\t\t\t\t\trS.getString(COLUMN_NAME_EMAIL),\n\t\t\t\t\t\t\t\t\t\t\trS.getString(COLUMN_NAME_KNICKNAME),\n\t\t\t\t\t\t\t\t\t\t\trS.getDate(COLUMN_NAME_BIRTHDATE).toLocalDate(),\n\t\t\t\t\t\t\t\t\t\t\trS.getDouble(COLUMN_NAME_CREDITS))\n\t\t\t\t\t\t\t\t);\n\t\t\t}\n\t\t\trS.close();\n\n\t\t\tresult = new Customer[resultTmp.size()];\n\t\t\tresultTmp.toArray(result);\n\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\"An SQL error occured during retrieving all data from of customer table : \" + e.getMessage());\n\t\t}\n\n\t\treturn result;\n\t}",
"@Override\n\tpublic Map<String, Object> readAll() {\n\t\tsimpleJdbcCall = new SimpleJdbcCall(jdbcTemplate)\n\t\t\t\t.withCatalogName(\"PKG_ALM_CRUD_PRODUNIDADMED\")\n\t\t\t\t.withProcedureName(\"PA_MAT_PRODUNIDADMED_LIS\")\t\n\t\t\t\t.declareParameters(new SqlOutParameter(\"uni\", OracleTypes\n\t\t\t\t.CURSOR, new ColumnMapRowMapper()));\n\t\treturn simpleJdbcCall.execute();\n\t}",
"public List<Clientes> read(){\n Connection con = ConectionFactory.getConnection();\n PreparedStatement pst = null;\n ResultSet rs = null;\n \n List<Clientes> cliente = new ArrayList<>();\n \n try {\n pst = con.prepareStatement(\"SELECT * from clientes ORDER BY fantasia\");\n rs = pst.executeQuery();\n \n while (rs.next()) { \n Clientes clientes = new Clientes();\n clientes.setCodigo(rs.getInt(\"codigo\"));\n clientes.setFantasia(rs.getString(\"fantasia\"));\n clientes.setCep(rs.getString(\"cep\"));\n clientes.setUf(rs.getString(\"uf\"));\n clientes.setLogradouro(rs.getString(\"logradouro\"));\n clientes.setNr(rs.getString(\"nr\"));\n clientes.setCidade(rs.getString(\"cidade\"));\n clientes.setBairro(rs.getString(\"bairro\"));\n clientes.setContato(rs.getString(\"contato\"));\n clientes.setEmail(rs.getString(\"email\"));\n clientes.setFixo(rs.getString(\"fixo\"));\n clientes.setCelular(rs.getString(\"celular\"));\n clientes.setObs(rs.getString(\"obs\"));\n cliente.add(clientes); \n }\n } catch (SQLException ex) {\n \n }finally{\n ConectionFactory.closeConnection(con, pst, rs);\n }\n return cliente;\n}",
"public List<NoticeBoardVO> selectAllBoards(int firstRow,int endRow){\r\n\t\tString sql=\"select * from board_notice order by num desc limit ?, ?\";\r\n\t\tList<NoticeBoardVO> list=new ArrayList<NoticeBoardVO>();\r\n\t\tConnection conn=null;\r\n\t\tPreparedStatement pstmt=null;\r\n\t\tResultSet rs=null;\t\t\r\n\t\ttry{\r\n\t\t\tconn=DBManager.getConnection();\r\n\t\t\tpstmt=conn.prepareStatement(sql);\r\n\t\t\tpstmt.setInt(1, firstRow-1);\r\n\t\t\tpstmt.setInt(2, endRow-firstRow+1);\r\n\t\t\tSystem.out.println(pstmt);\r\n\t\t\trs=pstmt.executeQuery();\r\n\t\t\twhile(rs.next()){\r\n\t\t\t\tNoticeBoardVO vo=new NoticeBoardVO();\r\n\t\t\t\tvo.setNum(rs.getInt(\"num\"));\r\n\t\t\t\tvo.setUserid(rs.getString(\"userid\"));\r\n\t\t\t\tvo.setTitle(rs.getString(\"title\"));\r\n\t\t\t\tvo.setContent(rs.getString(\"content\"));\r\n\t\t\t\tvo.setReadcount(rs.getInt(\"readcount\"));\r\n\t\t\t\tvo.setWritedate(rs.getTimestamp(\"writedate\"));\r\n\t\t\t\tlist.add(vo);\r\n\t\t\t}\r\n\t\t}catch(Exception e){\r\n\t\t\te.printStackTrace();\r\n\t\t}finally{\r\n\t\t\tDBManager.close(conn,pstmt,rs);\r\n\t\t}\r\n\t\tSystem.out.println(list);\r\n\t\treturn list;\t\t\r\n\t}",
"public Collection<T> readAll();",
"@SuppressWarnings(\"unchecked\")\n private <T> List<T> getNextBatch(final ObjectInputStream ois, final int batchSize) {\n final List<T> entities = new ArrayList<T>();\n try {\n while (entities.size() < batchSize) {\n entities.add((T) ois.readObject());\n }\n } catch (EOFException e) {\n // Great! No more data.. :)\n } catch (IOException e) {\n throw new RuntimeException(e);\n } catch (ClassNotFoundException e) {\n throw new RuntimeException(e);\n }\n return entities;\n }",
"public ArrayList<Foods> DataBaseLogFoodsGetFoods (long initialDate, long finalDate) {\n SQLiteDatabase db = this.getWritableDatabase();\n String query = \"SELECT * FROM \" + TABLE_NAME + \" WHERE \" + COLUMN_DATE + \" BETWEEN \" +\n + initialDate + \" AND \" + finalDate + \" ORDER BY \" + COLUMN_DATE +\n \" ASC\";\n\n Cursor cursor = db.rawQuery(query, null);\n\n cursor.moveToFirst();\n int counter = cursor.getCount();\n ArrayList<Foods> foodsList = new ArrayList<>();\n for ( ; counter > 0; ) {\n if (cursor.isAfterLast()) break;\n Foods food = new Foods();\n food.setId(cursor.getInt(cursor.getColumnIndex(COLUMN_ID)));\n food.setDate(cursor.getLong(cursor.getColumnIndex(COLUMN_DATE)));\n food.setName(cursor.getString(cursor.getColumnIndex(COLUMN_NAME)));\n food.setBrand(cursor.getString(cursor.getColumnIndex(COLUMN_BRAND)));\n food.setUnitsLogged(cursor.getFloat(cursor.getColumnIndex(COLUMN_UNITS_LOGGED)));\n food.setCaloriesLogged(cursor.getInt(cursor.getColumnIndex(COLUMN_CALORIES_LOGGED)));\n food.setUnits(cursor.getFloat(cursor.getColumnIndex(COLUMN_UNITS)));\n food.setUnitType(cursor.getString(cursor.getColumnIndex(COLUMN_UNIT_TYPE)));\n food.setCalories(cursor.getInt(cursor.getColumnIndex(COLUMN_CALORIES)));\n food.setMealTime(cursor.getString(cursor.getColumnIndex(COLUMN_MEAL_TIME)));\n food.setIsCustomCalories(cursor.getInt(cursor.getColumnIndex(COLUMN_IS_CUSTOM_CALORIES)) == 1);\n foodsList.add(food);\n cursor.moveToNext();\n }\n\n cursor.close();\n db.close(); // Closing database connection\n return foodsList;\n }",
"@Override\n\tpublic List<String> getAllImages() {\n\t\t\n\t\treturn jdbcTemplate.query(\"select * from news\", new BeanPropertyRowMapper<News>());\n\t}",
"public ArrayList<ArrayList<Object>> getRowSet()\r\n {\r\n ArrayList<ArrayList<Object>> list = new ArrayList<>();\r\n try {\r\n int c = 0; \r\n while(c < rows)\r\n {\r\n rs.next();\r\n System.out.println(c);\r\n ArrayList<Object> obj = new ArrayList<>();\r\n int col = rs.getMetaData().getColumnCount();\r\n for(int i = 1; i < col; i++)\r\n {\r\n obj.add(rs.getObject(i));\r\n }\r\n list.add(obj);\r\n c++;\r\n }\r\n return list;\r\n \r\n } catch (SQLException ex) {\r\n return list;\r\n }\r\n }",
"public List<CardImage> readAll() {\n List<CardImage> cards = new ArrayList<CardImage>();\n for (String colour : this.colours) {\n for (String number : this.numbers) {\n for (String darkLight : this.darkLight) {\n cards\n .add(\n new CardImage(colour, number, darkLight,\n new Image(getClass().getResource(\n \"cards/\" + colour + seperator + number + seperator + darkLight + \".png\")\n .toExternalForm())));\n }\n }\n }\n return cards;\n }",
"public static Cursor getAllCursor() {\n String tableName = Cache.getTableInfo(TodoItem.class).getTableName();\n\n // Query all items without any conditions\n String sql = new Select(tableName + \".*, \" + tableName + \".Id as _id\").\n from(TodoItem.class).toSql();\n\n return Cache.openDatabase().rawQuery(sql, null);\n }",
"public void prepareCursorSelectAllRows() {\n setCallFromStatement();\n // The statement is no longer require so can be released.\n clearStatement();\n\n super.prepareCursorSelectAllRows();\n }",
"public List<ActividadEntitie> LoadAllActividades() {\r\n\t\t\r\n\t\tCursor cursor = this.myDatabase.query(ActividadTablaEntidad.nombre_tabla,\r\n\t\t\t\t new String[] {ActividadTablaEntidad.id,ActividadTablaEntidad.actividad_codigo,ActividadTablaEntidad.actividad_descripcion}, \r\n\t\t\t\t null,null,null,null,ActividadTablaEntidad.actividad_codigo);\r\n\t\t\r\n\t\tcursor.moveToFirst();\r\n\t\t\r\n\t\tActividadEntitie datos = null;\r\n\t\tArrayList<ActividadEntitie> actividadList = null;\r\n\t\t\r\n\t\tif (cursor != null ) {\r\n\t\t\t\r\n\t\t\tactividadList = new ArrayList<ActividadEntitie>();\r\n\t\t\t\r\n\t\t\t\r\n\t\t if (cursor.moveToFirst()) {\r\n\t\t do {\r\n\t\t \t\r\n\t\t \tdatos = new ActividadEntitie();\r\n\t\t \tdatos.set_codigoActividad(cursor.getString(cursor.getColumnIndex(ActividadTablaEntidad.actividad_codigo)));\r\n\t\t \tdatos.set_descripcionActividad(cursor.getString(cursor.getColumnIndex(ActividadTablaEntidad.actividad_descripcion)));\r\n\t\t \tdatos.set_id(cursor.getLong(cursor.getColumnIndex(ActividadTablaEntidad.id)));\r\n\t\t \t\r\n\t\t \tactividadList.add(datos);\r\n\t\t \t\r\n\t\t }while (cursor.moveToNext());\r\n\t\t }\r\n\t\t}\r\n\t\t\r\n\t\tif(cursor != null)\r\n cursor.close();\r\n\t\t\r\n\t\treturn actividadList;\r\n\t}",
"@Override\n public Collection<FasciaOrariaBean> doRetrieveAll() throws SQLException {\n Connection con = null;\n PreparedStatement statement = null;\n String sql = \"SELECT * FROM fasciaoraria\";\n ArrayList<FasciaOrariaBean> collection = new ArrayList<>();\n try {\n con = DriverManagerConnectionPool.getConnection();\n statement = con.prepareStatement(sql);\n System.out.println(\"DoRetriveAll\" + statement);\n ResultSet rs = statement.executeQuery();\n while (rs.next()) {\n FasciaOrariaBean bean = new FasciaOrariaBean();\n bean.setId(rs.getInt(\"id\"));\n bean.setFascia(rs.getString(\"fascia\"));\n collection.add(bean);\n }\n return collection;\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n\n try {\n\n statement.close();\n DriverManagerConnectionPool.releaseConnection(con);\n\n } catch (SQLException e) {\n\n e.printStackTrace();\n }\n }\n return collection;\n }",
"public List<Record>getRecords(){\n List<Record>recordList=new ArrayList<>();\n RecordCursorWrapper currsorWrapper=queryRecords(null,null);\n try{\n currsorWrapper.moveToFirst();\n while(!currsorWrapper.isAfterLast()){\n recordList.add(currsorWrapper.getRecord());\n currsorWrapper.moveToNext();\n }\n }finally {\n currsorWrapper.close();\n }\n return recordList;\n }",
"private List<Embarcation> cursorToEmbarcationList(Cursor cursor){\n\t\tList<Embarcation> resultList = new ArrayList<Embarcation>();\n\t\t\n\t\twhile(cursor.moveToNext()){\n\t\t\tEmbarcation embarcation = new Embarcation(\n\t\t\t\t\tcursor.getInt(cursor.getColumnIndex(ID_WEB)),\n\t\t\t\t\tcursor.getString(cursor.getColumnIndex(LIBELLE)),\n\t\t\t\t\tcursor.getString(cursor.getColumnIndex(COMMENTAIRE)),\t\t\t\t\t\n\t\t\t\t\tcursor.getInt(cursor.getColumnIndex(DISPONIBLE)) > 0,\t\n\t\t\t\t\tcursor.getInt(cursor.getColumnIndex(CONTENANCE)),\t\t\t\n\t\t\t\t\tcursor.getLong(cursor.getColumnIndex(VERSION))\n\t\t\t\t\t);\n\t\t\t\n\t\t\tresultList.add(embarcation);\t\t\t\n\t\t}\n\t\tcursor.close();\n\t\t\n\t\treturn resultList;\n\t}",
"public static ArrayList<Object[]> getData(String query){\n ArrayList<Object[]> resultList = new ArrayList<Object[]>();\n ResultSet result;\n ResultSetMetaData rsmd;\n connect();\n try{\n Statement stm = conn.createStatement();\n result = stm.executeQuery(query);\n rsmd = result.getMetaData();\n Object[] obj = new Object[rsmd.getColumnCount()];\n while(result.next()){\n for(int col = 1; col < rsmd.getColumnCount(); col++){\n obj[col-1] = result.getObject(col);\n }\n resultList.add(obj);\n }\n }catch(Exception e) {\n System.out.println(e.getMessage());\n }\n disconnect();\n return resultList;\n }",
"public ArrayList<Info_laboral> findAll(){\n ConexionBD con = new ConexionBD();\n Connection c = con.conOracle();\n\n ArrayList<Info_laboral> eeg = new ArrayList();\n\n try{\n ResultSet gs = con.ejecutaCon(\" Select * from Info_laboral\"); \n while(gs.next()){\n \n Estudios_Egresado ee=new Estudios_Egresado();\n Info_laboral i =new Info_laboral();\n Egresado eg = new Egresado();\n Estudios es = new Estudios();\n \n i.setId(gs.getInt(1));\n i.setJefe(gs.getString(2));\n i.setCargo(gs.getString(3));\n i.setFuncion(gs.getString(4));\n i.setFecha_ini(gs.getDate(5));\n i.setFecha_fin(gs.getDate(6));\n i.setMotivo_retiro(gs.getString(7));\n eg.setId(gs.getLong(8));\n i.setId_egresado(eg);\n i.setPerfil(gs.getString(9));\n \n eeg.add(i);\n }\n }catch(SQLException e){\n System.out.println(\"error \"+e);\n return null;\n }\n return eeg;\n }",
"private void getTodoItemsFromDatabase(){\n Cursor result = todoDatabaseHelper.getAllData();\n if(result.getCount() > 0){\n //there is some data\n while(result.moveToNext()){\n TodoItem todoItem = new TodoItem(result.getInt(0) ,result.getString(1), result.getString(2));\n todoItem.setSelected(false);\n todoItem.setCollapsed(true);\n todoItems.add(todoItem);\n }\n }\n }",
"private void consultartiposincidentes() {\n\n db= con.getWritableDatabase();\n TipoIncidente clase_tipo_incidente= null;\n tipoincidentelist= new ArrayList<TipoIncidente>();\n //CONSULTA\n Cursor cursor=db.rawQuery(\"select codigo_incidente,tipo_incidente from \" +Utilitario.TABLE_TIPO_INCIDENTE,null);\n\n while (cursor.moveToNext()){\n clase_tipo_incidente=new TipoIncidente();\n clase_tipo_incidente.setCodigo(cursor.getInt(0));\n clase_tipo_incidente.setDescripcion(cursor.getString(1));\n\n Log.i(\"id\",clase_tipo_incidente.getCodigo().toString());\n Log.i(\"desc\",clase_tipo_incidente.getDescripcion());\n\n tipoincidentelist.add(clase_tipo_incidente);\n\n }\n llenarspinner();\n db.close();\n }",
"public List<User> fetchAll()\n {\n String query = \"SELECT * FROM user\";\n RowMapper<User> userRowMapper = new BeanPropertyRowMapper<>(User.class); // a collection type that holds the results of the query\n List<User> userList; // list of users that will be returned\n try\n {\n userList = template.query(query, userRowMapper); // call the database and assign the results to the userList\n } catch (EmptyResultDataAccessException e)\n {\n userList = new ArrayList<>(); // return an empty arrayList\n }\n return userList;\n }",
"public abstract long getCursor();",
"private Bitmap convertCursorRowToUXFormat(Cursor cursor) {\n // get row indices for our cursor\n int idx_poster_img = cursor.getColumnIndex(MoviesContract.MovieEntry.COLUMN_POSTER);\n\n byte[] blob = cursor.getBlob(idx_poster_img);\n ByteArrayInputStream inputStream = new ByteArrayInputStream(blob);\n Bitmap bitmap = BitmapFactory.decodeStream(inputStream);\n\n return bitmap;\n }",
"public List selectAll() {\n\t\tList values = new ArrayList();\n\t\topen();\n\t\tCursor c = queryDB();\n\n\t\tif (c.moveToFirst()) {\n\t\t\tdo {\n\t\t\t//\tvalues.add(hydrateNewObject(c));\n\t\t\t} while (c.moveToNext());\n\t\t}\n\t\t\n\t\tc.close();\n\t\tclose();\n\t\t\n\t\treturn values;\n\t}",
"private void getTravelItems() {\n String[] columns = Columns.getTravelColumnNames();\n Cursor travelCursor = database.query(TABLE_NAME, columns, null, null, null, null, Columns.KEY_TRAVEL_ID.getColumnName());\n travelCursor.moveToFirst();\n while (!travelCursor.isAfterLast()) {\n cursorToTravel(travelCursor);\n travelCursor.moveToNext();\n }\n travelCursor.close();\n }",
"public List<Usuario> getAllUsuarios(){\r\n List<Usuario> users = new ArrayList<Usuario>();\r\n try{\r\n PreparedStatement ps = bd.prepareStatement(SQLALL);\r\n ResultSet rs = ps.executeQuery();\r\n while(rs.next()){\r\n Usuario u = new Usuario();\r\n u.setId(rs.getInt(\"id\"));\r\n u.setUsuario(rs.getString(\"usuario\"));\r\n u.setNome(rs.getString(\"nome\"));\r\n u.setEmail(rs.getString(\"email\"));\r\n u.setSenha(rs.getString(\"senha\"));\r\n u.setPin(rs.getString(\"pin\"));\r\n u.setUrlfoto(rs.getString(\"urlfoto\"));\r\n u.setAcesso(rs.getTimestamp(\"acesso\"));\r\n u.setAdmin(rs.getInt(\"admin\"));\r\n users.add(u);\r\n }\r\n rs.close();\r\n ps.close();\r\n ConexaoBD.fechar(bd);\r\n } catch(SQLException sqle){\r\n System.out.println(\"Erro no getAllUsuarios no DAO: \" + sqle.getMessage());\r\n }\r\n return users;\r\n }",
"public ArrayList findShapes() {\n ArrayList shapes = new ArrayList<>();\n\n // open database connection\n DatabaseConnection connection = new DatabaseConnection();\n\n if (connection.openConnection()) {\n\n // if a connection was successfully setup, execute the SELECT statement.\n ResultSet resultset = connection.executeSQLSelectStatement(\n \"SELECT *\\n\" +\n \"FROM shape_objects\\n\" +\n \"JOIN shape ON shape_objects.shape = shape.shape_id\\n\");\n\n // check if result is not null\n if (resultset != null) {\n try {\n while (resultset.next()) {\n\n int idFromDb = resultset.getInt(\"id\");\n double heightFromDb = resultset.getDouble(\"height\");\n double radiusFromDb = resultset.getDouble(\"radius\");\n double lengthFromDb = resultset.getDouble(\"width\");\n double widthFromDb = resultset.getDouble(\"length\");\n String shapeNameFromDb = resultset.getString(\"name\");\n\n\n if (Objects.equals(shapeNameFromDb, \"cilinder\")) {\n Cilinder newCilinder = new Cilinder(idFromDb, shapeNameFromDb, heightFromDb, radiusFromDb);\n shapes.add(newCilinder);\n }\n\n if (Objects.equals(shapeNameFromDb, \"sphere\")) {\n Sphere newSphere = new Sphere(idFromDb, shapeNameFromDb, radiusFromDb);\n shapes.add(newSphere);\n }\n\n if (Objects.equals(shapeNameFromDb, \"cubic\")) {\n Cubic newCubic = new Cubic(idFromDb, shapeNameFromDb, lengthFromDb, widthFromDb, heightFromDb);\n shapes.add(newCubic);\n }\n }\n } catch (SQLException e) {\n shapes.clear();\n }\n }\n\n // close database connection\n connection.closeConnection();\n }\n\n return shapes;\n }",
"public ArrayList<rubro> obtenerTodoslosRubros() {\n ArrayList<rubro> lista = new ArrayList<>();\n try {\n Connection conn = DriverManager.getConnection(CONN, USER, PASS);\n\n PreparedStatement pr = conn.prepareStatement(\"select id_rubro , nombre, descripcion, estado, ruta \\n\"\n + \" from rubros \");\n\n ResultSet rs = pr.executeQuery();\n\n while (rs.next()) {\n int id = rs.getInt(1);\n String nombre = rs.getString(2);\n String descripcion = rs.getString(3);\n boolean estado = rs.getBoolean(4);\n String ruta = rs.getString(5);\n\n rubro r = new rubro(id, nombre, estado, descripcion, ruta);\n\n lista.add(r);\n }\n\n rs.close();\n conn.close();\n } catch (SQLException ex) {\n ex.printStackTrace();\n }\n\n return lista;\n\n }",
"DBCursor execute();",
"public static ResultSet getAllItem() {\n try {\n Statement st = conn.createStatement();\n ResultSet rs = st.executeQuery(\"SELECT itemID, ownerID, Name, status, description,category,image1,image2,image3,image4 FROM iteminformation\");\n return rs;\n } catch (SQLException ex) {\n Logger.getLogger(itemDAO.class.getName()).log(Level.SEVERE, null, ex);\n }\n return null;\n }",
"public List<ImagingDocument> getDocumentsToCompleteImports() throws SQLException {\n\t\tList<ImagingDocument> documentsToComplete = new ArrayList<ImagingDocument>();\n\t\tConnection connection = DataSourceUtils.getConnection(dataSource);\n\t\tString sql = SQL_UEWI_SELECT_DOCUMENTS_TO_COMPLETE_IMPORTS;\n\t\tPreparedStatement stmt = connection.prepareStatement(sql);\n\t\tstmt.setMaxRows(batchSize);\n\t\tResultSet rs = stmt.executeQuery();\n\t\t\n\t\twhile (rs.next()) {\n\t\t\tImagingDocument docRow = new ImagingDocument(rs.getString(1), rs.getString(2), rs.getBoolean(3), rs.getString(4), rs.getInt(5));\n\t\t\tdocumentsToComplete.add(docRow);\n\t\t}\n\t\trs.close();\n\t\tconnection.close();\n\t\tstmt.close();\n\t\t\n\t\treturn documentsToComplete;\n\t}",
"public abstract DBIterator NewIterator(ReadOptions options);",
"@Override\n public Iterator<T> iterator() {\n return new CLITableIterator<T>(createNew(tables, cursor, rowIndex));\n }",
"private void consultarlistareportes() {\n db= con.getWritableDatabase();\n ReporteIncidente reporte= null;\n listarreportesinc =new ArrayList<ReporteIncidente>();\n Cursor cursor= db.rawQuery(\"select imagen1,asunto_reporte,estado_reporte,desc_reporte,cod_reporte from \"+ Utilitario.TABLE_REPORTE_INCIDENTE+\" where estado_reporte<>'Incompleto'\",null);\n\n while (cursor.moveToNext()){\n reporte= new ReporteIncidente();\n reporte.setImage1(cursor.getBlob(0));\n reporte.setAsunto(cursor.getString(1));\n reporte.setEstado(cursor.getString(2));\n reporte.setDescripcion(cursor.getString(3));\n reporte.setCodreporte(cursor.getInt(4));\n listarreportesinc.add(reporte);\n }\n //obtenerinformacion();\n db.close();\n }",
"@Override\n\tpublic List<ImageEntity> getAll() {\n\t\treturn DatabaseContext.findAll(ImageEntity.class);\n\t}",
"public boolean fetchNext(Transaction trans, DatasetCursor cursor,\n DBObject obj, Filter filter, boolean forUpdate)\n throws StorageException, LockConflict {\n Rowid rowid = cursor.getRowid();\n int index = rowid.getIndex();\n\n while (true) {\n ++index;\n\n if (index < 0 || index >= dir.getCount())\n return false;\n\n rowid.setIndex((short) index);\n\n if (_read(trans, obj, index, forUpdate, filter))\n return true;\n }\n }",
"protected <T> List<T> readObjects(Class<T> klass, ResultSet rset, int objCol) throws DaoException {\n String json = null;\n try {\n List<T> results = new ArrayList<>();\n for (Row row = rset.one(); row != null; row = rset.one()) {\n json = row.getString(objCol);\n results.add(getMapper().readValue(json, klass));\n }\n return results;\n } catch (IOException e) {\n LOGGER.error(\"Unable to deserialize object from JSON\", e);\n LOGGER.error(\"{}\", json);\n throw new DaoException(\"Unable to deserialize object\", e);\n }\n }",
"private ArrayList<HashMap<String, String>> processRetrieve() {\n //Transform and Return Rows to a List of HashMaps\n try {\n if (rs == null) {\n System.out.println(\"rs is null\");\n } else {\n return rsToMaps();\n }\n } catch (SQLException ex) {\n throw new RuntimeException(ex);\n }\n return null;\n }",
"public abstract AbstractObjectIterator<LocalAbstractObject> getAllObjects();",
"public static interface Cursor {\n\t\tpublic void open() throws RelationException;\n\n\t\t//the hasNext() method actually loads the object, so don't skip it\n\t\tpublic boolean hasNext() throws RelationException;\n\n\t\t//this retrieves the next object. use in confunction with hasNext();\n\t\tpublic Tuple next() throws RelationException;\n\n\t\tpublic void close() throws RelationException;\n\t}",
"public ListIterator<T> getAllByRowsIterator() {\n\t\tAllByRowsIterator it = new AllByRowsIterator();\n\t\treturn it;\n\t}",
"private ArrayList<T> createObjects(ResultSet resultSet) {\n\t\tArrayList<T> list = new ArrayList<T>();\n\t\ttry {\n\t\t\twhile (resultSet.next()) {\n\t\t\t\tT instance = null;\n\t\t\t\ttry {\n\t\t\t\t\tinstance = type.getDeclaredConstructor().newInstance();\n\t\t\t\t} catch (NoSuchMethodException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tfor (Field field : type.getDeclaredFields()) {\n\t\t\t\t\tObject value = resultSet.getObject(field.getName());\n\t\t\t\t\tPropertyDescriptor propertyDescriptor = new PropertyDescriptor(field.getName(), type);\n\t\t\t\t\tMethod method = propertyDescriptor.getWriteMethod();\n\t\t\t\t\tmethod.invoke(instance, value);\n\t\t\t\t}\n\t\t\t\tlist.add(instance);\n\t\t\t}\n\t\t} catch (InstantiationException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IllegalAccessException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SecurityException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IllegalArgumentException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (InvocationTargetException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IntrospectionException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn list;\n\t}"
] | [
"0.6065496",
"0.6041164",
"0.594881",
"0.57803655",
"0.5755956",
"0.574083",
"0.5716205",
"0.5715267",
"0.5700741",
"0.5699952",
"0.5677734",
"0.5625836",
"0.561281",
"0.5594811",
"0.5589965",
"0.55698264",
"0.55472285",
"0.5514085",
"0.5491351",
"0.54808956",
"0.54664177",
"0.54626447",
"0.5460841",
"0.5440169",
"0.54373735",
"0.54101646",
"0.5379614",
"0.53666055",
"0.5363434",
"0.53590345",
"0.53560346",
"0.53327537",
"0.528248",
"0.52812964",
"0.5275192",
"0.52670574",
"0.52566755",
"0.5196852",
"0.5194808",
"0.5191719",
"0.5185101",
"0.51719326",
"0.5167949",
"0.51647425",
"0.514223",
"0.51399356",
"0.5124912",
"0.5113477",
"0.50947183",
"0.5085801",
"0.5076545",
"0.5065765",
"0.5064017",
"0.5056393",
"0.50561243",
"0.50536144",
"0.50461143",
"0.5046114",
"0.5024777",
"0.49879318",
"0.49858657",
"0.49716845",
"0.4952341",
"0.49420536",
"0.4939878",
"0.49346733",
"0.4932153",
"0.4929463",
"0.49278736",
"0.49216574",
"0.49155045",
"0.49038184",
"0.4887091",
"0.48841408",
"0.4883565",
"0.48834884",
"0.48821452",
"0.48816374",
"0.48808756",
"0.48780727",
"0.487612",
"0.48610353",
"0.48568535",
"0.48553106",
"0.48525852",
"0.4848583",
"0.48484755",
"0.48465684",
"0.4843984",
"0.4835896",
"0.48300046",
"0.48253602",
"0.48207867",
"0.4819109",
"0.48187155",
"0.48139688",
"0.4813584",
"0.4813499",
"0.48074096",
"0.47998908",
"0.47972307"
] | 0.0 | -1 |
A rawstyle query where you can pass any WHERE clause and arguments. | public List<District> queryDeep(String where, String... selectionArg) {
Cursor cursor = db.rawQuery(getSelectDeep() + where, selectionArg);
return loadDeepAllAndCloseCursor(cursor);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Query query();",
"public List sqlQuery(String sql,Object... params);",
"public abstract ResultList executeSQL(RawQuery rawQuery);",
"String getWhereClause();",
"public QbWhere where();",
"public Cursor rawQuery(String sql, String[] selectionArgs) {\n sqLiteDatabase.beginTransaction();\n Cursor res = null;\n try {\n res = sqLiteDatabase.rawQuery(sql, selectionArgs);\n sqLiteDatabase.setTransactionSuccessful();\n } catch (Exception e) {\n res = null;\n } finally {\n sqLiteDatabase.endTransaction();\n }\n return res;\n }",
"public Query createQuery(String hql, Object... params) ;",
"public ResultSet query(String cql, Object ... values) {\n\t\tLog.v(LOG_TAG, \" Query: \" + cql);\n\t\tList<Object> cqlSafeValues = this.getCqlSafeValues(values);\n\t\ttry {\t\t\t\n\t\t\tPreparedStatement prepared = this.getSession().prepare(cql);\n\t\t\tBoundStatement boundStatement = new BoundStatement(prepared);\n\t\t\tResultSet results;\n\t\t\tif (cqlSafeValues.size() > 0) {\n\t\t\t\tresults = this.getSession().execute(boundStatement.bind(cqlSafeValues.toArray()));\n\t\t\t} else {\n\t\t\t\tresults = this.getSession().execute(boundStatement);\n\t\t\t}\n\t\t\treturn results;\n\t\t} catch (Exception e) {\n\t\t\tLog.e(LOG_TAG, e);\n\t\t\tthrow new DatastoreServiceException(e);\t\t\t\n\t\t}\t\t\n\t}",
"public Ruta[] findByDynamicWhere(String sql, Object[] sqlParams) throws RutaDaoException;",
"public Cliente[] findByDynamicWhere(String sql, Object[] sqlParams) throws ClienteDaoException;",
"SelectQuery createSelectQuery();",
"public synchronized Cursor ExecuteRawSql(String s) {//Select Query\n try {\n\n//\t\t\tif(sqLiteDb != null)\n//\t\t\t\tcloseDB(null);\n\n sqLiteDb = openDatabaseInReadableMode();\n Log.d(TAG, \"Actual Query--->>\" + s);\n return sqLiteDb.rawQuery(s, null);\n\n }\n catch (Exception e) {\n e.printStackTrace();\n LogUtility.NoteLog(e);\n return null;\n }\n }",
"public Items[] findByDynamicWhere(String sql, Object[] sqlParams) throws ItemsDaoException;",
"public ResultSet query(String table_name, String[] columns,\n String where_condition, String[] whereArgs, String order_by) {\n\n // silently return if connection is closed\n if (!is_open) {\n return null;\n }\n\n // build the query string\n StringBuilder query_string = new StringBuilder(\"SELECT \");\n\n // if there are specific columns to select, do so\n if (columns != null) {\n\n int length = columns.length;\n for (int i = 0; i < length; i++) {\n query_string.append(columns[i]);\n\n // if we aren't at the last value, separate with a comma\n if (i != length - 1) {\n query_string.append(\", \");\n }\n }\n } else {\n // select everything\n query_string.append(\"*\");\n }\n\n // add from clause and table name\n query_string.append(\" FROM \");\n query_string.append(table_name);\n\n // if there is a condition, include it\n if (where_condition != null) {\n query_string.append(\" WHERE \");\n\n // replace question marks in where condition with strings (Android style!)\n if (where_condition.contains(\"?\") && whereArgs != null && whereArgs.length > 0) {\n for (String whereArg : whereArgs) {\n where_condition = where_condition.replaceFirst(\"\\\\?\", \"'\" + whereArg + \"'\");\n }\n }\n\n // append the new where condition\n query_string.append(where_condition);\n } else {\n // if no condition, query every row! (not too dangerous)\n query_string.append(\" WHERE 1 = 1\");\n }\n\n // if there is an order, include it\n if (order_by != null) {\n query_string.append(\" ORDER BY \");\n query_string.append(order_by);\n }\n\n // try the query\n try {\n return statement.executeQuery(query_string.toString());\n } catch (SQLException e) {\n System.out.println(\"Could not process query for table \" + table_name);\n e.printStackTrace();\n }\n\n // default return value\n return null;\n\n }",
"public abstract String createQuery();",
"SQLQuery createSQLQuery(final String query);",
"Query createQuery(final String query);",
"private String buildQuery(String ... sql) {\n\t\tfinal StringBuffer sb = new StringBuffer();\n\t\t\n\t\tfor (String s : sql) {\n\t\t\tsb.append(ParsingUtil.QUERY + \" \" + s + \"\\n\");\n\t\t}\n\t\t\n\t\treturn sb.toString(); \n\t}",
"@Override\n @PlainSQL\n public PaymentP2007_03 where(@Stringly.SQL String condition, Object... binds) {\n return where(DSL.condition(condition, binds));\n }",
"public SingleQuery query(String sql, Object... params) {\r\n PreparedStatement stmt = prepare(sql);\r\n\r\n try {\r\n if (params != null && params.length > 0) {\r\n for (int i = 0; i < params.length; i++) {\r\n stmt.setObject(i + 1, params[i]);\r\n }\r\n }\r\n } catch (SQLException e1) {\r\n throw new DbException(e1);\r\n }\r\n\r\n return runQuery(stmt);\r\n }",
"ZZW queryByHql(String hql,Map<String,Object> param);",
"public int execRawSql(String sql, Map<String, Object> params){\r\n\t\treturn execRawSqlPrivate(sql, false, params);\r\n\t}",
"public Faq[] findByDynamicWhere(String sql, Object[] sqlParams) throws FaqDaoException;",
"private String addWhere(String hql, Map<String, Object> params) {\n\t\t\thql += \" where \";\n\t\t\tint temp=0;\n\t\t\tif (params != null && !params.isEmpty()) {\n\t\t\t\tfor (String key : params.keySet()) {\n\t\t\t\t\tif(temp!=0){\n\t\t\t\t\t\thql+=\" and \";\n\t\t\t\t\t}\n\t\t\t\t\thql += \"t.\"+key+\"=:\"+key;\n\t\t\t\t\ttemp++;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn hql;\n\t}",
"public static Query of(String rawQuery) {\n return new Query(rawQuery);\n }",
"String query();",
"public Cursor raw(String query){\n SQLiteDatabase db = this.getWritableDatabase();\n Cursor c = db.rawQuery(query, null);\n return c;\n }",
"Query queryOn(Connection connection);",
"public ResultSet queryRawSQL(String sql) throws SQLException{\n return mysql.query(sql);\n }",
"public String getQueryString() {\n if (CoreUtil.isEmpty(sql)) {\n return \"\";\n }\n if(bind == null) {\n return sql;\n }\n StringBuilder buf = new StringBuilder();\n StringTokenizer tok = new StringTokenizer(sql + \" \", \"?\");\n int x = 0;\n while (tok.hasMoreTokens()) {\n String oneChunk = tok.nextToken();\n buf.append(oneChunk);\n Object value = null;\n if(x < bind.length) {\n value = bind[x];\n if(value instanceof java.util.Date) {\n value = \"'\"+CoreUtil.formatDateTime(\"yyyy.MM.dd\", (java.util.Date)value)+\"'\";\n }else if(value instanceof java.sql.Date) {\n value = \"'\"+CoreUtil.formatDateTime(\"yyyy.MM.dd\", (java.sql.Date)value)+\"'\";\n }else if(value instanceof String) {\n value = \"'\"+value+\"'\";\n }\n buf.append(value);\n }\n x++;\n }\n return buf.toString().trim();\n }",
"public int execRawSql(String sql, Object... params) {\r\n\t\treturn execRawSqlPrivate(sql, false, params);\r\n\t}",
"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 }",
"IQuery getQuery();",
"public List<String> queryForStrings(String sql, Object[] params);",
"private BeverageCursorWrapper queryBeverages(String whereClause, String[] whereArgs) {\n Cursor cursor = mDatabase.query(\n BeverageTable.NAME, // Name of table we are querying\n null, // Columns we are selecting (null means the entire row)\n whereClause, // What column are we looking at? (for example, the ID)\n whereArgs, // What must the value of that column be in order for us to return the row?\n null, // Group by\n null, // Having\n null // Order by\n );\n\n return new BeverageCursorWrapper(cursor);\n }",
"protected abstract NativeSQLStatement createNativeFilterStatement(Geometry geom);",
"List<Object[]> findBySql(String sql, final Object... objects);",
"public Usuario[] findByDynamicWhere(String sql, Object[] sqlParams) throws SQLException;",
"QueryArgs getQueryArgs();",
"protected StringBuilder generateQuery() {\n StringBuilder sb = new StringBuilder();\n sb.append(\" FROM \") \n .append(dao.getParameterClass(0).getName())\n .append(\" d WHERE (:incorrectEvent = '' OR d.incorrectEvent.id = :incorrectEvent) \")\n .append(\"AND (d.createDate BETWEEN :dateFrom AND :dateTo ) \")\n .append(\"AND ( ((:incorrectEvent ='' AND :incorrectEventName!='' AND UPPER(d.incorrectEvent.name) LIKE :incorrectEventName) \")\n .append(\" OR (:incorrectEvent ='' AND :incorrectEventName!='' AND UPPER(d.incorrectEvent.name) LIKE :incorrectEventName)) \")\n .append(\" OR (:search='' OR d.searchField LIKE :search) ) \");\n return sb;\n }",
"String getQuery() throws RemoteException;",
"public Items[] findByDynamicSelect(String sql, Object[] sqlParams) throws ItemsDaoException;",
"@Test\n public void createSqlQueryWithWhereSucceed()\n {\n // arrange\n // act\n QuerySpecification querySpecification = new QuerySpecificationBuilder(\"*\", QuerySpecificationBuilder.FromType.ENROLLMENTS).where(\"validWhere\").createSqlQuery();\n\n // assert\n Helpers.assertJson(querySpecification.toJson(), \"{\\\"query\\\":\\\"select * from enrollments where validWhere\\\"}\");\n }",
"private String getQuery(String attribute, String condition){\n String query= \"Select \" + attribute + \"\\n\";\n query += \"From \" + TABLE + \"\\n\";\n query += \"Where \" +condition + \";\";\n return query;\n }",
"protected String getSQLWhere()\n \t{\n \t\tStringBuffer sql = new StringBuffer();\n \t\tif (fDocumentNo.getText().length() > 0)\n \t\t\tsql.append(\" AND UPPER(p.DocumentNo) LIKE ?\");\n if (fRoutingNo.getText().length() > 0)\n sql.append(\" AND UPPER(p.RoutingNo) LIKE ?\"); // Marcos Zúñiga\n if (fCheckNo.getText().length() > 0)\n sql.append(\" AND UPPER(p.CheckNo) LIKE ?\"); // Marcos Zúñiga\n if (fA_Name.getText().length() > 0)\n sql.append(\" AND UPPER(p.A_Name) LIKE ?\"); // Marcos Zúñiga\n \t\tif (fDateFrom.getValue() != null || fDateTo.getValue() != null)\n \t\t{\n \t\t\tTimestamp from = (Timestamp)fDateFrom.getValue();\n \t\t\tTimestamp to = (Timestamp)fDateTo.getValue();\n \t\t\tif (from == null && to != null)\n \t\t\t\tsql.append(\" AND TRUNC(p.DateTrx) <= ?\");\n \t\t\telse if (from != null && to == null)\n \t\t\t\tsql.append(\" AND TRUNC(p.DateTrx) >= ?\");\n \t\t\telse if (from != null && to != null)\n \t\t\t\tsql.append(\" AND TRUNC(p.DateTrx) BETWEEN ? AND ?\");\n \t\t}\n \t\t//\n \t\tif (fAmtFrom.getValue() != null || fAmtTo.getValue() != null)\n \t\t{\n \t\t\tBigDecimal from = (BigDecimal)fAmtFrom.getValue();\n \t\t\tBigDecimal to = (BigDecimal)fAmtTo.getValue();\n \t\t\tif (from == null && to != null)\n \t\t\t\tsql.append(\" AND p.PayAmt <= ?\");\n \t\t\telse if (from != null && to == null)\n \t\t\t\tsql.append(\" AND p.PayAmt >= ?\");\n \t\t\telse if (from != null && to != null)\n \t\t\t\tsql.append(\" AND p.PayAmt BETWEEN ? AND ?\");\n \t\t}\n \t\tsql.append(\" AND p.IsReceipt=?\");\n \n \t\t// sql.append(\" AND p.IsReconciled='N'\");\n \n \t\tlog.fine(sql.toString());\n \t\treturn sql.toString();\n \t}",
"public abstract Statement queryToRetrieveData();",
"public interface QueryBuilder {\n QueryBuilder from();\n QueryBuilder where();\n QueryBuilder orderBy();\n QueryBuilder groupBy();\n Object execute(Object... args);\n Object execute(Tuple args);\n}",
"public SgfensBanco[] findByDynamicWhere(String sql, Object[] sqlParams) throws SgfensBancoDaoException;",
"@Override\n @PlainSQL\n public PaymentP2007_03 where(@Stringly.SQL String condition, QueryPart... parts) {\n return where(DSL.condition(condition, parts));\n }",
"public Faq[] findByDynamicSelect(String sql, Object[] sqlParams) throws FaqDaoException;",
"private Cursor query(boolean distinct, String table, String[] columns,\r\n\t\t\tString selection, String[] selectionArgs, String groupBy,\r\n\t\t\tString having, String orderBy, String limit) {\r\n\t\treturn mDataBase.query(distinct, table, columns, selection,\r\n\t\t\t\tselectionArgs, groupBy, having, orderBy, limit);\r\n\t}",
"BoundQuery<?,Ttuple> query(Query q,Focus<?> context)\n throws DataException;",
"public interface ExtraQuery {\n\n ExtraQuery setTypeName(String typeName);\n ExtraQuery setIndexName(String indexName);\n\n /**\n * Add condition for extraQuery\n * @see #eq(String, Object) for replace\n * @param name name of target field in repo.entity in <b>output channel</b>\n * @param value value of target field in repo.entity in <b>output channel</b>\n */\n @Deprecated\n ExtraQuery filter(String name, Object value);\n\n ExtraQuery eq(String name, Object value);\n\n /**\n * Add condition using primary key\n */\n ExtraQuery id(Object value);\n\n ExtraQuery select(String... field);\n\n /**\n * rename {@link #select(String...)} fields as new name\n * @param cols new name\n */\n ExtraQuery as(String... cols);\n\n /**\n * @see #as(String...) for replace\n */\n @Deprecated\n ExtraQuery addField(String... cols);\n\n @Override\n String toString();\n}",
"CampusSearchQuery generateQuery();",
"@Override\n @PlainSQL\n public PaymentP2007_03 where(@Stringly.SQL String condition) {\n return where(DSL.condition(condition));\n }",
"protected void applyWhere(SQL sql, CarExample example, boolean includeExamplePhrase) {\n if (example == null) {\n return;\n }\n \n String parmPhrase1;\n String parmPhrase1_th;\n String parmPhrase2;\n String parmPhrase2_th;\n String parmPhrase3;\n String parmPhrase3_th;\n if (includeExamplePhrase) {\n parmPhrase1 = \"%s #{example.oredCriteria[%d].allCriteria[%d].value}\";\n parmPhrase1_th = \"%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}\";\n parmPhrase2 = \"%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}\";\n parmPhrase2_th = \"%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}\";\n parmPhrase3 = \"#{example.oredCriteria[%d].allCriteria[%d].value[%d]}\";\n parmPhrase3_th = \"#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}\";\n } else {\n parmPhrase1 = \"%s #{oredCriteria[%d].allCriteria[%d].value}\";\n parmPhrase1_th = \"%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}\";\n parmPhrase2 = \"%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}\";\n parmPhrase2_th = \"%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}\";\n parmPhrase3 = \"#{oredCriteria[%d].allCriteria[%d].value[%d]}\";\n parmPhrase3_th = \"#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}\";\n }\n \n StringBuilder sb = new StringBuilder();\n List<Criteria> oredCriteria = example.getOredCriteria();\n boolean firstCriteria = true;\n for (int i = 0; i < oredCriteria.size(); i++) {\n Criteria criteria = oredCriteria.get(i);\n if (criteria.isValid()) {\n if (firstCriteria) {\n firstCriteria = false;\n } else {\n sb.append(\" or \");\n }\n \n sb.append('(');\n List<Criterion> criterions = criteria.getAllCriteria();\n boolean firstCriterion = true;\n for (int j = 0; j < criterions.size(); j++) {\n Criterion criterion = criterions.get(j);\n if (firstCriterion) {\n firstCriterion = false;\n } else {\n sb.append(\" and \");\n }\n \n if (criterion.isNoValue()) {\n sb.append(criterion.getCondition());\n } else if (criterion.isSingleValue()) {\n if (criterion.getTypeHandler() == null) {\n sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j));\n } else {\n sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler()));\n }\n } else if (criterion.isBetweenValue()) {\n if (criterion.getTypeHandler() == null) {\n sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j));\n } else {\n sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler()));\n }\n } else if (criterion.isListValue()) {\n sb.append(criterion.getCondition());\n sb.append(\" (\");\n List<?> listItems = (List<?>) criterion.getValue();\n boolean comma = false;\n for (int k = 0; k < listItems.size(); k++) {\n if (comma) {\n sb.append(\", \");\n } else {\n comma = true;\n }\n if (criterion.getTypeHandler() == null) {\n sb.append(String.format(parmPhrase3, i, j, k));\n } else {\n sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler()));\n }\n }\n sb.append(')');\n }\n }\n sb.append(')');\n }\n }\n \n if (sb.length() > 0) {\n sql.WHERE(sb.toString());\n }\n }",
"public Cliente[] findByDynamicSelect(String sql, Object[] sqlParams) throws ClienteDaoException;",
"@Override\r\n public StringBuilder getWhereStatement(BuildingContext context, StringBuilder targetAlias, List<Object> params) {\n AbstractMsSQLDatabaseDialect dialect = (AbstractMsSQLDatabaseDialect)context.getDialect(); \r\n String schemaName;\r\n try{\r\n schemaName = dialect.getSchemaName();\r\n }catch(Exception e){\r\n throw new RuntimeException(\"Failed to get schema name from MSSQL Dialect\", e);\r\n }\r\n \r\n StringBuilder statement = new StringBuilder((schemaName.length() != 0 ? schemaName+\".\" : \"\"))\r\n .append(\"PREAD\")\r\n .append(\"(\")\r\n .append(QueryUtils.asPrefix(targetAlias)).append(dialect.convertColumnName(Constants.FIELD_ID))\r\n .append(\",\")\r\n .append(QueryUtils.asPrefix(targetAlias)).append(dialect.convertColumnName(Constants.TABLE_NODE__SECURITY_ID))\r\n .append(\",?,?,?,?)>0\");\r\n\r\n \r\n Collection<String> groups = context.getSession().getGroupIDs();\r\n Collection<String> contexts = context.getSession().getContextIDs();\r\n StringBuffer groupNames = new StringBuffer();\r\n int i = 0;\r\n for(String group:groups){\r\n if(i++>0) {\r\n groupNames.append(',');\r\n }\r\n \r\n groupNames.append(dialect.convertStringToSQL(group));\r\n }\r\n \r\n StringBuffer contextNames = new StringBuffer();\r\n i = 0;\r\n for(String c:contexts){\r\n if(i++>0)\r\n contextNames.append(',');\r\n \r\n contextNames.append(dialect.convertStringToSQL(c));\r\n }\r\n \r\n \r\n params.add(dialect.convertStringToSQL(context.getSession().getUserID()));\r\n params.add(groupNames.toString());\r\n params.add(contextNames.toString());\r\n params.add(context.isAllowBrowse());\r\n \r\n return statement;\r\n }",
"SearchResponse query(SearchRequest request, Map<SearchParam, String> params);",
"public String asWhereClause() {\r\n LinkedList<String> whereClause = new LinkedList<>();\r\n \r\n if (noInduk != null && !noInduk.isEmpty())\r\n whereClause.add(noIndukColName + \" LIKE '%\" + noInduk + \"%'\");\r\n \r\n if (currentLevel != null)\r\n whereClause.add(currentLevelColName + \" LIKE '%\" + currentLevel.asWhereClause() + \"%'\");\r\n \r\n if (biodata != null){\r\n String wc = biodata.asWhereClause();\r\n if(wc != null && !wc.isEmpty())\r\n whereClause.add(wc);\r\n }\r\n \r\n if (tanggalMasuk != null)\r\n whereClause.add(tanggalMasukColName + \" LIKE '%\" + tanggalMasuk.asWhereClause(true) + \"%'\");\r\n \r\n if (tanggalLulus != null)\r\n whereClause.add(tanggalLulusColName + \" LIKE '%\" + tanggalLulus.asWhereClause(true) + \"%'\");\r\n if (gelombang != null)\r\n whereClause.add(gelombangColName + \" = '\" + gelombang + \"'\");\r\n if (statusPendaftaran != null)\r\n whereClause.add(statusPendaftaranColName + \" = '\" + statusPendaftaran + \"'\");\r\n if (lastUpdateDate != null)\r\n whereClause.add(lastUpdateDateColName + \" LIKE '%\" + lastUpdateDate.asWhereClause(true) + \"%'\");\r\n return whereClause.isEmpty()? \"\" : StringUtils.join(whereClause, \" AND \");\r\n }",
"private ContactCurserWrapper queryContacts(String whereClause, String[] whereArgs) {\n Cursor cursor = mDatabase.query(\n ContactTable.NAME,\n null, // columns - null selects all columns\n whereClause,\n whereArgs,\n null, // groupBy,\n null, // having\n null // orderBy\n );\n return new ContactCurserWrapper(cursor);\n }",
"private String createWhere() {\n String where = \"\";\n if (getLatitude() != FLOATNULL) {\n if (!where.equals(\"\")) {\n where = where + \" and \";\n } // if where\n where = where + LATITUDE + \"=\" + getLatitude(\"\");\n } // if getLatitude\n if (getLongitude() != FLOATNULL) {\n if (!where.equals(\"\")) {\n where = where + \" and \";\n } // if where\n where = where + LONGITUDE + \"=\" + getLongitude(\"\");\n } // if getLongitude\n if (getDepth() != FLOATNULL) {\n if (!where.equals(\"\")) {\n where = where + \" and \";\n } // if where\n where = where + DEPTH + \"=\" + getDepth(\"\");\n } // if getDepth\n if (getTemperatureMin() != FLOATNULL) {\n if (!where.equals(\"\")) {\n where = where + \" and \";\n } // if where\n where = where + TEMPERATURE_MIN + \"=\" + getTemperatureMin(\"\");\n } // if getTemperatureMin\n if (getTemperatureMax() != FLOATNULL) {\n if (!where.equals(\"\")) {\n where = where + \" and \";\n } // if where\n where = where + TEMPERATURE_MAX + \"=\" + getTemperatureMax(\"\");\n } // if getTemperatureMax\n if (getSalinityMin() != FLOATNULL) {\n if (!where.equals(\"\")) {\n where = where + \" and \";\n } // if where\n where = where + SALINITY_MIN + \"=\" + getSalinityMin(\"\");\n } // if getSalinityMin\n if (getSalinityMax() != FLOATNULL) {\n if (!where.equals(\"\")) {\n where = where + \" and \";\n } // if where\n where = where + SALINITY_MAX + \"=\" + getSalinityMax(\"\");\n } // if getSalinityMax\n if (getOxygenMin() != FLOATNULL) {\n if (!where.equals(\"\")) {\n where = where + \" and \";\n } // if where\n where = where + OXYGEN_MIN + \"=\" + getOxygenMin(\"\");\n } // if getOxygenMin\n if (getOxygenMax() != FLOATNULL) {\n if (!where.equals(\"\")) {\n where = where + \" and \";\n } // if where\n where = where + OXYGEN_MAX + \"=\" + getOxygenMax(\"\");\n } // if getOxygenMax\n if (getNitrateMin() != FLOATNULL) {\n if (!where.equals(\"\")) {\n where = where + \" and \";\n } // if where\n where = where + NITRATE_MIN + \"=\" + getNitrateMin(\"\");\n } // if getNitrateMin\n if (getNitrateMax() != FLOATNULL) {\n if (!where.equals(\"\")) {\n where = where + \" and \";\n } // if where\n where = where + NITRATE_MAX + \"=\" + getNitrateMax(\"\");\n } // if getNitrateMax\n if (getPhosphateMin() != FLOATNULL) {\n if (!where.equals(\"\")) {\n where = where + \" and \";\n } // if where\n where = where + PHOSPHATE_MIN + \"=\" + getPhosphateMin(\"\");\n } // if getPhosphateMin\n if (getPhosphateMax() != FLOATNULL) {\n if (!where.equals(\"\")) {\n where = where + \" and \";\n } // if where\n where = where + PHOSPHATE_MAX + \"=\" + getPhosphateMax(\"\");\n } // if getPhosphateMax\n if (getSilicateMin() != FLOATNULL) {\n if (!where.equals(\"\")) {\n where = where + \" and \";\n } // if where\n where = where + SILICATE_MIN + \"=\" + getSilicateMin(\"\");\n } // if getSilicateMin\n if (getSilicateMax() != FLOATNULL) {\n if (!where.equals(\"\")) {\n where = where + \" and \";\n } // if where\n where = where + SILICATE_MAX + \"=\" + getSilicateMax(\"\");\n } // if getSilicateMax\n if (getChlorophyllMin() != FLOATNULL) {\n if (!where.equals(\"\")) {\n where = where + \" and \";\n } // if where\n where = where + CHLOROPHYLL_MIN + \"=\" + getChlorophyllMin(\"\");\n } // if getChlorophyllMin\n if (getChlorophyllMax() != FLOATNULL) {\n if (!where.equals(\"\")) {\n where = where + \" and \";\n } // if where\n where = where + CHLOROPHYLL_MAX + \"=\" + getChlorophyllMax(\"\");\n } // if getChlorophyllMax\n if (dbg) System.out.println (\"<br>where = \" + where); // debug\n return (!where.equals(\"\") ? where : null);\n }",
"com.google.protobuf.ByteString\n getWhereClauseBytes();",
"public Query createQuery() {\n\n String queryString = getQueryString();\n\n if (debug == true) {\n logger.info( \"Query String: {0}\", queryString);\n logger.info( \"Parameters: Max Results: {0}, First result: {1}, Order By: {2}, Restrictions: {3}, Joins: {4}\", new Object[]{maxResults, firstResult, orderBy, normalizedRestrictions, joins});\n }\n\n Query query = entityManager.createQuery(queryString);\n\n List<QueryParameter> parameters = getQueryParameters();\n for (QueryParameter parameter : parameters) {\n //dates (Date and Calendar)\n if (parameter.getTemporalType() != null && (parameter.getValue() instanceof Date || parameter.getValue() instanceof Calendar)) {\n if (parameter.getValue() instanceof Date) {\n if (parameter.getPosition() != null) {\n query.setParameter(parameter.getPosition(), (Date) parameter.getValue(), parameter.getTemporalType());\n } else {\n if (parameter.getProperty() != null) {\n query.setParameter(parameter.getProperty(), (Date) parameter.getValue(), parameter.getTemporalType());\n }\n }\n } else if (parameter.getValue() instanceof Calendar) {\n if (parameter.getPosition() != null) {\n query.setParameter(parameter.getPosition(), (Calendar) parameter.getValue(), parameter.getTemporalType());\n } else {\n if (parameter.getProperty() != null) {\n query.setParameter(parameter.getProperty(), (Calendar) parameter.getValue(), parameter.getTemporalType());\n }\n }\n }\n } else {\n if (parameter.getPosition() != null) {\n query.setParameter(parameter.getPosition(), parameter.getValue());\n } else {\n if (parameter.getProperty() != null) {\n query.setParameter(parameter.getProperty(), parameter.getValue());\n }\n }\n }\n }\n\n if (maxResults != null) {\n query.setMaxResults(maxResults);\n }\n if (firstResult != null) {\n query.setFirstResult(firstResult);\n }\n return query;\n }",
"public Query createQuery(String hql, Object... values) {\n Assert.hasText(hql);\n Query query = getSession().createQuery(hql);\n for (int i = 0; i < values.length; i++) {\n query.setParameter(i, values[i]);\n }\n return query;\n }",
"String getMetadataWhereClause();",
"public Ruta[] findByDynamicSelect(String sql, Object[] sqlParams) throws RutaDaoException;",
"String getAskQuery(String... args);",
"@Override\n public Cursor query(Uri uri, String[] projection, String selection,\n String[] selectionArgs, String sortOrder) {\n // Open a read-only database.\n SQLiteDatabase db = myOpenHelper.getWritableDatabase();\n\n // Replace these with valid SQL statements if necessary.\n String groupBy = null;\n String having = null;\n \n SQLiteQueryBuilder queryBuilder = new SQLiteQueryBuilder();\n queryBuilder.setTables(MySQLiteOpenHelper.DATABASE_TABLE);\n \n // If this is a row query, limit the result set to the passed in row.\n switch (uriMatcher.match(uri)) {\n case SINGLE_ROW : \n String rowID = uri.getPathSegments().get(1);\n queryBuilder.appendWhere(KEY_ID + \"=\" + rowID);\n break;\n case SEARCH : \n String query = uri.getPathSegments().get(1);\n queryBuilder.appendWhere(KEY_SEARCH_COLUMN + \n \" LIKE \\\"%\" + query + \"%\\\"\");\n queryBuilder.setProjectionMap(SEARCH_SUGGEST_PROJECTION_MAP); \n break;\n default: break;\n }\n \n Cursor cursor = queryBuilder.query(db, projection, selection,\n selectionArgs, groupBy, having, sortOrder);\n\n return cursor;\n }",
"public UsState[] findByDynamicWhere(String sql, Object[] sqlParams) throws UsStateDaoException;",
"public interface QueryFilter {\n\t\tpublic void apply(Query<? extends PersistentObject> qbe);\n\t}",
"public String getWhereString()\n {\n String outString = \n \"WHERE recip = '\" + recip + \"'\" \n ;\n return outString;\n }",
"private String getFilteringWhereClause(String tableAlias, boolean withWHERE) {\n StringBuilder expr = new StringBuilder();\n if (filter != null && filter.length()>0 && keywordAllFields != null && keywordAllFields.size()>0) {\n int i = 0;\n expr.append(withWHERE ? \" WHERE \" : \"\");\n for (String column : keywordAllFields) {\n if (i++==0) expr.append(\"concat(\");\n else expr.append(\",'||',\");\n if (tableAlias != null && tableAlias.length()>0) {\n expr.append(\"COALESCE(\");\n expr.append(tableAlias);\n expr.append(\".\");\n }\n expr.append(column);\n expr.append(\", '')\");\n }\n expr.append(\") like '%\");\n expr.append(filter);\n expr.append(\"%'\");\n }\n return expr.toString();\n }",
"public abstract DbQuery getQuery(String queryName);",
"public QueryResponse query(SolrParams params) throws SolrServerException, IOException {\n return new QueryRequest(params).process(this);\n }",
"protected void applyWhere(SQL sql, MaterialTypeExample example, boolean includeExamplePhrase) {\r\n if (example == null) {\r\n return;\r\n }\r\n \r\n String parmPhrase1;\r\n String parmPhrase1_th;\r\n String parmPhrase2;\r\n String parmPhrase2_th;\r\n String parmPhrase3;\r\n String parmPhrase3_th;\r\n if (includeExamplePhrase) {\r\n parmPhrase1 = \"%s #{example.oredCriteria[%d].allCriteria[%d].value}\";\r\n parmPhrase1_th = \"%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}\";\r\n parmPhrase2 = \"%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}\";\r\n parmPhrase2_th = \"%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}\";\r\n parmPhrase3 = \"#{example.oredCriteria[%d].allCriteria[%d].value[%d]}\";\r\n parmPhrase3_th = \"#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}\";\r\n } else {\r\n parmPhrase1 = \"%s #{oredCriteria[%d].allCriteria[%d].value}\";\r\n parmPhrase1_th = \"%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}\";\r\n parmPhrase2 = \"%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}\";\r\n parmPhrase2_th = \"%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}\";\r\n parmPhrase3 = \"#{oredCriteria[%d].allCriteria[%d].value[%d]}\";\r\n parmPhrase3_th = \"#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}\";\r\n }\r\n \r\n StringBuilder sb = new StringBuilder();\r\n List<Criteria> oredCriteria = example.getOredCriteria();\r\n boolean firstCriteria = true;\r\n for (int i = 0; i < oredCriteria.size(); i++) {\r\n Criteria criteria = oredCriteria.get(i);\r\n if (criteria.isValid()) {\r\n if (firstCriteria) {\r\n firstCriteria = false;\r\n } else {\r\n sb.append(\" or \");\r\n }\r\n \r\n sb.append('(');\r\n List<Criterion> criterions = criteria.getAllCriteria();\r\n boolean firstCriterion = true;\r\n for (int j = 0; j < criterions.size(); j++) {\r\n Criterion criterion = criterions.get(j);\r\n if (firstCriterion) {\r\n firstCriterion = false;\r\n } else {\r\n sb.append(\" and \");\r\n }\r\n \r\n if (criterion.isNoValue()) {\r\n sb.append(criterion.getCondition());\r\n } else if (criterion.isSingleValue()) {\r\n if (criterion.getTypeHandler() == null) {\r\n sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j));\r\n } else {\r\n sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler()));\r\n }\r\n } else if (criterion.isBetweenValue()) {\r\n if (criterion.getTypeHandler() == null) {\r\n sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j));\r\n } else {\r\n sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler()));\r\n }\r\n } else if (criterion.isListValue()) {\r\n sb.append(criterion.getCondition());\r\n sb.append(\" (\");\r\n List<?> listItems = (List<?>) criterion.getValue();\r\n boolean comma = false;\r\n for (int k = 0; k < listItems.size(); k++) {\r\n if (comma) {\r\n sb.append(\", \");\r\n } else {\r\n comma = true;\r\n }\r\n if (criterion.getTypeHandler() == null) {\r\n sb.append(String.format(parmPhrase3, i, j, k));\r\n } else {\r\n sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler()));\r\n }\r\n }\r\n sb.append(')');\r\n }\r\n }\r\n sb.append(')');\r\n }\r\n }\r\n \r\n if (sb.length() > 0) {\r\n sql.WHERE(sb.toString());\r\n }\r\n }",
"protected void generateWhereClause( WrqInfo wrqInfo, SQLStatementWithParams sqlStatement ) throws Exception\n {\n StringBuilder sql = new StringBuilder();\n List<Element> boundVariables = new LinkedList<Element>();\n\n // Can be a meta-data request\n if( (rowEnd > 0 && rowStart > rowEnd) || rowEnd == 0 ) {\n sql.append(\" WHERE 1=0 \");\n sqlStatement.append(sql.toString());\n return;\n }\n\n WrqFilter2Sql wrqFilter2Sql = new WrqFilter2Sql(wrqInfo, wrqInfo.getFilterNode(), false);\n String filterClause = wrqFilter2Sql.getAsSql( boundVariables );\n\n // Take care for row level security\n String subjectSettingsClause = \"\";\n Subject subject = null;\n try { subject = SecurityUtils.getSubject(); } catch (Exception e) {/* no shiro at all */}\n if (subject != null) {\n if (WebUtils.isHttp(SecurityUtils.getSubject())) {\n SQLStatementWithParams subjectSettingsStmt = wrqInfo.getResultingBindingSet().getSubjectFilterExpression(wrqInfo);\n subjectSettingsClause = subjectSettingsStmt.getStatement();\n boundVariables.addAll(subjectSettingsStmt.getFilterItems());\n }\n else {\n Iterator<StandardBindingSet> bsIterator = wrqInfo.getResultingBindingSet().getResolvedBindingSets().iterator();\n while(bsIterator.hasNext()) {\n StandardBindingSet bs = bsIterator.next();\n if (! bs.isBackendCanBypassSubjectFilter())\n throw new BindingException(\"The BindingSet \" + bs.getName() +\" can't bypass SubjectFilters. Consider using bnd:BindingSet/sec:SubjectSettings/sec:SubjectFilters/@backendCanBypassSubjectFilter\");\n }\n }\n }\n\n // Now combine the two restrictions (Filter and SubjectSettings) into one WHERE clause\n if( ! filterClause.isEmpty() || ! subjectSettingsClause.isEmpty() )\n sql.append(\" WHERE \");\n if( ! filterClause.isEmpty() )\n sql.append(\"( \"+filterClause+\" )\");\n if( ! filterClause.isEmpty() && ! subjectSettingsClause.isEmpty() )\n sql.append(\" AND \");\n if( ! subjectSettingsClause.isEmpty() )\n sql.append(\" ( \"+subjectSettingsClause+\" )\");\n\n sqlStatement.append(sql.toString(), boundVariables, wrqInfo.getResultingBindingSet());\n }",
"protected String buildDataQuery() {\n StringBuilder sql = new StringBuilder(\"select\");\n String delim = \" \";\n for (String vname : getColumnNames()) {\n sql.append(delim).append(vname);\n delim = \", \";\n }\n \n Element ncElement = getNetcdfElement();\n \n String table = ncElement.getAttributeValue(\"dbTable\");\n if (table == null) {\n String msg = \"No database table defined. Must set 'dbTable' attribute.\";\n _logger.error(msg);\n throw new TSSException(msg);\n }\n sql.append(\" from \" + table);\n \n String predicate = ncElement.getAttributeValue(\"predicate\");\n if (predicate != null) sql.append(\" where \" + predicate);\n \n //Order by time.\n String tname = getTimeVarName();\n sql.append(\" order by \"+tname+\" ASC\");\n \n return sql.toString();\n }",
"@Test\n public void testWhere_withValidQuery() {\n String column0 = \"user_id\";\n String column1 = \"age\";\n int idValue0 = 0;\n int ageValue0 = 23;\n int idValue1 = 1;\n int ageValue1 = 22;\n int idValue2 = 2;\n int ageValue2 = 18;\n\n try {\n String sql = \"CREATE TABLE ModelExtension (\" +\n column0 + \" int, \" +\n column1 + \" int)\";\n PreparedStatement pstmt = Setup.getConnection().prepareStatement(sql);\n pstmt.execute();\n sql = \"INSERT INTO ModelExtension (\" +\n column0 + \", \" +\n column1 + \") VALUES (\" +\n idValue0 + \", \" +\n ageValue0 + \"), (\" +\n idValue1 + \", \" +\n ageValue1 + \"), (\" +\n idValue2 + \", \" +\n ageValue2 + \")\";\n pstmt = Setup.getConnection().prepareStatement(sql);\n pstmt.executeUpdate();\n } catch (SQLException e) {\n e.printStackTrace();\n assertTrue(false);\n }\n\n List<ModelExtension> models = child.findAll().where(column1 + \">20\").execute(ModelExtension.class);\n\n assertEquals(2, models.size());\n assertEquals(idValue0, models.get(0).get(column0));\n assertEquals(ageValue0, models.get(0).get(column1));\n assertEquals(idValue1, models.get(1).get(column0));\n assertEquals(ageValue1, models.get(1).get(column1));\n }",
"String execute(String... parameters);",
"public abstract List createNativeSQLQuery(String query);",
"@SuppressWarnings(\"unchecked\")\n\tpublic List sqlQuery(String sql,HashMap entities,HashMap joins,Object... params);",
"@Query(\"SELECT p FROM Person p WHERE p.name=?1 OR p.age=?2\")\n List<Person> FindByNameOrAge(String name, Integer age);",
"@Override\n\tpublic String getSqlWhere() {\n\t\treturn null;\n\t}",
"@Override\n public PlainSqlQuery<T, ID> createPlainSqlQuery() {\n return null;\n }",
"public List<Record> executeNativeFinder(String queryName, Object context);",
"List<E> queryAll(String namedQuery);",
"private int execRawSqlPrivate(String sql, boolean isNative, Object params) {\r\n\t\tQuery query = createQuery(sql, null, isNative, 0, 0, params);\r\n\t\tint executeUpdate = query.executeUpdate();\r\n\t\treturn executeUpdate;\r\n\t}",
"public interface QuerySql extends ConditionAble, Stream {\n\n\t/**\n\t * Add parameters to your SQL to replace the question mark?This is a more\n\t * recommended way to replace string splices\n\t * \n\t * @param paramers\n\t * @return\n\t */\n\tQuerySql addParamer(Object... paramers);\n\n\tint update();\n\n\t/**\n\t * \n\t * <p>\n\t * If you need to return a result set instead of a single item; The return type\n\t * is automatically determined by the constructor. If you want to return an\n\t * entity type, add the entity type before the {@link #list(Class)} method\n\t * \n\t * <p>\n\t * The method is equivalent to the integrator of two methods\n\t * \n\t * @see #entities(Class)\n\t * @see #maps()\n\t * \n\t */\n\t<T> List<T> list();\n\n\t<T> List<T> list(Class<T> entityClass);\n\n\t/**\n\t * \n\t * @return Returns a collection of entity class mappings.\n\t */\n\t<T> List<T> entities(Class<T> entityClass);\n\n\t/**\n\t * The result set encapsulated in the form of\n\t * {@code List<Map<String,Object>>}<br>\n\t * This will be an acceptable way to get the mapping of SQL result sets\n\t * \n\t * @return {@link List}{@code <}{@link Map}{@code <}\n\t * {@link String},{@link Object}{@code >}{@code >}\n\t */\n\tList<Map<String, Object>> maps();\n\n\t/**\n\t * \n\t * @param alias - Aliased key-value pairs, returned as aliased key-value if\n\t * matched\n\t * @return\n\t * @since 2.24\n\t */\n\tList<Map<String, Object>> maps(HashMap<String, String> alias);\n\n\t/**\n\t * The result set encapsulated in the form of {@code Map<String,Object>}<br>\n\t * This will be an acceptable way to get the mapping of SQL result sets\n\t * \n\t * @return {@link Map}{@code <} {@link String},{@link Object}{@code >}\n\t */\n\tMap<String, Object> map();\n\n\t/**\n\t * Returns a single result;The return type is automatically determined based on\n\t * the constructor, and if you want to return an entity type, add before that\n\t * \n\t * @return\n\t */\n\t<T> T unique();\n\n\t\n\t/**\n\t * Specify entity class mappings\n\t * @param entityClass - Be sure to include an {@link Id} annotation to declare the primary key\n\t * @return\n\t */\n\t<T> T unique(Class<T> entityClass);\n\t\n\t<T> T entity(Class<T> entityClass);\n\n\t/**\n\t * Gets the columns contained in the query result.\n\t * \n\t * @return\n\t */\n\tList<Column> getQueryColumns();\n\n\t@Override\n\tQuerySql addCondition(Condition cond);\n\n\t@Override\n\tQuerySql addCondition(String fieldName, Cs cs);\n\n\t@Override\n\tQuerySql addCondition(String fieldName, Cs cs, Object value);\n\n\t@Override\n\tQuerySql addCondition(Consumer<List<Condition>> conds);\n\n\t/**\n\t * An extension to the {@link Stream} interface,Returns the specified number of\n\t * results from the SQL statement\n\t * \n\t * @param count\n\t */\n\tList<Map<String, Object>> stream(int count);\n\n}",
"protected String generateSQL() {\n String fields = generateFieldsJSON();\n return String.format(QUERY_PATTERN, fields, esQuery.generateQuerySQL(), from, size);\n }",
"public QueryExecution createQueryExecution(Query qry);",
"@Override\n\tpublic Cursor query(final Uri target, final String[] columns, final String selection,\n\t\t\t\t\t\tfinal String[] selectionArgs, final String sortOrder)\n\t{\n\t\tLog.d(getClass().getName(), \"Query on URI: \" + target.toString());\n\n\t\tif (! super.getTableName(target).equals(\"recipe\")) {\n\t\t\tthrow new UnsupportedOperationException(\"Only recipes can be searched for now.\");\n\t\t}\n\t\telse if (selection == null || selection.trim().isEmpty()) {\n\t\t\tthrow new UnsupportedOperationException(\"Cannot run wildcard queries.\");\n\t\t}\n\n\t\tfinal Map<String,Object> queryParams = new HashMap<String,Object>();\n\t\tqueryParams.put(\"columns\", prefaceSearchColumns(Arrays.asList(columns)));\n\t\tqueryParams.put(\"queryString\", selection);\n\n\t\tfinal String actualSql = RECIPE_QUERY_SQL_FORMAT.withParams(queryParams).toString();\n\t\tLog.d(getClass().getName(), \"Actual recipe search SQL: \" + actualSql);\n\t\tfinal Cursor results = db.rawQuery(actualSql, null);\n\n\t\tLog.d(\n\t\t\tgetClass().getName(),\n\t\t\tString.format(\"Found %d results: queryString=%s\", results.getCount(), selection));\n\t \n\t return results;\n\t}",
"public AbstractJoSQLFilter (String q)\n\t throws QueryParseException\n {\n\n\tthis.setQuery (q);\n\n }",
"private DbQuery() {}",
"@Override\n protected Cursor buildCursor() {\n return(db.getReadableDatabase().rawQuery(rawQuery, args));\n }",
"public NominaPuesto[] findByDynamicWhere(String sql, Object[] sqlParams) throws NominaPuestoDaoException;",
"public RequestBuilder query(Map<String, String> args) {\n this.query = args;\n return this;\n }",
"interface FindByQueryWithQuery<T> extends TerminatingFindByQuery<T> {\n\n\t\t/**\n\t\t * Set the filter query to be used.\n\t\t *\n\t\t * @param query must not be {@literal null}.\n\t\t * @return new instance of {@link TerminatingFindByQuery}.\n\t\t * @throws IllegalArgumentException if query is {@literal null}.\n\t\t */\n\t\tTerminatingFindByQuery<T> matching(Query query);\n\n\t}",
"public Query queryRule(String rule, Object... args) throws Exceptions.OsoException {\n Host new_host = host.clone();\n String pred = new_host.toPolarTerm(new Predicate(rule, Arrays.asList(args))).toString();\n return new Query(ffiPolar.newQueryFromTerm(pred), new_host);\n }",
"Object executeQuery(String sparqlQuery);",
"public void createQuery(String s) throws HibException;"
] | [
"0.6377732",
"0.6370847",
"0.6192332",
"0.6159502",
"0.61246324",
"0.606008",
"0.60413194",
"0.6011913",
"0.5929633",
"0.59272194",
"0.5905693",
"0.5884991",
"0.58732295",
"0.58611894",
"0.58499575",
"0.5843732",
"0.58225197",
"0.5804529",
"0.5788572",
"0.57828075",
"0.57789856",
"0.5761837",
"0.5752089",
"0.57430375",
"0.5739242",
"0.5729063",
"0.5709486",
"0.5683032",
"0.56746894",
"0.5666686",
"0.5658141",
"0.5630108",
"0.5629457",
"0.5601992",
"0.558624",
"0.55815494",
"0.55806977",
"0.556031",
"0.5554337",
"0.5528894",
"0.55036396",
"0.55017877",
"0.55011064",
"0.55005765",
"0.54831517",
"0.5456844",
"0.5454344",
"0.54357666",
"0.54269373",
"0.542442",
"0.54215753",
"0.54192793",
"0.5415914",
"0.54122967",
"0.5412033",
"0.5400896",
"0.5392215",
"0.5382295",
"0.53806907",
"0.5378099",
"0.53649616",
"0.5360116",
"0.53465885",
"0.5336205",
"0.5328967",
"0.5328492",
"0.5316559",
"0.53115934",
"0.53072596",
"0.53068584",
"0.5305751",
"0.53024656",
"0.5301732",
"0.5297591",
"0.52766526",
"0.5258516",
"0.525214",
"0.52470225",
"0.524184",
"0.52375215",
"0.5236783",
"0.52365404",
"0.5236422",
"0.523627",
"0.52262485",
"0.52208024",
"0.52202326",
"0.52023727",
"0.5189107",
"0.5180967",
"0.5175073",
"0.5173561",
"0.51703846",
"0.5156748",
"0.51499385",
"0.5149581",
"0.5148687",
"0.5148639",
"0.5143791",
"0.51418597",
"0.51305985"
] | 0.0 | -1 |
Constructor of the object. | public TrolleyDetail() {
super();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Constructor() {\r\n\t\t \r\n\t }",
"public Constructor(){\n\t\t\n\t}",
"public Curso() {\r\n }",
"private Instantiation(){}",
"public CyanSus() {\n\n }",
"public RngObject() {\n\t\t\n\t}",
"public PSRelation()\n {\n }",
"public Orbiter() {\n }",
"private SingleObject()\r\n {\r\n }",
"public Chauffeur() {\r\n\t}",
"public Libro() {\r\n }",
"public CSSTidier() {\n\t}",
"public Cohete() {\n\n\t}",
"public Chick() {\n\t}",
"public Tbdtokhaihq3() {\n super();\n }",
"public Coche() {\n super();\n }",
"public Ov_Chipkaart() {\n\t\t\n\t}",
"public Odontologo() {\n }",
"public Supercar() {\r\n\t\t\r\n\t}",
"public Aanbieder() {\r\n\t\t}",
"public _355() {\n\n }",
"public ObjectFactory() {\n\t}",
"public ObjectFactory() {\n super(grammarInfo);\n }",
"protected abstract void construct();",
"public Carrinho() {\n\t\tsuper();\n\t}",
"public Lanceur() {\n\t}",
"public Phl() {\n }",
"public CMN() {\n\t}",
"public ObjectFactory() {\r\n\t}",
"@SuppressWarnings(\"unused\")\n public NoConstructor() {\n // Empty\n }",
"public Pitonyak_09_02() {\r\n }",
"private TMCourse() {\n\t}",
"public Magazzino() {\r\n }",
"public Pasien() {\r\n }",
"public Achterbahn() {\n }",
"public Mitarbeit() {\r\n }",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"public Construct() {\n\tprefixes = new StringBuilder();\n\tvariables = new StringBuilder();\n\twheres = new StringBuilder();\n }",
"public Overview() {\n\t\t// It will work whenever i create object with using no parameter const\n\t\tSystem.out.println(\"This is constructor\");\n\t}",
"public Trening() {\n }",
"private Composite() {\n }",
"public Anschrift() {\r\n }",
"public Connection() {\n\t\t\n\t}",
"public ChaCha()\n\t{\n\t\tsuper();\n\t}",
"@Override public void init()\n\t\t{\n\t\t}",
"defaultConstructor(){}",
"public Corso() {\n\n }",
"public Data() {\n }",
"public Data() {\n }",
"public Book() {\n\t\t// Default constructor\n\t}",
"ConstructorPractice () {\n\t\tSystem.out.println(\"Default Constructor\");\n\t}",
"public Soil()\n\t{\n\n\t}",
"public Parser()\n {\n //nothing to do\n }",
"public Zeffit()\n {\n // TODO: initialize instance variable(s)\n }",
"public Demo() {\n\t\t\n\t}",
"public Carrera(){\n }",
"public Job() {\n\t\t\t\n\t\t}",
"@Override\n public void construct() throws IOException {\n \n }",
"public Job() {\r\n\t\tSystem.out.println(\"Constructor\");\r\n\t}",
"public TTau() {}",
"public mapper3c() { super(); }",
"public void init() {\n \n }",
"public Student() {\n//\t\tname = \"\";\n//\t\tage = 0;\n\t\t\n\t\t\n\t\t//call constructors inside of other constructors\n\t\tthis(999,0);\n\t}",
"public ObjectFactory() {\r\n }",
"public ObjectFactory() {\r\n }",
"public ObjectFactory() {\r\n }",
"public ObjectFactory() {\r\n }",
"public ObjectFactory() {\r\n }",
"public ObjectFactory() {\r\n }",
"public ObjectFactory() {\r\n }",
"public ObjectFactory() {\r\n }",
"public ObjectFactory() {\r\n }",
"public ObjectFactory() {\r\n }",
"public ObjectFactory() {\r\n }",
"public ObjectFactory() {\r\n }",
"public ObjectFactory() {\r\n }",
"public ObjectFactory() {\r\n }",
"public ObjectFactory() {\r\n }",
"public ObjectFactory() {\r\n }",
"public ObjectFactory() {\r\n }",
"public ObjectFactory() {\r\n }",
"public ObjectFactory() {\r\n }",
"public ObjectFactory() {\r\n }",
"public ObjectFactory() {\r\n }",
"public ObjectFactory() {\r\n }",
"public ObjectFactory() {\r\n }",
"public ObjectFactory() {\r\n }",
"public ObjectFactory() {\r\n }",
"public ObjectFactory() {\r\n }",
"public ObjectFactory() {\r\n }",
"public ObjectFactory() {\r\n }",
"public ObjectFactory() {\r\n }",
"public ObjectFactory() {\r\n }",
"public ObjectFactory() {\r\n }",
"public ObjectFactory() {\r\n }",
"public ObjectFactory() {\r\n }",
"public ObjectFactory() {\r\n }",
"public ObjectFactory() {\r\n }",
"public ObjectFactory() {\r\n }",
"public ObjectFactory() {\r\n }",
"public ObjectFactory() {\r\n }"
] | [
"0.85453546",
"0.83174706",
"0.72354287",
"0.7234532",
"0.7211791",
"0.71650505",
"0.71315366",
"0.71215373",
"0.7097914",
"0.7087967",
"0.7087348",
"0.7070951",
"0.7054235",
"0.70462006",
"0.70424324",
"0.70329",
"0.6996156",
"0.69732815",
"0.69716096",
"0.6948889",
"0.69442433",
"0.69358236",
"0.6932255",
"0.6929099",
"0.6917104",
"0.6915017",
"0.69096947",
"0.69066626",
"0.6898009",
"0.6895936",
"0.68945354",
"0.6887701",
"0.68815094",
"0.6880202",
"0.68603325",
"0.6856258",
"0.68543154",
"0.68466336",
"0.6842509",
"0.6839488",
"0.68364394",
"0.6831597",
"0.68105656",
"0.6808974",
"0.680446",
"0.6797633",
"0.6790951",
"0.678856",
"0.678856",
"0.6788212",
"0.6784895",
"0.6784095",
"0.6777204",
"0.6776866",
"0.67727745",
"0.677104",
"0.6769799",
"0.6761142",
"0.6755991",
"0.6753748",
"0.6748703",
"0.67467594",
"0.6741091",
"0.674023",
"0.674023",
"0.674023",
"0.674023",
"0.674023",
"0.674023",
"0.674023",
"0.674023",
"0.674023",
"0.674023",
"0.674023",
"0.674023",
"0.674023",
"0.674023",
"0.674023",
"0.674023",
"0.674023",
"0.674023",
"0.674023",
"0.674023",
"0.674023",
"0.674023",
"0.674023",
"0.674023",
"0.674023",
"0.674023",
"0.674023",
"0.674023",
"0.674023",
"0.674023",
"0.674023",
"0.674023",
"0.674023",
"0.674023",
"0.674023",
"0.674023",
"0.674023",
"0.674023"
] | 0.0 | -1 |
Destruction of the servlet. | public void destroy() {
super.destroy(); // Just puts "destroy" string in log
// Put your code here
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void destroy() {\n\t\tsuper.destroy(); \n\t\tSystem.out.println(\"=====destory servlet=========\");\n\t}",
"public final void destroy()\n {\n log.info(\"PerformanceData Servlet: Done shutting down!\");\n }",
"@Override\r\n\tpublic void destroy() {\n\t\tSystem.out.println(\"second servlet destory\");\r\n\t}",
"@Override\n\tpublic void destroy() {\n\t\tsuper.destroy();\n\t\tSystem.out.println(\"Destory LoginServlet\");\n\t}",
"@Override\n\tpublic void destroy() {\n\t\t// TODO Auto-generated method stub\n\t\tsuper.destroy();\n\t\tSystem.out.println(\"Servlet Destroy Call\");\n\t}",
"public void stop() {\n\t\t// To be garbage collected if adapter remains active\n\t\tservletOut = null;\n\t}",
"@Override\n\tpublic void destroy() {\n\t\tlogService=null;\n\t\tnoInterceptUrlRegxList=null;\n\n\t}",
"@Override\n\tfinal public void destroy() {\n\t\tjspDestroy();\n\t}",
"public void destroy() {\n\t\ttermMap = null;\n\t\tdoc = null;\n\t}",
"public static void destroy() {\n\t}",
"public void destroy() {\n \t\n }",
"public void onDestroy() {\n requestTracker.clearRequests();\n }",
"@Override\n public void close() {\n for (Servlet registeredServlet : registeredServlets) {\n paxWeb.unregisterServlet(registeredServlet);\n }\n for (Filter filter : registeredFilters) {\n paxWeb.unregisterFilter(filter);\n }\n for (EventListener eventListener : registeredEventListeners) {\n paxWeb.unregisterEventListener(eventListener);\n }\n for (String alias : registeredResources) {\n paxWeb.unregister(alias);\n }\n }",
"public void destroy() {\r\n\r\n\t}",
"public void destroy() {\n\t\texcludeItem = null;\r\n\t\tloginPage=null;\r\n\t\tloaginAction=null;\r\n\t\tauthority = null;\r\n\t}",
"public void destroy() {\n\t\t\r\n\t}",
"public void destroy() {\n\t\t\r\n\t}",
"public void destroy() {\n\t\t\r\n\t}",
"public void destroy() {\n\t\t\r\n\t}",
"public void destroy() {\r\n }",
"public void unregisterAll()\n {\n final Set<javax.servlet.Servlet> servlets = new HashSet<>(this.localServlets);\n for (final javax.servlet.Servlet servlet : servlets)\n {\n unregisterServlet(servlet);\n }\n }",
"public void destroy() {\n\t}",
"public void destroy() {\n\t}",
"public void destroy() {\n\t}",
"public void destroy() {\n\t}",
"public void destroy() {\n\t}",
"public void destroy() {\n\t}",
"public void destroy() {\n\t}",
"public void destroy() {\n\t}",
"public void destroy() {\n\t}",
"public void destroy() {\n\t}",
"public void destroy() {\n\t}",
"public void destroy() {\n\t}",
"public void destroy() {\n\t}",
"public void destroy() {\n\t}",
"public void destroy() {\n\t}",
"public void destroy() {\n\t\t\n\t}",
"public void destroy() {\n\t\t\n\t}",
"public void destroy() {\n\t\t\n\t}",
"public void destroy() {\n\t\t\n\t}",
"public void destroy() {\n\t\t\n\t}",
"public void destroy() {\n\t\t\n\t}",
"public static void destroy() {\n handler = null;\n initialized = false;\n }",
"public void destroy() {}",
"public void destroy() {}",
"public void destroy()\r\n\t{\r\n\t}",
"public void destroy()\r\n\t{\n\t\t\r\n\t}",
"public void destroy()\r\n {\r\n }",
"@Override\n public void destroy() {\n // destroy any persistent resources\n // such as thread pools or persistent connections\n }",
"public void destroy() {\n\n\t}",
"public void destroy() {\n\n\t}",
"public void destroy() {\n\n\t}",
"public void destroy() {\n\n\t}",
"public void destroy() {\n\n\t}",
"public void destroy() {\n\n\t}",
"public void destroy() {\n }",
"public void destroy() {\n }",
"public void destroy() {\n }",
"public void destroy() {\n }",
"public void destroy() {\n }",
"public void destroy() {\n }",
"public void destroy() {\n }",
"public void destroy() {\n }",
"public void destroy() {\n }",
"public void destroy() {\n }",
"public void destroy() {\n }",
"public void destroy() {\r\n\t\tsuper.destroy();\r\n\t\tBirtEngine.destroyBirtEngine();\r\n\t}",
"public void destroy()\n\t{\n\t}",
"@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\t//取消某个网络请求\n\t\tNMApplication.getRequestQueue().cancelAll(VOLLEY_POST);\n\t}",
"public final void destroy() {\n requestExit();\n }",
"public void destroy()\n\t{\n\t\tM_log.info(\"destroy()\");\n\t}",
"public void destroy() {\n this.bfc.cleanUp();\n }",
"public void destroy();",
"public void destroy();",
"public void destroy();",
"public void destroy();",
"public void destroy();",
"public void destroy();",
"public void destroy();",
"public void destroy();",
"public void contextDestroyed(ServletContextEvent servletcontextevent) \n\t {\n\t\t \n\t }",
"public final void destroy()\n {\n processDestroy();\n super.destroy();\n }",
"public void destroy() {\r\n final String METHOD_NAME = \"destroy\";\r\n LOGGER.info(\"Entering \" + METHOD_NAME);\r\n\r\n this.filterConfig = null;\r\n\r\n LOGGER.info(\"Exiting \" + METHOD_NAME);\r\n }",
"public void stop () {\n if (server != null)\n server.shutDown ();\n server = null;\n }",
"public void destroy() {\n\r\n\t}",
"public void destroy() {\n\r\n\t}",
"public void destroy() {\n\r\n\t}",
"public void destroy() {\n\r\n\t}",
"public void destroy() {\n\r\n\t}",
"public void destroy()\r\n {\n }",
"public static void destruct() {\n\t\tinstance = null;\n\t}",
"public void destroy()\r\n\t{\r\n\t\tlog.fine(\"destroy\");\r\n\t}",
"void destruct()\n\t{\n\t\tlistenerList = null;\n\t}",
"public void destroy() {\n }",
"@PreDestroy\n\tpublic void destroy() {\n\t\tthis.executorService.shutdown();\n\t}",
"public void testDestroyAccuracy() throws Exception {\r\n // Initial the vairables.\r\n servlet.init(config);\r\n assertEquals(\"init fails.\", \"UserId\",\r\n TestHelper.getVariable(AjaxSupportServlet.class, \"userIdAttributeName\", servlet));\r\n\r\n Map handlers = (Map) TestHelper.getVariable(AjaxSupportServlet.class, \"handlers\", servlet);\r\n assertEquals(\"destroy fails\", 5, handlers.size());\r\n\r\n // destroy the variables.\r\n servlet.destroy();\r\n\r\n assertNull(\"destroy fails.\",\r\n TestHelper.getVariable(AjaxSupportServlet.class, \"userIdAttributeName\", servlet));\r\n\r\n Map handlers1 = (Map) TestHelper.getVariable(AjaxSupportServlet.class, \"handlers\", servlet);\r\n assertTrue(\"init fails.\", handlers1.isEmpty());\r\n }",
"public void destroy() {\n\t\tsuper.destroy(); \n\t\t// Put your code here\n\t}",
"void destroy() {\n INSTANCE = null;\n }",
"public void destroyOsgi();",
"@PreDestroy\n public void destroy() {\n TempObjectCache tempObjectCache = TempObjectCache.getInstance();\n tempObjectCache.cleanUp();\n\n // release all persist caches & persist cache redis client\n PersistObjectCache persistObjectCache = PersistObjectCache.getInstance();\n persistObjectCache.cleanUp();\n\n // destroy redis client pool\n RedisTool.destroy();\n\n // Shutdown UniRest\n try {\n Unirest.shutdown();\n } catch (IOException ignore) {\n }\n }",
"public void destroy() {\r\n // applet is going away...\r\n }"
] | [
"0.8358668",
"0.8068802",
"0.7902813",
"0.750188",
"0.74449927",
"0.6997688",
"0.6951129",
"0.6784333",
"0.66453546",
"0.662955",
"0.6534266",
"0.6458207",
"0.6419172",
"0.6386573",
"0.6369197",
"0.6355449",
"0.6355449",
"0.6355449",
"0.6355449",
"0.63451165",
"0.6335389",
"0.6335219",
"0.6335219",
"0.6335219",
"0.6335219",
"0.6335219",
"0.6335219",
"0.6335219",
"0.6335219",
"0.6335219",
"0.6335219",
"0.6335219",
"0.6335219",
"0.6335219",
"0.6335219",
"0.6335219",
"0.63319147",
"0.63319147",
"0.63319147",
"0.63319147",
"0.63319147",
"0.63319147",
"0.6323755",
"0.6323147",
"0.6323147",
"0.6320102",
"0.6314368",
"0.6289541",
"0.6287814",
"0.6281055",
"0.6281055",
"0.6281055",
"0.6281055",
"0.6281055",
"0.6281055",
"0.62785125",
"0.62785125",
"0.62785125",
"0.62785125",
"0.62785125",
"0.62785125",
"0.62785125",
"0.62785125",
"0.62785125",
"0.62785125",
"0.62785125",
"0.6274624",
"0.6244176",
"0.6240078",
"0.6232922",
"0.62301546",
"0.62269044",
"0.6225168",
"0.6225168",
"0.6225168",
"0.6225168",
"0.6225168",
"0.6225168",
"0.6225168",
"0.6225168",
"0.6223191",
"0.62212276",
"0.6214883",
"0.62045974",
"0.62002337",
"0.62002337",
"0.62002337",
"0.62002337",
"0.62002337",
"0.61972",
"0.61916405",
"0.6187979",
"0.61538005",
"0.6150806",
"0.6140724",
"0.61377907",
"0.6121045",
"0.6105259",
"0.60951614",
"0.6093785",
"0.608765"
] | 0.0 | -1 |
The doGet method of the servlet. This method is called when a form has its tag value method equals to get. | public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
this.doPost(request, response);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tSystem.out.println(\"get\");\n\t\tthis.doPost(req, resp);\n\t}",
"@Override\n \tpublic void doGet(HttpServletRequest req, HttpServletResponse resp)\n \t\t\tthrows ServletException, IOException {\n \t\tdoPost(req, resp);\n \t}",
"void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException;",
"@Override\r\n protected void doGet(HttpServletRequest req, HttpServletResponse resp)\r\n throws ServletException, IOException {\n this.doPost(req, resp);\r\n }",
"public void doGet(HttpServletRequest req, HttpServletResponse resp)\r\n throws ServletException, IOException {\r\n\r\n doPost(req, resp); // call doPost processing\r\n\r\n }",
"@Override\n\tpublic void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\r\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\r\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\r\n\t\tdoPost(req, resp);\r\n\t}",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n doPost(request, response);\r\n }",
"@Override\n protected void doGet( HttpServletRequest request, HttpServletResponse response ) throws ServletException, IOException {\n doPost( request, response );\n }",
"@Override\n\tpublic void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tthis.doPost(request, response);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\tdoPost(req, resp);\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\r\n\t}",
"@Override\n public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n doPost(request, response);\n }",
"protected void doGet(HttpServletRequest request, HttpServletResponse response)\n\tthrows ServletException, IOException {\nthis.doPost(request, response);\n}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n \tdoPost(request, response);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req,resp);;\n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n // only POST should be used\n doPost(request, response);\n }",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tdoPost(req, resp);\r\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tdoPost(req, resp);\r\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}",
"public void doGet(HttpServletRequest request,\n HttpServletResponse response)\n throws IOException, ServletException {\n \n doPost(request, response);\n }",
"public void doGet(\r\n HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n doPost(request, response);\r\n }",
"@Override\n\tprotected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tdoPost(request, response);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tdoPost(request, response);\n\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tthis.doPost(req, resp);\r\n\t}",
"protected void doGet(HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t\tdoPost(request, response); // calling doPost method\n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n doPost(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n doPost(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n doPost(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n doPost(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n doPost(request, response);\n }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException\r\n\t{\n\t\tdoPost(req, resp);\r\n\t}",
"@Override\r\n\t\tprotected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t this.doGet(request, response);\r\n\t }",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t doPost(request, response);\n\t}",
"@Override\r\n\tprotected void doPost( final HttpServletRequest request, final HttpServletResponse response ) throws ServletException, IOException {\r\n\t\tdoGet( request, response );\r\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\r\n\t\t// TODO Auto-generated method stub\r\n\t\t doPost(req, resp);\r\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t\t\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n doPost(request, response);\n }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}",
"public synchronized void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {\r\n\t\tdoPost(request, response);\r\n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n metGet(request, response);\n }",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n doGet(request, response);\r\n }",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tdoPost(request, response);\r\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tdoPost(request, response);\r\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\r\n\r\n\t\tdoPost(request, response);\r\n\t}",
"public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n }",
"protected void doGet(HttpServletRequest request, \r\n\t\t\tHttpServletResponse response) throws ServletException, IOException {\r\n\t\t// Send all get requests to doPost\r\n\t\tdoPost(request, response);\r\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t}",
"public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException,\n IOException\n {\n doPost(request,response);\n }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req,resp);\n\n\t}",
"@Override\n protected void doGet( HttpServletRequest req, HttpServletResponse resp )\n throws ServletException, IOException {\n log( \"GET\" );\n createInputBloodDonationForm( req, resp );\n }",
"protected void doGet(HttpServletRequest request,\r\n\t\t\tHttpServletResponse response) throws ServletException, IOException {\r\n\t\tdoPost(request,response);\r\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\t\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\n\t}",
"public void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\ndoPost(request, response);\n\t\t\n\t}",
"public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException\r\n\t{\r\n\t\tdoPost(request, response);\r\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\tthis.doPost(request, response);\n\t}",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n\n doGet(request, response);\n\n }",
"@Override\r\n\tprotected void doPost(HttpServletRequest request,\r\n\t\t\tHttpServletResponse response) throws ServletException, IOException {\r\n\t\tdoGet(request, response);\r\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\r\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t}",
"@Override\n\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoGet(req, resp);\n\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n this.doPost(request, response);\n }",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tdoPost(request, response);\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tdoPost(request, response);\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tdoPost(request, response);\n\t}",
"public void doGet(HttpServletRequest request, \n HttpServletResponse response)\n throws ServletException, IOException \n {\n response.setContentType(\"text/html\");\n\n // Writing message to the web page\n PrintWriter out = response.getWriter();\n String title = \"Using GET Method to Read Form Data\";\n String docType =\n \"<!doctype html public \\\"-//w3c//dtd html 4.0 \" + \"transitional//en\\\">\\n\";\n \n out.println(docType +\n \t \"<html>\\n\" +\n \t \"<head><title>\" + title + \"</title></head>\\n\" +\n \t \"<body bgcolor = \\\"#f0f0f0\\\">\\n\" +\n \t \"<h1 align = \\\"center\\\">\" + title + \"</h1>\\n\" +\n \t \"<ul>\\n\" +\n \t \" <li><b>Email</b>: \"\n \t + request.getParameter(\"uname\") + \"\\n\" +\n \t \" <li><b>Password</b>: \"\n \t + request.getParameter(\"psw\") + \"\\n\" +\n \t \"\t<li><b>Remember?</b>: \"\n \t + request.getParameter(\"remember\") +\n \t \"</ul>\\n\" +\n \t \"</body>\" +\n \t \"</html>\"\n \t );\n \n }",
"@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoGet(req, resp);\r\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tdoPost(request,response);\n\t}",
"public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException\n\t{\n\t\tthis.doPost(request, response);\n\t}",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoGet(req, resp);\n\t}",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoGet(req, resp);\n\t}",
"public void doGet(HttpServletRequest request,\n HttpServletResponse response) throws ServletException,\n IOException {\n doPost(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \tSystem.out.println(\"---here--get--\");\n processRequest(request, response);\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n doGet(request, response);\n }"
] | [
"0.74321973",
"0.7351684",
"0.7254353",
"0.72517896",
"0.7243276",
"0.72414607",
"0.720676",
"0.720676",
"0.7205302",
"0.7200583",
"0.72004616",
"0.71830994",
"0.717302",
"0.7170418",
"0.7159133",
"0.71552026",
"0.7151952",
"0.7150853",
"0.71395576",
"0.7138539",
"0.7138539",
"0.7134312",
"0.7134312",
"0.7134312",
"0.7134148",
"0.71248156",
"0.71155614",
"0.7108337",
"0.7099834",
"0.7097104",
"0.7090368",
"0.7090368",
"0.7090368",
"0.7090368",
"0.7090368",
"0.7086542",
"0.7086542",
"0.7086542",
"0.7086542",
"0.70863783",
"0.7075513",
"0.7073561",
"0.7069075",
"0.7068313",
"0.7054004",
"0.7049408",
"0.7049218",
"0.7049218",
"0.70476806",
"0.7035674",
"0.7032245",
"0.7008681",
"0.7008681",
"0.700453",
"0.7004084",
"0.699986",
"0.6996051",
"0.6996051",
"0.69931346",
"0.6992763",
"0.69885725",
"0.69856924",
"0.69842976",
"0.69796216",
"0.69794375",
"0.6978767",
"0.6975543",
"0.697479",
"0.69697356",
"0.69695395",
"0.6969472",
"0.69679564",
"0.69654816",
"0.6965044",
"0.6964817",
"0.69516957",
"0.6935941",
"0.6935941",
"0.6935941",
"0.69285655",
"0.6924731",
"0.69033",
"0.69033",
"0.69033",
"0.69033",
"0.69033",
"0.69033",
"0.69033",
"0.69033",
"0.69033",
"0.69033",
"0.69033",
"0.69033",
"0.6898089",
"0.6897831",
"0.68958616",
"0.68958616",
"0.6890818",
"0.68903744",
"0.68839407",
"0.6881611"
] | 0.0 | -1 |
The doPost method of the servlet. This method is called when a form has its tag value method equals to post. | public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
Object memberIDs = request.getSession().getAttribute("memberID");
String uri = request.getRequestURI();
String from = uri.substring(uri.indexOf("/", 2));
if(memberIDs != null ){
if(memberIDs.toString() != null || memberIDs.toString() != ""){
int memberID = Integer.parseInt(memberIDs.toString());
List<MyTrolleyVo> list1 = mts.getTrolleyID(memberID);
int trolleyID = 0;
TrollyDetailPo tdp = new TrollyDetailPo();
for (MyTrolleyVo myTrolleyVo : list1) {
trolleyID = myTrolleyVo.getTrolleyID();
}
List<TrolleyDetailVo> list = tds.checkTroDetail(trolleyID);
List<GoodsVo> glist = new ArrayList<GoodsVo>();
GoodsVo gv = null;
//给glist赋值
for (TrolleyDetailVo tli : list) {
List<GoodsVo> one = gs.checkGoods(tli.getGoodsID());
for (GoodsVo gone : one) {
gv = gone;
}
gv.setGoodsCoun(tli.getGoodsCoun());
glist.add(gv);
for (GoodsVo goodsVo : one) {
if(goodsVo.getIsValid() == 0){
glist.remove(goodsVo);//如果商品已过期,则list中移除这个商品
}
}
System.out.println(gv.getGoodsCoun()+"----");
}
double totle = 0.0;
for (GoodsVo goodsVo : glist) {
totle = totle+goodsVo.getGoodsMemberPrice()*goodsVo.getGoodsCoun();
}
//计算总价格
// List<Double> listPrice = tds.totle(trolleyID);
//
// for (Double price : listPrice) {
// totle += price;
// }
System.out.println("totle:" + totle);
// if(list != null){
// request.getSession().setAttribute("trodetlist", list);
// request.getSession().setAttribute("totle", totle);
// request.getRequestDispatcher("carGoods").forward(request, response);
// }
if(glist != null){
request.getSession().setAttribute("totle", totle);
request.getSession().setAttribute("glist", glist);
request.getSession().setAttribute("carId", trolleyID);
response.sendRedirect(request.getContextPath()+"/otherpage/mytrolley.jsp");/////
}
}else{
response.sendRedirect(request.getContextPath()+"/member/login.jsp?from="+from);
}
}else{
response.sendRedirect(request.getContextPath()+"/member/login.jsp?from="+from);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n }",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n }",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"public void doPost( )\n {\n \n }",
"public void doPost(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\r\n\r\n\t\t\r\n\t}",
"public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\n\t\t\t\n\t\t \n\t}",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n metPost(request, response);\n }",
"protected void doPost(HttpServletRequest request,\r\n\t\t\tHttpServletResponse response)\r\n\t/* 43: */throws ServletException, IOException\r\n\t/* 44: */{\r\n\t\t/* 45:48 */doGet(request, response);\r\n\t\t/* 46: */}",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n }",
"@Override\n\tpublic void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n\t}",
"@Override\n\tpublic void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n\t}",
"public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\t\n\t}",
"@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) {\n }",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }",
"protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException {\n }",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\t\n\t}",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n\r\n }",
"public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\n\t}",
"@Override\n\tprotected void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t}",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }",
"@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}",
"@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}",
"@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}",
"@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}",
"@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }",
"@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}",
"@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n super.doPost(req, resp);\n }",
"public void doPost(HttpServletRequest request ,HttpServletResponse response){\n\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n }",
"@Override\r\n\t/**\r\n\t * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse\r\n\t * response)\r\n\t */\r\n\tprotected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\n\t\tdoGet(request, response);\r\n\t}",
"public void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows IOException {\n\n\t}",
"@Override\n\tpublic void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows IOException, ServletException {\n\t\t\n\t\t\tdoGet(request, response);\n\t\t\n\t}",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.getWriter().println(\"go to post method in manager\");\n }",
"@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\n\tsuper.doPost(req, resp);\n\t\n\tSystem.out.println(\"dddd\");\n}",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n System.out.println(\"teste dopost\");\r\n }",
"public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\ndoGet(request, response);\n\t}",
"public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n this.doGet(request, response);\n\t\t\n\t\t\t\n\t}",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tdoGet(request, response);\r\n\t\t\r\n\t}",
"@Override\n public void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n \tdoGet(request, response);\n }",
"protected void doPost(HttpServletRequest request, \r\n \t\tHttpServletResponse response) throws ServletException, IOException {\n\t\tdoGet(request, response);\r\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException\n {\n processRequest(request, response);\n }",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n doPost(request, response);\r\n }",
"public void processPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException\n {\n }",
"protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tString string= request.getParameter(\"action\");\n\t\tif(string.equals(\"fileUpload\")) {\n\t\t\tfileUpload(request, response);\n\t\t}\n\t\telse if(string.equals(\"updateImformation\")) {\n\t\t\tupdateImformation(request, response);\n\t\t}\n\t\telse {\n\t\t\trequest.getRequestDispatcher(\"index.jsp\").forward(request, response);\n\t\t}\n\t}",
"protected void doPost (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException\n {\n doGet(request,response);\n }",
"@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {\n\t\t\r\n\t}",
"protected void doPost(final HttpServletRequest request,final HttpServletResponse response)\r\n throws ServletException, IOException {\r\n this.doGet(request, response);\r\n \r\n }",
"protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, java.io.IOException {\n processRequest(request, response);\n }",
"protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, java.io.IOException {\n processRequest(request, response);\n }",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"@Override\n protected void doGet( HttpServletRequest request, HttpServletResponse response ) throws ServletException, IOException {\n doPost( request, response );\n }",
"protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n doGet(request,response);\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t// TODO Auto-generated method stub\n\t\tdoGet(request, response);\n\t}",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException\r\n {\r\n processRequest(request, response);\r\n }",
"@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\tprocess(req,resp);\r\n\t}",
"@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t\tdoGet(req, resp);\r\n\t}",
"public void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\tthrows ServletException, IOException {\n\t\tMap<String, String> messages = new HashMap<String, String>();\n\t\treq.setAttribute(\"messages\", messages);\n\n\t\tList<MeetUps> meetups = new ArrayList<MeetUps>();\n \n\t\t// Retrieve and validate the user last name that is retrieved from the form POST submission. By default, it\n\t\t// is populated by the URL query string (in FindUsers.jsp).\n\t\tString district = req.getParameter(\"district\");\n\t\tif (district == null || district.trim().isEmpty()) {\n\t\t\tmessages.put(\"success\", \"Please enter a valid intensity value.\");\n\t\t} else {\n\t\t\t// Retrieve meetups, and store as a message.\n\t\t\ttry {\n\t\t\t\tmeetups = meetupsDao.getAllMeetUpsByDistrict(district);\n\t\t\t} catch (SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\tthrow new IOException(e);\n\t\t\t}\n\t\t\tmessages.put(\"success\", \"Displaying results for meetups in the district: \" + district);\n\t\t}\n\t\treq.setAttribute(\"meetups\", meetups);\n \n\t\treq.getRequestDispatcher(\"/MeetUp.jsp\").forward(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req,resp);;\n\t}",
"@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\r\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, java.io.IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doPost\n (HttpServletRequest request, HttpServletResponse response\n )\n throws ServletException\n , IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n\t throws ServletException, IOException {\n\tprocessRequest(request, response);\n }",
"protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, java.io.IOException\n {\n internalProcessRequest(request, response);\n }",
"@Override\r\n protected void doPost(HttpServletRequest request,\r\n HttpServletResponse response)\r\n throws ServletException,\r\n IOException {\r\n processRequest(request,\r\n response);\r\n\r\n }",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\r\n \tif(\"Submit Request\".equalsIgnoreCase(request.getParameter(\"action\"))){\t\t\t\r\n \t\tSite site = getLoggedOnSite(request);\r\n \t\tUser user = getLoggedOnUser(request);\r\n\r\n\t \tint itemId = Integer.parseInt(request.getParameter(\"itemId\"));\r\n\t \tint numRequested = Integer.parseInt(request.getParameter(\"numberUnits\"));\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tmakeFoodBankRequestDAO.makeFoodBankRequest(itemId, site.getId(), user.getEmail(), numRequested);\r\n\t\t\t\t\r\n\t\t\t\tresponse.getWriter().write((\"Success\"));\t\t\t\r\n\t\t\t\t\r\n\t\t\t} catch (SQLException e) {\t\t\t\t\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t\tresponse.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.toString());\r\n\t\t\t}\r\n\t\t}\r\n }",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n \r\n }",
"@Override\n\tprotected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tdoPost(request, response);\n\t}"
] | [
"0.76588804",
"0.7604264",
"0.7526298",
"0.74706787",
"0.74706787",
"0.74706787",
"0.74706787",
"0.74706787",
"0.74706787",
"0.74706787",
"0.74706787",
"0.74706787",
"0.74706787",
"0.74706787",
"0.7469177",
"0.74289393",
"0.74130076",
"0.74035096",
"0.73867726",
"0.7372807",
"0.73713285",
"0.73713285",
"0.7370323",
"0.7348822",
"0.7346204",
"0.7339751",
"0.7325896",
"0.7321582",
"0.7314906",
"0.73103815",
"0.73075277",
"0.7303272",
"0.7303272",
"0.7303272",
"0.7271607",
"0.7271607",
"0.7271607",
"0.72694266",
"0.722653",
"0.722653",
"0.7226398",
"0.7226398",
"0.7226398",
"0.7147443",
"0.7129223",
"0.7118164",
"0.70893365",
"0.70696753",
"0.7059048",
"0.7050026",
"0.70423514",
"0.703838",
"0.7036622",
"0.70321",
"0.70159566",
"0.699992",
"0.69890815",
"0.6983867",
"0.6976661",
"0.6937375",
"0.6934398",
"0.6926204",
"0.6926204",
"0.6926204",
"0.6926204",
"0.6926204",
"0.6926204",
"0.6926204",
"0.6920013",
"0.6920013",
"0.6920013",
"0.6920013",
"0.6920013",
"0.6916372",
"0.6913437",
"0.69112235",
"0.6909456",
"0.6898764",
"0.6898764",
"0.6894436",
"0.689074",
"0.6885316",
"0.6874595",
"0.6874595",
"0.6874595",
"0.68734616",
"0.6867755",
"0.6864754",
"0.6862382",
"0.6858837",
"0.68527263",
"0.6852032",
"0.6848251",
"0.6845802",
"0.68407834",
"0.6840312",
"0.6833675",
"0.6829763",
"0.6821313",
"0.6820622",
"0.68137157"
] | 0.0 | -1 |
Initialization of the servlet. | public void init() throws ServletException {
// Put your code here
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void init() throws ServletException {\r\n\r\n\t}",
"public void init() throws ServletException {\n }",
"public void init() throws ServletException {\n\t\t\n\t}",
"public void init() throws ServletException {\r\n\t\t// Put your code here\r\n\t}",
"public void init() throws ServletException {\r\n\t\t// Put your code here\r\n\t}",
"public void init() throws ServletException {\r\n\t\t// Put your code here\r\n\t}",
"public void init() throws ServletException {\r\n\t\t// Put your code here\r\n\t}",
"public void init() throws ServletException {\r\n\t\t// Put your code here\r\n\t}",
"public void init() throws ServletException {\r\n\t\t// Put your code here\r\n\t}",
"public void init() throws ServletException {\r\n\t\t// Put your code here\r\n\t}",
"public void init() throws ServletException {\r\n\t\t// Put your code here\r\n\t}",
"public void init() throws ServletException {\r\n\t\t// Put your code here\r\n\t}",
"public void init() throws ServletException {\r\n\t\t// Put your code here\r\n\t}",
"public void init() throws ServletException {\r\n\t\t// Put your code here\r\n\t}",
"public void init() throws ServletException {\r\n\t\t// Put your code here\r\n\t}",
"public void init() throws ServletException {\r\n\t\t// Put your code here\r\n\t}",
"public void init() throws ServletException {\r\n\t\t// Put your code here\r\n\t}",
"public void init() throws ServletException {\r\n\t\t// Put your code here\r\n\t}",
"public void init() throws ServletException {\r\n\t\t// Put your code here\r\n\t}",
"public void init() throws ServletException {\r\n\t\t// Put your code here\r\n\t}",
"public void init() throws ServletException {\r\n\t\t// Put your code here\r\n\t}",
"public void init() throws ServletException {\r\n\t\t// Put your code here\r\n\t}",
"public void init() throws ServletException {\r\n\t\t// Put your code here\r\n\t}",
"public void init() throws ServletException {\n\t\t// Put your code here\n\t\t\n\t}",
"public void init() throws ServletException {\n\t\t// Put your code here\n\n\t}",
"public void init() throws ServletException {\r\n\t\t\r\n\t}",
"public void init() throws ServletException {\n\t}",
"public void init() throws ServletException {\n\t}",
"public void init() throws ServletException {\n\t}",
"public void init() throws ServletException {\n\t}",
"public void init() throws ServletException {\n\t}",
"public void init() throws ServletException {\n\t}",
"public void init() throws ServletException {\n\t}",
"public void init() throws ServletException {\n\t}",
"public void init() throws ServletException {\n\t}",
"public void init() throws ServletException {\n\t}",
"public void init() throws ServletException {\n\t}",
"public void init() throws ServletException {\n\t}",
"public void init() throws ServletException {\n\t}",
"public void init() throws ServletException {\n\t}",
"public void init() throws ServletException {\n\t}",
"@Override\n\tpublic void init() throws ServletException {\n\t\tSystem.out.println(\"Servlet initializing\");\n\t}",
"public void init() throws ServletException\n\t{\n\t\t// Put your code here\n\t}",
"public void init() throws ServletException{\n\t\tSystem.out.println(this.getServletName()+\" is INITILIAZED\");\n\t\tsuper.init();\n\t}",
"@Override\n\tpublic void init() throws ServletException {\n\t\tsuper.init();\n\t\tcounter = 1;\n\t\tSystem.out.println(\"Servlet Init Call\");\n\t}",
"@Override\n\tpublic void init() throws ServletException {\n\t}",
"@Override\n\tpublic void init() throws ServletException {\n\t}",
"@Override\n\tpublic void init() throws ServletException {\n\t}",
"@Override\n\tpublic void init() throws ServletException {\n\t\t\n\t}",
"@Override\n\tpublic void init() throws ServletException {\n\t\t// Put your code here\n\t}",
"public void init(ServletConfig arg0) throws ServletException {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() throws ServletException {\n\t\tsuper.init();\r\n\t}",
"@Override\r\n\tpublic void init() throws ServletException {\n\t\tsuper.init();\r\n\t}",
"public void init(HttpServletRequest request) throws ServletException {\n\t}",
"public void init() {\n ServletContext context = getServletContext();\r\n host = context.getInitParameter(\"host\");\r\n port = context.getInitParameter(\"port\");\r\n user = context.getInitParameter(\"user\");\r\n pass = context.getInitParameter(\"pass\");\r\n }"
] | [
"0.81776613",
"0.8165632",
"0.8125925",
"0.81145406",
"0.81145406",
"0.81145406",
"0.81145406",
"0.81145406",
"0.81145406",
"0.81145406",
"0.81145406",
"0.81145406",
"0.81145406",
"0.81145406",
"0.81145406",
"0.81145406",
"0.81145406",
"0.81145406",
"0.81145406",
"0.81145406",
"0.81145406",
"0.81145406",
"0.81145406",
"0.8110146",
"0.8063847",
"0.8058449",
"0.80374163",
"0.80374163",
"0.80374163",
"0.80374163",
"0.80374163",
"0.80374163",
"0.80374163",
"0.80374163",
"0.80374163",
"0.80374163",
"0.80374163",
"0.80374163",
"0.80374163",
"0.80374163",
"0.80374163",
"0.802789",
"0.7923467",
"0.7824179",
"0.7775065",
"0.7764168",
"0.7764168",
"0.7764168",
"0.77421993",
"0.77381545",
"0.7697023",
"0.7680191",
"0.7680191",
"0.7679679",
"0.7678588"
] | 0.80423874 | 67 |
main method to launch the game | public static void main(String[] args) {
launch(args);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void main(String[] args) {\n Game game = new Game(\"Programming 2 Project\",600,600);\n game.start();\n \n }",
"public static void main(String[] args) {\n MainGameClass mg=new MainGameClass();\n mg.start();\n \n \n \n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}",
"public static void main(String[] args) {\n game();\n }",
"public static void main(String[] args) {\n\t\tGame game = new Game();\n\t\t//game.playGame();\n\t}",
"public static void main(String args[]) {\n (new Game()).start();\n }",
"public static void main(String args[]) {\n (new Game()).play();\n }",
"public static void main(String[] args) {\n GameEx gameEx = new GameEx();\n\n gameEx.play();\n }",
"public static void main(String[] args){\n DotComBust game = new DotComBust();\n game.setUpGame();\n game.startPlaying();\n }",
"public static void main(String[] args){\n try {\n GameClient.start();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public static void main(String[] args) {\n\t\tGame myGame = new Game();\n\t\tmyGame.start();\n\t}",
"public static void main(String[] args) {\n\n System.out.println(\"Welcome to TEAM-11 Game\");\n new GameEngine().start();\n }",
"public static void main(String[] args) {\n init();\n\n //take input from the players before starting the game\n input();\n\n //the gameplay begins from here\n System.out.println();\n System.out.println();\n System.out.println(\"***** Game starts *****\");\n play();\n }",
"public static void main(String[] args) {\n clock = new GameClock();\n ProjectGame game = new ProjectGame();\n game.start();\n\n\n }",
"public static void main(String[] args) {\n Game game = new HaMGame();\n game.playGame();\n }",
"public static void main(String[] args)\n {\n //Create an instance of the game\n game Game = new game(PAGE_HEIGHT,PAGE_WIDTH,PAGE_TITLE);\n \n //Start the game loop\n Game.start();\n }",
"public static void main(String[] args) {\n setUpGamePlayer();\r\n \r\n //display of game board for computer\r\n setUpGameComp();\r\n System.out.println();\r\n \r\n System.out.println();\r\n System.out.println();\r\n \r\n //starting game\r\n // code incomplete to play game\r\n //playGame();\r\n }",
"public static void main(String[] args) {\n\t\t\r\n\t\tResources.setEncoding(Resources.ENCODING_UTF_8);\r\n\t\tGame.setInfo(\"gameInfo.xml\");\r\n\t\tGame.init();\r\n\t\tGame.getRenderEngine().setBaseRenderScale((float) 2);\r\n\t\tGame.getScreenManager().setResolution(Resolution.custom(1280, 720, \"1280*720\"));\r\n\t\tGame.getScreenManager().addScreen(new mainMenu());\r\n\t\tGame.getScreenManager().addScreen(mainGameScreen.getInstance());\r\n\t\tGame.getScreenManager().displayScreen(mainMenu.NAME);\r\n\t\tGame.start();\r\n\t\tSystem.out.println(\"Game version is: \" + Game.getInfo().getVersion());\r\n\t\tSystem.out.println(\"Currently active screen: \" + Game.getScreenManager().getCurrentScreen().getName());\r\n\t\t\r\n\t}",
"public static void main(String arg[]){\r\n GameContainer gc = new GameContainer(new GameManager());\r\n\r\n gc.setWidth(400);\r\n gc.setHeight(300);\r\n gc.setScale(2);\r\n\r\n gc.setClearScreen(true);\r\n gc.setLightEnable(true);\r\n gc.setDynamicLights(true);\r\n gc.start();\r\n }",
"public static void main(String[] args) {\n\t\tGameEnvironment runningGame = new GameEnvironment();\n\t\trunningGame.launchStartupScreen();\n\t}",
"public static void main(String[] args){\n\t\tnew GamePanel(790,630); //Sonst grauer Streifen an den Rändern rechts und unten\n\t}",
"public static void main(String[] args) {\n Game game = new Game();\n }",
"public static void main(String[] args) {\n Properties props = new Properties();\n try {\n props.load(ResourceLoader.getResourceAsStream(\"game.properties\"));\n Config config = new Config(props);\n Game game = new Game(\"PlatformerState\");\n AppGameContainer app = new AppGameContainer(game);\n app.setIcons( new String[] {\"res/icon/16x16.png\", \"res/icon/32x32.png\"} ); //load icons\n app.setDisplayMode(config.getInteger(Config.WINDOW_WIDTH_CONFIG_KEY), \n config.getInteger(Config.WINDOW_HEIGHT_CONFIG_KEY), \n config.getBoolean(Config.WINDOW_FULLSCREEN_CONFIG_KEY));\n app.setTargetFrameRate(60);\n app.setShowFPS(false);\n app.start();\n } catch(IOException e) {\n e.printStackTrace();\n } catch(SlickException e) {\n e.printStackTrace();\n }\n }",
"public static void main(String[] args)\r\n\t{\r\n\t\tnew SimpleGame();\r\n\t}",
"public static void main(String[] args){\n GameFrame frame = new GameFrame(1);\n frame.run();\n }",
"public static void main(String[] args) {\n\t\tgame(1);\r\n\t}",
"public static void main(String[] args) {\n\n ConsoleChessGui gui = new ConsoleChessGui();\n GameController gameController = new GameController(gui);\n gameController.run();\n\n\n\n\n }",
"public static void main(String[] args) {\n\t\tnew GameTest();\n\t}",
"public static void main(String[] args) {\n int width = 800;\n int height = 600;\n Game game = new Game(width, height);\n game.start();\n }",
"public static void main(String[] args) {\r\n\r\n\t\tGame game = new Game();\r\n\r\n\t}",
"public static void main(String[] args) {\n\n ShapeGame shapeGame = new ShapeGame();\n shapeGame.run();\n }",
"public static void main(String[] args) throws Exception {\r\n\t\tGame game = new Game();\r\n\t\tgame.start(true,null,null,null);\r\n\t}",
"public static void main(String[] args){\n\t\t\n\t\tSwingUtilities.invokeLater(new Runnable() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tGameLauncher gameLauncher = new GameLauncher();\n\t\t\t}\n\t\t});\n\t\t\n\t\t\n\t}",
"public static void main(String[] argv) {\n\t\ttry {\n\t\t\tAppGameContainer container = new AppGameContainer(new MyGame());\n\t\t\tcontainer.setDisplayMode(800, 600, false);\n\t\t\tcontainer.start();\n\t\t} catch (SlickException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public static void main(String[] args) {\n // TODO code application logic here\n //play();//This method will start the 20 minute battle scene music\n gameplay = true;\n while(gameplay) {\n /*#extra credit made a separate class and music selector below:*/\n Luong_7_audioclass pl = new Luong_7_audioclass();//this is how to use classes, pl._ to start the methods\n pl.soundsystem_commands();//this is the object used to call upon the public method sound system\n intro();//starts the game \n } \n }",
"public static void main(String[] args) {\r\n\t\tThread t = new Thread(new GameLauncher());\r\n\t\tt.start();\r\n\t}",
"public static void main(String[] args) {\n\t\t// MarioGame game = new MarioGame();\n//\t\tChessGame game = new ChessGame();\n\n//\t\tGamingConsole game = new MarioGame();\n\t\tChessGame game = new ChessGame();\n\t\tgame.up();\n\t\tgame.down();\n\t\tgame.left();\n\t\tgame.right();\n\t}",
"public static void main(String[] args) {\r\n\t\tSystem.out.println(\"Starting...\");\r\n\t\ttry {\r\n\t\t\tCmdApp cmd = new CmdApp();\t\t\r\n\t\t\tcmd.launchGame();\t\t\t\r\n\t\t} catch (FileNotFoundException | LevelException | VacuumException | SpriteException e) {\t\t\t\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(\"Finishing... bye!!\");\r\n\t}",
"public static void main(String[] args) {\n GameApplication application = new GameApplication();\n application.startApplication(args);\n }",
"public void run() {\n\t\tprepareVariables(true);\n\t\t\n\t\t// Prepares Map Tables for Song and Key Info.\n\t\tprepareTables();\n\t\t\n\t\t// Selects a Random Song.\n\t\tchooseSong(rgen.nextInt(0, songlist.size()-1));\n\t\t\n\t\t// Generates layout.\n\t\tgenerateLabels();\n\t\tgenerateLines();\n\t\t\n\t\t// Listeners\n\t\taddMouseListeners();\n\t\taddKeyListeners();\n\t\t\n\t\t// Game Starts\n\t\tplayGame();\n\t}",
"public static void main(String[] args) {\n\t\tSystem.out.printf(\"炒青菜的第一个小游戏\");\n\t\tBallGame game=new BallGame();\n\t\tgame.launchFrame();\n\t\n\t\t\n\t\t\n\n\t}",
"public static void main(String[] args) {\n\t\t// System.out.println(Tile.class.getName());\n\t\tAppGameContainer app = null;\n\t\ttry {\n\t\t\tapp = new AppGameContainer(new GameStart());\n\t\t} catch (SlickException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\ttry {\n\t\t\t// app.setMinimumLogicUpdateInterval(TICK_TIME);\n\t\t\t// app.setMaximumLogicUpdateInterval(TICK_TIME);\n\t\t\tapp.setDisplayMode(WINDOW_WIDTH, WINDOW_HEIGHT, false);\n\t\t\tapp.start();\n\t\t} catch (SlickException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public static void main(String[] args) {\n Model model = new Model();\n View view = new View(model);\n Controller controller = new Controller(model, view);\n\n /*main program (each loop):\n -player token gets set\n -game status gets shown visually and user input gets requested\n -game grid gets updated\n -if the game is determined: messages gets shown and a system exit gets called*/\n while (model.turnCounter < 10) {\n model.setToken();\n view.IO();\n controller.update();\n if (controller.checker()){\n System.out.println(\"player \" + model.playerToken + \" won!\");\n System.exit(1);\n }\n System.out.println(\"draw\");\n }\n }",
"public void runGame()\r\n\t{\r\n\t\tmainFrame.runGame();\r\n\t}",
"public static void main(String[] argv) {\r\n\t\tboolean sharedContextTest = false;\r\n\r\n\t\tAppGameContainer container = new AppGameContainer(new ImageCornerTest(), 800, 600, DisplayMode.Opt.WINDOWED);\r\n\t\tcontainer.setDisplayMode(800,600, DisplayMode.Opt.WINDOWED);\r\n\t\tcontainer.start();\r\n\t}",
"public static void main(String[] args) { \n \tprintAvailableMaps();\n \t\n\t\tGame game = new Game();\n\t\tScanner input = game.openFile();\n \tgame.readMapFile(input);\n \tgame.prepareTable();\n \tTapeHead player = game.preparePlayer();\n \t//game.print();\n \twhile(true) {\n \t\tgame.GameRunning(player);\n \t} \n }",
"public static void main(String[] args) {\n\n\t\t// Aus diese Schleife sorgt dafür, das man ohne großen aufwand immer neu spielen kann\n\t\t// hier wird auch das spiel raus gestartet\n\t\twhile (true){\n\n\t\tboard = new Board(); //erstellt das Fenster des Spielfeldes\n\t\tgui = new GUI();\t//erstellt das Fenster des Einstellungs/Start fensters\n\t\tgui.checkBtnPlay(); //wird von hier aufgerufen damit gui nicht = null ist und objekt erstellung abgeschlossen wird\n\t\t\t\t\t\t\t//in dieser Funktion wird auch das spiel gestartet\n\n\t\t//Wenn man hier angekommen ist ist das Aktuelle spiel zuende\n\t\tboard.dispose();\n\n\n\n\t\t//Zurück setzen der der Richtung\n\t\t// 4 heißt keine Bewegung\n\t\tGame.p1direction = 4;\n\t\tGame.p2direction = 4;\n\t}\n\n\n\t\t\n\t}",
"public static void main(String[] args) {\n new GameJFrame();\n // new DigitalWatch();\n }",
"private void startGame() {\n\t\tmain.next_module = new Game(main, inputs, gameSelectionData);\n\t}",
"public static void main(String[] args){\n \t\tJFrame game = new theGame();\n \t\tgame.setVisible(true);\n \n \t}",
"@SuppressWarnings(\"unused\")\r\n\tpublic static void main(String[] args) {\n\t\tGame game = new Game();\r\n\t}",
"public static void main(String[] args) \r\n\t{\n\t\t\r\n\t\tboolean playing = false;\r\n\t\t\r\n\t\twhile(true)\r\n\t\t{\r\n\t\t\tString option = menu();\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"\\n\\n\\n\\n\\n\\n\");\r\n\t\t\t\r\n\t\t\tif(option.equals(\"1\"))\r\n\t\t\t{\r\n\t\t\t\tcreateGame();\r\n\t\t\t\tplaying = true;\r\n\t\t\t}\r\n\t\t\telse if(option.equals(\"2\"))\r\n\t\t\t{\r\n\t\t\t\tcontinueGame();\r\n\t\t\t\tplaying = true;\r\n\t\t\t}\r\n\t\t\telse if(option.equals(\"3\"))\r\n\t\t\t{\r\n\t\t\t\tdeleteGames();\r\n\t\t\t}\r\n\t\t\telse if(option.equals(\"4\"))\r\n\t\t\t{\r\n\t\t\t\tGameManager.instance().viewHallOfFame();\r\n\t\t\t\tinput.nextLine();\r\n\t\t\t}\r\n\t\t\telse if(option.equals(\"5\"))\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"Thanks for playing Rogue Lands\");\r\n\t\t\t\t\r\n\t\t\t\tSystem.exit(0);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"Invalid option\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(playing)\r\n\t\t\t{\t\r\n\t\t\t\tboolean ans = Game.instance().Load();\r\n\t\t\t\t\r\n\t\t\t\tif(!ans) continue;\r\n\t\t\t\t\r\n\t\t\t\tGame.instance().AssembleScene();\r\n\t\t\t\t\r\n\t\t\t\tGame.instance().Setup();\r\n\t\t\t\t\r\n\t\t\t\tGame.instance().Play();\r\n\t\t\t\t\r\n\t\t\t\tplaying = false;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public static void main(String[] args) {\n\t\t\t\tAdditonGameMethod();\n\t\t\t}",
"public void startProgram()\r\n\t{\r\n\t\tview.displayPlayerNames();\r\n\t\tview.loadGameData();\r\n\t\tview.displayGame();\r\n\t}",
"public static void main(String[] args) throws InterruptedException {\n runGame();\n System.out.println(\"Game has finished\");\n\n }",
"public static void main(String[] args) {\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n try {\n new LaunchGame().setVisible(true);\n } catch (IOException ex) {\n Logger.getLogger(LaunchGame.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n });\n }",
"public static void main(String[] args) {\r\n\t\tTicketToRide myGame = new TicketToRide();\r\n\t\tmyGame.setFramesPerSecond(60);\r\n\r\n\t\t/*\r\n\t\t * Initialize two players. This can be any combination of human players\r\n\t\t * or AI players\r\n\t\t */\r\n\t\tPlayer player1 = new SuperPlayer();\r\n\t\tPlayer player2 = new ShaoPlayer();\r\n\r\n\t\t/* Setup the scene, and get the game started */\r\n\t\tTTRGamePlayScene scene = new TTRGamePlayScene(\"Ticket To Ride\",\r\n\t\t\t\t\"woodBacking.jpg\", myGame, player1, player2);\r\n\t\tmyGame.setCurrentScene(scene);\r\n\t\tplayer1.setScene(scene);\r\n\t\tplayer2.setScene(scene);\r\n\t\tmyGame.start();\r\n\t\tscene.playGame();\r\n\t}",
"public static void main(String[] args){\n\t\t EventQueue.invokeLater(new Runnable() {\n\t @Override\n\t public void run() {\n\t // create our game and set it to visible\n\t \tSnakeGame game = new SnakeGame();\n\t }\n\t });\n\t}",
"public static void main(String[] args) {\n\t\tif (sNeedRepack == 1) {\n\t\t\trepackGfx();\n\t\t\tSystem.out.printf(\"repacking completed; don't forget to refresh projects(F5 eclipse)\");\n\t\t\treturn;\n\t\t}\n\t\tif (sNeedCrypt == 1) {\n\t\t\tcryptAssets();\n\t\t\tSystem.out.printf(\"encrypting completed; don't forget to refresh projects(F5 eclipse)\");\n\t\t\treturn;\n\t\t}\n\n\t\tLwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();\n\t\tcfg.title = \"Demo Title\";\n\t\tcfg.width = 1280;\n\t\tcfg.height = 800;\n\t\t\n\t\t\n\t\tCoreManager coreManager = new CoreManager(new CoreOsManager() {\n\t\t\t@Override\n\t\t\tpublic void doAction(int actionId, UniversalBundle bundle) {\n\t\t\t}\n\t\t}, 32, 20) {\n\t\t\t@Override\n\t\t\tpublic void create() {\n\t\t\t\tsuper.create();\n\t\t\t\tCoreScreen screen = new ExampleGameScreen();\n\t\t\t\tpushScreen(screen);\n\t\t\t\tpushScreen(screen.createLoaderScreen());\n\t\t\t}\n\t\t};\n\n\t\tnew LwjglApplication(coreManager, cfg);\n\t}",
"public static void main(String[] args){\n\t\tGameLoop game=new GameLoop();\n\t\tgame.registerGlobalCallbacks();\n\t\t//Game loop and setting initial scene\n\t\tmusic = new Sound(\"res\\\\Music.wav\");\n\t\tmusic.setLoop(true);\n\t\tgameOverMenu.setMusic(new Sound(\"res\\\\GameOver.wav\"));\n\t\ttimeText = new Text(screenWidth*9/10-100,screenHeight*1/32-20,20,20,\"\");\n\t\ttimeText.setColor(0, 0, 0);\n\t\tscoreText = new Text(screenWidth*9/10-100,screenHeight*1/32,20,20,\"\");\n\t\tscoreText.setColor(0, 0, 0);\n\t\twaveText = new Text(screenWidth*9/10-100,screenHeight*1/32+20,20,20,\"\");\n\t\twaveText.setColor(0, 0, 0);\n\t\t\n\t\tinitScene iLauncher = new initScene(game);\n\t\toLauncher = new overScene(game);\n\t\t\n\t\tmainMenu.addUnselItem(screenWidth/2-165, screenHeight/2-300, 50, 50, \"Spell Flingers\",0,0,1);\n\t\tmainMenu.addUnselItem(25, screenHeight-45, 20, 20, \"CONTROLS: WASD to move, esc to pause, and mouse buttons to cast spells!\",0,0,0);\n\t\tmainMenu.addUnselItem(screenWidth/2-265, screenHeight/2-308, 64, (Texture) SpellList.getTexture(Spell.ARCANE_MISSILE)[0]);\n\t\tmainMenu.addUnselItem(screenWidth/2+265, screenHeight/2-308, 64, (Texture) SpellList.getTexture(Spell.ARCANE_MISSILE)[0]);\n\t\tmainMenu.addSelItem(new Scenes.SelectableText(screenWidth/2-165, screenHeight/2-100, 30, 30, \"Play Game\", 1, 0, 0, 0, 0, 0), iLauncher);\n\t\tmainMenu.addSelItem(new Scenes.SelectableText(screenWidth/2-165, screenHeight/2-50, 30, 30, \"Exit\", 1, 0, 0, 0, 0, 0), null);\n\t\tmainMenu.select(0);\n\t\t\n\t\tpauseMenu.addUnselItem(screenWidth/2-165, screenHeight/2-300, 50, 50, \"PAUSED\",0,1,0);\n\t\tpauseMenu.addUnselItem(timeText);\n\t\tpauseMenu.addUnselItem(scoreText);\n\t\tpauseMenu.addUnselItem(waveText);\n\t\tpauseMenu.addSelItem(new Scenes.SelectableText(screenWidth/2-165, screenHeight/2-100, 30, 30, \"Resume Game\", 1, 0, 0, 0, 0, 0), game);\n\t\tpauseMenu.addSelItem(new Scenes.SelectableText(screenWidth/2-165, screenHeight/2-50, 30, 30, \"Abandon Run\", 1, 0, 0, 0, 0, 0), oLauncher);\n\n\t\ttimeTextGO = new Text(screenWidth/2-165, 240, 20, 20,\"\");\n\t\ttimeTextGO.setColor(1, 1, 1);\n\t\tscoreTextGO = new Text(screenWidth/2-165, 270, 20, 20,\"\");\n\t\tscoreTextGO.setColor(1, 1, 1);\n\t\twaveTextGO = new Text(screenWidth/2-165, 300, 20, 20,\"\");\n\t\twaveTextGO.setColor(1, 1, 1);\n\t\tgameOverMenu.addUnselItem(screenWidth/2-165, 100, 50, 50, \"GAME OVER\",1,0,0);\n\t\tgameOverMenu.addUnselItem(timeTextGO);\n\t\tgameOverMenu.addUnselItem(scoreTextGO);\n\t\tgameOverMenu.addUnselItem(waveTextGO);\n\t\tgameOverMenu.addSelItem(new Scenes.SelectableText(screenWidth/2-165, screenHeight/2+50, 30, 30, \"New Game\", 1, 0, 0, 1, 1, 1), iLauncher);\n\t\tgameOverMenu.addSelItem(new Scenes.SelectableText(screenWidth/2-165, screenHeight/2+100, 30, 30, \"Return to Main Menu\", 1, 0, 0, 1, 1, 1), mainMenu);\n\t\tgameOverMenu.addSelItem(new Scenes.SelectableText(screenWidth/2-165, screenHeight/2+150, 30, 30, \"Exit\", 1, 0, 0, 1, 1, 1), null);\n\t\t\n\t\tgame.setScene(mainMenu);\n\t\tgame.gameLoop();\n\t}",
"public static void main(String args[]) \n {\n\n \n \n \tNewFrame.introDialog();\n EvolutionGame game = new EvolutionGame();\n \n \n while(true)\n\n {\n Area nextArea = ioUtils.enterCommand(character);\n\n if(!character.fighting)\n {\n if(nextArea != character.currentArea)\n\n {\n\n character.moveToArea(nextArea);\n NewFrame.setAreaDescription();\n NewFrame.addCharacters();\n\n }\n }\n else\n {\n\n }\n \n\n }\n\n }",
"public static void main(String[] args) {\n\t\tnew GameBoard();\n\t}",
"public void startGame() {\r\n this.setupGame();\r\n }",
"public static void main(String[] args)\n\t{\n\t\t// welcome message (call)\n\t\twelcome();\n\t\t\n\t\t// game call\n\t\tgame();\n\t\n\t}",
"public static void main(String[] args){\n\t\tTicTacToe gameSystem = new TicTacToe();\n\t\tgameSystem.run();\t\t\n\t}",
"public static void main(String[] args){\n\t\tChessGame G = new ChessGame(PrinterFactory.getPrinter(PrinterType.SWING));\n\t\tG.start();\n\t}",
"public static void main(String[] args)\n {\n Game game = new Game(8);\n \n Turn turn = game.nextTurn();\n printStatus(turn);\n \n turn = game.nextTurn();\n printStatus(turn);\n }",
"public static void main(String[] args) {\n\t\tGame game = new Football();\n\t\tgame.play();\n\n\t\tgame = new Cricket();\n\t\tgame.play();\n\t}",
"public static void main(String[] arguments){\r\n TicTac frame = new TicTac(); //runs the screen layout class.\r\n }",
"public static void main(String[] args) {\r\n\t\tnew GameFullVersion();\r\n\t\t\r\n\t\t//initialize game board\r\n\t\tboard.addRandom();\r\n\t\tboard.addRandom();\r\n\t\t\r\n\t\t//show instructions\r\n\t\tJOptionPane.showMessageDialog(null, \"Use the arrow keys to move the \"\r\n\t\t\t\t+ \"tiles.\", \"Directions:\", JOptionPane.INFORMATION_MESSAGE);\r\n\t\t\r\n\t\t//game loop\r\n\t\twhile (!winCheck(board)) {\r\n\t\t\tif (board.getFreeList().isEmpty() && canMerge(board).isEmpty()) {\r\n\t\t\t\tint answer = JOptionPane.showConfirmDialog(null, \"GAME OVER!!! \"\r\n\t\t\t\t\t\t+ \"\\nWould you like to restart?\", \"Sorry.\", \r\n\t\t\t\t\t\tJOptionPane.YES_NO_OPTION);\r\n\t\t\t\tif (answer == JOptionPane.YES_OPTION) {\r\n\t\t\t\t\tboard = new GameBoard();\r\n\t\t\t\t\tboard.addRandom();\r\n\t\t\t\t\tboard.addRandom();\r\n\t\t\t\t}\r\n\t\t\t\telse break;\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.exit(0);\r\n\t}",
"public static void main(String[] args) {\r\n\t\tPApplet.main(\"ruizhizi_xue_oscar_assignment6.edu.nyu.cs.yx2021.rx513.PlayGame\");\r\n\t}",
"public static void main(String[] args) {\n HighScoresTable highScoresTable = null;\n // trying to read the high score file\n try {\n highScoresTable = HighScoresTable.loadFromFile((new File(\"highScores.txt\")));\n } catch (IOException e) {\n e.printStackTrace();\n } // if the table is empty\n if (highScoresTable.getHighScores().isEmpty()) {\n highScoresTable = new HighScoresTable(5);\n }\n final HighScoresTable scoresTable = highScoresTable;\n GUI gui = new GUI(\"arknoid\", 800, 600);\n // creating a runner\n final AnimationRunner runner = new AnimationRunner(gui);\n final KeyboardSensor keyborad = runner.getGui().getKeyboardSensor();\n // creating a menu\n Menu<Task<Void>> mainMenu = new MenuAnimation<Task<Void>>(\"chicken invaders\", keyborad);\n mainMenu.addSelection(\"s\", \"Start game\", new Task<Void>() {\n // run the levels\n public Void run() {\n // creating a level information object to run over finally\n LevelInformation spaceInvader = new SpaceInvadersLevel();\n GameFlow flow = new GameFlow(800, 600, scoresTable, gui, keyborad);\n flow.runLevels(spaceInvader);\n return null;\n }\n }); // the option for watching the high score table\n mainMenu.addSelection(\"h\", \"High Scores\", new Task<Void>() {\n // show the highScoreAnimation with the scores table\n public Void run() {\n runner.run(new KeyPressStoppableAnimation(keyborad, KeyboardSensor.SPACE_KEY,\n new HighScoresAnimation(scoresTable)));\n return null;\n }\n }); // the option of quiting\n mainMenu.addSelection(\"q\", \"Exit\", new Task<Void>() {\n // q to quit game\n public Void run() {\n System.exit(0);\n return null;\n }\n });\n while (true) {\n // run the main menu\n runner.run(mainMenu);\n Task<Void> task = mainMenu.getStatus();\n // as long the task is not null - run it.\n if (task != null) {\n task.run();\n mainMenu.setStop(false);\n }\n }\n\n }",
"public static void main( String args[] ) {\r\n\t\tGameContainer gc = \r\n\t\tnew GameContainer(DEFAULT_GAME_SIZE,DEFAULT_GAME_SIZE);\r\n\t}",
"public static void main(String[] args) {\n boolean stillPlaying = true;\r\n // the boolean above passes through the while function, which will start \r\n // the method newGame()\r\n while(stillPlaying==true){\r\n // the stillPlaying may no longer still be equal to the newGame, as the \r\n // newGame may return a boolean stating false. That will close the loop, \r\n // stop the game, and print the results.\r\n stillPlaying = newGame(attempts);\r\n }\r\n }",
"public void start() {\n ArrayList<String> names = new ArrayList<>();\n game.initialize(names);\n //game.play(this.mainPkmn, this.attack);\n\n }",
"public static void main(String[] args) {\n BasicConfigurator.configure();\n // note: running mode starts as a result of finishing building mode\n BuildingWindow buildingWindow = new BuildingWindow(\"Game Build\");\n buildingWindow.start();\n }",
"public static void main(String[] args) {\n SwingUtilities.invokeLater(new Runnable() {\n @Override\n public void run() {\n new Window(new Game()).setVisible(true);\n }\n });\n }",
"public static void main (String []args) {\n\t\t// Seed is to ensure we get the same initial cards every time.\n\t\tGameWindow gw = Main.generateWindow(new Deuces(), Deck.OrderByRank);\n\t\tgw.setVisible(true);\n\t}",
"public static void main(String[] args) {\r\n\t\r\n\t\tUno game = new Uno();\r\n\t\t\r\n\t\tgame.game();\r\n\t\t\r\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void run() {\n\t\t\t\tGameGrafic game = null;\r\n\t\t\t\tGameState state = new GameState();\r\n\t\t\t\t// if (opt == 2) {\r\n\t\t\t\t// game = SaveGameOptions.load();\r\n\t\t\t\t// } else {\r\n\t\t\t\tgame = new GameGrafic(state);\r\n\t\t\t\t// }\r\n\r\n\t\t\t\tif (game != null) {\r\n\t\t\t\t\tgame.start();\r\n\t\t\t\t}\r\n\r\n\t\t\t}",
"public static void main(String[] args) {\n\t\tBlackjackGame game = new BlackjackGame(\"Blackjack\", \"Welcome to my BlackJack Game!\");\n\t\tgame.playRound();\n\t}",
"public static void main(String[] args) {\n\t\tUtil.debug = true;\n\t\tTitleScreen screen = new TitleScreen(WIDTH, HEIGHT);\n\n\t\twhile (!screen.getMadeGame())\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tThread.sleep(100);\n\t\t\t}\n\t\t\tcatch (InterruptedException e)\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\tscreen.stopMusic();\n\t\tscreen.dispose();\n\t\tGameBoard g = new GameBoard(WIDTH, HEIGHT);\n\t\tg.gameLoop();\n\t}",
"public static void main(String[] args) throws IOException, InterruptedException {\n GameFrame gameFrame = new GameFrame();\n gameFrame.run();\n System.exit(0);\n }",
"void startGame();",
"void startGame();",
"void startGame();",
"public static void main(String[] args) {\n\t\tJFrame frame=new JFrame();\n\t\tStart start=new Start();\n\t\tframe.add(start);\n\t\tframe.setSize(WIDTH, HEIGHT);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.setLocationRelativeTo(null);\n\t\tframe.addKeyListener(start.kl);\n\t\tframe.setVisible(true);\n\t\tstart.mos.add(start.sky);\n\t\tstart.mos.add(start.hero);\n\t\tstart.action();\n\n\t}",
"public static void main(String[] args) {\n // Interact\n System.out.println(\"Welcome to my terrain checker:\");\n loadPgm(); actionPrompt();\n System.out.println(\"Bye.\");\n }",
"public static void main(String[] args) {\n\t\t LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();\n\t config.title = \"Snake\";\n\t config.width = 800;\n\t config.height = 480;\n\t new LwjglApplication(new SnakeEngineAdapter(), config);\n\t}",
"public static void main(String[] args) {\n \t\tJFrame gameFrame = new JFrame();\n \n \t\t// Setup window properties for frame\n \t\t// i.e can't resize, close on exit, and title\n \t\tgameFrame.setResizable(false);\n \t\tgameFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n \t\tgameFrame.setTitle(\"CodePath Snake Project\");\n \n \t\t// Setup game board with size, add SnakeGame panel\n \t\t// and set the window visible\n\t\tgameFrame.setSize(625, 645);\n \t\tgameFrame.setLocationRelativeTo(null);\n \t\tgameFrame.add(new SnakeGame());\n \t\tgameFrame.setVisible(true);\n \t}",
"public void startGame() {\n\t\tinitChips();\n\t\tassignAndStartInitialProjects();\n\t}",
"public static void main(String[] args) {\r\n\t\tSwingUtilities.invokeLater(new Runnable() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void run() {\r\n\t\t\t\twindow = new Window(750, 700);\r\n\t\t\t\tgame = new Game(window);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t}",
"public static void main(String[] args) {\n SwingUtilities.invokeLater(new Game());\n }",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\tGameLauncher gameLauncher = new GameLauncher();\n\t\t\t}",
"public static void main(String[] args) {\n\n Scanner scanner = new Scanner(System.in);\n\n final String gameType = scanner.nextLine();\n final int playerCount = scanner.nextInt();\n\n log.info(\"[{}] was selected.\", gameType);\n log.info(\"Player count is [{}].\", playerCount);\n\n final Game game = GameFactory.build(gameType, playerCount);\n\n game.populate();\n game.shuffle();\n game.deal();\n game.start();\n\n scanner.close();\n }",
"public static void main(String[] args){\n\n GameClientImpl client = new GameClientImpl();\n client.startConnection(\"127.0.0.1\", ProtocolConfiguration.PORT);\n\n }",
"public static void main(String[] args) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tplay();\r\n\t\t\r\n\t}",
"public static void main(String args[])\n {\n\t\t\tMouseController mC = new MouseController(Canvas.getInstance(),new starter());\n\t\t\t\n\t\t\t// please leave following line alone, necessary for keyboard input\n\t\t\tKeyController kC = new KeyController(Canvas.getInstance(),new starter());\n\t\t\t\n\t\t\t joe = new happyFace(520,321);\n\t\t\tjoe.fill();\n\t\t\tCar j = new Car(220,281,\"pop\");\n\t\t\tj.setStep(2);\n\t\t\tj.fill();\n\t\t\twhile(true)\n\t\t\t{\n\t\t\t\tj.translate(j.getStep(),0);\n\t\t\t\tj.drive();\n\t\t\t\tCanvas.pause(10);\n\t\t\t\tif (joe.crash(j))\n\t\t\t\t{\n\t\t\t\t\tj.setStep(0);\n\t\t\t\t\tSystem.out.println(\" CRASH!! \");\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\" GG \");\n\t\t\t}\n\t\t\t\n\t\t}",
"public static void main(String[] args) {\r\n\r\n\t\t// Much taken from the application launcher provided by WindowBuilder in\r\n\t\t// Eclipse.\r\n\t\tEventQueue.invokeLater(new Runnable() {\r\n\t\t\t@Override\r\n\t\t\tpublic void run() {\r\n\t\t\t\ttry {\r\n\t\t\t\t\t// Create a setup window and set the action for pressing the\r\n\t\t\t\t\t// start game button.\r\n\t\t\t\t\tsetup = new SetupGUI();\r\n\t\t\t\t\tsetup.addStartGameActionListener(new ActionListener() {\r\n\t\t\t\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\r\n\t\t\t\t\t\t\tsetup.setVisible(false);\r\n\r\n\t\t\t\t\t\t\t// If the view is never disposed, it can not be\r\n\t\t\t\t\t\t\t// garbage collected\r\n\t\t\t\t\t\t\tif (view != null)\r\n\t\t\t\t\t\t\t\tview.dispose();\r\n\r\n\t\t\t\t\t\t\t// Create the underlying game model with the values\r\n\t\t\t\t\t\t\t// set in the setup window\r\n\t\t\t\t\t\t\tmodel = new GreedGameModel(setup.getBustLimit(),\r\n\t\t\t\t\t\t\t\t\tsetup.getPointsToWin());\r\n\r\n\t\t\t\t\t\t\t// Create a new view and set it to observe the game\r\n\t\t\t\t\t\t\t// model\r\n\t\t\t\t\t\t\tview = new GreedGameGUI(model);\r\n\r\n\t\t\t\t\t\t\t// Set an action for when the window is closing,\r\n\t\t\t\t\t\t\t// either manually or because the model has ended\r\n\t\t\t\t\t\t\tview.addWindowListener(new WindowAdapter() {\r\n\t\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\t\tpublic void windowClosing(WindowEvent arg0) {\r\n\r\n\t\t\t\t\t\t\t\t\t// Get the winning player, if any\r\n\t\t\t\t\t\t\t\t\tPlayer winningPlayer = model\r\n\t\t\t\t\t\t\t\t\t\t\t.getWinningPlayer();\r\n\r\n\t\t\t\t\t\t\t\t\t// If a winning player was found, present\r\n\t\t\t\t\t\t\t\t\t// the players result to the user with a\r\n\t\t\t\t\t\t\t\t\t// message box\r\n\t\t\t\t\t\t\t\t\tif (winningPlayer != null)\r\n\t\t\t\t\t\t\t\t\t\tJOptionPane.showMessageDialog(\r\n\t\t\t\t\t\t\t\t\t\t\t\tnull,\r\n\t\t\t\t\t\t\t\t\t\t\t\twinningPlayer.getName()\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ \" won the game with \"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ winningPlayer\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getScore()\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ \" points.\");\r\n\r\n\t\t\t\t\t\t\t\t\t// Change visible window to setup\r\n\t\t\t\t\t\t\t\t\tsetup.setVisible(true);\r\n\t\t\t\t\t\t\t\t\tview.setVisible(false);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\t// Create a new controller object, which creates all\r\n\t\t\t\t\t\t\t// necessary bindings between the GUI's action\r\n\t\t\t\t\t\t\t// listeners and the model's functions\r\n\t\t\t\t\t\t\tcontroller = new GreedGameController(model, view);\r\n\r\n\t\t\t\t\t\t\t// Display the view\r\n\t\t\t\t\t\t\tview.setVisible(true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Once setup is setup, display the window\r\n\t\t\t\t\tsetup.setVisible(true);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t}",
"public static void main(String args[]) {\n StandaloneGameOfLife gameOfLife = new StandaloneGameOfLife();\n gameOfLife.args = args;\n new AppletFrame( \"Game of Life\", gameOfLife );\n }",
"public static void main (String[] arg) {\n\t\tLwjglApplicationConfiguration config = new LwjglApplicationConfiguration();\n\t\t//set game window title, width and height\n\t\tconfig.title=\"Chess Dynasties\";\n\t\tconfig.width=1100;\n\t\tconfig.height=618;\n\t\tconfig.resizable=true;\n\n\t\t//create window\n\t\tnew LwjglApplication(new CEOV2(), config);\n\n\n\t}",
"public static void main(String[] args) { \r\n Connect4TextConsole board = new Connect4TextConsole();\r\n board.newGame();\r\n }"
] | [
"0.82763016",
"0.810269",
"0.8100126",
"0.8038911",
"0.79624283",
"0.79453444",
"0.7876481",
"0.7847224",
"0.78344727",
"0.7832188",
"0.7811518",
"0.77895594",
"0.7776925",
"0.7714857",
"0.77115464",
"0.7699207",
"0.7662241",
"0.7659976",
"0.7657963",
"0.76570976",
"0.7652119",
"0.7651189",
"0.76442724",
"0.7634472",
"0.7627299",
"0.7624741",
"0.76124924",
"0.76121235",
"0.7587894",
"0.75649136",
"0.755142",
"0.75408524",
"0.75333977",
"0.750861",
"0.74936277",
"0.74791884",
"0.7453044",
"0.7432296",
"0.7430628",
"0.7420838",
"0.74123037",
"0.7412071",
"0.7412015",
"0.7403574",
"0.73548275",
"0.7353086",
"0.73437506",
"0.7340378",
"0.7336127",
"0.73262525",
"0.7323612",
"0.73215103",
"0.72906154",
"0.7286378",
"0.72854984",
"0.72800684",
"0.72777706",
"0.72643995",
"0.72561586",
"0.72199297",
"0.72191477",
"0.7218419",
"0.72010654",
"0.7190123",
"0.71884596",
"0.7179353",
"0.7159148",
"0.71507955",
"0.7139154",
"0.71304435",
"0.7128108",
"0.71267474",
"0.71246475",
"0.7116884",
"0.7116128",
"0.71100503",
"0.71037364",
"0.7097352",
"0.7093628",
"0.70879966",
"0.7072889",
"0.7067338",
"0.7047729",
"0.7047729",
"0.7047729",
"0.702944",
"0.70274717",
"0.70181745",
"0.7014306",
"0.7008152",
"0.70023227",
"0.69981116",
"0.69952655",
"0.6993882",
"0.69938076",
"0.69929075",
"0.6990042",
"0.6973654",
"0.696815",
"0.69497734",
"0.69489986"
] | 0.0 | -1 |
the start method for the app set up the stage | @Override
public void start(Stage primaryStage) {
root = new VBox(10);
root.setPadding(new Insets(30));
initLabel();
//set up scene
Scene scene = new Scene(root);
primaryStage.setScene(scene);
primaryStage.sizeToScene();
primaryStage.setTitle("Mastermind");
primaryStage.show();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void start() {\r\n\t\tsetupWWD();\r\n\t\tsetupStatusBar();\r\n\t\tsetupViewControllers();\r\n\t\tsetupSky();\r\n\t\t//setupAnnotationToggling();\r\n\r\n\t\t// Center the application on the screen.\r\n\t\tWWUtil.alignComponent(null, this, AVKey.CENTER);\r\n\t\t\r\n\t\tgetLayerEnableCmd().run(); // Enable/disable the desired layers.\r\n\t}",
"@Override\n public void start(Stage stage){\n // set the stage\n this.stage = stage;\n\n // set the scenes\n mainScene();\n inputScene();\n\n // set the stage attributes\n stage.setTitle(\"Maze solver\");\n stage.setWidth(VisualMaze.DISPLAY_WIDTH);\n stage.setHeight(VisualMaze.DISPLAY_HEIGHT + 200);\n stage.setScene(main);\n\n // display the app\n stage.show();\n }",
"public void start(Stage mainStage) {\r\n\t\t\r\n\t}",
"@Override\n public void start (Stage primaryStage) {\n Group root = new Group();\n Scene scene = new Scene(root, AppConstants.STAGE_WIDTH, AppConstants.STAGE_HEIGHT);\n ModulePopulator = new ModuleCreationHelper(root, scene, primaryStage);\n view = new View();\n scene.setFill(AppConstants.BACKGROUND_COLOR);\n // scene.getStylesheets().add(getClass().getResource(\"application.css\").toExternalForm());\n view.init(root, ModulePopulator);\n ModulePopulator.setView(view);\n ModulePopulator.createMainPageModules();\n view.initRunner(root, ModulePopulator);\n primaryStage.setTitle(\"SLogo!\");\n primaryStage.setScene(scene);\n primaryStage.show();\n\n System.out.println(\"App Has Started!\");\n }",
"public void start(Stage mainStage) {\n\t\t\n\t}",
"@Override\n\tpublic void start(Stage stage) throws Exception {\n\t\tinstance = this;\n\t\tmainStage = stage;\n\t\tHemsProps.init(hemsPropsPath);\n\t\t\n\t\t//decide if data upload mode or normal production\n\t\tif (!IS_DATA_UPLOAD_MODE) {\n\t\t\tstage.setScene(createScene(loadMainPane()));\n\t\t\tstage.setTitle(windowTitle);\n\t\t\tstage.show();\n\n\t\t} else {\n\t\t\tDataCreator();\n\t\t}\n\t}",
"public void start(Stage stage) {\r\n // Setting our primaryStage variable to the stage given to us by init()\r\n primaryStage = stage;\r\n // Retrieving the primary scene (the first thing we want the user to see)\r\n Scene primaryScene = getPrimaryScene();\r\n // Setting the title of the stage, basically what the window says on the top left\r\n primaryStage.setTitle(\"SeinfeldMemeCycler\");\r\n // Setting the scene\r\n primaryStage.setScene(primaryScene);\r\n // Displaying the stage\r\n primaryStage.show();\r\n }",
"@Override\n\tpublic void start(Stage arg0) throws Exception \n\t{\t\t\n\n\t}",
"@Override\n\tpublic void start(Stage stage) throws Exception {\n\t\tMain.stg = stage;\n\t\tParent root = FXMLLoader.load(getClass().getResource(\"/stylesheets/MainMenu.fxml\"));\n\t\tstage.setTitle(BowmanConstants.GAME_TITLE);\n\t\tstage.setScene(new Scene(root, BowmanConstants.MENU_WIDTH, BowmanConstants.MENU_HEIGHT));\n\t\tstage.show();\n\t\tinit_settings();\n\t}",
"public void start(Stage stage) {\n Layout layout = new Layout();\n Scene scene = new Scene(layout, 400, 400); \n stage.setScene(scene);\n layout.bindToScene(scene);\n new AppController(layout);\n stage.show();\n showInstructions();\n }",
"@Override\n public void start(Stage stage) throws Exception \n {\n \n FXMLLoader appMainLoader = new FXMLLoader(getClass().getResource(Resources.app_main));\n\n Parent root = (Parent)appMainLoader.load();\n root.prefHeight(600);\n root.prefWidth(1100);\n\n AppMainController appMainController = appMainLoader.getController();\n appMainController.setAppLauncher(this);\n\n// stage.initStyle(StageStyle.UNDECORATED);\n stage.setResizable(false);\n stage.setMaxHeight(600);\n stage.setMaxWidth(1000);\n\n Scene scene = new Scene(root, Color.TRANSPARENT);\n scene.getStylesheets().add(Resources.app_css);\n \n stage.setTitle(\"Hims-Lab Equipment Interface\");\n stage.setScene(scene);\n stage.show();\n //init();\n }",
"private void setup() {\n this.primaryStage.setTitle(Constants.APP_NAME);\n\n this.root = new VBox();\n root.setAlignment(Pos.TOP_CENTER);\n root.getChildren().addAll(getMenuBar());\n\n Scene scene = new Scene(root);\n this.primaryStage.setScene(scene);\n\n // set the default game level.\n setGameLevel(GameLevel.BEGINNER);\n\n // fix the size of the game window.\n this.primaryStage.setResizable(false);\n this.primaryStage.show();\n }",
"@Override\r\n\tpublic void start(Stage primaryStage) {\r\n\t\tthis.primaryStage=primaryStage;\r\n\t\tthis.primaryStage.setTitle(\"AmwayWinston\");\r\n\t\t\r\n\t\tinitRootLayout();\r\n\t\t\r\n\t\tshowPersonOverview();\r\n\t\t\r\n\t}",
"void start(Stage primaryStage);",
"@Override\n\tpublic void start( Stage stage ) throws Exception {\n\t\tpstage= stage;\n\t\tif( _SysConfig.maxWindowOnStart() ){\n\t\t\tstage.setMaximized( true );\n\t\t}else{\n\t\t\tstage.setWidth( currentBoard.getDim().getX() );\n\t\t\tstage.setHeight( currentBoard.getDim().getY() );\n\t\t}\n\t\t//\n\t\tstage.setScene( currentBoard.refreshRoot() );\n\t\tswitchWallPaperMode();\n\t\tstage.show();\n\t\tcurrentBoard.setWindowSizeChange();\n\t\t//\n\t\tstage.getIcons().add( new Image( \"file:\" + _SysConfig.getSysFolderName() +\n\t\t\t\tFile.separatorChar + \"icon.png\" ) );\n\t\tstage.setOnCloseRequest( new EventHandler <WindowEvent>() {\n\t\t\tpublic void handle( WindowEvent we ) {\n\t\t\t\tp.p( \"System closing\" );\n\t\t\t\tcloseApp();\n\t\t\t\tSystem.exit( 0 );\n\t\t\t}\n\t\t} );\n\t\t//\n\t\tstage.widthProperty().addListener( ( obs, oldVal, newVal ) -> {\n\t\t\tcurrentBoard.setWindowSizeChange();\n\t\t} );\n\t\tstage.heightProperty().addListener( ( obs, oldVal, newVal ) -> {\n\t\t\tcurrentBoard.setWindowSizeChange();\n\t\t} );\n\t\tstage.xProperty().addListener( ( obs, oldVal, newVal ) -> {\n\t\t\tif( wallpaperMode )\n\t\t\t\tstage.setX( 0.0 );\n\t\t} );\n\t\tstage.yProperty().addListener( ( obs, oldVal, newVal ) -> {\n\t\t\tif( wallpaperMode )\n\t\t\t\tstage.setY( 0.0 );\n\t\t} );\n\t\tstage.setFullScreenExitHint( \"\" );\n\t}",
"@Override\n public void start(Stage primaryStage) {\n try {\n stage = primaryStage;\n stage.setTitle(\"Indie Airways\");\n stage.setMinWidth(WINDOW_WIDTH);\n stage.setMinHeight(WINDOW_HEIGHT);\n gotoLogin();\n //gotoMenu();\n primaryStage.show(); \n } catch (Exception ex) {\n Logger.getLogger(IndieAirwaysClient.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n }",
"public void startApp()\r\n\t{\n\t}",
"@Override\r\n public void start(Stage primaryStage) {\n }",
"@Override\r\n\tpublic void start(Stage primaryStage) throws Exception {\n\t\tthis.stage = primaryStage;\r\n\t\tprimaryStage.setResizable(false);\r\n\t\tthis.stage.setTitle(\"Forza 4\");\r\n\t\t\r\n\t\tstartWindow();\r\n\t\thomeStage();\r\n\t\t\r\n\t}",
"@Override\n public void start(Stage primaryStage) throws IOException {\n Main.primaryStage = primaryStage;\n Main.primaryStage.setTitle(\"American Travel Bucketlist\");\n\n //Call the extension of the FXMLLoader for the MainView.\n showMainView();\n }",
"@Override\n public void start(Stage primaryStage) {\n this.mainStage = primaryStage;\n mainStage.setTitle(\"Art Sorter\");\n changeScreen( new MainScreen() );\n }",
"private void startStageOne() {\n\t\tCollections.addAll(this.starterDigits, 1, 28, 22, 48, 44, 60, 58, 64,\n\t\t\t\t52, 55, 34, 39, 8, 15);\n\t\tCollections.addAll(this.starterButtons, button00, button01, button07,\n\t\t\t\tbutton12, button16, button23, button25, button34, button52,\n\t\t\t\tbutton55, button61, button66, button70, button77);\n\t\tthis.initializeStarterButtons();\n\t}",
"@Override\n public void start( Stage primaryStage ) throws Exception {\n primaryStage.setTitle(\"Battleship\");\n primaryStage.setScene(createScene());\n primaryStage.show();\n }",
"@Override\n public void start(Stage primaryStage) {\n primaryStage.setTitle(\"Inventory Home\");\n Image img = new Image(\"file:resources/img/logo.png\");\n primaryStage.getIcons().add(img);\n //log.info(\"before initLoginProcess() method\");\n \tfinal Task<Boolean> startRestTask = new Task<Boolean>() {\n\t\t\t@Override\n\t\t\tprotected Boolean call() throws Exception {\n\t\t\t\tupdateMessage(\"Application is starting the services . . . \");\n\t\t\t\tstartRestAPI(arguments);\n\t\t\t\tupdateMessage(\"All services started successfully . . . \");\n\t\t\t\treturn true;\n\t\t\t}\n\t\t};\n\t\tshowSplash(\n primaryStage,\n startRestTask,\n () -> initLoginProcess()\n );\n new Thread(startRestTask).start(); \n }",
"public void startup() {\n\t\tstart();\n }",
"@Override // Override the start method in the Application class\r\n /**\r\n * Start method for layout building\r\n */\r\n public void start(Stage primaryStage)\r\n {\n Scene scene = new Scene(pane, 370, 200);\r\n primaryStage.setTitle(\"Sales Conversion\"); // Set the stage title\r\n primaryStage.setScene(scene); // Place the scene in the stage\r\n primaryStage.show(); // Display the stage\r\n }",
"public void start(Stage myStage) { \n \n System.out.println(\"Inside the start() method.\"); \n \n // Give the stage a title. \n myStage.setTitle(\"JavaFX Skeleton.\"); \n \n // Create a root node. In this case, a flow layout \n // is used, but several alternatives exist. \n FlowPane rootNode = new FlowPane(); \n \n // Create a scene. \n Scene myScene = new Scene(rootNode, 300, 200); \n \n // Set the scene on the stage. \n myStage.setScene(myScene); \n \n // Show the stage and its scene. \n myStage.show(); \n }",
"@Override\r\n\tpublic void start(Stage s) throws Exception {\n\t\tc=new Container();\r\n\t\tthis.st=s;\r\n\t\tc.setFs(new FirstScreen(st,c));\r\n\t\tthis.sc=new Scene(c.getFs(), 800,600);\r\n\t\tst.setScene(sc);\r\n\t\tst.setTitle(\"Main Window\");\r\n\t\tst.show();\r\n\t}",
"public void start(Stage primaryStage) {\n this.primaryStage = primaryStage;\n\n setup();\n }",
"@Override\n public void start (Stage stage) throws IOException {\n init.start(stage);\n myScene = view.makeScene(50,50);\n stage.setScene(myScene);\n stage.show();\n }",
"@Override\n public void start(Stage stage) throws IOException {\n logInfo();\n\n scene = new Scene(loadFXML(\"mainView\"));\n stage.setScene(scene);\n stage.setTitle(\"OzoMorph\");\n stage.show();\n }",
"public void start(Stage stage){\n //set the class fields for the stage and app controller\n this.stage = stage;\n this.appController = AppController.getInstance();\n appController.setStage(stage);\n //load FXML\n //each screen requires the following\n //a \"Parent screenNameRoot\" object to hold the controller for each screen\n //a \"ScreenName screenName\" object of the ScreenName class for each screen that exists\n //a \"FXMLLoader screenNameLoader = new FXMLLoader(this.getClass().getResource(\"fxml/fxmlFileName.fxml\"));\" object to load the controller from FXML\n //an entry in the try/catch block that does the following (should catch IOException)\n //sets the screenNameRoot object to screenNameLoader.load()\n //sets the screenName object to screenNameLoader.getController()\n Parent whoAmIScreenRoot = null;\n FXMLLoader whoAmIScreenLoader = new FXMLLoader(this.getClass().getResource(\"fxml/whoAreYouScene.fxml\"));\n WhoAmIScreen whoAmIScreen = null;\n\n try{ \n whoAmIScreenRoot = whoAmIScreenLoader.load();\n whoAmIScreen = whoAmIScreenLoader.getController();\n }\n catch(IOException e){\n System.out.println(e.getMessage());\n System.out.println(\"Failed to load FXML\");\n System.exit(1);\n }\n\n //set the title for the window (not super important since this application would be embedded in a web page where this wouldn't be visible, but done anyway for posterity)\n stage.setTitle(\"Potluck Main Menu\");\n\n //create scenes for each screen\n Scene whoAmIScreenScene = new Scene(whoAmIScreenRoot);\n\n\n //give AppController references to scenes and objects\n appController.setWhoAmIScreen(whoAmIScreen);\n appController.setWhoAmIScreenScene(whoAmIScreenScene);\n\n //set stage's current scene to the WhoAmIScreenScene cause that's the default\n stage.setScene(whoAmIScreenScene);\n\n //must be final call in the function, tells JavaFX to start the app\n stage.show();\n }",
"public void start(Stage mainStage) throws IOException { \r\n\r\n\t}",
"@Override\n public void start(Stage stage) throws Exception {//method inside Application abstract class\n displayClock(stage);\n }",
"private void start() {\r\n\t\t// Clear the log file.\r\n\t\tBPCC_Logger.clearLogFile();\r\n\t\t\r\n\t\t// Initialize BPCC_Util static fields.\r\n\t\tBPCC_Util.initStaticFields();\r\n\t\t\r\n\t\t// Set logging level desired for test.\r\n\t\tBPCC_Util.setLogLevel(LogLevelEnum.DEBUG);\r\n\t\t\r\n\t\t// Initialize class global variables.\r\n\t\tinitVars();\r\n\t\t\r\n\t\tcreateAndShowGUI();\r\n\t}",
"@Override\r\n public void start(Stage primaryStage) throws IOException {\r\n this.primaryStage = primaryStage;\r\n this.primaryStage.setTitle(\"HidatoTheGame\");\r\n initializeLayout(primaryStage);\r\n swapLoginFX();\r\n }",
"protected void start() {\n }",
"@Override\r\n public void start(Stage primaryStage) throws Exception {\n Parent root = FXMLLoader.load(getClass().getResource(\"ui/main.fxml\")); //FXMLLoader.load(Utilities.getResourceURL(\"ui/main.fxml\"));\r\n primaryStage.setTitle(\"Custom Groovy Game Engine\");\r\n primaryStage.setScene(new Scene(root, 960, 480));\r\n primaryStage.show();\r\n }",
"@Override\n public void start(Stage stage) throws Exception {\n LaunchOptions options = new LaunchOptions(false);\n if (options.skipLauncher) {\n log.warn(\"Launcher was skipped\");\n launchGame(options);\n } else {\n stage.setScene(new Launcher(stage, options));\n stage.centerOnScreen();\n stage.show();\n }\n }",
"public void startUp() {\n\t\t/* Language of App */\n\t\t\n\t\t/* Init Icons */\n\t\tPaintShop.initIcons(display);\n\t\t/* Init all components */\n\t\tinitComponents();\n\t\t\n\t\t\n\t}",
"public void start (Stage primaryStage) throws Exception{\r\n\t\t\r\n\t\tfrogScenemanager scenemanager = new frogScenemanager(primaryStage);\r\n\t\tscenemanager.startMainMenu();\r\n\t}",
"public void start() {\n }",
"private void setStage() {\n\t\tstage = new Stage();\n\t\tstage.setScene(myScene);\n\t\tstage.setTitle(title);\n\t\tstage.show();\n\t\tstage.setResizable(false);\n//\t\tstage.setOnCloseRequest(e -> {\n//\t\t\te.consume();\n//\t\t});\n\t}",
"@Override\n public void start(Stage stage) throws Exception \n {\n Database.connectDatabase();\n // accessing the FXML File from project directory\n Parent root = FXMLLoader.load(getClass().getResource(\"StartPage.fxml\"));\n // Creating a new Secene with the pointer\n Scene scene = new Scene(root);\n //Setting the scene as default\n stage.setScene(scene);\n // Setting the title of the window\n stage.setTitle(\"Online Judge\");\n // The Window can not be resized like make it small or big\n // This will break the design\n stage.setResizable(false);\n stage.show();\n // keeping the previous page tracked so the it can be disabled \n // when movved to the next page\n Indicator.setCurrentPage(stage);\n \n \n }",
"public void start()\n {\n }",
"@Override\r\n\tpublic void start(Stage primaryStage) throws Exception {\n\t\t\r\n\t}",
"@Override\n public void start(Stage stage) throws IOException {\n try {\n FXMLLoader fxmlLoader = new FXMLLoader(MainScreen.class.getResource(\"MainScreen.fxml\"));\n\n\n Parent root = fxmlLoader.load();\n MainScreen mainScreen = fxmlLoader.getController();\n Scene scene = new Scene(root);\n\n stage.setTitle(\"Inventory Management System\");\n stage.setScene(scene);\n stage.show();\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n }",
"private void initStage() {\n stage = new Stage();\n stage.setTitle(\"Attentions\");\n stage.setScene(new Scene(root));\n stage.sizeToScene();\n }",
"@Override\n public void start(Stage theStage) throws IOException {\n IntCodeGame game = new IntCodeGame(theStage);\n }",
"@Override\n\tpublic void start(BundleContext context) throws Exception {\n\t\t// TODO Auto-generated method stub\n////\t\tsuper.start(context);\n//\t\tServiceReference serviceReference = context.getServiceReference(Application.class.getName());\n//\t\tservice = (Application) context.getService(serviceReference);\n//\t\tSystem.out.println(\"Activator.init() \" + service);\n////\t\tApplication.launch(null);\n//\t\ttry {\n//\t\t\t\n//\t\t\tnew JFXPanel();\n//\t\t\t\n//\t\t\tPlatform.runLater(new Runnable() {\n//\t\t\t\t\n//\t\t\t\t@Override\n//\t\t\t\tpublic void run() {\n//\t\t\t\t\ttry {\n//\t\t\t\t\t\tservice.start(new Stage());\n//\t\t\t\t\t\tservice.launch(null);\n//\t\t\t\t\t\t\n//\t\t\t\t\t\tSystem.out.println(\"Activator.init() Service is launched and started\");\n//\t\t\t\t\t} catch (Exception e) {\n//\t\t\t\t\t\t// TODO Auto-generated catch block\n//\t\t\t\t\t\tSystem.err.println(\"\" + e);\n//\t\t\t\t\t}\n//\t\t\t\t\t\n//\t\t\t\t}\n//\t\t\t});\n//\t\t} catch (Exception e) {\n//\t\t\tSystem.err.println(e);\n//\t\t\tservice.start(new Stage());\n//\t\t}\n\t}",
"public void start() {}",
"public void start() {}",
"@Override\n\tpublic void start(Stage primaryStage) throws Exception {\n\t\t\n\t}",
"public void start() {\n\n }",
"private void start() {\n\n\t}",
"public void start()\n {\n uploadDataFromFile();\n menu.home();\n home();\n }",
"@Override\n\tpublic void start(Stage stage) throws Exception {\n\t\t\n\t\tsetUserAgentStylesheet(javafx.application.Application.STYLESHEET_MODENA);\n\n\t\t// esto muestra la ventana\n\t\tFXMLLoader loader = new FXMLLoader(getClass().getResource(\"/com/marmar/farmapp/view/Splash.fxml\"));\n\t\tstage.setTitle(\"HerdApp v1.6\");\n\t\tParent root = (Parent) loader.load();\n//\t\troot.getStylesheets().add(ResourceManager.metroCSS);\n\t\tstage.setScene(new Scene(root));\n\t\tSplashController controller = loader.<SplashController> getController();\n\t\tstage.show();\n\t\tcontroller.initData(stage);\n\t\t\n\t}",
"public void start() {\n\n\t}",
"@Override\n public final void start(final Stage primaryStage) {\n Scene scene = new Scene(getPane(), PANE_WIDTH, PANE_HEIGHT);\n primaryStage.setTitle(\"Tic-Tak-Toe\"); // Set the stage title.\n primaryStage.setScene(scene); // Place the scene in the stage.\n primaryStage.show(); // Display the stage.\n }",
"public void start(){\n }",
"@Override\r\n public void start(Stage stage) throws Exception \r\n {\r\n \r\n IData Data = new DataFacade();\r\n IBusiness Business = new BusinessFacade();\r\n IPresentation UI = PresentationFacade.getUI(); //new PresentationFacade();\r\n \r\n Business.injectData(Data);\r\n UI.injectBusiness(Business);\r\n UI.start();\r\n // Sagsbehandler: tota // abcabc\r\n // Admin: admin // 12345\r\n // Borger: borgar30 // 12345\r\n // Sekratær: ras // rass\r\n\r\n }",
"public void startup(){}",
"public void startApp() {\r\n\t\ttry {\r\n\t\t\tFXMLLoader loader;\r\n\t\t\t// load the FXML resource\r\n\t\t\tif (isRegister) {\r\n\t\t\t\tloader = changeScreen(\"/view/HomeRegister.fxml\", new BorderPane(), \"Register\");\r\n\t\t\t\tHomeRegisterController regiController = loader.getController();\r\n\t\t\t\tregiController.setMain(this);\r\n\t\t\t} else {\r\n\t\t\t\tloader = changeScreen(\"/view/HomeIdentification.fxml\", new BorderPane(), \"Identification\");\r\n\t\t\t\tHomeIdentificationController identiController = loader.getController();\r\n\t\t\t\tidentiController.setMain(this);\r\n\t\t\t}\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t}",
"@Override\n\tpublic void start(Stage primaryStage) throws Exception {\n\t\t\n\t\tSystem.out.println(\"The game begins now...\");\n\t\tBoardConfig boardConfig = new BoardConfig(new XY(25, 25));\n\n\t\tBoard board = new Board(boardConfig);\n\n\t\tState state = new State(board);\n\n\t\tFxUI fxUI = FxUI.createInstance(boardConfig.getSize());\n\n\t\tfinal Game game = new GameImpl(state);\n\n\t\tgame.setUi(fxUI);\n\n\t\tfxUI.setGameImpl((GameImpl) game);\n\n\t\tprimaryStage.setScene(fxUI);\n\t\tprimaryStage.setTitle(\"Welcome to the virtual world of Squirrels.\");\n\t\tprimaryStage.setAlwaysOnTop(true);\n\t\tfxUI.getWindow().setOnCloseRequest(new EventHandler<WindowEvent>() {\n\t\t\tpublic void handle(WindowEvent evt) {\n\t\t\t\tSystem.exit(-1);\n\t\t\t}\n\n\t\t});\n\t\tprimaryStage.show();\n\n\t\tstartGame(game);\n\t}",
"@Override\n public void start(Stage primaryStage) throws Exception {\n\n Button playBtn = new Button(\"Start!!\");\n playBtn.setMinSize(150, 35);\n\n playBtn.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent event) {\n Application configStage = new GameConfiguration(config);\n try {\n configStage.start(primaryStage);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n });\n\n Button helpBtn = new Button(\"Help!!\");\n helpBtn.setMinSize(110, 30);\n\n VBox panelButtons = new VBox(20);\n panelButtons.setAlignment(Pos.CENTER);\n panelButtons.getChildren().addAll(playBtn, helpBtn);\n\n String GAME_TITLE = \"Mates Rapidas Game\";\n Text title = new Text(GAME_TITLE);\n title.setFont(new Font(30));\n\n VBox panelMain = new VBox(10);\n panelMain.setAlignment(Pos.CENTER);\n panelMain.getChildren().addAll(title, panelButtons);\n\n StackPane canvas = new StackPane();\n canvas.setPadding(new Insets(30));\n canvas.getChildren().add(panelMain);\n\n Scene principal = new Scene(canvas, 400, 400);\n\n primaryStage.setTitle(GAME_TITLE);\n primaryStage.setScene(principal);\n primaryStage.setResizable(false);\n primaryStage.show();\n }",
"@Override\n\tpublic void start(Stage primaryStage) throws Exception {\n\t\ttry {\n\t\t\tStartFactory start = new StartFactory(primaryStage);\n\t\t\tstart.init();\n\t\t} catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"@Override\n public void start(Stage primaryStage) throws Exception {\n console(\"start...\");\n\n Parent root = FXMLLoader.load(getClass().getResource(\"AutoGraderApp.fxml\"));\n\n primaryStage.setTitle(appName);\n primaryStage.setScene(new Scene(root, MIN_STAGE_WIDTH, MIN_STAGE_HEIGHT));\n primaryStage.setMinWidth(MIN_STAGE_WIDTH);\n primaryStage.setMinHeight(MIN_STAGE_HEIGHT);\n\n primaryStage.show();\n }",
"private void setupStage(Scene scene) {\n SystemTray.create(primaryStage, shutDownHandler);\n\n primaryStage.setOnCloseRequest(event -> {\n event.consume();\n stop();\n });\n\n\n // configure the primary stage\n primaryStage.setTitle(bisqEnvironment.getRequiredProperty(AppOptionKeys.APP_NAME_KEY));\n primaryStage.setScene(scene);\n primaryStage.setMinWidth(1020);\n primaryStage.setMinHeight(620);\n\n // on windows the title icon is also used as task bar icon in a larger size\n // on Linux no title icon is supported but also a large task bar icon is derived from that title icon\n String iconPath;\n if (Utilities.isOSX())\n iconPath = ImageUtil.isRetina() ? \"/images/[email protected]\" : \"/images/window_icon.png\";\n else if (Utilities.isWindows())\n iconPath = \"/images/task_bar_icon_windows.png\";\n else\n iconPath = \"/images/task_bar_icon_linux.png\";\n\n primaryStage.getIcons().add(new Image(getClass().getResourceAsStream(iconPath)));\n\n // make the UI visible\n primaryStage.show();\n }",
"public void startApplication() {\n\t\tgameView = new GameGUI(this);\n\t\t\n\t\t/*\n\t\t * Create bonus GUI now.\n\t\t * TODO: Use swing worker thread to create bonus GUI\n\t\t * \t\t that way if GUI had more bells and whistles to it\n\t\t * \t\t the bonus GUI creation wouldn't take up processing time\n\t\t * \t\t on the main thread.\n\t\t */\n\t\tcreateBonusGUI();\n\t\t\n\t\t//GUI created and ready to show to the user\n\t\tgameView.allowVisibility();\n\t\tGameSounds.startBackgroundMusic();\n\t}",
"@Override \n public void start(Stage stage) throws Exception {\n \tBeanContext.getStage(\"a\").show();\n }",
"public void start() {\n BorderPane borderPane = new BorderPane();\n VBox centerPane = new VBox();\n\n borderPane.setTop(lobbyMenu());\n\n String TITLE = \"Connect 4\";\n Text title = new Text(TITLE);\n title.setFont(Font.font(\"Arial\", FontWeight.BOLD, 30));\n centerPane.getChildren().add(title);\n centerPane.getChildren().add(lobbyButtons());\n centerPane.setAlignment(Pos.CENTER);\n\n borderPane.setCenter(centerPane);\n\n Scene scene = new Scene(borderPane, 520, 360);\n\n stage.setTitle(TITLE);\n stage.setScene(scene);\n }",
"@Override\r\n public void start(Stage primaryStage) {\r\n System.loadLibrary(Core.NATIVE_LIBRARY_NAME);\r\n btnCam = new Button(\"Start camera\");\r\n btnManAut = new Button(\"Manual\");\r\n manualMode = true;\r\n camRunning = false;\r\n this.primaryStage = primaryStage;\r\n root = new BorderPane();\r\n\r\n loadImage();\r\n createScene();\r\n handleUI();\r\n updateGUIStatus();\r\n }",
"public void start() {\n\t\t\n\t}",
"public void start() {\n\t\t\n\t}",
"public void start(Stage stage) {\n game = new Game();\n\n Scene gameScene = new Scene(game.getVisual().getRoot(), MainGUI.WIDTH, MainGUI.HEIGHT);\n gameScene.setOnKeyPressed(new PressHandler());\n gameScene.setOnKeyReleased(new ReleaseHandler());\n\n createMenu(stage, gameScene);\n Scene menuScene = new Scene(root, MainGUI.WIDTH, MainGUI.HEIGHT);\n stage.setScene(menuScene);\n\n }",
"@Override\n public void start(final Stage stage) {\n\tLabel label = new Label(\" The key to making programs fast\\n\" +\n\t\t\t\" is to make them do practically nothing.\\n\" +\n\t\t\t\" -- Mike Haertel\");\t\n\tCircle circle = new Circle(160, 120, 30);\n\tPolygon polygon = new Polygon(160, 120, 200, 220, 120, 220);\n\tGroup group = new Group(label, circle, polygon);\n Scene scene = new Scene(group,320,240);\n stage.setScene(scene);\n\tstage.setTitle(\"CS 400: The Key\");\n stage.show();\n }",
"@Override\n\tpublic void start(Stage primaryStage) throws Exception {\n\t\tprimaryStage.setTitle(\"MyMoney Application\");\n\t\t// Set the scene of the application to the new Scene\n\t\tprimaryStage.setScene(createScene());\n\t\tprimaryStage.setResizable(true);\n\t\t// Display the Stage\n\t\tprimaryStage.show();\n\t}",
"@Override\r\n\tpublic void start(Stage primaryStage) throws Exception {\n\t\tthis.primaryStage = primaryStage;\r\n\t\tthis.primaryStage.setTitle(\"My GitHub Profile\");\r\n\t\tthis.primaryStage.setX(600);\r\n\t\tthis.primaryStage.setY(400);\r\n\t\t\r\n\t\tthis.primaryStage = primaryStage;\r\n\t\tprimaryStage.show();\r\n\t\tinitRootLayout();\r\n\t\t\r\n\t}",
"public void start(Stage primaryStage) throws Exception {\n DependencyGraph dg = DependencyGraph.getGraph();\n\n //Validate out arguments and make sure they are correct\n _argumentsParser = new KernelParser(this);\n validateArguments();\n _maxThreads = _argumentsParser.getMaxThreads();\n\n //Parse the graph so that our data is ready for use in any point post this line.\n dg.setFilePath(_argumentsParser.getFilePath());\n dg.parse();\n\n //set up statistics\n ChartModel cModel = new ChartModel(_argumentsParser.getProcessorNo());\n _sModel = new StatisticsModel(cModel, _argumentsParser.getFilePath());\n _sModel.setStartTime(System.nanoTime());\n\n // run the algorithm\n Task task = new Task<Void>() {\n @Override\n public Void call() {\n InitialiseScheduling(_sModel);\n return null;\n }\n };\n\n new Thread(task).start();\n\n // renders the visualisation if nessasary\n if (_argumentsParser.displayVisuals()) {\n MainScreen mainScreen = new MainScreen(primaryStage, _sModel, this);\n }\n\n }",
"@Override\n public void onStart() {\n GuiMain gui = new GuiMain(this);\n gui.setVisible(true);\n log(\"Script is starting!\");\n\n }",
"public void startScene()\r\n\t{\r\n\t\tthis.start();\r\n\t}",
"@Override\r\n\tpublic void start(Stage stage) throws Exception {\r\n\t\t\r\n\t\tthis.stage = stage;\r\n\t\t\r\n\t\tstage.setTitle(windowName);\r\n\r\n\t\tPlatform.setImplicitExit(false);\r\n\r\n\t\tFXMLLoader loader = new FXMLLoader();\r\n\r\n\t\tloader.setClassLoader(this.getClass().getClassLoader());\r\n\t\t\r\n\t\tParent box = loader.load(new ByteArrayInputStream(fxml.getBytes()));\r\n\t\t\r\n\t\tcontroller = loader.getController();\r\n\t\t\r\n\t\tcontroller.setGUI(this);\r\n\r\n\t\tscene = new Scene(box);\r\n\t\t\r\n\t\tscene.setFill(Color.TRANSPARENT);\r\n\r\n\t\tif (this.customTitleBar)\r\n\t\t\tstage.initStyle(StageStyle.UNDECORATED);\r\n\t\t\r\n\t\tif (this.css != null)\r\n\t\t\tscene.getStylesheets().add(this.css.toExternalForm());\r\n\t\tstage.setScene(scene);\r\n\t\t\r\n\t\tstage.setResizable(false);\r\n\r\n\t\tstage.setOnCloseRequest(new EventHandler<WindowEvent>() {\r\n\r\n\t @Override\r\n\t public void handle(WindowEvent event) {\r\n\t Platform.runLater(new Runnable() {\r\n\r\n\t @Override\r\n\t public void run() {\r\n\t endScript();\r\n\t }\r\n\t });\r\n\t }\r\n\t });\r\n\t\t\r\n\t}",
"@Override\n\tpublic void start(Stage stage) throws Exception {\n\t\tStackPane pane = new StackPane();\n\t\tScene scene = new Scene(pane);\n\t\tfirstLevel();\n\t\tpane.getChildren().add(mRoot);\n\t\tstage.setScene(scene);\n\t\t\n\t\t\n\t}",
"@Override\n\tpublic void start(Stage primaryStage) throws Exception {\n\t FXMLLoader loader = new FXMLLoader(getClass().getResource(\"/sample.fxml\"));\n Parent root = loader.load();\n primaryStage.setTitle(\"Tower Defence\");\n s = new Scene(root, 600, 480);\n primaryStage.setScene(s);\n primaryStage.show();\n MyController appController = (MyController)loader.getController();\n appController.createArena(); \t\t\n\t}",
"@Override\n public void start(Stage primaryStage) {\n initGUI(primaryStage);\n connectToServer();\n }",
"@Override\n public void start(Stage primaryStage) {\n\n pStage = primaryStage;\n\n try {\n\n\n Parent root = FXMLLoader.load(getClass().getResource(\"/GUI.fxml\"));\n\n Scene scene = new Scene(root, 600, 400);\n\n primaryStage.setTitle(\"Shopper 5000 Ultimate\");\n\n primaryStage.setResizable(false);\n primaryStage.setScene(scene);\n primaryStage.show();\n\n } catch(Exception e) {\n e.printStackTrace();\n }\n }",
"@Override\r\n\tpublic void start(Stage primaryStage) throws IOException {\n\t Parent root = FXMLLoader.load(getClass().getResource(\"WeatherView.fxml\"));\r\n\t \r\n\t //setting the title of the stage\r\n\t primaryStage.setTitle(\"Weather Forecast\");\r\n\t \r\n\t //Setting the scene in the stage\r\n\t primaryStage.setScene(new Scene(root));\r\n\t \r\n\t //this method shows the stage\r\n\t primaryStage.show();\r\n\t \r\n\t \r\n\t \r\n\t \r\n\t}",
"void start() {\n }",
"@Override\n /**\n * Start method that runs at the start of the photos app\n * @param primaryStage - main stage\n * @throws Exception\n */\n public void start(Stage primaryStage) throws Exception{\n\t\tFile dir = new File(\"photoData\");\n\t\tif(!dir.exists()) {\n\t\t\tdir.mkdir();\n\t\t}\n window = primaryStage;\n\t\tsetStage(\"Login Page\", \"../view/login.fxml\");\n errorWindow = new Alert(AlertType.ERROR);\n errorWindow.initOwner(primaryStage);\n }",
"@Override\n\tpublic void start(Stage stage) throws Exception {\n\t\tSideMenu sidemenu = new SideMenu(canvas);\n\t\tgridpane.add(sidemenu, 0, 0);\n\t\tgridpane.add(canvas, 1, 0);\n\t\t\n\t\tScene scene = new Scene(gridpane);\n\t\t\n\t\tstage.setScene(scene);\n\t\tstage.sizeToScene();\n\t\t\n\t\tstage.setTitle(\"Make your own Dot Drawing - By Joeri\");\n\t\tstage.show();\n\t\t\n\t\tstage.setMinWidth(stage.getWidth());\n\t\tstage.setMinHeight(stage.getHeight());\n\t}",
"public void start(){\n\t\tsuper.start();\n\t}",
"@Override\n public void start(Stage mainStage) throws Exception {\n this.LBMS = SerializedLibraryBookManagementSystem.loadFromFile();\n this.mainStage = mainStage;\n this.page = new StartPage(this, LBMS);\n this.root = new BorderPane();\n this.clientBar = new ClientBar(this, LBMS);\n this.root.setTop(clientBar.getRoot());\n this.mainStage.setScene(new Scene(root));\n refresh();\n //Scene scene = this.page.getRoot();\n //this.mainStage.setScene( scene );\n //mainStage.show();\n }",
"@Override\n public void start(Stage primaryStage) throws Exception{\n\n Music.playBackGroundMusic();\n\n try {\n SpellingListData.getInstance();\n _revisionData.loadFailed();\n _overallStats.loadStats();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n }\n\n _primaryStage = primaryStage;\n\n Parent root = FXMLLoader.load(getClass().getResource(\"MainMenuV2.fxml\"));\n primaryStage.setTitle(\"VOXSPELL\");\n primaryStage.setScene(new Scene(root, 1200, 800));\n primaryStage.setResizable(false);\n primaryStage.show();\n\n\n }",
"@Override\n public void start(Stage primaryStage)\n throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {\n makeMainGrid();\n Scene myHomeScene = new Scene(myMainGrid, WINDOW_WIDTH, WINDOW_HEIGHT);\n primaryStage.setScene(myHomeScene);\n primaryStage.show();\n }",
"public void start(Stage mainStage) throws Exception{\r\n\t\tcreatePane();\r\n\t\tcreateStage(mainStage);\r\n\t\tmainStag = mainStage;\r\n\t\tmainStag.show();\r\n\t}",
"public void start(Stage s) {\n\t\ts.setTitle(\"SpaceY | Menu principal\");\n\t\ts.setScene(scene);\n\t\ts.setResizable(true);\n//\t\ts.setMaximized(true);\n\t\ts.getIcons().add(Sprite.LOGO.getImage());\n\t\ts.show();\n\t}",
"public abstract void startup();",
"public void start()\n {}",
"@Override\r\n public void start(Stage primaryStage) throws Exception{\n primaryStage.setTitle(\"Color switch\");\r\n Gameplay obj1 = new Gameplay();\r\n obj1.mainmenu(primaryStage);\r\n// pane.getChildren().add(new Polygon(10,20,30,10,20,30));\r\n\r\n }",
"public void start_game() throws IOException, JAXBException {\n savetoxml();\n logger.trace(\"starting the game now...\");\n primarystage.setResizable(false);\n primarystage.setScene(game_scene);\n primarystage.show();\n\n }"
] | [
"0.7613939",
"0.747283",
"0.743417",
"0.7404011",
"0.7395021",
"0.7382308",
"0.73521686",
"0.7302529",
"0.72267747",
"0.7223551",
"0.7208558",
"0.7196861",
"0.71900725",
"0.7177994",
"0.7173534",
"0.7166832",
"0.71318895",
"0.7115436",
"0.71137094",
"0.71132344",
"0.71027327",
"0.7097367",
"0.70953894",
"0.70884216",
"0.708328",
"0.70798904",
"0.707611",
"0.7060867",
"0.7053489",
"0.7035763",
"0.70356166",
"0.70284015",
"0.7027423",
"0.70212346",
"0.701795",
"0.70120347",
"0.70116144",
"0.69972575",
"0.69932866",
"0.69815487",
"0.6980261",
"0.6955479",
"0.69548976",
"0.6951927",
"0.6948476",
"0.6945865",
"0.69457453",
"0.693459",
"0.69324577",
"0.6925548",
"0.69181913",
"0.69181913",
"0.69087213",
"0.6899427",
"0.6888238",
"0.68796647",
"0.687488",
"0.6865742",
"0.6860724",
"0.6855112",
"0.6853904",
"0.6850442",
"0.6849338",
"0.6846538",
"0.68317336",
"0.683167",
"0.6831017",
"0.6829786",
"0.6823321",
"0.68224424",
"0.6800779",
"0.67845213",
"0.6780246",
"0.6780246",
"0.677861",
"0.6770547",
"0.6768467",
"0.6761089",
"0.6756731",
"0.6754983",
"0.6751886",
"0.6749681",
"0.67451996",
"0.6744303",
"0.67392117",
"0.6737118",
"0.6729141",
"0.6728001",
"0.67250407",
"0.672026",
"0.67145103",
"0.6714292",
"0.6713077",
"0.6709367",
"0.67054725",
"0.66954505",
"0.6694084",
"0.66909796",
"0.6688767",
"0.6686346"
] | 0.69923246 | 39 |
initialize the simulate label actions | private void initSimulateModeController() {
simulateMode.setOnMouseClicked(event -> {
SimulatorMain sm = null;
try { sm = new SimulatorMain(); }
catch (Exception e) { e.printStackTrace(); }
sm.start(SimulatorMain.stage);
});
simulateMode.setOnMouseEntered(event -> { simulateMode.setGraphic(new Circle(5)); });
simulateMode.setOnMouseExited(event -> { simulateMode.setGraphic(null); });
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void initActions() {\n\t\t\r\n\t}",
"private void initActions() \n {\n // Quits the application\n this.quitAction = new AbstractAction (\"Quit\") \n {\n public static final long serialVersionUID = 2L;\n\n @Override\n public void actionPerformed (ActionEvent arg0) \n { \n System.exit(0);\n }\n };\n\n // Creates a new model\n this.newGameAction = new AbstractAction (\"New Game\") \n {\n public static final long serialVersionUID = 3L;\n\n @Override\n public void actionPerformed(ActionEvent arg0) \n {\n AsteroidsFrame.this.newGame ();\n }\n };\n }",
"protected void init_actions()\r\n {\r\n action_obj = new CUP$SintaxAnalysis$actions(this);\r\n }",
"public abstract void init_actions() throws Exception;",
"private void initializeControls() {\n\t\tlabel = new Label(status.toString());\n\t}",
"protected void init_actions()\r\n {\r\n action_obj = new CUP$CircuitCup$actions(this);\r\n }",
"protected void init_actions()\r\n {\r\n action_obj = new CUP$AnalizadorSintactico$actions(this);\r\n }",
"private void initialize() {\r\n\r\n // add default buttons\r\n addButton(getToggleButton(),\"toggle\");\r\n addButton(getFinishButton(),\"finish\");\r\n addButton(getCancelButton(),\"cancel\");\r\n addActionListener(new ActionListener() {\r\n\r\n public void actionPerformed(ActionEvent e) {\r\n String cmd = e.getActionCommand();\r\n if(\"toggle\".equalsIgnoreCase(cmd)) change();\r\n else if(\"finish\".equalsIgnoreCase(cmd)) finish();\r\n else if(\"cancel\".equalsIgnoreCase(cmd)) cancel();\r\n }\r\n\r\n });\r\n\r\n }",
"protected void init_actions() {\r\n action_obj = new CUP$SintacticoH$actions(this);\r\n }",
"public void initiateAction() {\r\n\t\t// TODO Auto-generated method stub\t\r\n\t}",
"private void manageTestTarget(){ \n if(labelArray[TEST_TARGET_LOCATION].getIcon()==iconSet.getGrayIcon()){\n labelArray[TEST_TARGET_LOCATION].setIcon(iconSet.getTestTargetIcon());\n System.out.println(\"Test Start\");\n } \n else{\n testTargetDelay++;\n System.out.println(\"DELAY:\" + testTargetDelay);\n }\n }",
"protected void init_actions()\r\n {\r\n action_obj = new CUP$LuaGrammarCup$actions(this);\r\n }",
"protected void init_actions()\n {\n action_obj = new CUP$Sintactico$actions(this);\n }",
"@Override\r\n public void initAction() {\n \r\n }",
"private void initHandlers(){\n\t\tlabel.setOnMouseClicked(new EventHandler<MouseEvent>() {\n\t\t\tpublic void handle(MouseEvent e) {\n\t\t\t\tfor(TLEventLabel label : eventLabels){\n\t\t\t\t\tlabel.setSelected(false);\n\t\t\t\t}\n\t\t\t\tsetSelected(true);\n\t\t\t\tnew Thread(new Runnable() {\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tmodel.selectEvent(event);\n\t\t\t\t\t}\n\t\t\t\t}).start();\n\t\t\t}\n\t\t});\n\t}",
"private void initSimulateMode() {\n initSimulateModeView();\n initSimulateModeController();\n }",
"protected void init_actions()\n {\n action_obj = new CUP$PCLParser$actions(this);\n }",
"private void setActions(){\n login.setOnAction(e->login());\n simulate.setOnAction(e->simulate());\n scoreBoardButton.setOnAction(e->scoreBoard());\n viewBracket.setOnAction(e->viewBracket(selectedBracket, playerMap));\n clearButton.setOnAction(e->clear());\n resetButton.setOnAction(e->reset());\n finalizeButton.setOnAction(e->finalizeBracket());\n }",
"@Override\n protected void initialize() {\n led.setLED_M1(false, false, false);\n count = 0;\n led.setLED_M1(true, false, false);\n ledState = status.ONE;\n System.out.println(\"BUTTON PRESSED\");\n }",
"@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tif(ModelName == null)\r\n\t\t\t\t{\r\n\t\t\t\t\ttopLabel.removeAll();\r\n\t\t\t\t\ttopLabel.setText(\"请进行抽象测试序列生成!\");\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tinitThread();\r\n\t\t\t\t\tmainthread.start();\r\n\t\t\t\t\tthread1.start();\r\n\t\t\t\t}\r\n\t\t\t}",
"public void initialize() {\n\t\tbombLabel.setText(\"Flag: \" + game.getFlagCounter() + \"/\" + game.getNumOfBombs());\n\t\ttimerLabel.setText(\"Time: \" + 0);\n\t\tboard.getStyleClass().add(\"grid\");\n\t\tbtnArray = new Button[game.getHeight()][game.getWidth()];\n\t\tfor (int x = 0; x < game.getHeight(); x++) {\n\t\t\tfor (int y = 0; y < game.getWidth(); y++) {\n\t\t\t\tButton btn = new Button(\"\");\n\t\t\t\tbtnArray[x][y] = btn;\n\t\t\t\tbtn.setMaxSize(50, 50);\n\t\t\t\tbtn.setMinSize(50, 50);\n\t\t\t\t//Add Button to the board (GridPane)\n\t\t\t\tboard.add(btn, x, y);\n\t\t\t\tbtn.setId(x + \" . \" + y);\n\t\t\t\tbtn.setOnMouseClicked(e -> TileClicked(e));\n\t\t\t}\n\t\t}\n\t}",
"protected void init_actions()\n {\n action_obj = new CUP$ParserForms$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$XPathParser$actions(this);\n }",
"private void _initLabels() \n {\n _lblName = _createNewLabel( \"Mother Teres@ Practice Management System\");\n _lblVersion = _createNewLabel(\"Version 1.0.1 (Beta)\");\n _lblAuthor = _createNewLabel( \"Company: Valkyrie Systems\" );\n _lblRealAuthor = _createNewLabel( \"Author: Hein Badenhorst\" );\n _lblDate = _createNewLabel( \"Build Date:\" );\n _lblRealDate = _createNewLabel( \"31 October 2010\");\n }",
"private void initialize() {\r\n label = new JLabel();\r\n panel = new JPanel();\r\n }",
"protected void init_actions()\r\n {\r\n action_obj = new CUP$parser$actions(this);\r\n }",
"protected void init_actions()\r\n {\r\n action_obj = new CUP$Parser$actions(this);\r\n }",
"protected void init_actions()\n {\n action_obj = new CUP$analisis_sintactico_re$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$Parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$Parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$Parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$Parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$Parser$actions(this);\n }",
"protected void init_actions()\r\n {\r\n action_obj = new CUP$MJParser$actions(this);\r\n }",
"protected void init_actions()\n {\n action_obj = new CUP$Asintactico$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$FractalParser$actions(this);\n }",
"@Override\n public void init() {\n robot = new MecanumBotHardware(true,true,true,true);\n robot.init(hardwareMap);\n int deg180=845;\n // Create the state machine and configure states.\n smDrive = new StateMachine(this, 16);\n smDrive.addStartState(new WaitState(\"wait\",0.1,\"MainDriveTeleop\"));\n smDrive.addState(new GigabyteTeleopDriveState(\"MainDriveTeleop\", robot));\n smDrive.addState(new SpinPose(\"90DegSpin\",(int)(deg180*0.5),robot,0.1f));\n smDrive.addState(new SpinPose(\"180DegSpin\",deg180,robot,0.1f));\n smDrive.addState(new SpinPose(\"270DegSpin\",(int)(deg180*1.5),robot,0.1f));\n\n smArm = new StateMachine(this, 16);\n smArm.addStartState(new WaitState(\"wait\",0.1,\"MainArmTeleop\"));\n smArm.addState(new GigabyteTeleopArmState(\"MainArmTeleop\", robot));\n smArm.addState(new ShoulderPose(\"Pose1\", robot,0, \"MainArmTeleop\"));//0.12\n smArm.addState(new ShoulderPose(\"Pose2\", robot,1079, \"MainArmTeleop\"));//0.05\n smArm.addState(new ShoulderPose(\"Pose3\", robot,2602, \"MainArmTeleop\"));//-0.17\n smArm.addState(new ShoulderPose(\"Pose4\", robot,3698, \"MainArmTeleop\" ));//-0.35\n // Init the state machine\n smDrive.init();\n smArm.init();\n }",
"public void init(){\n\t\tsetBackground(Color.green);\n\t\tmsg = \"Let's Play\";\n//\t\tmsg1 = \"Your Frinds Choice\";\n\t\tSystem.out.println(cpu);\n\t\tb1 = new Button(\"Stone\");\n\t\tb2 = new Button(\"Paper\");\n\t\tb3 = new Button(\"Seaser\");\n\t\tb1.addActionListener(this);\n\t\tb2.addActionListener(this);\n\t\tb3.addActionListener(this);\n\t\tadd(b1);\n\t\tadd(b2);\n\t\tadd(b3);\n\t}",
"private void initActors() {\r\n\t\t// Prepare everything\r\n\t\tinitLabels();\r\n\t\tinitButtons();\r\n\t\t// Initialize our Actors\r\n\t\tinitTable();\r\n\t}",
"private void initialize() {\r\n\t\tsetLabels();\r\n\t\tinitPoints();\r\n\t\tsetButtons();\r\n\t\tthis.setTitle(\"Digite os pesos dos pontos\");\r\n\t\tthis.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);\r\n\t}",
"public void initiateValues() {\n\t\t// initialise states and actions\n\t\toldState = new MarioState(configFile);\n\t\tstate = new MarioState(configFile);\n\t\t\n\t\treturnAction = new boolean[Environment.numberOfButtons];\n\t\tallActions = getAllActions();\n\t\t\n\t\t// hardcoded set the possible actions\n\t\tJUMP[Mario.KEY_JUMP] = true;\n\t\tSPEED[Mario.KEY_SPEED] = true;\n\t\tJUMP_SPEED[Mario.KEY_JUMP] = JUMP_SPEED[Mario.KEY_SPEED] = true;\n\t\tRIGHT[Mario.KEY_RIGHT] = true;\n\t\tRIGHT_JUMP[Mario.KEY_RIGHT] = RIGHT_JUMP[Mario.KEY_JUMP] = true;\n\t\tRIGHT_SPEED[Mario.KEY_RIGHT] = RIGHT_SPEED[Mario.KEY_SPEED] = true;\n\t\tRIGHT_JUMP_SPEED[Mario.KEY_RIGHT] = RIGHT_JUMP_SPEED[Mario.KEY_JUMP] = \n\t\t\t\tRIGHT_JUMP_SPEED[Mario.KEY_SPEED] = true;\n\t\tLEFT[Mario.KEY_LEFT] = true;\n\t\tLEFT_JUMP[Mario.KEY_LEFT] = LEFT_JUMP[Mario.KEY_JUMP] = true;\n\t\tLEFT_SPEED[Mario.KEY_LEFT] = LEFT_SPEED[Mario.KEY_SPEED] = true;\n\t\tLEFT_JUMP_SPEED[Mario.KEY_LEFT] = LEFT_JUMP_SPEED[Mario.KEY_JUMP] = \n\t\t\t\tLEFT_JUMP_SPEED[Mario.KEY_SPEED] = true;\n\n\t}",
"protected void init_actions()\n {\n action_obj = new CUP$CoolParser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$CoolParser$actions(this);\n }",
"private void setButtons()\n\t{\n\t\tstartSim = new JButton(\"Start Sim\");\n\t\tstartSim.addActionListener(this);\n\t\tpauseSim = new JButton(\"Pause Sim\");\n\t\tpauseSim.addActionListener(this);\n\t\taddEat = new JButton(\"Add Eatery\");\n\t\taddEat.addActionListener(this);\n\t\tsubEat = new JButton(\"Subtract Eatery\");\n\t\tsubEat.addActionListener(this);\n\t\taddCash = new JButton(\"Add Cashier\");\n\t\taddCash.addActionListener(this);\n\t\tsubCash = new JButton(\"Subtract Cashier\");\n\t\tsubCash.addActionListener(this);\n\t}",
"public void robotInit() {\n\t\toi = new OI();\n // instantiate the command used for the autonomous period\n }",
"private void initialize() {\n\t\tlabelmessage = new JTextField();\n\t\tlabelmessage.setText(\"You've clicked this button 0 times\");\n\t\tframe = new JFrame();\n\t\tframe.setBounds(100, 100, 478, 332);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(null);\n\t\t\n\t\tJButton btnPointlessButton = new JButton(\"pointless button\");\n\t\tbtnPointlessButton.addActionListener(new ActionListener() {\n\t\t\tint pointlesnumber = 0;\n\t\t\t\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tpointlesnumber++;\n\t\t\t\tlabelmessage.setText(\"You've clicked this button \" + pointlesnumber + \" times\");\n\t\t\t\tlabelmessage.setBounds(162, 71, 116, 22);\n\t\t\t\tframe.getContentPane().add(labelmessage);\n\t\t\t\tlabelmessage.setColumns(10);\n\t\t\t}\n\t\t});\n\t\tbtnPointlessButton.setForeground(Color.BLACK);\n\t\tbtnPointlessButton.setBackground(Color.LIGHT_GRAY);\n\t\tbtnPointlessButton.setFont(new Font(\"Gentium Basic\", Font.ITALIC, 21));\n\t\tbtnPointlessButton.setBounds(145, 126, 206, 68);\n\t\tframe.getContentPane().add(btnPointlessButton);\n\t\t\n\t\ttxtClickThisButton = new JTextField();\n\t\ttxtClickThisButton.setFont(new Font(\"Tahoma\", Font.PLAIN, 16));\n\t\ttxtClickThisButton.setBackground(Color.LIGHT_GRAY);\n\t\ttxtClickThisButton.setText(\"click this button ^\");\n\t\ttxtClickThisButton.setBounds(132, 205, 146, 26);\n\t\tframe.getContentPane().add(txtClickThisButton);\n\t\ttxtClickThisButton.setColumns(10);\n\t\t\n\t\t\n\t}",
"@Override\n\tvoid setupAction() {\n\n\t\tgetButton().setOnAction(event -> {\n\t\t\tmainPrevCommandBox.addText(mainTextInput.getText());\n\t\t\tfor (Turtle t : getThisTurtleList()) {\n\n\t\t\t\tlanguage = ((LanguageCombo) mainLanguageComboBox).getLanguage();\n\t\t\t\tCommand test = new Command(mainTextInput.getText(), t, variableMap, userCommandMap, language);\n\t\t\t\ttest.execute();\n\n\t\t\t}\n\t\t\tmainVarTable.updateVars(variableMap);\n\t\t\tmainFuncTable.updateCommandFuncs(userCommandMap);\n\t\t\tmainTurtleTable.updateValues();\n\n\t\t\tmainTextInput.clear();\n\n\t\t});\n\t}",
"public void robotInit() {\n\t\toi = new OI();\n chooser = new SendableChooser();\n chooser.addDefault(\"Default Auto\", new ExampleCommand());\n// chooser.addObject(\"My Auto\", new MyfAutoCommand());\n SmartDashboard.putData(\"Auto mode\", chooser);\n \n //Drive\n //this.DriveTrain = new DriveTrain();\n \t//RobotMap.robotDrive1.arcadeDrive(oi.stickLeft);\n \n //Buttons\n // oi.button1.whenPressed(new SetMaxMotorOutput());\n \n //Ultrasonic\n sonic1 = new Ultrasonic(0,1);\n sonic1.setAutomaticMode(true);\n \n }",
"protected void init_actions()\n {\n action_obj = new CUP$Grm$actions();\n }",
"private void initialize() {\r\n this.add(getJMenuItemRestore()); // Generated\r\n\r\n this.add(getJMenuItemExit()); // Generated\r\n\r\n this.setLabel(\"WorkDayPlanner\");\r\n }",
"protected void initialize() {\n \ttarget = (int) SmartDashboard.getNumber(\"target\", 120);\n \ttarget = (int) (target * Constants.TICKS_TO_INCHES);\n\t\tRobot.drive.stop();\n\t\tmaxCount = (int) SmartDashboard.getNumber(\"max count\", 0);\n\t\ttolerance = (int) SmartDashboard.getNumber(\"tolerance\", 0);\n\t\tRobot.drive.left.motor1.setSelectedSensorPosition(0, Constants.kPIDLoopIdx, Constants.kTimeoutMs);\n\t\tRobot.drive.right.motor1.setSelectedSensorPosition(0, Constants.kPIDLoopIdx, Constants.kTimeoutMs);\n }",
"private void initSetUp()\n\t{\n\t\tthis.setActionName(NAME);\n\t\tthis.setDescription(DESCRIPTION);\n\t\tthis.setMagic(IS_MAGIC);\n\t\tthis.setAttack(IS_ATTACK);\n\t\tthis.setTargetSelf(IS_TARGET_SELF);\n\t\tthis.setInternalName(INTERNAL_NAME);\n\t}",
"private void enableLabels() {\n Label[] labelArray = {id00, id01, id02, id10, id11, id12, id20, id21, id22};\n for(Label lbl : labelArray) {\n lbl.setOnMouseClicked((event) -> printTurn(event));\n }\n }",
"private void initSimulateModeView() {\n simulateMode = new Label(\"SIMULATE\");\n simulateMode.setPrefSize(200, 100);\n simulateMode.setFont(Font.font(null, FontWeight.BOLD, 30));\n simulateMode.setTextFill(Color.ORANGE);\n simulateMode.setEffect(getDropShadow());\n }",
"public void initializeBtn(){\r\n\t\t\r\n\t\t//Populate Table\r\n\t\tinitializeTable();\r\n\t\t\r\n\t\t//Initialize form\r\n\t\tinitializeForm();\r\n\t\t\r\n\t}",
"public void action() {\n try {\n //System.out.println(\"LoadAgent\"+neighId[i]);\n DFAgentDescription template = new DFAgentDescription();\n ServiceDescription sd = new ServiceDescription();\n sd.setName(\"DSO agent\");\n template.addServices(sd);\n DFAgentDescription[] result = DFService.search(myAgent, template);\n AgentAIDs[0] = result[0].getName();\n sd.setName(\"PV Agent\");\n template.addServices(sd);\n result = DFService.search(myAgent, template);\n AgentAIDs[2] = result[0].getName();\n sd.setName(\"Load Agent\");\n template.addServices(sd);\n result = DFService.search(myAgent, template);\n AgentAIDs[3] = result[0].getName();\n\n } catch (FIPAException ex) {\n Logger.getLogger(CurtailAgent.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n //initializa GUI and add listeners\n appletVal = new SetCellValues();\n appletVal.playButton.addActionListener(new listener());\n appletVal.playButton.setEnabled(true);\n appletVal.resetButton.addActionListener(new listener());\n appletVal.resetButton.setEnabled(true);\n //operate microgrid\n addBehaviour(operate);\n\n }",
"@Override\r\n\tpublic void simulate() {\n\t\t\r\n\t}",
"@Override\n public void actionPerformed(ActionEvent e) {\n\n myFirstLabel.setText(\"You just clicked a button!\");\n }",
"protected void init_actions()\n {\n action_obj = new CUP$include$actions(this);\n }",
"public ClickButtonAction() {\n _target = new TargetComponent();\n }",
"@FXML\n public void initialize()\n {\n randomlyChooseWord();\n setHangmanWord();\n\n hangmanShapes[0] = hangman1;\n hangmanShapes[1] = hangman2;\n hangmanShapes[2] = hangman3;\n hangmanShapes[3] = hangman4;\n hangmanShapes[4] = hangman5;\n hangmanShapes[5] = hangman6;\n hangmanShapes[6] = hangman7;\n hangmanShapes[7] = hangman8;\n hangmanShapes[8] = hangman9;\n hangmanShapes[9] = hangman10;\n }",
"public ButtonWizard(DialogueSystem system) {\n this.system = system;\n currentAction = new JLabel();\n currentJoint = new JLabel();\n }",
"@Override\n public void testInit() {\n CommandScheduler.getInstance().cancelAll();\n //left_belt.set(ControlMode.PercentOutput,0.5);\n }",
"private void initialize() {\r\n\t\tGridBagConstraints gridBagConstraints1 = new GridBagConstraints();\r\n\t\tgridBagConstraints1.gridx = 0;\r\n\t\tgridBagConstraints1.gridy = 1;\r\n\t\tlaunchSubLabel = new JLabel();\r\n\t\tlaunchSubLabel.setText(Message.getMessage(\"reportmaker.process.sublabel\"));\r\n\t\tGridBagConstraints gridBagConstraints = new GridBagConstraints();\r\n\t\tgridBagConstraints.gridx = 0;\r\n\t\tgridBagConstraints.gridy = 0;\r\n\t\tthis.setSize(800, 400);\r\n\t\tthis.setLayout(new GridBagLayout());\r\n\t\tthis.setPreferredSize(new Dimension(800, 400));\r\n\t\tthis.setBackground(Color.white);\r\n\t\tthis.add(getLaunchButton(), gridBagConstraints);\r\n\r\n\t\tGridBagConstraints gridBagConstraints2 = new GridBagConstraints();\r\n\t\tgridBagConstraints2.insets = new Insets(50, 0, 0, 0);\r\n\t\tgridBagConstraints2.gridx = 0;\r\n\t\tgridBagConstraints2.gridy = 2;\r\n\t\tthis.add(getViewButton(), gridBagConstraints2);\r\n\t\tthis.add(launchSubLabel, gridBagConstraints1);\r\n\t}",
"public void teleopInit() {\n // Initalize test command\n Jagbot.isAutonomous = false;\n MessageWindow.write(1, \"Robot init\");\n //testCommand = new TestCommand();\n //testCommand.start();\n }",
"protected abstract void initHardwareInstructions();",
"public void init()\r\n {\r\n this.setText(\"Migrate\");\r\n \r\n this.addActionListener(this);\r\n }",
"public void robotInit() {\n RobotMap.init();\n driveTrain = new DriveTrain();\n oi = new OI();\n flippy = new Flipper();\n flappy = new Flapper();\n autonomousCommand = new AutoFlip();\n \n OI.init();\n CommandBase.init();\n autoChooser = new SendableChooser();\n autoChooser.addDefault(\"Flap Left\", new AutoFlip());\n SmartDashboard.putData(\"Autonomous_Mode\", autoChooser); \n }",
"protected void init_actions()\n {\n action_obj = new CUP$A4Parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$A4Parser$actions(this);\n }",
"@Override\n public void init(TaskManager tm, Ui ui) {\n setResponse(ui.askEventName());\n setUtility(tm, ui);\n }",
"protected void initialize ()\n\t{\n\t\tSubsystems.goalVision.processNewImage();\n\t\t\n \t//Send positive values to go forwards.\n \tSubsystems.transmission.setLeftJoystickReversed(true);\n \tSubsystems.transmission.setRightJoystickReversed(true);\n\t}",
"private void setupActions(MediatorListener mediator) {\n\n\t\tProperties hotKeysProperties = null;\n\t\tString fileName = \"hotkeys.properties\";\n\t\ttry {\n\t\t\thotKeysProperties = readPropertiesFromClassPath(fileName);\n\t\t} catch (Exception e) {\n\t\t\thotKeysProperties = new Properties();\n\t\t\thotKeysProperties.put(\"Hotkey.Gui.BaselineMode\", \"B\");\n\t\t\thotKeysProperties.put(\"Hotkey.Gui.Attending\", \"A\");\n\t\t\thotKeysProperties.put(\"Hotkey.Gui.Independent\", \"1\");\n\t\t\thotKeysProperties.put(\"Hotkey.Gui.Verbal\", \"2\");\n\t\t\thotKeysProperties.put(\"Hotkey.Gui.Modeling\", \"3\");\n\t\t\thotKeysProperties.put(\"Hotkey.Gui.NoAnswer\", \"4\");\n\t\t\thotKeysProperties.put(\"Hotkey.Gui.WrongAnswer\", \"5\");\n\t\t\tlog.warn(String.format(\n\t\t\t\t\t\"Problem reading %s. Defaulting hotkeysPropteries=%s\",\n\t\t\t\t\tfileName, hotKeysProperties), e);\n\t\t}\n\n\t\tString hk = (String) hotKeysProperties.get(\"Hotkey.Gui.BaselineMode\");\n\n\t\tbaselineModeAction = new ActionRecorder(Messages\n\t\t\t\t.getString(\"Gui.BaselineMode\"), null, //$NON-NLS-1$\n\t\t\t\tMessages.getString(\"Gui.BaselineModeDescription\"), new Integer( //$NON-NLS-1$\n\t\t\t\t\t\tKeyEvent.VK_F1), KeyStroke.getKeyStroke(hk),\n\t\t\t\tAction.BASELINE_MODE, mediator);\n\n\t\thk = (String) hotKeysProperties.get(\"Hotkey.Gui.Attending\");\n\n\t\tattendingAction = new ActionRecorder(Messages\n\t\t\t\t.getString(\"Gui.Attending\"), null, //$NON-NLS-1$\n\t\t\t\tMessages.getString(\"Gui.AttendingDescription\"), new Integer( //$NON-NLS-1$\n\t\t\t\t\t\tKeyEvent.VK_F1), KeyStroke.getKeyStroke(hk),\n\t\t\t\tAction.ATTENDING, mediator);\n\n\t\thk = (String) hotKeysProperties.get(\"Hotkey.Gui.Independent\");\n\n\t\tindependentAction = new ActionRecorder(Messages\n\t\t\t\t.getString(\"Gui.Independent\"), null, //$NON-NLS-1$\n\t\t\t\tMessages.getString(\"Gui.IndependentDescription\"), new Integer( //$NON-NLS-1$\n\t\t\t\t\t\tKeyEvent.VK_F2), KeyStroke.getKeyStroke(hk),\n\t\t\t\tAction.INDEPENDENT, mediator);\n\n\t\thk = (String) hotKeysProperties.get(\"Hotkey.Gui.Verbal\");\n\n\t\tverbalAction = new ActionRecorder(\n\t\t\t\tMessages.getString(\"Gui.Verbal\"), null, //$NON-NLS-1$\n\t\t\t\tMessages.getString(\"Gui.VerbalDescription\"), //$NON-NLS-1$\n\t\t\t\tnew Integer(KeyEvent.VK_F3), KeyStroke.getKeyStroke(hk),\n\t\t\t\tAction.VERBAL, mediator);\n\n\t\thk = (String) hotKeysProperties.get(\"Hotkey.Gui.Modeling\");\n\n\t\tmodelingAction = new ActionRecorder(\n\t\t\t\tMessages.getString(\"Gui.Modeling\"), null, //$NON-NLS-1$\n\t\t\t\tMessages.getString(\"Gui.ModelingDescriptin\"), new Integer( //$NON-NLS-1$\n\t\t\t\t\t\tKeyEvent.VK_F4), KeyStroke.getKeyStroke(hk),\n\t\t\t\tAction.MODELING, mediator);\n\n\t\thk = (String) hotKeysProperties.get(\"Hotkey.Gui.NoAnswer\");\n\n\t\tnoAnswerAction = new ActionRecorder(\n\t\t\t\tMessages.getString(\"Gui.NoAnswer\"), null, //$NON-NLS-1$\n\t\t\t\tMessages.getString(\"Gui.NoAnswerDescription\"), new Integer(KeyEvent.VK_F5), //$NON-NLS-1$\n\t\t\t\tKeyStroke.getKeyStroke(hk), Action.NO_ANSWER, mediator);\n\n\t\thk = (String) hotKeysProperties.get(\"Hotkey.Gui.WrongAnswer\");\n\t\twrongAnswerAction = new ActionRecorder(\n\t\t\t\tMessages.getString(\"Gui.WrongAnswer\"), null, //$NON-NLS-1$\n\t\t\t\tMessages.getString(\"Gui.WrongAnswerDescription\"), new Integer(KeyEvent.VK_F5), //$NON-NLS-1$\n\t\t\t\tKeyStroke.getKeyStroke(hk), Action.WRONG_ANSWER, mediator);\n\n\t\ttoggleButtonsAction = new ActionRecorder(\n\t\t\t\tMessages.getString(\"Gui.ToggleButtons\"), null, //$NON-NLS-1$\n\t\t\t\tMessages.getString(\"Gui.ToggleButtons.Description\"), new Integer(KeyEvent.VK_L), //$NON-NLS-1$\n\t\t\t\tKeyStroke.getKeyStroke(\"T\"), Action.TOGGLE_BUTTONS, mediator);\n\n\t\tquitAction = new ActionRecorder(\n\t\t\t\tMessages.getString(\"Gui.Quit\"), null, //$NON-NLS-1$\n\t\t\t\tMessages.getString(\"Gui.QuitDescriptino\"), new Integer(KeyEvent.VK_L), //$NON-NLS-1$\n\t\t\t\tKeyStroke.getKeyStroke(\"control Q\"), Action.QUIT, mediator);\n\n\t\ttimerAction = new ActionRecorder(\n\t\t\t\tMessages.getString(\"Gui.TimerSwing\"), null, //$NON-NLS-1$\n\t\t\t\t\"Quit (Exit) the program\", new Integer(KeyEvent.VK_L), //$NON-NLS-1$\n\t\t\t\tKeyStroke.getKeyStroke(\"control F2\"), Action.TIMER, mediator);\n\n\t\ttimerBetweenAction = new ActionRecorder(Messages\n\t\t\t\t.getString(\"Gui.TimerBetweenSwing\"), null, //$NON-NLS-1$\n\t\t\t\t\"Quit (Exit) the program\", new Integer(KeyEvent.VK_L), //$NON-NLS-1$\n\t\t\t\tKeyStroke.getKeyStroke(\"control F2\"), Action.BETWEEN_TIMER,\n\t\t\t\tmediator);\n\n\t\ttimerTimeDelayAutoAdvance = new ActionRecorder(Messages\n\t\t\t\t.getString(\"Gui.TimeDelayAutoAdvance\"), null, //$NON-NLS-1$\n\t\t\t\t\"xxxxxxxxxxxxxx\", new Integer(KeyEvent.VK_L), //$NON-NLS-1$\n\t\t\t\tKeyStroke.getKeyStroke(\"control F2\"),\n\t\t\t\tAction.CHANGE_DELAY_TIMER, mediator);\n\n\t\topenAction = new ActionRecorder(Messages.getString(\"Gui.Open\"), null, //$NON-NLS-1$\n\t\t\t\tMessages.getString(\"Gui.OpenDescription\"), //$NON-NLS-1$\n\t\t\t\tnew Integer(KeyEvent.VK_L),\n\t\t\t\tKeyStroke.getKeyStroke(\"control O\"), Action.OPEN, mediator);\n\n\t\tshowLoggingFrameAction = new ActionRecorder(\n\t\t\t\tMessages.getString(\"Gui.Open.ShowLoggingFrame\"), null, //$NON-NLS-1$\n\t\t\t\tMessages.getString(\"Gui.ShowLoggingFrameDescription\"), //$NON-NLS-1$\n\t\t\t\tnew Integer(KeyEvent.VK_L),\n\t\t\t\tKeyStroke.getKeyStroke(\"control D\"), Action.SHOW_LOGGING_FRAME,\n\t\t\t\tmediator);\n\n\t}",
"@Override\r\n public void robotInit() {\r\n // Instantiate our RobotContainer. This will perform all our button bindings\r\n robotContainer = new RobotContainer();\r\n }",
"public RobotInit() {\n initComponents();\n }",
"public static void init() {\n // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS\n drivetrainSpeedController1 = new CANTalon(1);\n LiveWindow.addActuator(\"Drivetrain\", \"Speed Controller 1\", (CANTalon) drivetrainSpeedController1);\n \n drivetrainSpeedController2 = new CANTalon(2);\n LiveWindow.addActuator(\"Drivetrain\", \"Speed Controller 2\", (CANTalon) drivetrainSpeedController2);\n drivetrainSpeedController3 = new CANTalon(3);\n LiveWindow.addActuator(\"Drivetrain\", \"Speed Controller 2\", (CANTalon) drivetrainSpeedController3);\n drivetrainSpeedController4 = new CANTalon(4);\n LiveWindow.addActuator(\"Drivetrain\", \"Speed Controller 2\", (CANTalon) drivetrainSpeedController4);\n drivetrainSpeedController5 = new CANTalon(5);\n LiveWindow.addActuator(\"Drivetrain\", \"Speed Controller 2\", (CANTalon) drivetrainSpeedController5);\n drivetrainSpeedController6 = new CANTalon(6);\n LiveWindow.addActuator(\"Drivetrain\", \"Speed Controller 2\", (CANTalon) drivetrainSpeedController6);\n \n drivetrainRobotDrive21 = new RobotDrive(drivetrainSpeedController1, drivetrainSpeedController2, drivetrainSpeedController3, drivetrainSpeedController4, drivetrainSpeedController5, drivetrainSpeedController6);\n \n drivetrainRobotDrive21.setSafetyEnabled(true);\n drivetrainRobotDrive21.setExpiration(0.1);\n drivetrainRobotDrive21.setSensitivity(0.5);\n drivetrainRobotDrive21.setMaxOutput(1.0);\n\n\n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS\n }",
"@Override\n public void init(ArrayList<String> args) {\n label = args.get(0);\n }",
"public void robotInit() {\n\t\toi = new OI();\n\t\t\n\t\tteleopCommand = new TeleopCommand();\n }",
"private void initSimulation()\r\n {\r\n int mark = rn.nextInt(2);\r\n if(mark == 0)\r\n {\r\n computer.setMarker(Marker.cross);\r\n marker = computer.getMarker();\r\n computer2.setMarker(Marker.circle);\r\n computer.makeMove(this);\r\n turn = 2;\r\n }\r\n else\r\n {\r\n computer.setMarker(Marker.circle);\r\n computer2.setMarker(Marker.cross);\r\n marker = computer2.getMarker();\r\n computer2.makeMove(this);\r\n turn = 1;\r\n }\r\n bh.setBoard(this);\r\n simtime.start();\r\n }",
"protected void initialize() {\n \t_finalTickTargetLeft = _ticksToTravel + Robot.driveTrain.getEncoderLeft();\n \t_finalTickTargetRight = _ticksToTravel + Robot.driveTrain.getEncoderRight();\n \t\n }",
"private void timerAction(){\n \n timerEnd();\n \n if (timerCounter == TEST_TARGET_APPERANCE + testTargetDelay){\n manageTestTarget();\n }\n \n if (timerCounter == TEST_TARGET_DISAPPERANCE + testTargetDelay){\n labelArray[TEST_TARGET_LOCATION].setIcon(iconSet.getGrayIcon());\n //System.out.println(\"Test End\");\n }\n //creates clickable red target in random, non occupied location\n //and handles removal of unclicked, expired targets\n int randRedTarget = generator.nextInt(100);\n while(labelArray[randRedTarget].getIcon()!=iconSet.getGrayIcon()){\n //System.out.println(\"Already a target in place\");\n randRedTarget = generator.nextInt(100);\n }\n labelArray[randRedTarget].setIcon(iconSet.getRedTargetIcon());\n \n if (timerCounter<ACTIVE_RED_TARGET_TOTAL){\n activeRedTarget[timerCounter] = randRedTarget;\n }\n \n if (timerCounter>=ACTIVE_RED_TARGET_TOTAL){\n if(labelArray[activeRedTarget[0]].getIcon()!=iconSet.getGrayIcon()){\n labelArray[activeRedTarget[0]].setIcon(iconSet.getGrayIcon());\n }\n for(int i = 0; i < activeRedTarget.length-1; i++){\n activeRedTarget[i] = activeRedTarget[i+1];\n }\n activeRedTarget[ACTIVE_RED_TARGET_TOTAL-1] = randRedTarget;\n }\n\n if (timerCounter%4==0){\n manageBlueTargets();\n }\n \n timerCounter++;\n \n if (timerCounter%4==0){\n manageGreenTargets();\n }\n \n System.out.println(\"Timer: \" + timerCounter); \n }",
"protected void init_actions()\n {\n action_obj = new CUP$CompParser$actions(this);\n }",
"private void initializeLabels() {\n labelVertexA = new Label(\"Vertex A\");\n labelVertexB = new Label(\"Vertex B\");\n labelVertexA.setTextFill(Color.web(\"#ffffff\"));\n labelVertexB.setTextFill(Color.web(\"#ffffff\"));\n }",
"@Override\n public void init_loop() {\n telemetry.addData(\"Say\", \"We pressed INIT!\");\n robot.clawRight.setPosition(0);\n robot.clawLeft.setPosition(0);\n }",
"public static void init() {\n // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS\n driveTrainmotor_leftFront = new Talon(1);\n LiveWindow.addActuator(\"DriveTrain\", \"motor_leftFront\", (Talon) driveTrainmotor_leftFront);\n \n driveTrainmotor_leftRear = new Talon(2);\n LiveWindow.addActuator(\"DriveTrain\", \"motor_leftRear\", (Talon) driveTrainmotor_leftRear);\n \n driveTrainmotor_rightFront = new Talon(3);\n LiveWindow.addActuator(\"DriveTrain\", \"motor_rightFront\", (Talon) driveTrainmotor_rightFront);\n \n driveTrainmotor_rightRear = new Talon(4);\n LiveWindow.addActuator(\"DriveTrain\", \"motor_rightRear\", (Talon) driveTrainmotor_rightRear);\n \n driveTrainRobotDrive = new RobotDrive(driveTrainmotor_leftFront, driveTrainmotor_leftRear,\n driveTrainmotor_rightFront, driveTrainmotor_rightRear);\n \n driveTrainRobotDrive.setSafetyEnabled(true);\n driveTrainRobotDrive.setExpiration(0.1);\n driveTrainRobotDrive.setSensitivity(0.5);\n driveTrainRobotDrive.setMaxOutput(1.0);\n\n liftmotor_Lift = new Talon(0);\n LiveWindow.addActuator(\"Lift\", \"motor_Lift\", (Talon) liftmotor_Lift);\n \n liftencoderLiftHeight = new Encoder(1, 2, true, EncodingType.k4X);\n LiveWindow.addSensor(\"Lift\", \"encoder LiftHeight\", liftencoderLiftHeight);\n liftencoderLiftHeight.setDistancePerPulse(1.0);\n liftencoderLiftHeight.setPIDSourceParameter(PIDSourceParameter.kRate);\n liftlimitBottom = new DigitalInput(0);\n LiveWindow.addSensor(\"Lift\", \"limitBottom\", liftlimitBottom);\n \n\n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS\n }"
] | [
"0.664329",
"0.66357625",
"0.62738335",
"0.6243266",
"0.6187252",
"0.6131818",
"0.6093363",
"0.6086593",
"0.6018861",
"0.6008564",
"0.5994663",
"0.5983715",
"0.5979419",
"0.59718615",
"0.59652746",
"0.59535927",
"0.5951332",
"0.59268016",
"0.5896266",
"0.58920497",
"0.5876011",
"0.5854926",
"0.5846129",
"0.58431417",
"0.5841488",
"0.5817594",
"0.581116",
"0.58104223",
"0.5805666",
"0.5805666",
"0.5805666",
"0.5805666",
"0.5805666",
"0.5805666",
"0.5805666",
"0.5805666",
"0.5805666",
"0.5805666",
"0.5805666",
"0.5805666",
"0.5805666",
"0.5805666",
"0.5805666",
"0.5805554",
"0.5805554",
"0.5805554",
"0.5805554",
"0.5805554",
"0.5796171",
"0.5787661",
"0.57745725",
"0.57731855",
"0.5770491",
"0.5759754",
"0.57507837",
"0.5721737",
"0.57208145",
"0.57208145",
"0.5704378",
"0.5703438",
"0.56959873",
"0.5689012",
"0.5680082",
"0.5677701",
"0.56770855",
"0.5672666",
"0.56721836",
"0.566699",
"0.5666397",
"0.5666159",
"0.56641245",
"0.5644736",
"0.56420815",
"0.56351435",
"0.5628736",
"0.5615647",
"0.5610721",
"0.5607208",
"0.560364",
"0.5599282",
"0.55982",
"0.55953336",
"0.559394",
"0.5591",
"0.5591",
"0.55842984",
"0.55831754",
"0.5582149",
"0.5579065",
"0.5573471",
"0.55718046",
"0.55704254",
"0.55621624",
"0.55505514",
"0.5544804",
"0.55432475",
"0.5539398",
"0.5535206",
"0.55209994",
"0.55204695"
] | 0.5946296 | 17 |
initialize the exit label | private void initExit() {
initExitView();
initExitController();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void initExitView() {\n exit = new Label(\"Exit Game\");\n exit.setPrefSize(200, 100);\n exit.setFont(Font.font(null, FontWeight.BOLD, 30));\n exit.setTextFill(Color.RED);\n exit.setEffect(getDropShadow());\n }",
"private void initExitController() {\n exit.setOnMouseClicked(event -> { System.exit(1); });\n exit.setOnMouseExited(event -> { exit.setGraphic(null); });\n exit.setOnMouseEntered(event -> { exit.setGraphic(new Circle(5)); });\n }",
"public Exit()\n {\n super(\"Exit\");\n putValue(Action.NAME, \"Exit\");\n IconSetter iconSetter = new IconSetter(\"/config/images/exiticon.gif\");\n Icon icon = iconSetter.getIcon();\n putValue(Action.SMALL_ICON, icon);\n putValue(Action.ACCELERATOR_KEY,\n KeyStroke.getKeyStroke('Q',\n Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), false));\n putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_Q));\n }",
"@Override\r\n\tpublic void exit() {\n\t\t\r\n\t}",
"public static void printExitMsg() {\r\n CmdUx.printHBars(EXIT_MSG);\r\n }",
"private void exitAction() {\n\t}",
"@Override\n public String toString() {\n return \"exit\";\n }",
"@Override\n\tpublic void exit() {\n\t\t\n\t}",
"@Override\n\tpublic void exit() {\n\t\t\n\t}",
"@Override\n\tpublic void exit() {\n\t\t//do nothing\n\t}",
"private static void exit(){\n\t\t\n\t\tMain.run=false;\n\t\t\n\t}",
"@Override\n\tpublic void exit() {\n\n\t}",
"@Override\n\tpublic void exit() {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}",
"@Override\n public void exit() {\n super.exit();\n }",
"@Override\r\n\tpublic void exit() {\n\r\n\t}",
"public void showExit();",
"public ExitMenu(){\n\t\tint n = showConfirmDialog(null,\"Exit Game\", \"Exiting Game\",JOptionPane.YES_NO_OPTION);\n\t\tif(n==0)\n\t\t\tSystem.exit(0);\t\t\n\t}",
"public ExitCommand() {\n }",
"private void btnExitActionPerformed(java.awt.event.ActionEvent evt) {\n System.exit(0);\n }",
"public void setExit(Boolean exit) {\r\n this.exit = exit;\r\n }",
"public Command getExitCommand () {\nif (exitCommand == null) {//GEN-END:|19-getter|0|19-preInit\n // write pre-init user code here\nexitCommand = new Command (\"Exit\", Command.EXIT, 0);//GEN-LINE:|19-getter|1|19-postInit\n // write post-init user code here\n}//GEN-BEGIN:|19-getter|2|\nreturn exitCommand;\n}",
"@Override\n\tpublic int exit() {\n\t\treturn 0;\n\t}",
"public void setExit(boolean exit) {\r\n this.exit = exit;\r\n }",
"static void exit()\r\n\t {\n\t\t System.exit(0);\r\n\t }",
"public void exitButtonClicked() {\r\n\t\tSystem.exit(0); \r\n\t\treturn;\r\n\t}",
"public TracingTestPreProcExit()\n {\n super();\n }",
"private void btn_ExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_ExitActionPerformed\n System.exit(0);\n }",
"private void exitButtonActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_exitButtonActionPerformed\n\tSystem.exit(0);\n }",
"public void exit();",
"public void setExit(boolean exit) {\n this.exit = exit;\n }",
"public ExitAction() {\n super(tr(\"Exit\"), \"exit\", tr(\"Exit the application.\"),\n Shortcut.registerShortcut(\"system:menuexit\", tr(\"Exit\"), KeyEvent.VK_Q, Shortcut.GROUP_MENU), true);\n putValue(\"help\", ht(\"/Action/Exit\"));\n }",
"public void a_exit() {\r\n\t\tSystem.exit(0);\r\n\t}",
"protected void exit() {\n\t\tSystem.exit(0);\n\t}",
"public Command getExitCommand1 () {\nif (exitCommand1 == null) {//GEN-END:|32-getter|0|32-preInit\n // write pre-init user code here\nexitCommand1 = new Command (\"Exit\", Command.EXIT, 0);//GEN-LINE:|32-getter|1|32-postInit\n // write post-init user code here\n}//GEN-BEGIN:|32-getter|2|\nreturn exitCommand1;\n}",
"public ExitEstaciona() {\n initComponents();\n }",
"private void printExitMenu() {\n System.out.println(\"Goodbye! Thanks for using the app!\");\n }",
"private void exitButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitButtonActionPerformed\n System.exit(0);\n }",
"public void exit() {\n System.out.println(\"Thank you for playing Nim\");\n }",
"public void exit() {\n\t\tSystem.exit(0);\n\t}",
"public void exit() {\n\t\tSystem.exit(0);\n\t}",
"@Override\n\tpublic void onExit() {\n\t\tlabelHelp = null;\n\t\tlayer_force = null;\n\t\tmSoundBtn = null;\n\t\tboxMessage = null;\n\n\t\tSystem.gc();\n\t\tsuper.onExit();\n\t}",
"abstract public void exit();",
"private void jmiExitActionPerformed(java.awt.event.ActionEvent evt) {\n System.exit(0);\r\n }",
"public static void printExitMessage() {\n printLine();\n System.out.println(\" Bye Bye for now! See you soon!\");\n printLine();\n }",
"IRBasicBlock getExit();",
"public void clickedQuitButton(Button button) {\r\n System.exit(0);\r\n }",
"@Override\n\t public void onExit() {\n\t\t super.onExit();\n\t }",
"@Override\n public void init(ArrayList<String> args) {\n label = args.get(0);\n }",
"private void _initLabels() \n {\n _lblName = _createNewLabel( \"Mother Teres@ Practice Management System\");\n _lblVersion = _createNewLabel(\"Version 1.0.1 (Beta)\");\n _lblAuthor = _createNewLabel( \"Company: Valkyrie Systems\" );\n _lblRealAuthor = _createNewLabel( \"Author: Hein Badenhorst\" );\n _lblDate = _createNewLabel( \"Build Date:\" );\n _lblRealDate = _createNewLabel( \"31 October 2010\");\n }",
"public Command getExitCommand() {\n if (exitCommand == null) {//GEN-END:|18-getter|0|18-preInit\n // write pre-init user code here\n exitCommand = new Command(\"Exit\", Command.EXIT, 0);//GEN-LINE:|18-getter|1|18-postInit\n // write post-init user code here\n }//GEN-BEGIN:|18-getter|2|\n return exitCommand;\n }",
"public Command getExitCommand() {\n if (exitCommand == null) {//GEN-END:|18-getter|0|18-preInit\n // write pre-init user code here\n exitCommand = new Command(\"Exit\", Command.EXIT, 0);//GEN-LINE:|18-getter|1|18-postInit\n // write post-init user code here\n }//GEN-BEGIN:|18-getter|2|\n return exitCommand;\n }",
"public abstract void exit();",
"public void exit() {\r\n\t\tdispose();\r\n\t}",
"public static void main(String[] args) {\n\t\t\n\t\tnew LabelEx();\n\n\t}",
"@Override\n\tpublic void onExit() {\n\t\t\n\t}",
"private static void exit(int i) {\n\t\t\n\t}",
"public void quit(String dummy) {\n System.exit(1);\n }",
"public void printExitMessage()\n {\n System.out.println(\"\\t _ _ _ _ \");\n System.out.println(\"\\t | | | | | | | | \");\n System.out.println(\"\\t | |_| | __ _ ___| |_ __ _ | | _ _ ___ __ _ ___ \");\n System.out.println(\"\\t | _ |/ _` / __| __/ _` | | | | | | |/ _ \\\\/ _` |/ _ \\\\ \");\n System.out.println(\"\\t | | | | (_| \\\\__ \\\\ || (_| | | |___| |_| | __/ (_| | (_) | \");\n System.out.println(\"\\t \\\\_| |_/\\\\__,_|___/\\\\__\\\\__,_| \\\\_____/\\\\__,_|\\\\___|\\\\__, |\\\\___/\");\n System.out.println(\"\\t __/ | \");\n System.out.println(\"\\t |___/ \");\n System.out.println(\" \");\n }",
"public Exit(int x, int y) {\n\n super('E');\n this.x = x;\n this.y = y;\n }",
"private void exitJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitJButtonActionPerformed\n System.exit(0);\n }",
"@Override\n public void exit() {\n model.exit();\n }",
"private void menu_ExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menu_ExitActionPerformed\n System.exit(0);\n }",
"int getExitNum() {\n return exitNum;\n }",
"public DoneUndefinedTaskException(int label) {\n this.label = label;\n }",
"@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\texit_click(e);\r\n\t\t\t}",
"private static void exit() {\n dvm.exit();\n stop = true;\n }",
"public void quit(){\n this.println(\"Bad news!!! The library has been cancelled!\");\n System.exit(0);\n\n }",
"public Hallway01(Boolean gui){\n super(\n \"Hallway01\", \n \"Hallway connecting Personal, Laser and Net.\",\n new Exit('S', \"Personal\"),\n new Exit('E', \"Laser\"),\n new Exit('E', \"Net\"),\n null, \n \"hallway01Map.txt\");\n }",
"private void btnKeluarActionPerformed(java.awt.event.ActionEvent evt) {\n System.exit(0);\n }",
"private void jButtonCancelActionPerformed() {\r\n\t\texit();\r\n\t}",
"private void createStartingLabel() {\n \tcreateLabel(myResources.getString(\"title\"), 1, 0, TITLE_FONT);\n }",
"@Override\n\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\texit = new ExitDialog();\n\t\t\t\t\t\t\t}",
"void exit();",
"public void quit() {System.exit(0);}",
"private void initExitView() {\n\t\tmExitConfirmView = mInflater.inflate(R.layout.exit_app_confirm, null);\r\n\t\tmComfirmExitBtn = (Button) mExitConfirmView\r\n\t\t\t\t.findViewById(R.id.confirm_exit_btn);\r\n\t\tmComfirmExitBtn.setOnClickListener(this);\r\n\t}",
"private void setExitScreen(String text){\n\t\t\n\t\tscreenUI.clearScreen();\n\t\tscreenUI.drawText(3, 1, text);\n\t\tscreenUI.drawText(2, 2, Languages.getMessages().get(chosenLanguage).get(\"goodbye\"));\n\t\tscreenUI.drawText(2, 3, Languages.getMessages().get(chosenLanguage).get(\"restart\"));\n\t}",
"Node exit();",
"public void exit() {\n try {\n processLine(\"exit\");\n } catch (NoSystemException ex) {\n\t\t\tLog.error(\"No System available. Please load a model before executing this command.\");\n }\n }",
"@Override\n\tpublic void traceExit(EntryMessage message) {\n\n\t}",
"public void onExit();",
"void jmiExit_actionPerformed(ActionEvent e) {\n System.out.println(\"Exiting Carrier Agent \");\n unregisterWithMasterServer(); //unregister when exited\n logWriter.writeLog(\"Terminating agent.\");\n System.exit(0);\n }",
"private void jb_CloseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jb_CloseActionPerformed\n System.exit(0);\n }",
"void onExit();",
"@FXML\n private void handleExit() {\n GuiSettings guiSettings = new GuiSettings(primaryStage.getWidth(), primaryStage.getHeight(),\n (int) primaryStage.getX(), (int) primaryStage.getY());\n logic.setGuiSettings(guiSettings);\n logic.displayAllTasks();\n resultDisplay.setFeedbackToUser(\"\");\n primaryStage.hide();\n }",
"public Label() {\n }",
"private void initialize() {\r\n this.add(getJMenuItemRestore()); // Generated\r\n\r\n this.add(getJMenuItemExit()); // Generated\r\n\r\n this.setLabel(\"WorkDayPlanner\");\r\n }",
"public LLabel() {\n this(\"\");\n }",
"private void jButtonCancelActionPerformed(java.awt.event.ActionEvent evt) {\n System.exit(0);\n \n }",
"public void setExited() {\n this.exited = true;\n }",
"private void jb_closeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jb_closeActionPerformed\n System.exit(0);\n }",
"private void exit() {\n audrey.setExtractingSample(false);\n // If we just extracted argument samples, let the following event know that we're done with\n // arguments.\n instrumentationContext.setLookingForFirstStatement(false);\n }",
"public static LabelTarget label() { throw Extensions.todo(); }",
"private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {\n System.exit(0);\r\n }",
"@Override\n\tpublic void msgExitHome() {\n\t\t\n\t}",
"@Override\n public void actionPerformed(ActionEvent e) {\n System.exit(1);\n }",
"private void quitButtonActionPerformed(ActionEvent evt) {\r\n\t\tlogger.info(\"Quit button Clicked.\");\r\n\t\tSystem.exit(0);\r\n\t}",
"public void\nsetNewLabel()\nthrows Exception\n{\n\tdouble lineLength = this.getNucLabelLineLength();\n\tif (lineLength <= 0.0)\n\t\tlineLength = ComplexDefines.NUCLABEL_LINE_LENGTH;\n\tthis.setNewLabel(\n\t\tnew Font(\"Helvetica\", Font.PLAIN, 12),\n\t\tthis.getParentSSData2D().getNucLabelLineWidth(),\n\t\tlineLength, Color.black, this.getID());\n}",
"private String getExitString()\n {\n String returnString = \"Exits:\\n\\t\";\n Set<String> keys = exits.keySet();\n if(exits.size() <= 0) {\n returnString += \"[None]\";\n return returnString;\n }\n for(String exit : keys) {\n returnString += \" [\" + exit + \"]\";\n }\n return returnString;\n }",
"public void exit()\r\n\t{\r\n\t\tmainFrame.exit();\r\n\t}",
"public void initExitBtn(){\n FontIcon homeIcon = new FontIcon(\"fa-sign-out\");\n homeIcon.setIconSize(30);\n homeIcon.setIconColor(new Color(1,1,1,1));\n signOutBtn.setGraphic(homeIcon);\n signOutBtn.setOnMouseEntered(new EventHandler<MouseEvent>() {\n @Override\n public void handle(MouseEvent event) {\n homeIcon.setIconColor(Color.web(\"#dcd7d7\"));\n }\n });\n signOutBtn.setOnMousePressed(new EventHandler<MouseEvent>() {\n @Override\n public void handle(MouseEvent event) {\n homeIcon.setIconColor(Color.web(\"#a59d9d\"));\n }\n });\n signOutBtn.setOnMouseExited(new EventHandler<MouseEvent>() {\n @Override\n public void handle(MouseEvent event) {\n homeIcon.setIconColor(Color.web(\"#ffffff\"));\n }\n });\n }"
] | [
"0.69901896",
"0.64447916",
"0.64250034",
"0.6361262",
"0.63216674",
"0.62782973",
"0.6270893",
"0.62607396",
"0.62607396",
"0.62597233",
"0.6240498",
"0.62393934",
"0.6233774",
"0.6228558",
"0.61842954",
"0.61759835",
"0.61432326",
"0.6136798",
"0.612116",
"0.6107895",
"0.6106372",
"0.61054695",
"0.6099131",
"0.6090634",
"0.604288",
"0.60308313",
"0.60262823",
"0.6023441",
"0.59882003",
"0.59815216",
"0.59761107",
"0.59740376",
"0.59607786",
"0.5957271",
"0.59513956",
"0.5922731",
"0.59140307",
"0.5883285",
"0.5858613",
"0.5858613",
"0.58534884",
"0.58474326",
"0.58419144",
"0.58382654",
"0.5824447",
"0.5821344",
"0.5818542",
"0.58173585",
"0.5804763",
"0.5778423",
"0.5778423",
"0.5766377",
"0.5758749",
"0.5746741",
"0.57416993",
"0.57302874",
"0.5729542",
"0.5728995",
"0.571937",
"0.5716509",
"0.570782",
"0.5698705",
"0.5697141",
"0.5694739",
"0.56927985",
"0.56921923",
"0.5690249",
"0.5682559",
"0.5681699",
"0.5679079",
"0.5669885",
"0.5669539",
"0.5668025",
"0.5654695",
"0.5637689",
"0.5636788",
"0.5633685",
"0.56305194",
"0.56241953",
"0.5623876",
"0.5614986",
"0.5613414",
"0.56095517",
"0.56059796",
"0.5603142",
"0.5596108",
"0.5593248",
"0.5589687",
"0.5583919",
"0.5573207",
"0.5571784",
"0.55667996",
"0.55628586",
"0.5561039",
"0.5558927",
"0.5558705",
"0.5547906",
"0.5546821",
"0.55437446",
"0.5539367"
] | 0.6721557 | 1 |
add the function to the exit label, it will exit system after clicked it will have the circle appear to indicate you are selected | private void initExitController() {
exit.setOnMouseClicked(event -> { System.exit(1); });
exit.setOnMouseExited(event -> { exit.setGraphic(null); });
exit.setOnMouseEntered(event -> { exit.setGraphic(new Circle(5)); });
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\texit_click(e);\r\n\t\t\t}",
"public void mouseClicked(MouseEvent e) {\n\t\t\tif(e.getSource()==exit){\n\t\t\t\tm.jumpTomanagerMenuUI();\t\t\t\n\t\t\t}\n\t\t\trepaint();\n\t\t}",
"public void showExit();",
"@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\tSystem.exit(0);\n\t\t\t}",
"public void exitButtonClicked() {\r\n\t\tSystem.exit(0); \r\n\t\treturn;\r\n\t}",
"public void mouseExited(MouseEvent e) {\n\t\t\t\texit.setFont(font1);\n\t\t\t}",
"private void btnCerrarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnCerrarMouseClicked\r\n \r\n System.exit(0);\r\n// TODO add your handling code here:\r\n }",
"public void Exit_button() {\n\t \t Stage stage = (Stage) btnExit.getScene().getWindow();\n\t \t \n\t \t stage.close();\n\t }",
"public void exitOptions()\n {\n System.out.println(\"\\n\\t\\t:::::::::::::::::::::::::::::::::::::::::\");\n System.out.println(\"\\t\\t| Select Options Below : |\");\n System.out.println(\"\\t\\t:::::::::::::::::::::::::::::::::::::::::\");\n System.out.println(\"\\t\\t| [1] Exit and Save Changes |\");\n System.out.println(\"\\t\\t| [2] Exit Without Save Any Changes |\");\n System.out.println(\"\\t\\t| [3] Back To Menu |\");\n System.out.println(\"\\t\\t=========================================\");\n System.out.print(\"\\t\\t Input the option number : \");\n }",
"private void jmiExitMouseClicked(java.awt.event.MouseEvent evt) {\n\r\n }",
"public void clickedQuitButton(Button button) {\r\n System.exit(0);\r\n }",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\n\t\t\t\tif(JOptionPane.showConfirmDialog(f4, \"Confrom if you want to exit\",\"Library Management System\",\n\t\t\t\t\t\tJOptionPane.YES_NO_OPTION)==JOptionPane.YES_NO_OPTION) {\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t}",
"@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\texit();\r\n\t\t\t}",
"public void actionPerformed(ActionEvent e) {\n\t\t\t\tdialogExit();\r\n\t\t\t}",
"public ActionListener exitSelected() {\n return new ActionListener() {\n\n @Override\n public void actionPerformed(ActionEvent e) {\n System.exit(0);\n }\n };\n }",
"private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {\n System.exit(0);\n }",
"private void ExitProc()\r\n\t{\r\n\t\tint n = JOptionPane.showConfirmDialog(\r\n\t\t\t frame ,\r\n\t\t\t \"EXIT NOF FreeWare ???\",\r\n\t\t\t \"--NOF--\",\r\n\t\t\t JOptionPane.YES_NO_OPTION);\r\n\t\t\r\n\t\t//user pressed result.\r\n\t\tswitch (n) \r\n\t\t{\r\n\t\tcase 0: //yes\r\n\r\n\t\t\tframe.dispose();\r\n\t\t\tl = new log(\"event\",\"Exit Software\",\"Exit Pressed - Thank you for using NOF Software.\");\r\n\t\t\terase del = new erase(StStr); //StStr);\r\n\t\t\t//del.erase_output(StStr);\r\n\t\t\tSystem.exit(0); // Exit Program\r\n\t\t\t\r\n\t\t\tbreak;\r\n\t\tcase 1: //no\r\n\t\t\tl = new log(\"event\",\"Exit_option\",\"Exit - have been canceled\");\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t}",
"private void closeBtnMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_closeBtnMouseClicked\n System.exit(0);\n }",
"private void btnExitActionPerformed(java.awt.event.ActionEvent evt) {\n System.exit(0);\n }",
"public void exitMenu(){\n }",
"@Override\n public void actionPerformed(ActionEvent e) {\n System.exit(1);\n }",
"private void btn_ExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_ExitActionPerformed\n System.exit(0);\n }",
"void close_actionPerformed(ActionEvent e){\n\t System.exit(0);\n\t }",
"private void exitAction() {\n\t}",
"@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tdoExit();\r\n\t\t\t}",
"public ExitMenu(){\n\t\tint n = showConfirmDialog(null,\"Exit Game\", \"Exiting Game\",JOptionPane.YES_NO_OPTION);\n\t\tif(n==0)\n\t\t\tSystem.exit(0);\t\t\n\t}",
"@FXML\n private void handleExit() {\n GuiSettings guiSettings = new GuiSettings(primaryStage.getWidth(), primaryStage.getHeight(),\n (int) primaryStage.getX(), (int) primaryStage.getY());\n logic.setGuiSettings(guiSettings);\n logic.displayAllTasks();\n resultDisplay.setFeedbackToUser(\"\");\n primaryStage.hide();\n }",
"protected void do_mntmExit_actionPerformed(ActionEvent arg0) {\n\t\tthis.dispose();\n\t}",
"public void mouseExited(MouseEvent e) {\n\t\t\t\tswitch(num){\n\t\t\t\tcase 1:\n\t\t\t\t\tconfirm.setIcon(new ImageIcon(\"src/image/userUi/confirm.png\") );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tcancel.setIcon(new ImageIcon(\"src/image/userUi/cancel.png\") );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}",
"private void menu_ExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menu_ExitActionPerformed\n System.exit(0);\n }",
"@Override\r\n\tpublic void mouseExited(MouseEvent e) {\n\t\tmsg=\"\";\r\n\t\tmsg+=\"You Exited the frame\";\r\n\t\t\r\n\t\tlabel.setText(msg);\r\n\t}",
"private void closeLabelMouseExited(java.awt.event.MouseEvent evt) {\n Border labelBorder = BorderFactory.createMatteBorder(1, 1, 1, 1, Color.black);\n closeLabel.setBorder(labelBorder);\n closeLabel.setForeground(Color.black);\n }",
"@Override\r\n\t\t\t\tpublic void actionPerformed(ActionEvent Event) {\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\tint reply = JOptionPane.showConfirmDialog(null, getPanel(), \"Exit\", JOptionPane.YES_NO_OPTION);\r\n\t\t\t\t\tif (reply == JOptionPane.NO_OPTION)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t System.exit(0);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}",
"private void jmiExitActionPerformed(java.awt.event.ActionEvent evt) {\n System.exit(0);\r\n }",
"private void exitButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitButtonActionPerformed\n System.exit(0);\n }",
"protected void ACTION_B_EXIT(ActionEvent e) {\n\t\tsetVisible(false);\r\n\t\tdispose();\r\n\t}",
"private void exitItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitItemActionPerformed\n System.exit(0);\n }",
"private void menu_lable_4MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_menu_lable_4MouseClicked\n // TODO add your handling code here:\n int x = JOptionPane.showConfirmDialog(this, \"You are not yet log out to current account, are yousure want to exit without logout!! and exit the system. Yes exit, No logout !\", \"Not logged out!!\", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE);\n switch (x) {\n case JOptionPane.YES_OPTION:\n this.dispose();\n System.exit(0);\n break;\n case JOptionPane.CANCEL_OPTION:\n break;\n default:\n this.log_out();\n new SubInterface_Login_Staff().setVisible(true);\n this.dispose();\n break;\n }\n }",
"private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {\n System.exit(0);\n }",
"@Override\n\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}",
"private void printExitMenu() {\n System.out.println(\"Goodbye! Thanks for using the app!\");\n }",
"public void actionPerformed(ActionEvent e) {\n if(e.getSource() == confirmButton) {\n setVisible(false); // causes all the add text \n }\n else if(e.getSource() == exitButton) {\n System.exit(0);\n }\n }",
"@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\r\n\t\t\t\tSystem.exit(0);\r\n\r\n\t\t\t}",
"private void actionOnClicExit() {\r\n\t\tframe.setVisible(false);\r\n\t\tframe.dispose();\r\n\t}",
"@Override\r\n\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\tSystem.exit(0);\r\n\t\t\t\t\t\r\n\t\t\t\t}",
"private void exitListener() {\n buttonPanel.getQuit().addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n toDoList.saveAll(fileLocation);\n System.exit(0);\n }\n });\n }",
"public void mouseExited(MouseEvent e) {\n\t\t\tif(work){\n\t\t\t\tif(num==1){\n\t\t\t\t\t\n\t\t\t\t\tsignIn.setIcon(new ImageIcon(\"src/image/userUi/sign in.png\") );\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse if(num==2){\n\t\t\t\t\tregister.setIcon(new ImageIcon(\"src/image/userUi/register.png\") );\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t}",
"public void initExitBtn(){\n FontIcon homeIcon = new FontIcon(\"fa-sign-out\");\n homeIcon.setIconSize(30);\n homeIcon.setIconColor(new Color(1,1,1,1));\n signOutBtn.setGraphic(homeIcon);\n signOutBtn.setOnMouseEntered(new EventHandler<MouseEvent>() {\n @Override\n public void handle(MouseEvent event) {\n homeIcon.setIconColor(Color.web(\"#dcd7d7\"));\n }\n });\n signOutBtn.setOnMousePressed(new EventHandler<MouseEvent>() {\n @Override\n public void handle(MouseEvent event) {\n homeIcon.setIconColor(Color.web(\"#a59d9d\"));\n }\n });\n signOutBtn.setOnMouseExited(new EventHandler<MouseEvent>() {\n @Override\n public void handle(MouseEvent event) {\n homeIcon.setIconColor(Color.web(\"#ffffff\"));\n }\n });\n }",
"private void btnKeluarActionPerformed(java.awt.event.ActionEvent evt) {\n System.exit(0);\n }",
"public void exit()\r\n\t{\r\n\t\tmainFrame.exit();\r\n\t}",
"private void exitForm(java.awt.event.WindowEvent evt) {\n int aux = Funcoes.voltar(\"Deseja voltar ao menu de opções?\",\"SIM\",\"NÃO\");\n if (aux == 1){\n new MenuOpcoes().setVisible(true);\n this.dispose();\n }\n }",
"private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {\n System.exit(0);\r\n }",
"private void exitButtonActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_exitButtonActionPerformed\n\tSystem.exit(0);\n }",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tSystem.exit(0);\n\n\t\t\t}",
"public void toExit() {\n int sure=JOptionPane.showConfirmDialog(rootPane,\"Are you sure to Exit?\");\n if(sure==JOptionPane.YES_OPTION)\n { \n System.exit(0);\n } \n }",
"@Override\n\t\t\tpublic void mouseExited(MouseEvent e) {\n\t\t\t\tlabel_3.setForeground(Color.black);\n\t\t\t\tsetCursor(Cursor.getDefaultCursor());\n\t\t\t}",
"private void jb_closeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jb_closeActionPerformed\n System.exit(0);\n }",
"private void dialogExit() {\n\t\tint result = showConfirmDialog(frmRentCalc, \"Вы действительно ходите выйти?\", \"Окно подтверждения\", YES_NO_OPTION, QUESTION_MESSAGE);\r\n\t\tif (result == YES_OPTION) {\r\n\t\t\tSystem.exit(0);\r\n\t\t} else {\r\n\t\t\tif (result == NO_OPTION) {\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private void jb_CloseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jb_CloseActionPerformed\n System.exit(0);\n }",
"public void exitToMenu()\n {\n exitToMenuFlag = true;\n }",
"private void initExitView() {\n exit = new Label(\"Exit Game\");\n exit.setPrefSize(200, 100);\n exit.setFont(Font.font(null, FontWeight.BOLD, 30));\n exit.setTextFill(Color.RED);\n exit.setEffect(getDropShadow());\n }",
"void exitShapeEditor();",
"private void jbtn_exitActionPerformed(ActionEvent evt) {\n\t\t\t\tJFrame frame = new JFrame(\"Exit\");\n\t\t \tif(JOptionPane.showConfirmDialog(frame,\"Confirm you want to exit\",\"Medicine Info\",JOptionPane.YES_NO_OPTION)==JOptionPane.YES_OPTION)\n\t\t \t{\n\t\t \t\t\n\t\t \t\tnew medicine();\n\t\t \t\tshow_medicine.this.setVisible(false);\n\t\t \t\t\n\t\t \t}\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tSystem.exit(0);\n\t\t\t}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tSystem.exit(0);\n\t\t\t}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tSystem.exit(0);\n\t\t\t}",
"private void exitJMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitJMenuItemActionPerformed\n System.exit(0);\n }",
"private void addQuitButtonFunction() {\n\t\tquitButton.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tGUIQuit quit = new GUIQuit();\n\t\t\t\tcloseFrame();\n\t\t\t}\t\t\n\t\t});\n\t}",
"private void jButtonCancelActionPerformed() {\r\n\t\texit();\r\n\t}",
"private void sairButtonActionPerformed(java.awt.event.ActionEvent evt) {\n System.exit(0);\n }",
"@Override\n public void actionPerformed(ActionEvent e) {\n System.exit(0);\n }",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tGUIQuit quit = new GUIQuit();\n\t\t\t\tcloseFrame();\n\t\t\t}",
"@Override\r\n\t\t\t\tpublic void mouseExited(MouseEvent e) {\n\t\t\t\t\tSim.setForeground(Color.darkGray);\r\n\t\t\t\t}",
"private void exitJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitJButtonActionPerformed\n System.exit(0);\n }",
"public void mouseExited(MouseEvent e) {\n\t\t\t\t\t\tswitch(num){\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\tright.setIcon(right0);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\tconfirm.setIcon(confirm0);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}",
"@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tSystem.exit(0);\r\n\t\t\t}",
"@Override\n\t\t\tpublic void mouseExited(MouseEvent e) {\n\t\t\t\tlabel_1.setForeground(Color.black);\n\t\t\t\tsetCursor(Cursor.getDefaultCursor());\n\t\t\t}",
"@Override\r\n\t\t\t\t\tpublic void mouseExited(MouseEvent e) {\n\t\t\t\t\t\tSim.setForeground(Color.DARK_GRAY);\r\n\t\t\t\t\t}",
"private void buttonMouseExit(Button btn){\r\n\t\tbtn.setBackground(\r\n\t\t\t\tnew Background(new BackgroundFill(Color.ALICEBLUE, new CornerRadii(0), new Insets(0)))); // set login button aliceblue with mouse exit\r\n\t\tbtn.setTextFill(Color.BLACK); // set text black\r\n\t}",
"public void exitApplication(){\r\n String message = coeusMessageResources.parseMessageKey(\r\n \"toolBarFactory_exitConfirmCode.1149\");\r\n int answer = CoeusOptionPane.showQuestionDialog(message,\r\n CoeusOptionPane.OPTION_YES_NO, CoeusOptionPane.DEFAULT_NO);\r\n if (answer == CoeusOptionPane.SELECTION_YES) {\r\n if( mdiForm.closeInternalFrames() ) {\r\n mdiForm.dispose();\r\n }\r\n }\r\n }",
"private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {\n System.exit(0);\n }",
"public void jMenuFileExit_actionPerformed(ActionEvent e) {\n System.exit(0);\n }",
"@Override\r\n\tpublic void mouseExited(MouseEvent e) {\n\t\tl1.setText(\"You exited the mouse\");\r\n\t}",
"@Override\n protected void clickAction(int numClicks) {\n exit(true);\n }",
"public void game_over() {\n JOptionPane.showMessageDialog(null,\"GAME OVER\",\"Titolo finestra mettici quello che vuoi\",1);\n\n System.exit(0);\n}",
"private void quitJMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_quitJMenuItemActionPerformed\n // TODO add your handling code here:\n System.exit(0);\n }",
"public void exit() {\n System.out.println(\"Thank you for playing Nim\");\n }",
"public void exit() {\r\n \t\t// Send a closing signat to main window.\r\n \t\tmainWindow.dispatchEvent(new WindowEvent(mainWindow, WindowEvent.WINDOW_CLOSING));\r\n \t}",
"@Override\n public void windowClosing(WindowEvent e)\n {\n gui.exitApp();\n }",
"@FXML\n void exitAddWindow() {\n drawMenuElements(false);\n window.setTitle(\"Timelines: Menu\");\n\n toggleMenuButtonVisibility(true);\n cancelTimelineButton.setVisible(false);\n cancelEventButton.setVisible(false);\n\n resetAddWindowFields();\n }",
"public void quit (ActionEvent aAe)\n\t{\n\t\t\tSystem.exit (0);\n\n\t}",
"void onExit();",
"@Override\n\t\t\tpublic void mouseExited(MouseEvent e) {\n\t\t\t\tlabel_2.setForeground(Color.black);\n\t\t\t\tsetCursor(Cursor.getDefaultCursor());\n\t\t\t}",
"private void quitButtonActionPerformed(ActionEvent evt) {\r\n\t\tlogger.info(\"Quit button Clicked.\");\r\n\t\tSystem.exit(0);\r\n\t}",
"private void menuitemExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuitemExitActionPerformed\n if ( mainApp != null ) {\n mainApp.btnExitActionPerformed(); // note call to method in Main class\n } else {\n System.exit( 0 );\n }\n }",
"private void exitForm(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_exitForm\n\n\n System.exit(0);\n\n\n }",
"@Override\r\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\tSystem.exit(0);\r\n\t\t}",
"public void menu()\r\n\t{\r\n\t\t//TODO\r\n\t\t//Exits for now\r\n\t\tSystem.exit(0);\r\n\t}",
"public void mouseExited(MouseEvent e) {\n\t\t\tswitch(num){\n\t\t\tcase 21:businessProcess.setIcon(businessProcessIcon0);\n\t\t\t\tbreak;\n\t\t\tcase 22:businessSituation.setIcon(businessSituationIcon0);\n\t\t\t\tbreak;\n\t\t\tcase 23:salesDetail.setIcon(salesDetailIcon0);\n\t\t\t\tbreak;\n\t\t\tcase 24:systemRecord.setIcon(systemRecordIcon0);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"public void mouseExited(MouseEvent e) {\n\t\t\t\t\tswitch(num){\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\tup.setIcon(upIconW);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tdown.setIcon(downIconW);\n\t\t\t\t\t\tbreak;\t\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\tinquire.setIcon(searchIconW);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 4:\n\t\t\t\t\t\tdelete.setIcon(deleteIconW);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 5:\n\t\t\t\t\t\tedit.setIcon(editIconW);\n\t\t\t\t\t\tbreak;\t\t\n\t\t\t\t\tcase 7:\n\t\t\t\t\t\tadd.setIcon(addIconW);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}"
] | [
"0.74208236",
"0.7366361",
"0.7336733",
"0.70751345",
"0.6920928",
"0.68931246",
"0.6890457",
"0.6856787",
"0.68511534",
"0.68371314",
"0.6830749",
"0.6798787",
"0.6790856",
"0.677995",
"0.67731476",
"0.67657006",
"0.67516583",
"0.67320067",
"0.6716764",
"0.6711638",
"0.6700477",
"0.6698143",
"0.66893756",
"0.6686437",
"0.66744787",
"0.6668899",
"0.66668284",
"0.6640812",
"0.6637396",
"0.6613689",
"0.6605608",
"0.6598795",
"0.659563",
"0.65835667",
"0.6582523",
"0.65718764",
"0.65703386",
"0.6560653",
"0.6552382",
"0.6551405",
"0.65507996",
"0.6543944",
"0.654197",
"0.6535206",
"0.6531669",
"0.6524276",
"0.6523765",
"0.6513385",
"0.6509316",
"0.6500699",
"0.6493781",
"0.64917547",
"0.6490448",
"0.64825404",
"0.64770097",
"0.64768034",
"0.64692557",
"0.6467963",
"0.64608014",
"0.64553237",
"0.64467317",
"0.64437324",
"0.6441912",
"0.64408284",
"0.64408284",
"0.64408284",
"0.6431684",
"0.64289814",
"0.64265054",
"0.64157575",
"0.6413904",
"0.6409976",
"0.64094895",
"0.64075613",
"0.64051026",
"0.6404346",
"0.63662237",
"0.6366172",
"0.636593",
"0.63646877",
"0.6359429",
"0.63583446",
"0.635701",
"0.63568467",
"0.63550794",
"0.63465625",
"0.6342704",
"0.6339852",
"0.63360995",
"0.6330933",
"0.63264257",
"0.6323761",
"0.63235825",
"0.6322182",
"0.63176996",
"0.6316048",
"0.6310654",
"0.6306185",
"0.63046956",
"0.6301198"
] | 0.66734755 | 25 |
the appearance of the exit view | private void initExitView() {
exit = new Label("Exit Game");
exit.setPrefSize(200, 100);
exit.setFont(Font.font(null, FontWeight.BOLD, 30));
exit.setTextFill(Color.RED);
exit.setEffect(getDropShadow());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public ExitControlView() {\n this.setSize(180,560);\n initSubviews();\n }",
"@FXML\n void exitAddWindow() {\n drawMenuElements(false);\n window.setTitle(\"Timelines: Menu\");\n\n toggleMenuButtonVisibility(true);\n cancelTimelineButton.setVisible(false);\n cancelEventButton.setVisible(false);\n\n resetAddWindowFields();\n }",
"private void initExitController() {\n exit.setOnMouseClicked(event -> { System.exit(1); });\n exit.setOnMouseExited(event -> { exit.setGraphic(null); });\n exit.setOnMouseEntered(event -> { exit.setGraphic(new Circle(5)); });\n }",
"@FXML\n void exitDeleteWindow() {\n\n// lists Elements in default mode\n drawMenuElements(false);\n\n// adds all main buttons, removes confirm and cancel buttons for delete\n toggleMenuButtonVisibility(true);\n toggleDeleteButtonVisibility(false);\n\n// creates a message for the user\n setMessage(\"Exited Delete Mode without deleting elements\", false);\n window.setTitle(\"Timelines: Menu\");\n }",
"public void showExit();",
"private void initExitView() {\n\t\tmExitConfirmView = mInflater.inflate(R.layout.exit_app_confirm, null);\r\n\t\tmComfirmExitBtn = (Button) mExitConfirmView\r\n\t\t\t\t.findViewById(R.id.confirm_exit_btn);\r\n\t\tmComfirmExitBtn.setOnClickListener(this);\r\n\t}",
"@FXML\n private void handleExit() {\n GuiSettings guiSettings = new GuiSettings(primaryStage.getWidth(), primaryStage.getHeight(),\n (int) primaryStage.getX(), (int) primaryStage.getY());\n logic.setGuiSettings(guiSettings);\n logic.displayAllTasks();\n resultDisplay.setFeedbackToUser(\"\");\n primaryStage.hide();\n }",
"public void initExitBtn(){\n FontIcon homeIcon = new FontIcon(\"fa-sign-out\");\n homeIcon.setIconSize(30);\n homeIcon.setIconColor(new Color(1,1,1,1));\n signOutBtn.setGraphic(homeIcon);\n signOutBtn.setOnMouseEntered(new EventHandler<MouseEvent>() {\n @Override\n public void handle(MouseEvent event) {\n homeIcon.setIconColor(Color.web(\"#dcd7d7\"));\n }\n });\n signOutBtn.setOnMousePressed(new EventHandler<MouseEvent>() {\n @Override\n public void handle(MouseEvent event) {\n homeIcon.setIconColor(Color.web(\"#a59d9d\"));\n }\n });\n signOutBtn.setOnMouseExited(new EventHandler<MouseEvent>() {\n @Override\n public void handle(MouseEvent event) {\n homeIcon.setIconColor(Color.web(\"#ffffff\"));\n }\n });\n }",
"private void initExit() {\n initExitView();\n initExitController();\n }",
"@Override\n\tpublic void windowClosing(WindowEvent we) {\n\t\tif (we.getSource() == this) {\n\t\t\tdExit.setBounds(this.getX() + this.getWidth() / 2 - dExit_Width / 2,\n\t\t\t\tthis.getY() + this.getHeight() /2 - dExit_Height / 2,\n\t\t\t\tdExit_Width, dExit_Height);\n\t\t\tdExit.setVisible(true);\n\t\t}\n\t\telse if (we.getSource() == dColor) {\n\t\t\tdColor.setVisible(false);\n\t\t\t\n\t\t}\n\t\telse if (we.getSource() == dExit) {\n\t\t\tdExit.setVisible(false);\n\t\t}\n\t}",
"@Override\r\n public void drawExit()\r\n {\r\n\tdraw();\r\n\tif (_transition != null)\r\n\t _transition.draw();\r\n }",
"protected void ACTION_B_EXIT(ActionEvent e) {\n\t\tsetVisible(false);\r\n\t\tdispose();\r\n\t}",
"private JPanel createExitPanel() {\n JPanel panel = new JPanel();\n panel.setLayout(new MigLayout());\n panel.setPreferredSize(new Dimension(400, 50));\n panel.setOpaque(true);\n panel.setBorder(BorderFactory.createTitledBorder(\n localization.get(\"ExitsTitle\")));\n return panel;\n }",
"public void Exit_button() {\n\t \t Stage stage = (Stage) btnExit.getScene().getWindow();\n\t \t \n\t \t stage.close();\n\t }",
"public void setExitButton() {\n clickable = true;\n endButton.setVisibility(View.VISIBLE);\n }",
"private void actionOnClicExit() {\r\n\t\tframe.setVisible(false);\r\n\t\tframe.dispose();\r\n\t}",
"@Override\n public void onBackPressed() {\n AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.MyTheme);\n builder.setMessage(R.string.do_u_want_exit_app)\n .setCancelable(false)\n .setPositiveButton(R.string.yes,\n new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n dialog.cancel();\n onExit();\n\n }\n })\n .setNegativeButton(R.string.no,\n new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n dialog.cancel();\n }\n });\n builder.show();\n }",
"public ExitRenderer(TileRenderer tileRenderer, boolean isDark) {\r\n super(tileRenderer, isDark);\r\n\r\n imageSize = (int) (size * 0.8);\r\n }",
"public Exit()\n {\n super(\"Exit\");\n putValue(Action.NAME, \"Exit\");\n IconSetter iconSetter = new IconSetter(\"/config/images/exiticon.gif\");\n Icon icon = iconSetter.getIcon();\n putValue(Action.SMALL_ICON, icon);\n putValue(Action.ACCELERATOR_KEY,\n KeyStroke.getKeyStroke('Q',\n Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), false));\n putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_Q));\n }",
"public Component exitButton() {\n exitButton = new JButton(\"Exit\");\n setFocusable(false);\n return exitButton;\n }",
"@Override\n\tpublic void hideContents() {\n\t\tprogram.setBackground(null);\n\t\tprogram.remove(returnToMain);\n\t\tprogram.remove(congratMessage);\n\t\t\n\t}",
"@Override\n\tprotected boolean inputExit(View view, DragEvent event)\n\t{// Give back red color\n\t\tview.setBackgroundColor(CLEAR);\n\t\treturn true;\n\t}",
"public void helpPaneClose(ActionEvent actionEvent) {\n darkPane.setDisable(true);\n darkPane.setVisible(false);\n helpPane.setDisable(true);\n helpPane.setVisible(false);\n }",
"public void createPaneClose(ActionEvent actionEvent) {\n createTeamPane.setDisable(true);\n createTeamPane.setVisible(false);\n darkPane.setDisable(true);\n darkPane.setVisible(false);\n logoChangeImageCreate.setImage(new Image(\"/Resources/Images/emptyTeamLogo.png\"));\n createTeamLogoFile = null;\n }",
"void btn_Exit_actionPerformed(ActionEvent e) {\n\t\t// TODO : changer le behaviour oneshot ? le remplacer par le notre ?\n m_owner.addBehaviour( new OneShotBehaviour() {\n public void action() {\n ((TinderSupervisorAgent) myAgent).terminateHost();\n }\n } );\n }",
"void onExit();",
"public ExitMenu(){\n\t\tint n = showConfirmDialog(null,\"Exit Game\", \"Exiting Game\",JOptionPane.YES_NO_OPTION);\n\t\tif(n==0)\n\t\t\tSystem.exit(0);\t\t\n\t}",
"@Override\n\tpublic void onExit() {\n\t\t\n\t}",
"public void onExit();",
"public void Exit() {\r\n \tsuper.onBackPressed();\r\n }",
"private void exitAction() {\n\t}",
"@FXML\r\n void exit(ActionEvent event) {\r\n \tSystem.out.println(\"Student Account Working Controller\");\r\n \t((Node) event.getSource()).getScene().getWindow().hide();\r\n }",
"public void exitMenu(){\n }",
"public void mouseClicked(MouseEvent e) {\n\t\t\tif(e.getSource()==exit){\n\t\t\t\tm.jumpTomanagerMenuUI();\t\t\t\n\t\t\t}\n\t\t\trepaint();\n\t\t}",
"public JButton getExitButton() {\n\t\treturn exitButton;\n\t}",
"@Override\n public void onDismiss() {\n backgroundAlpha(1f);\n }",
"public void exitWindow()\n {\n //hide all windows except intro screen\n introScreen.setVisible(true);\n optionsScreen.setVisible(false);\n instructionScreen.setVisible(false);\n gameSelectScreen.setVisible(false);\n lobbyScreen.setVisible(false);\n revealedCardsScreen.setVisible(false);\n accusationScreen.setVisible(false);\n mainGameScreen.setVisible(false);\n\n clientController.leaveLobby();\n\n //set state to INTRO\n state = CurrentWindow.INTRO;\n }",
"@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\texit();\r\n\t\t\t}",
"private void finalScreen() {\r\n\t\tdisplay.setLegend(GAME_OVER);\r\n\t\tdisplay.removeKeyListener(this);\r\n\t}",
"private void buttonMouseExit(Button btn){\r\n\t\tbtn.setBackground(\r\n\t\t\t\tnew Background(new BackgroundFill(Color.ALICEBLUE, new CornerRadii(0), new Insets(0)))); // set login button aliceblue with mouse exit\r\n\t\tbtn.setTextFill(Color.BLACK); // set text black\r\n\t}",
"public void doExit(View view) {\n mainHelper.restart();\n setContentView(R.layout.fragment_main_activity_ttt);\n }",
"public static void printExitMsg() {\r\n CmdUx.printHBars(EXIT_MSG);\r\n }",
"private void printExitMenu() {\n System.out.println(\"Goodbye! Thanks for using the app!\");\n }",
"@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tdoExit();\r\n\t\t\t}",
"private void onExit()\n {\n if (settings.window_size_remember)\n {\n settings.window_size_last = html_panel.getSize();\n settings.saveWindowSize();\n }\n \n System.exit(1);\n }",
"public void closeButtonPushed(ActionEvent actionEvent) {\n editTeamPane.setDisable(true);\n editTeamPane.setVisible(false);\n darkPane.setDisable(true);\n darkPane.setVisible(false);\n editTeamLogoFile = null;\n }",
"@Override\n public void onBackPressed() {\n new AlertDialog.Builder(this)\n .setTitle(\"EXIT?\")\n .setIcon(R.drawable.exit)\n .setMessage(\"Are u sure you want to exit\")\n .setCancelable(false)\n .setPositiveButton(\"Exit\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n finishAffinity();\n }\n })\n .setNegativeButton(\"Stay\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n dialogInterface.dismiss();\n }\n })\n .create().show();\n }",
"public void quitnow(View view){\n finish();\n System.exit(0);\n }",
"@Override\n public void mouseExited(MouseEvent e) {\n setBorderPainted(false);\n setForeground(Color.BLACK);\n }",
"public void mouseExited(MouseEvent e) {\n\t\t\t\texit.setFont(font1);\n\t\t\t}",
"protected void createContents() {\n\t\tsetText(\"Termination\");\n\t\tsetSize(340, 101);\n\n\t}",
"@FXML\n public void resetLogout()\n {\n logoutButton.setOnMouseExited(mouseEvent -> logoutButton.setTextFill(Color.WHITE));\n }",
"@FXML\n public void btnExitClicked(){\n System.exit(1);\n }",
"private GridPane absencePane(){\n GridPane absencePane = new GridPane();\n \n Button menuButton = new Button(\"Back to employee menu\");\n menuButton.setOnAction(e->menu());\n \n absencePane.add(menuButton, 2,1);\n absencePane.setAlignment(Pos.CENTER);\n\n return absencePane;\n }",
"void exitShapeEditor();",
"@FXML\n public void resetMainMenu()\n {\n mainMenuButton.setOnMouseExited(mouseEvent -> mainMenuButton.setTextFill(Color.WHITE));\n }",
"private void returnHome() {\n parentPane.getChildren().clear();\n parentPane.setTop(mainMenu);\n parentPane.setCenter(imgHome);\n }",
"@Override\n public void onExitAmbient() {\n\n Toast.makeText(getApplicationContext(), \"Exit\", Toast.LENGTH_LONG).show();\n }",
"private void setExitScreen(String text){\n\t\t\n\t\tscreenUI.clearScreen();\n\t\tscreenUI.drawText(3, 1, text);\n\t\tscreenUI.drawText(2, 2, Languages.getMessages().get(chosenLanguage).get(\"goodbye\"));\n\t\tscreenUI.drawText(2, 3, Languages.getMessages().get(chosenLanguage).get(\"restart\"));\n\t}",
"@Override\n public void exit()\n {\n\t ((ControllerHost)getHost()).showPopupNotification(\"Chord Buddy Exited\");\n }",
"public void setOutside(View view) {\n\t\tlocation = \"Outside\";\n\t\tresetButtonStyles();\n\t\tButton outsideButton = (Button) findViewById(R.id.outside);\n\t\tint pink = Color.parseColor(\"#D75A5D\");\n\t\toutsideButton.setBackgroundColor(pink);\t\n\t}",
"public void exit() {\r\n \t\t// Send a closing signat to main window.\r\n \t\tmainWindow.dispatchEvent(new WindowEvent(mainWindow, WindowEvent.WINDOW_CLOSING));\r\n \t}",
"public void windowBecameFront() \n {\n return; \n }",
"@Override\r\n\t\t\t\t\tpublic void mouseExited(MouseEvent e) {\n\t\t\t\t\t\tSim.setForeground(Color.DARK_GRAY);\r\n\t\t\t\t\t}",
"@Override\n public void onBackPressed() {\n confirmExit();\n }",
"@FXML\n private void exitMenuItem() {\n\n // Exit the entire application\n Platform.exit();\n }",
"@FXML void handleExitForm()\n {\n Stage stage = (Stage) exitForm.getScene().getWindow();\n stage.close();\n }",
"@Override\n\t public void onExit() {\n\t\t super.onExit();\n\t }",
"public void exit(View v) {\n finish();\n }",
"public void exitToMenu()\n {\n exitToMenuFlag = true;\n }",
"@Override\r\n\tpublic void exit() {\n\t\t\r\n\t}",
"private void handleMouseExit(MouseEvent mouseEvent) {\n if (simulator.isEditable()) {\n setColor();\n }\n }",
"@Override\n public void windowClosing(java.awt.event.WindowEvent e) {\n setVisible(false);\n }",
"private void Exit() {\r\n this.dispose();\r\n app.setVisible(true);\r\n }",
"public void paintFinalScreen() {\n\t\tapp.image(end, 0, 0);\n\t}",
"@Override\r\n\t\t\t\tpublic void mouseExited(MouseEvent e) {\n\t\t\t\t\tSim.setForeground(Color.darkGray);\r\n\t\t\t\t}",
"public void exit() {\r\n\t\tdispose();\r\n\t}",
"public void mouseExited(MouseEvent e) {\n\t\t\t\t\t\tswitch(num){\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\tright.setIcon(right0);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\tconfirm.setIcon(confirm0);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}",
"protected void do_mntmExit_actionPerformed(ActionEvent arg0) {\n\t\tthis.dispose();\n\t}",
"public void backMenu() {\n openWindowGeneral(\"/gui/administrator/fxml/FXMLMenuAdministrator.fxml\", btnCancel);\n }",
"@Override\n public void onBackPressed() {\n exitReveal();\n\n super.onBackPressed();\n }",
"@Override\n\tpublic void hideContents() {\n\t\tprogram.remove(Background);\n\t\tprogram.remove(lvl1);\n\t\tprogram.remove(lvl2);\n\t\tprogram.remove(lvl3);\n\t\tprogram.remove(Back);\n\t}",
"public void mouseExited(java.awt.event.MouseEvent evt) {\n button.setForeground(coloursObject.getButtonTextColour());//the colour of the text when the cursor is removed\n button.setBackground(coloursObject.getTitlePanelColour());\n }",
"void windowClosed();",
"private void dialogExit() {\n\t\tint result = showConfirmDialog(frmRentCalc, \"Вы действительно ходите выйти?\", \"Окно подтверждения\", YES_NO_OPTION, QUESTION_MESSAGE);\r\n\t\tif (result == YES_OPTION) {\r\n\t\t\tSystem.exit(0);\r\n\t\t} else {\r\n\t\t\tif (result == NO_OPTION) {\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void confirmExit() {\n boolean confirmOnExit = getIntent().getExtras().getBoolean(MapsActivity.PARAMETERS.CONFIRM_ON_EXIT, true);\n if (confirmOnExit) {\n new AlertDialog.Builder(this).setTitle(R.string.button_confirm_exit_title)\n .setMessage(R.string.button_confirm_exit)\n .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int which) {\n finish();\n return;\n }\n }).setNegativeButton(android.R.string.no, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int which) {\n // do nothing\n }\n }).show();\n } else {\n finish();\n }\n }",
"@Override\n public void windowClosing(WindowEvent e) {\n new Thread() {\n @Override\n public void run() {\n if (animator.isStarted()) animator.stop();\n System.exit(0);\n }\n }.start();\n }",
"@Override\n public void windowClosing(WindowEvent e) {\n new Thread() {\n @Override\n public void run() {\n if (animator.isStarted()) animator.stop();\n System.exit(0);\n }\n }.start();\n }",
"@FXML protected void doExit(ActionEvent event) {\n\t\tmodel.exit();\n\t}",
"@Override\n public void exit() {\n super.exit();\n }",
"public void exit()\r\n\t{\r\n\t\tmainFrame.exit();\r\n\t}",
"@Override\n public void closeWindow() {\n \n }",
"public void onClosingFinished() {\n super.onClosingFinished();\n resetHorizontalPanelPosition();\n setClosingWithAlphaFadeout(false);\n }",
"@Override\n\tpublic void destroy() {\n\t\tif(!isVisible())\n\t\t{\n\t\t\tSystem.out.println(\"敌机销毁\");\n\t\t}\n\t}",
"@Override\n public void windowClosing(WindowEvent e) {\n System.exit(0);\n // super.windowClosing(e);\n }",
"@Override\n\tpublic void exit() {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}",
"@Override\n\tpublic void onBackPressed() {\n\t\tif(relativeLayoutregist.getVisibility()==View.INVISIBLE)\n\t\t{\n\t\t\trelativeLayoutregist.setVisibility(View.VISIBLE);\n\t\t\trelativeLayouttijiao.setVisibility(View.INVISIBLE);\n\t\t}\n\t\telse {\n\t\t\tsuper.onBackPressed();\n\t\t}\n\n\t}",
"@FXML private void backOut(ActionEvent event) {\n try {\n FXMLLoader loader = new FXMLLoader(getClass().getResource(\"/Views/mainScreen.fxml\"));\n mainScreen controller = new mainScreen(false);\n\n loader.setController(controller);\n Parent root = loader.load();\n Scene scene = new Scene(root);\n Stage stage = (Stage) ((Node) event.getSource()).getScene().getWindow();\n stage.setScene(scene);\n stage.setResizable(false);\n stage.show();\n } catch (Exception e) {e.printStackTrace();}\n }",
"private void control()\r\n\t\t{\r\n\t\tsetDefaultCloseOperation(EXIT_ON_CLOSE);\r\n\t\t}",
"private void control()\r\n\t\t{\r\n\t\tsetDefaultCloseOperation(EXIT_ON_CLOSE);\r\n\t\t}"
] | [
"0.71553946",
"0.6811288",
"0.67881924",
"0.6623195",
"0.65080154",
"0.6485635",
"0.6340896",
"0.6275456",
"0.6212231",
"0.6210195",
"0.61330014",
"0.61317337",
"0.60822487",
"0.6014504",
"0.59904826",
"0.59503347",
"0.59423375",
"0.59416366",
"0.5940294",
"0.5921547",
"0.59140927",
"0.58590406",
"0.58421946",
"0.5828957",
"0.5797948",
"0.57954425",
"0.5791317",
"0.5779894",
"0.5771928",
"0.57567596",
"0.575525",
"0.57435596",
"0.5718218",
"0.57132304",
"0.5708061",
"0.5702219",
"0.57017976",
"0.57013786",
"0.5695351",
"0.56910306",
"0.5679462",
"0.5678073",
"0.56755906",
"0.5665616",
"0.5663741",
"0.56598884",
"0.5658778",
"0.56562454",
"0.5653656",
"0.56446517",
"0.5639772",
"0.5634469",
"0.5627492",
"0.5617701",
"0.5614809",
"0.56127995",
"0.5608412",
"0.5608219",
"0.56058466",
"0.56042504",
"0.56007254",
"0.5600463",
"0.5589409",
"0.5585993",
"0.5580155",
"0.55730635",
"0.5572422",
"0.5569862",
"0.55681634",
"0.5567359",
"0.55630517",
"0.5551921",
"0.5548284",
"0.55389726",
"0.5537431",
"0.5529321",
"0.55218387",
"0.55092627",
"0.550763",
"0.54907674",
"0.5488304",
"0.54748076",
"0.5471042",
"0.5467988",
"0.5463622",
"0.54623836",
"0.5461257",
"0.5461257",
"0.5460342",
"0.546031",
"0.5459137",
"0.54573876",
"0.5455097",
"0.545298",
"0.5438069",
"0.5437786",
"0.5436153",
"0.54354155",
"0.543397",
"0.543397"
] | 0.7582104 | 0 |
initialize the simulate mode | private void initSimulateMode() {
initSimulateModeView();
initSimulateModeController();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void initSimulateModeController() {\n simulateMode.setOnMouseClicked(event -> {\n SimulatorMain sm = null;\n try { sm = new SimulatorMain(); }\n catch (Exception e) { e.printStackTrace(); }\n sm.start(SimulatorMain.stage);\n });\n simulateMode.setOnMouseEntered(event -> { simulateMode.setGraphic(new Circle(5)); });\n simulateMode.setOnMouseExited(event -> { simulateMode.setGraphic(null); });\n }",
"@Override\r\n\tpublic void simulate() {\n\t\t\r\n\t}",
"private void initSimulateModeView() {\n simulateMode = new Label(\"SIMULATE\");\n simulateMode.setPrefSize(200, 100);\n simulateMode.setFont(Font.font(null, FontWeight.BOLD, 30));\n simulateMode.setTextFill(Color.ORANGE);\n simulateMode.setEffect(getDropShadow());\n }",
"public void quickSimulation() {\n\t\tnew SimulationControleur();\n\t}",
"@Override\r\n public void runSimulation(){\r\n initialize();\r\n initialRun();\r\n initialize(\"square\");\r\n initialRun();\r\n initialize(\"circle\");\r\n initialRun();\r\n initialize(\"crack\");\r\n initialRun(); \r\n initialize(\"cross\");\r\n initialRun();\r\n }",
"public void setupSimulation() {\n final Timer timerStatus = new Timer();\n\n TimerTask taskUpdateFood = new TimerTask() {\n @Override\n public void run() {\n terrain.toggleFood();\n }\n };\n timerStatus.schedule(taskUpdateFood, 0, 1000);\n\n startTime = System.currentTimeMillis();\n }",
"public void startSimulation();",
"private void initSimulation()\r\n {\r\n int mark = rn.nextInt(2);\r\n if(mark == 0)\r\n {\r\n computer.setMarker(Marker.cross);\r\n marker = computer.getMarker();\r\n computer2.setMarker(Marker.circle);\r\n computer.makeMove(this);\r\n turn = 2;\r\n }\r\n else\r\n {\r\n computer.setMarker(Marker.circle);\r\n computer2.setMarker(Marker.cross);\r\n marker = computer2.getMarker();\r\n computer2.makeMove(this);\r\n turn = 1;\r\n }\r\n bh.setBoard(this);\r\n simtime.start();\r\n }",
"public abstract void simulate();",
"public Simulator(){}",
"public void autonomousInit() {\n Jagbot.isAutonomous = true;\n int mode = (int)SmartDashboard.getNumber(RobotMap.Autonomous.MODE_KEY);\n switch (mode) {\n case 0:\n System.out.println(\"Standing still\");\n new StandStill().start();\n break;\n case 1:\n System.out.println(\"Driving forward\");\n new DriveStraight(1).start();\n break;\n \n case 2:\n System.out.println(\"Turning left and shooting to score\");\n new TurnAndScore(-1).start();\n break;\n case 3:\n System.out.println(\"Turning right and shooting to score\");\n new TurnAndScore(1).start();\n break;\n }\n }",
"public simulation() {\n\n }",
"public void autonomousInit() {\n\t\tSystem.out.println(\"Auto Init\");\n//\t\tint autonStep = 0;\t//step that autonomous is executing\n\t\tclaw = new Claw();\n\t\televator = new Elevator();\n//\t\televator.elevator();\n\t\tdecode = new Decode();\n//\t\tdecode.decode();\n\t}",
"protected void initialize() {\n \ttime.start();\n \tRobot.camera.setExposureManual(20);\n \tzach();\n\t\tSystem.out.println(\"josh\");\n\t\t\n }",
"protected void initializeExecutionRandomness() {\r\n\r\n\t}",
"protected void setup() {\n\t\t\n\n\n\t\tif(PropertiesLoaderImpl.IS_MAIN_SIMULATION_NODE)addBehaviour(new HandleClockBehaviour(this, TimeRateControl));\n\t\telse addBehaviour(new SlaveNodeClockBehaviour(this, TimeRateControl));\n\t\t\n\t\tif(PropertiesLoaderImpl.DEBUG) System.out.println(this.getName() +\" alive!!!!!!!!!!\\nStarting the simulation time\");\n\t\t\n\t\n\t\t\tSimulationClock.getInstance().setSimulationStarted(true);\n\t\n\t}",
"@Override\n\tpublic void testInit() {\n\t\tif (autonomousCommand != null)\n ((Command) autonomousCommand).cancel();\n \n\t\tprocessRobotModeChange(RobotMode.TEST);\n\t}",
"public void autonomousInit() {\n //autonomousCommand = (Command) chooser.getSelected();\n autoLoopCounter = 0; //This resets the loop counter to 0\n //if (autonomousCommand != null) autonomousCommand.start();\n }",
"SimulatedAnnealing() {\n generator = new Random(System.currentTimeMillis());\n }",
"public void robotInit() {\n\t\toi = new OI();\n chooser = new SendableChooser();\n chooser.addDefault(\"Default Auto\", new ExampleCommand());\n// chooser.addObject(\"My Auto\", new MyfAutoCommand());\n SmartDashboard.putData(\"Auto mode\", chooser);\n \n //Drive\n //this.DriveTrain = new DriveTrain();\n \t//RobotMap.robotDrive1.arcadeDrive(oi.stickLeft);\n \n //Buttons\n // oi.button1.whenPressed(new SetMaxMotorOutput());\n \n //Ultrasonic\n sonic1 = new Ultrasonic(0,1);\n sonic1.setAutomaticMode(true);\n \n }",
"public void robotInit()\n\t{\n\t\toi = new OI();\n\t\t// instantiate the command used for the autonomous period\n\t\t// autonomousCommand = new Driver();\n\t}",
"public void teleopInit() {\n // Initalize test command\n Jagbot.isAutonomous = false;\n MessageWindow.write(1, \"Robot init\");\n //testCommand = new TestCommand();\n //testCommand.start();\n }",
"protected void initialize() {\n \ttarget = (int) SmartDashboard.getNumber(\"target\", 120);\n \ttarget = (int) (target * Constants.TICKS_TO_INCHES);\n\t\tRobot.drive.stop();\n\t\tmaxCount = (int) SmartDashboard.getNumber(\"max count\", 0);\n\t\ttolerance = (int) SmartDashboard.getNumber(\"tolerance\", 0);\n\t\tRobot.drive.left.motor1.setSelectedSensorPosition(0, Constants.kPIDLoopIdx, Constants.kTimeoutMs);\n\t\tRobot.drive.right.motor1.setSelectedSensorPosition(0, Constants.kPIDLoopIdx, Constants.kTimeoutMs);\n }",
"public abstract int simulate();",
"public void init() {\n // Define and Initialize Motors (note: need to use reference to actual OpMode).\n leftDrive = myOpMode.hardwareMap.get(DcMotor.class, \"left_drive\");\n rightDrive = myOpMode.hardwareMap.get(DcMotor.class, \"right_drive\");\n armMotor = myOpMode.hardwareMap.get(DcMotor.class, \"arm\");\n\n // To drive forward, most robots need the motor on one side to be reversed, because the axles point in opposite directions.\n // Pushing the left stick forward MUST make robot go forward. So adjust these two lines based on your first test drive.\n // Note: The settings here assume direct drive on left and right wheels. Gear Reduction or 90 Deg drives may require direction flips\n leftDrive.setDirection(DcMotor.Direction.REVERSE);\n rightDrive.setDirection(DcMotor.Direction.FORWARD);\n\n // If there are encoders connected, switch to RUN_USING_ENCODER mode for greater accuracy\n // leftDrive.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n // rightDrive.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n\n // Define and initialize ALL installed servos.\n leftHand = myOpMode.hardwareMap.get(Servo.class, \"left_hand\");\n rightHand = myOpMode.hardwareMap.get(Servo.class, \"right_hand\");\n leftHand.setPosition(MID_SERVO);\n rightHand.setPosition(MID_SERVO);\n\n myOpMode.telemetry.addData(\">\", \"Hardware Initialized\");\n myOpMode.telemetry.update();\n }",
"protected AutonomousMode() {\n driveMotions = new Vector();\n auxMotions = new Vector();\n }",
"@Override\n public void init() {\n robot = new MecanumBotHardware(true,true,true,true);\n robot.init(hardwareMap);\n int deg180=845;\n // Create the state machine and configure states.\n smDrive = new StateMachine(this, 16);\n smDrive.addStartState(new WaitState(\"wait\",0.1,\"MainDriveTeleop\"));\n smDrive.addState(new GigabyteTeleopDriveState(\"MainDriveTeleop\", robot));\n smDrive.addState(new SpinPose(\"90DegSpin\",(int)(deg180*0.5),robot,0.1f));\n smDrive.addState(new SpinPose(\"180DegSpin\",deg180,robot,0.1f));\n smDrive.addState(new SpinPose(\"270DegSpin\",(int)(deg180*1.5),robot,0.1f));\n\n smArm = new StateMachine(this, 16);\n smArm.addStartState(new WaitState(\"wait\",0.1,\"MainArmTeleop\"));\n smArm.addState(new GigabyteTeleopArmState(\"MainArmTeleop\", robot));\n smArm.addState(new ShoulderPose(\"Pose1\", robot,0, \"MainArmTeleop\"));//0.12\n smArm.addState(new ShoulderPose(\"Pose2\", robot,1079, \"MainArmTeleop\"));//0.05\n smArm.addState(new ShoulderPose(\"Pose3\", robot,2602, \"MainArmTeleop\"));//-0.17\n smArm.addState(new ShoulderPose(\"Pose4\", robot,3698, \"MainArmTeleop\" ));//-0.35\n // Init the state machine\n smDrive.init();\n smArm.init();\n }",
"public void robotInit() {\n\t\toi = new OI();\n // instantiate the command used for the autonomous period\n }",
"public void autonomousInit() {\n\t\tswitch (autoMode) {\r\n\t\tcase 0:\r\n\t\t\tauto = new G_NoAuto();\r\n\t\t\tbreak;\r\n\t\tcase 1:\r\n\t\t\tauto = new G_Step();\r\n\t\t\tbreak;\r\n\t\tcase 2:\r\n\t\t\tauto = new G_BlockThenFour();\r\n\t\t\tbreak;\r\n\t\tcase 3:\r\n\t\t\tauto = new G_BinTwoLeft();\r\n\t\t\tbreak;\r\n\t\tcase 4:\r\n\t\t\tauto = new G_StepBinCentre();\r\n\t\t\tbreak;\r\n\t\tcase 5:\r\n\t\t\tauto = new G_StepBinLeft();\t\r\n\t\t\tbreak;\r\n\t\tcase 6:\r\n\t\t\tauto = new G_Block();\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\t//Start the chosen Autonomous command. \r\n\t\tauto.start();\r\n\t\t//Cancel the tele-op command, in case it was running before autonomous began. \r\n\t\tteleop.cancel();\r\n\t\t// Start pushing sensor readings to the SD.\r\n\t\treadings.start();\r\n\r\n\t}",
"private void MotorInit()\n {\n intake_up.configFactoryDefault();\n intake_down.configFactoryDefault();\n intake_up.configOpenloopRamp(Constants.kMotorRampRate);\n intake_down.configOpenloopRamp(Constants.kMotorRampRate);\n intake_up.setInverted(PortReversed.intake_up_reversed.value);\n intake_down.setInverted(PortReversed.intake_down_reversed.value);\n intake_up.setNeutralMode(NeutralMode.Brake);\n intake_down.setNeutralMode(NeutralMode.Brake);\n }",
"@Override\n public void init() {\n\n robot.init(hardwareMap);\n\n // Tell the driver that initialization is complete.\n\n telemetry.addData(\"Robot Mode:\", \"Initialized\");\n telemetry.update();\n }",
"public abstract void initMode();",
"private void runSimulation() throws Exception{\n\t\tsimulatable.simulate();\n\t\tprintUsage();\n\t}",
"protected void initialize() {\n\t\tRobot.firstAutonomousCommandDone = true;\n\t}",
"@Before\n\tpublic void setUp() throws Exception {\n\t\tsimulator = new Simulator(4, 30);\n\t}",
"@Override\n\tprotected void autonomousInit()\n\t{\n\t\tarmTurnMotor.resetSpeedControl();\n\t\tclawArm.resetTargets();\n\t}",
"protected void initialize() {\r\n \t((Launcher) Robot.fuelLauncher).controlSpeed(i);\r\n }",
"protected void initialize()\n {\n // Set the pid up for driving straight\n Robot.drivetrain.getAngleGyroController().setPID(Constants.DrivetrainAngleGyroControllerP, Constants.DrivetrainAngleGyroControllerI, Constants.DrivetrainAngleGyroControllerD);\n //Robot.drivetrain.resetGyro();\n if (setpointSpecified == true)\n {\n Robot.drivetrain.getAngleGyroController().setSetpoint(Robot.initialGyroAngle); \n }\n else\n {\n Robot.drivetrain.getAngleGyroController().setSetpoint(Robot.drivetrain.getGyroValue());\n }\n Robot.drivetrain.setDirection(driveDirection);\n Robot.drivetrain.setMagnitude(drivePower);\n Robot.drivetrain.getAngleGyroController().enable();\n timer.reset();\n timer.start();\n }",
"@Override\r\n public void initialRun(){\r\n tProcess = parser.nextSimProcessTime();\r\n System.out.println();\r\n boolean goRun=true;\r\n while(goRun){\r\n\r\n if(currentTime == tProcess){\r\n mc = parser.simProcess(mc);\r\n tProcess = parser.nextSimProcessTime();\r\n }\r\n mc.doOneStep();\r\n\r\n if(makeVideo){\r\n if(currentTime%FrameRate ==0){\r\n\r\n vid.addLatticeFrame(mc.getSimSystem().getSystemImg());\r\n makeVideo = vid.isWritten();\r\n }\r\n }\r\n\r\n if((currentTime % 10) ==0){System.out.println(\"t:\"+currentTime+\" M:\"+mc.getM());}\r\n currentTime++;\r\n\r\n\r\n goRun = !(mc.nucleated());\r\n if(mc.getM()<0 && currentTime> 300){goRun=false;}\r\n if(currentTime > maxT){goRun= false;}\r\n }\r\n\r\n if(makeVideo){\r\n vid.writeVideo();\r\n }\r\n }",
"public void autonomousInit() {\n\t\ttimer.start();\n\t\tautonomousCommand = autoChooser.getSelected();\n\t\t//This outputs what we've chosen in the SmartDashboard as a string.\n\t\tSystem.out.println(autonomousCommand);\n\t\tif (DriverStation.getInstance().isFMSAttached()) {\n\t\t\tgameData = DriverStation.getInstance().getGameSpecificMessage();\n\t\t}\n\t\telse {\n\t\t\tgameData=\"RLR\";\n\t\t}\n\t\t//armSwing.setAngle(90); //hopefully this will swing the arms down. not sure what angle it wants though\n\t}",
"public void setUp()\n {\n mTimer = new SudokuTimer();\n }",
"protected void initialize() {\n\t\tRobot.motor.getPIDController().setPID(SmartDashboard.getDouble(\"MotorP\"), SmartDashboard.getDouble(\"MotorI\"), SmartDashboard.getDouble(\"MotorD\"));\n\t\tRobot.motor.setOutputRange(0, 1);\n\t\tRobot.motor.setSetpoint(SmartDashboard.getDouble(\"MotorSpeed\"));\n \tRobot.motor.enable();\n }",
"public void init() {\n robot.init(hardwareMap);\n robot.liftUpDown.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n robot.liftRotate.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n robot.liftRotate.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n robot.liftUpDown.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n robot.blinkinLedDriver.setPattern(RevBlinkinLedDriver.BlinkinPattern.GREEN);\n\n }",
"@Override\n public void autonomousInit() {\n\tgameData.readGameData();\n\tautonomousCommand = (Command) chooserMode.getSelected();\n\tdriveSubsystem.resetEncoders();\n\televatorSubsystem.resetEncoder();\n\t// schedule the autonomous command\n\tif (autonomousCommand != null) {\n\t // SmartDashboard.putString(\"i\", \"nit\");\n\t autonomousCommand.start();\n\t}\n }",
"protected void initialize() {\n \t starttime = Timer.getFPGATimestamp();\n \tthis.startAngle = RobotMap.navx.getAngle();\n \tangleorientation.setSetPoint(RobotMap.navx.getAngle());\n \t\n \tRobotMap.motorLeftTwo.enableControl();\n \tRobotMap.motorRightTwo.enableControl();\n \tRobotMap.motorLeftTwo.enableControl();\n \tRobotMap.motorRightTwo.enableControl();\n \n //settting talon control mode\n \tRobotMap.motorLeftTwo.changeControlMode(TalonControlMode.MotionMagic);\t\t\n\t\tRobotMap.motorLeftOne.changeControlMode(TalonControlMode.Follower);\t\n\t\tRobotMap.motorRightTwo.changeControlMode(TalonControlMode.MotionMagic);\t\n\t\tRobotMap.motorRightOne.changeControlMode(TalonControlMode.Follower);\n\t\t//setting peak and nominal output voltage for the motors\n\t\tRobotMap.motorLeftTwo.configPeakOutputVoltage(+12.0f, -12.0f);\n\t\tRobotMap.motorLeftTwo.configNominalOutputVoltage(0.00f, 0.0f);\n\t\tRobotMap.motorRightTwo.configPeakOutputVoltage(+12.0f, -12.0f);\n\t\tRobotMap.motorRightTwo.configNominalOutputVoltage(0.0f, 0.0f);\n\t\t//setting who is following whom\n\t\tRobotMap.motorLeftOne.set(4);\n\t\tRobotMap.motorRightOne.set(3);\n\t\t//setting pid value for both sides\n\t//\tRobotMap.motorLeftTwo.setCloseLoopRampRate(1);\n\t\tRobotMap.motorLeftTwo.setProfile(0);\n\t RobotMap.motorLeftTwo.setP(0.000014f);\n \tRobotMap.motorLeftTwo.setI(0.00000001);\n\t\tRobotMap.motorLeftTwo.setIZone(0);//325);\n\t\tRobotMap.motorLeftTwo.setD(1.0f);\n\t\tRobotMap.motorLeftTwo.setF(this.fGainLeft+0.014);//0.3625884);\n\t\tRobotMap.motorLeftTwo.setAllowableClosedLoopErr(0);//300);\n\t\t\n\t RobotMap.motorRightTwo.setCloseLoopRampRate(1);\n\t RobotMap.motorRightTwo.setProfile(0);\n\t\tRobotMap.motorRightTwo.setP(0.000014f);\n\t\tRobotMap.motorRightTwo.setI(0.00000001);\n\t\tRobotMap.motorRightTwo.setIZone(0);//325);\n\t\tRobotMap.motorRightTwo.setD(1.0f);\n\t\tRobotMap.motorRightTwo.setF(this.fGainRight);// 0.3373206);\n\t\tRobotMap.motorRightTwo.setAllowableClosedLoopErr(0);//300);\n\t\t\n\t\t//setting Acceleration and velocity for the left\n\t\tRobotMap.motorLeftTwo.setMotionMagicAcceleration(125);\n\t\tRobotMap.motorLeftTwo.setMotionMagicCruiseVelocity(250);\n\t\t//setting Acceleration and velocity for the right\n\t\tRobotMap.motorRightTwo.setMotionMagicAcceleration(125);\n\t\tRobotMap.motorRightTwo.setMotionMagicCruiseVelocity(250);\n\t\t//resets encoder position to 0\t\t\n\t\tRobotMap.motorLeftTwo.setEncPosition(0);\n\t\tRobotMap.motorRightTwo.setEncPosition(0);\n\t //Set Allowable error for the loop\n\t\tRobotMap.motorLeftTwo.setAllowableClosedLoopErr(300);\n\t\tRobotMap.motorRightTwo.setAllowableClosedLoopErr(300);\n\t\t\n\t\t//sets desired endpoint for the motors\n RobotMap.motorLeftTwo.set(motionMagicEndPoint);\n RobotMap.motorRightTwo.set(-motionMagicEndPoint );\n \t\n }",
"protected void initialize() {\n \tif (Robot.autoAimSys.aimingAllowed()==false)\n \t{\n \t\tRobot.autoAimSys.resetAim();\n \t}\n \tif (auton==1)//if toggled by AUTON MODE\n \t{\n \t\tRobot.autoAimSys.setAutonAIM(true);\n \t} \n \telse if(auton==2)//if toggled by USER\n \t{\n \t\tRobot.autoAimSys.setAutonAIM(true);\n \t}\n }",
"public void robotInit(){\n\t\tSmartDashboard.putNumber(\"Climber Arm Speed: \", 0.5);\n\t\tSmartDashboard.putNumber(\"Climber Winch Speed: \", 0.25);\n\t}",
"@Override\n public void robotInit() {\n m_chooser.setDefaultOption(\"Default Auto\", kDefaultAuto);\n m_chooser.addOption(\"My Auto\", kCustomAuto);\n SmartDashboard.putData(\"Auto choices\", m_chooser);\n //starts the dual cameras\n CameraServer.getInstance().startAutomaticCapture(0);\n CameraServer.getInstance().startAutomaticCapture(1);\n //auto start (disabled atm)\n //pressBoy.setClosedLoopControl(true);\n pressBoy.setClosedLoopControl(false);\n \n \n }",
"public static void init(){\r\n CommandBase.magazine.setSpeed(0.0);\r\n CommandBase.loader.setSpeed(0.0);\r\n Init.manualTankDrive.start(); \r\n Init.runCompressor.start();\r\n Init.stopGyroDrift.start();\r\n \r\n }",
"@Override\r\n public void initialize(String type){\r\n lattice = new AtomicLatticeSumSpin(param.s,\"Movie\",type,instId); \r\n parser = new SimProcessParser(parser,getSimPostFix(),getParamPostFix());\r\n currentTime =0;\r\n FixedPostFix=type;\r\n\r\n if(type.equalsIgnoreCase(\"\")){\r\n MakeFixedConfig.clearFixedConfig2D(getFixedPostFix());}\r\n \r\n \r\n //which algo is going to be used\r\n if(param.mcalgo.equalsIgnoreCase(\"metropolis\")){\r\n if(useGPU){\r\n // clear up context on GPU if creating a new context\r\n if(mc != null){\r\n ((CLMetropolisMC)mc).closeOpenCL();\r\n }else{}\r\n mc = new CLMetropolisMC(this,output); \r\n }else{\r\n mc = new MetropolisMC(this,output);\r\n }\r\n }else if (param.mcalgo.equalsIgnoreCase(\"metropolisfix\")){\r\n mc = new MetropolisFixedStrengthMC(this,output);\r\n }else{}\r\n\r\n // get a random seed and save it\r\n currentSeed = Math.abs(Ran.nextInt());\r\n //currentSeed=387483474;\r\n //currentSeed=98437549;\r\n\r\n mc.setSeed(currentSeed);\r\n System.out.println(\"Seed:\"+currentSeed);\t\r\n\r\n // Make Video\r\n if(makeVideo){\r\n vid = new VideoMakerCV(currentSeed,VideoLength,type+\"MOVIERUN\");\r\n vid.setFramesPerCapture(framesPerCapture);\r\n }\r\n }",
"protected void initialize() {\r\n x = 0;\r\n y = 0;\r\n driveTrain.reInit();\r\n }",
"protected void initialize() {\n \tstartTime = System.currentTimeMillis();\n \tintake.setLeftPower(power);\n \tintake.setRightPower(power);\n }",
"SimulationRun() {\n firms = new ArrayList<>();\n }",
"protected void initialize() {\n Robot.m_drivetrain.resetPath();\n Robot.m_drivetrain.addPoint(0, 0);\n Robot.m_drivetrain.addPoint(3, 0);\n Robot.m_drivetrain.generatePath();\n \n\t}",
"@Override\n public void robotInit() {\n m_chooser.setDefaultOption(\"Default Auto\", kDefaultAuto);\n m_chooser.addOption(\"My Auto\", kCustomAuto);\n SmartDashboard.putData(\"Auto choices\", m_chooser);\n \n //Initialize Drive Train Motors/\n LeftFront = new WPI_TalonSRX(11);\n RightFront = new WPI_TalonSRX(13);\n LeftBack = new WPI_TalonSRX(10);\n RightBack = new WPI_TalonSRX(12);\n RobotDT = new MecanumDrive(LeftFront, LeftBack, RightFront, RightBack);\n \n //Initialize Xbox Controller or Joystick/\n xcontroller1 = new XboxController(0);\n xcontroller2 = new XboxController(1);\n \n //Initialize Cameras/\n RoboCam = CameraServer.getInstance();\n FrontCamera = RoboCam.startAutomaticCapture(0);\n BackCamera = RoboCam.startAutomaticCapture(1);\n\n //GPM Init/\n mGPM = new GPM();\n \n }",
"public void robotInit() {\n RobotMap.init();\n driveTrain = new DriveTrain();\n oi = new OI();\n flippy = new Flipper();\n flappy = new Flapper();\n autonomousCommand = new AutoFlip();\n \n OI.init();\n CommandBase.init();\n autoChooser = new SendableChooser();\n autoChooser.addDefault(\"Flap Left\", new AutoFlip());\n SmartDashboard.putData(\"Autonomous_Mode\", autoChooser); \n }",
"protected void initialize() {\r\n\t \tRobotMap.armarm_talon.changeControlMode(CANTalon.ControlMode.Position);\r\n\t }",
"public GridSimRandom() {\n // empty\n }",
"public void robotInit() {\n\n }",
"public void robotInit() {\n\n }",
"@Override\r\n\t@BeforeMethod\r\n\tpublic void initSetting() {\n\t\tSystem.out.println(\"start\");\r\n\t\toTest.initSetting();\r\n\t}",
"protected void initialize() {\n finished = false;\n Robot.shooter.Spin();//Spin up wheels\n Timer.delay(3);\n Robot.shooter.TriggerExtend();//Reset Trigger\n Timer.delay(.2);\n Robot.shooter.FeederExtend();//Drop Frisbee\n Timer.delay(1.5);\n Robot.shooter.TriggerRetract();//Fire frisbee\n Timer.delay(.2);\n Robot.shooter.FeederRetract();//Reset Feeder\n Timer.delay(.4);\n \n Robot.shooter.TriggerExtend();//Reset Trigger\n Timer.delay(.2);\n Robot.shooter.FeederExtend();//Drop Frisbee\n Timer.delay(1.5);\n Robot.shooter.TriggerRetract();//Fire frisbee\n Timer.delay(.2);\n Robot.shooter.FeederRetract();//Reset Feeder\n Timer.delay(.4);\n \n Robot.shooter.TriggerExtend();//Reset Trigger\n Timer.delay(.2);\n Robot.shooter.FeederExtend();//Drop Frisbee\n Timer.delay(1.5);\n Robot.shooter.TriggerRetract();//Fire frisbee\n Timer.delay(.2);\n Robot.shooter.FeederRetract();//Reset Feeder\n Timer.delay(.4);\n //Robot.shooter.Stop();\n Robot.shooter.TriggerExtend();//Reset Trigger\n \n Robot.driveTrain.DriveBack();//Drives backwards from pyramid\n Timer.delay(1.5);\n Robot.driveTrain.TurnAround();//Turns Bob around\n Timer.delay(1);\n Robot.driveTrain.Stop();//Stops Bob\n \n Robot.pneumatics.CompressorOn();//Turns compressor on\n }",
"@Override\n\tpublic void testInit(IRobot robot) {\n\t}",
"@Override\n public void init_loop() {\n smDrive.init_loop();\n smArm.init_loop();\n }",
"protected void initialize() {\n done = false;\n\n\n prevAutoShiftState = driveTrain.getAutoShift();\n driveTrain.setAutoShift(false);\n driveTrain.setCurrentGear(DriveTrain.DriveGear.High);\n// double p = SmartDashboard.getNumber(\"drive p\", TTA_P);\n// double i = SmartDashboard.getNumber(\"drive i\", TTA_I);\n// double d = SmartDashboard.getNumber(\"drive d\", TTA_D);\n// double rate = SmartDashboard.getNumber(\"rate\", TTA_RATE);\n// double tolerance = TTA_TOLERANCE; // SmartDashboard.getNumber(\"tolerance\", 2);\n// double min = SmartDashboard.getNumber(\"min\", TTA_MIN);\n// double max = SmartDashboard.getNumber(\"max\", TTA_MAX);\n// double iCap = SmartDashboard.getNumber(\"iCap\", TTA_I_CAP);\n// pid = new PID(p, i, d, min, max, rate, tolerance, iCap);\n pid = new PID(TTA_P, TTA_I, TTA_D, TTA_MIN, TTA_MAX, TTA_RATE, TTA_TOLERANCE, TTA_I_CAP);\n\n driveTrain.setSpeedsPercent(0, 0);\n driveTrain.setCurrentControlMode(ControlMode.Velocity);\n }",
"private void init()\n {\n sendData(REG_MMXCOMMAND, MMXCOMMAND_RESET);\n Delay.msDelay(50);\n // init motor operation parameters\n for (int i=0;i<CHANNELS;i++){\n motorParams[MOTPARAM_RAMPING][i] = MOTPARAM_OP_TRUE;\n motorParams[MOTPARAM_ENCODER_BRAKING][i] = MOTPARAM_OP_TRUE;\n motorParams[MOTPARAM_POWER][i] = 0;\n motorParams[MOTPARAM_REGULATE][i] = MOTPARAM_OP_TRUE;\n doCommand(CMD_SETPOWER, 100, i); // will set motorParams[MOTPARAM_POWER][channel]\n }\n \n }",
"public void initPanel() {\n\t\tAgentInterface agent = new RandomAgent();\n\t\t\n\t\t/*\n\t\t * Instantiate the environment\n\t\t * \n\t\t * Simply change the name of the environment to one imported above to \n\t\t * view random behavior in another environment (a couple environments\n\t\t * may not visualize because they are experimental/unfinished code \n\t\t * from RL-Library.\n\t\t * \n\t\t * This agent should work with any discrete state and action environment\n\t\t * and at least a few environments with continuous state and discrete\n\t\t * actions (e.g., mountain car, cart pole, and acrobot).\n\t\t */\n\t\tEnvironmentInterface env = new CartArm(); \n\t\t\n\t\t\n\t\t/*\n\t\t * Initialize the JPanel to be used by the applet.\n\t\t */\n\t\trlPanel.init(agent, env);\n\t\tthis.getContentPane().add(rlPanel);\n\t\tthis.rlPanel.runLocal.addObserver(this);\n\t\t\n\t\t/*\n\t\t * Initialize experiment, which initializes both the environment and \n\t\t * the agent.\n\t\t * \n\t\t * RunLocalExperiment (which runLocal below is an instance of) controls\n\t\t * the timing, calling RLGlue.RL_init() (which calls agent_init() and \n\t\t * env_init()) and step() on the TinyGlueExtended instance that calls \n\t\t * agent_start(), env_start(), agent_step(), and so on.\n\t\t */\n\t\trlPanel.runLocal.initExp();\n\t\t\n\t\t/*\n\t\t * Start experiment. In each episode, agent_start() and env_start() are\n\t\t * called first. Then agent_step() and env_step() are called repeatedly\n\t\t * until the end of the episode, at which point agent_end() and env_end()\n\t\t * are called. See TinyGlueExtended for exact ordering between agent and \n\t\t * env.\n\t\t */\n\t\trlPanel.runLocal.startExp();\n\t}",
"@Override\n public void init() {\n telemetry.addData(\"Status\", \"Initialized Interative TeleOp Mode\");\n telemetry.update();\n\n // Initialize the hardware variables. Note that the strings used here as parameters\n // to 'get' must correspond to the names assigned during the robot configuration\n // step (using the FTC Robot Controller app on the phone).\n leftDrive = hardwareMap.dcMotor.get(\"leftDrive\");\n rightDrive = hardwareMap.dcMotor.get(\"rightDrive\");\n armMotor = hardwareMap.dcMotor.get(\"armMotor\");\n\n leftGrab = hardwareMap.servo.get(\"leftGrab\");\n rightGrab = hardwareMap.servo.get(\"rightGrab\");\n colorArm = hardwareMap.servo.get(\"colorArm\");\n leftTop = hardwareMap.servo.get(\"leftTop\");\n rightTop = hardwareMap.servo.get(\"rightTop\");\n\n /*\n left and right drive = motion of robot\n armMotor = motion of arm (lifting the grippers)\n extendingArm = motion of slider (used for dropping the fake person)\n left and right grab = grippers to get the blocks\n */\n\n }",
"public void startTrainingMode() {\n\t\t\r\n\t}",
"@Override\n protected void initialize() {\n Robot.powerCellManipulator.stopIntake();\n }",
"@Override\n protected void initialize() {\n ramper.reset();\n Robot.toteLifterSubsystem.setGateState(GateState.OPEN);\n }",
"protected void initialize() {\n \tRobot.intake.setHard(isHard);\n }",
"public Simulation() {\n\t\tstation = new Station();\n\t\ttaxis = new Taxi[NR_OF_TAXIS];\n\t\tfor (int i = 0; i < NR_OF_TAXIS; i++) {\n\t\t\ttaxis[i] = i < NR_OF_SMALL_TAXIS ? new Taxi(i + 1, CAPACITY_SMALL, TIME_SMALL, station)\n\t\t\t\t\t: new Taxi(i + 1, CAPACITY_LARGE, TIME_LARGE, station);\n\t\t}\n\t\ttrain = new Train(station);\n\t}",
"protected void initialize() {\r\n Robot.driveTrain.resetRangefinder();\r\n }",
"@Override\n public void runOpMode() {\n telemetry.addData(\"Status\", \"Simple Ready to run\"); //\n telemetry.update();\n telemetry.addData(\"Status\", \"Initialized\");\n\n /**\n * Initializes the library functions\n * Robot hardware and motor functions\n */\n robot = new Robot_1617(hardwareMap);\n motorFunctions = new MotorFunctions(-1, 1, 0, 1, .05);\n\n //servo wheels are flipped in configuration file\n robot.servoLeftWheel.setPosition(.45);\n robot.servoRightWheel.setPosition(.25);\n\n robot.servoLeftArm.setPosition(0);\n robot.servoRightArm.setPosition(0.7);\n\n robot.servoFlyAngle.setPosition(1);\n\n robot.servoElbow.setPosition(0.95);\n robot.servoShoulder.setPosition(0.1);\n\n robot.servoFeed.setPosition(.498);\n\n robot.servoPlaid.setPosition(.85);\n\n telemetry.addData(\"Servos: \", \"Initialized\");\n // Wait for the game to start (driver presses PLAY)\n waitForStart();\n\n sleep(5000);\n robot.motorLift.setPower(0);\n robot.servoFlyAngle.setPosition(0);\n sleep(500);\n robot.motorFlyLeft.setPower(.9);\n robot.motorFlyRight.setPower(1);\n sleep(250);\n robot.motorIntakeElevator.setPower(1);\n robot.servoFeed.setPosition(-1);\n telemetry.addData(\"Status\", \"Shooting\"); //\n telemetry.update();\n sleep(5000);\n robot.motorFlyLeft.setPower(0);\n robot.motorFlyRight.setPower(0);\n// sleep(5000); //no idea why this is here\n robot.motorIntakeElevator.setPower(0);\n robot.servoFeed.setPosition(.1);\n sleep(250);\n\n telemetry.addData(\"Status\", \"Driving\");\n telemetry.update();\n encoderDrive(1.0, 30, 30, 1);\n\n encoderDrive(1.0, 35, 35, 1);\n }",
"protected void initialize() {\n Robot.limelight.setPipeline(0.0);\n }",
"public CarWashSimulation ()\n {\n bay = new Bay(CarWashApplication.BAY_TIME);\n waitingLine = new LLQueue<Car>();\n randGen = new Random();\n reset();\n }",
"public static void init(){\t\t\n\t\tParameters p = RunEnvironment.getInstance().getParameters();\n\n\t\tSIM_RANDOM_SEED = (Integer)p.getValue(\"randomSeed\");\n\t\tSIM_NUM_AGENTS = (Integer)p.getValue(\"maxAgents\");\n\t\tSIM_NORM_VIOLATION_RATE = (Float) p.getValue(\"Norm Violation Rate\");\n\t\tNUM_TICKS_TO_CONVERGE = (Long)p.getValue(\"NumTicksToConverge\");\n\t\tCONTENTS_QUEUE_SIZE = (Long)p.getValue(\"ContentsQueueSize\");\n\t\t\n\t\tNORM_GEN_EFF_THRESHOLD = (Double)p.getValue(\"NormsGenEffThreshold\");\n\t\tNORM_GEN_NEC_THRESHOLD = (Double)p.getValue(\"NormsGenNecThreshold\");\n\t\tNORM_SPEC_EFF_THRESHOLD = (Double)p.getValue(\"NormsSpecEffThreshold\");\n\t\tNORM_SPEC_NEC_THRESHOLD = (Double)p.getValue(\"NormsSpecNecThreshold\");\n\t\tNORM_UTILITY_WINDOW_SIZE = (Integer)p.getValue(\"NormsPerfRangeSize\");\n\t\tNORM_DEFAULT_UTILITY = (Double)p.getValue(\"NormsDefaultUtility\");\n\n\t\tNORM_SYNTHESIS_STRATEGY = (Integer)p.getValue(\"NormSynthesisStrategy\");\n\t\tNORM_GENERATION_REACTIVE = (Boolean)p.getValue(\"NormGenerationReactive\");\n\t\tNORM_GENERALISATION_MODE = (Integer)p.getValue(\"NormGeneralisationMode\");\n\t\tNORM_GENERALISATION_STEP = (Integer)p.getValue(\"NormGeneralisationStep\");\n\t\tNORM_SPEC_THRESHOLD_EPSILON = (Double)p.getValue(\"NormsSpecThresholdEpsilon\");\n\t\tNORMS_MIN_EVALS_CLASSIFY = (Integer)p.getValue(\"NormsMinEvaluationsToClassify\");\n\t\tNORMS_WITH_USER_ID = (Boolean)p.getValue(\"NormsWithUserId\");\n\n\t\t\n\t\t\n\t\t// System goals and their constants\n\t\tsystemGoals = new ArrayList<Goal>();\n\t\tsystemGoals.add(new GComplaints());\n\n\t\t//\t\tdouble tMinusEpsilon = NORM_SPEC_NEC_THRESHOLD - NORM_SPEC_THRESHOLD_EPSILON;\n\t\t//\t\t\n\t\t//\t\t/* For SIMON+ and LION, set default utility in a different manner... */\n\t\t//\t\tif(NORM_SYNTHESIS_STRATEGY == 3 || NORM_SYNTHESIS_STRATEGY == 4) {\n\t\t//\t\t\tNORM_DEFAULT_UTILITY = (float)(tMinusEpsilon * (NORM_MIN_EVALS+1)); \n\t\t//\t\t}\n\n\t\t/* For SIMON+ and LION, set default utility in a different manner... */\n\t\tif((NORM_SYNTHESIS_STRATEGY == 3 || NORM_SYNTHESIS_STRATEGY == 4) &&\n\t\t\t\t!NORM_GENERATION_REACTIVE) \n\t\t{\n\t\t\tNORM_DEFAULT_UTILITY = 0f; \n\t\t\tSystem.out.println(\"Norm generation is set as Deliberative\");\n\t\t}\n\t}",
"protected void initialize() {\n initialPos = Math.abs(Robot.arm.getArmEncoderValue());\n double direction = Math.signum(setpoint - Math.abs(Robot.arm.getArmEncoderValue()));\n Robot.arm.moveArm(direction * RobotMap.ArmConstants.ARM_AUTONOMOUS_MOVEMENT_POWER, 1);\n }",
"protected void initialize() {\r\n\r\n Robot.pneumatics.pneuOpen();\r\n }",
"@Override\n public void init() {\n runtime.reset();\n robot.init(hardwareMap);\n\n telemetry.addData(\"Status\", \"Initialized\");\n }",
"public void robotInit() {\n // North.registerCommand(\"setSetpoint\", (params) -> ??, [\"Setpoint\"]);\n // North.registerCondition(\"atSetpoint\", elevator::atSetpoint);\n\n //NOTE: init(name, size, logic provider, drive & nav)\n North.init(/*NorthUtils.readText(\"name.txt\")*/ \"lawn chair\", 24/12, 24/12, drive);\n North.default_drive_controller = HoldController.I;\n\n UsbCamera camera = CameraServer.getInstance().startAutomaticCapture();\n camera.setResolution(640, 480);\n }",
"public void robotInit() {\n\t\toi = new OI();\n\t\t\n\t\tteleopCommand = new TeleopCommand();\n }",
"@Before\n\tpublic void initial() {\n\t\tmodele = new FractaleModele();\n\t\tcontroleur = new FractaleControler(modele);\n\t}",
"public void start() {\n rfMotor.setPower(1);\n rrMotor.setPower(1);\n lfMotor.setPower(1);\n lrMotor.setPower(1);\n }",
"static void runTest() {\n dw = DiagnosticsWrapper.getInstance();\n dw.setDebugOutput( true );\n\n // How many ticks? Each one is a week.\n int simulationDurationTicks = (int) Math.floor(Constants.WEEKS_IN_YEAR * 20);\n // print debug-info on all parameters moving between models\n boolean printFrameData = false;\n GameThread one = new GameThread(simulationDurationTicks, printFrameData);\n GameManager gm = one.game;\n \n dw.addGameThread(one); // for debugging purposes\n\n // globalit\n gm.createModel(\"Weather\");\n\n SettingMaster sm;\n \n // kaupungit\n sm = gm.getDefaultSM(\"PopCenter\");\n sm.settings.get(\"vehicles\").setValue(\"1000\");\n sm.settings.get(\"initialFood\").setValue(\"1000000\");\n Model town1 = gm.createModel(\"PopCenter\");\n sm = gm.getDefaultSM(\"PopCenter\");\n sm.settings.get(\"births%\").setValue(\"0.047492154\");\n Model town2 = gm.createModel(\"PopCenter\");\n sm = gm.getDefaultSM(\"PopCenter\");\n sm.settings.get(\"births%\").setValue(\"0.047492154\");\n Model road1 = gm.createModel(\"Road\");\n ((RoadModel)road1).setLengthToDistance(sm);\n sm = one.game.getDefaultSM(\"Field\");\n sm.settings.get(\"content\").setValue(\"maize\");\n sm.settings.get(\"area\").setValue(\"1000000\");\n\n // ruoka x kaupungit\n gm.linkModelsWith(gm.createModel(\"Field\",sm), town1, gm.createModel(\"GenericConnection\"));\n gm.linkModelsWith(town1, town2, road1);\n\n // water\n Model l1 = gm.createModel(\"Lake\");\n sm = gm.getDefaultSM(\"Lake\");\n sm.settings.get(\"order\").setValue(\"1\");\n sm.settings.get(\"k\").setValue(\"1\");\n sm.settings.get(\"surfaceArea\").setValue(\"256120000f\");\n sm.settings.get(\"depth\").setValue(\"14.1\");\n sm.settings.get(\"startAmount\").setValue(\"0.9\");\n sm.settings.get(\"flowAmount\").setValue(\"0.91\");\n sm.settings.get(\"basinArea\").setValue(\"7642000000f\");\n sm.settings.get(\"terrainCoefficient\").setValue(\"0.5f\");\n l1.onActualUpdateSettings(sm);\n \n Model l2 = gm.createModel(\"Lake\");\n sm = gm.getDefaultSM(\"Lake\");\n sm.settings.get(\"order\").setValue(\"1\");\n sm.settings.get(\"k\").setValue(\"1\");\n sm.settings.get(\"surfaceArea\").setValue(\"256120000f\");\n sm.settings.get(\"depth\").setValue(\"14.1\");\n sm.settings.get(\"startAmount\").setValue(\"0.9\");\n sm.settings.get(\"flowAmount\").setValue(\"0.91\");\n sm.settings.get(\"basinArea\").setValue(\"7642000000f\");\n sm.settings.get(\"terrainCoefficient\").setValue(\"0.5f\");\n l2.onActualUpdateSettings(sm);\n \n Model r1 = gm.createModel(\"River\");\n sm = gm.getDefaultSM(\"River\");\n sm.settings.get(\"order\").setValue(\"2\");\n sm.settings.get(\"width\").setValue(\"100\");\n sm.settings.get(\"length\").setValue(\"100000\");\n sm.settings.get(\"startDepth\").setValue(\"0\");\n sm.settings.get(\"floodDepth\").setValue(\"10\");\n sm.settings.get(\"flowDepth\").setValue(\"0.5\");\n r1.onActualUpdateSettings(sm);\n \n Model r2 = gm.createModel(\"River\");\n sm = gm.getDefaultSM(\"River\");\n sm.settings.get(\"order\").setValue(\"2\");\n sm.settings.get(\"width\").setValue(\"100\");\n sm.settings.get(\"length\").setValue(\"100000\");\n sm.settings.get(\"startDepth\").setValue(\"0\");\n sm.settings.get(\"floodDepth\").setValue(\"10\");\n sm.settings.get(\"flowDepth\").setValue(\"0.5\");\n r2.onActualUpdateSettings(sm);\n \n Model l3 = gm.createModel(\"Lake\");\n sm = gm.getDefaultSM(\"Lake\");\n sm.settings.get(\"order\").setValue(\"3\");\n sm.settings.get(\"k\").setValue(\"1\");\n sm.settings.get(\"surfaceArea\").setValue(\"256120000f\");\n sm.settings.get(\"depth\").setValue(\"14.1\");\n sm.settings.get(\"startAmount\").setValue(\"0.9\");\n sm.settings.get(\"flowAmount\").setValue(\"0.91\");\n sm.settings.get(\"basinArea\").setValue(\"7642000000f\");\n sm.settings.get(\"terrainCoefficient\").setValue(\"0.5f\");\n l3.onActualUpdateSettings(sm);\n \n Model r3 = gm.createModel(\"River\");\n sm = gm.getDefaultSM(\"River\");\n sm.settings.get(\"order\").setValue(\"4\");\n sm.settings.get(\"width\").setValue(\"100\");\n sm.settings.get(\"length\").setValue(\"100000\");\n sm.settings.get(\"startDepth\").setValue(\"0\");\n sm.settings.get(\"floodDepth\").setValue(\"10\");\n sm.settings.get(\"flowDepth\").setValue(\"0.5\");\n r3.onActualUpdateSettings(sm);\n \n Model s1 = gm.createModel(\"Sea\");\n sm = gm.getDefaultSM(\"Sea\");\n sm.settings.get(\"order\").setValue(\"5\");\n s1.onActualUpdateSettings(sm);\n \n gm.linkModelsWith(l1, l3, r1);\n gm.linkModelsWith(l2, l3, r2);\n gm.linkModelsWith(l3, s1, r3);\n\n if (!profilingRun) {\n gm.printOnDone = 2;\n }\n\n // Start the gamethread\n one.start();\n \n //Save population to a csv file\n CSVDumper csv = new CSVDumper(\"none\", \"population\");\n csv.add(town1, \"totalPopulation\"); //local\n\n csv.save(gm, true);\n }",
"public void robotInit() {\n\t\toi = OI.getInstance();\r\n\t\t\r\n\t\t// instantiate the command used for the autonomous and teleop period\r\n\t\treadings = new D_SensorReadings();\r\n\t\t// Start pushing values to the SD.\r\n\t\treadings.start();\r\n\t\t//Gets the single instances of driver and operator, from OI. \r\n\t\tdriver = oi.getDriver();\r\n\t\toperator = oi.getOperator();\r\n\r\n\t\t//Sets our default auto to NoAuto, if the remainder of our code doesn't seem to work. \r\n\t\tauto = new G_NoAuto();\r\n\t\t\r\n\t\t//Sets our teleop commandGroup to T_TeleopGroup, which contains Kaj,ELevator, Intake, and Crossbow Commands. \r\n\t\tteleop = new T_TeleopGroup();\r\n\t\t\r\n\t}",
"public void autonomousInit() { //Problems here when power is not cycled between matches.\n \tauto.autonomousInit();\n }",
"protected void initialize() {\n ////TEST CODE\n \tRobotMap.frontLeftTurn.set(0);\n \tRobotMap.frontRightTurn.set(0);\n \tRobotMap.backLeftTurn.set(0);\n \tRobotMap.backRightTurn.set(0);\n \t\n \t//Spin motors\n \tRobotMap.frontLeftTurn.set(85);\n \tRobotMap.frontRightTurn.set(85);\n \tRobotMap.backLeftTurn.set(85);\n \tRobotMap.backRightTurn.set(85);\n \tTimer.delay(2.75);\n \t\n \t//Stop Spin\n \tRobotMap.frontLeftTurn.set(0);\n \tRobotMap.frontRightTurn.set(0);\n \tRobotMap.backLeftTurn.set(0);\n \tRobotMap.backRightTurn.set(0);\n \tTimer.delay(2.75);\n \t\n \t//Move Back\n \tRobotMap.frontLeftDrive.set(0.2);\n \tRobotMap.frontRightDrive.set(0.2);\n \tRobotMap.backLeftDrive.set(0.2);\n \tRobotMap.backRightDrive.set(0.2); \t\n \tTimer.delay(2.75); \n \t\n \t//Stop\n \t\n \tRobotMap.frontLeftDrive.set(0);\n \tRobotMap.frontRightDrive.set(0);\n \tRobotMap.backLeftDrive.set(0);\n \tRobotMap.backRightDrive.set(0);\n }",
"@Override\n protected void initialize() {\n desiredTime = System.currentTimeMillis() + (long) (seconds * 1000);\n Robot.driveTrain.configForTeleopMode();\n }",
"@Override\n public void runOpMode() {\n\n robot.init(hardwareMap);\n robot.MotorRightFront.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n robot.MotorLeftFront.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n robot.MotorRightFront.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n robot.MotorLeftFront.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n\n /** Wait for the game to begin */\n while (!isStarted()) {\n telemetry.addData(\"angle\", \"0\");\n telemetry.update();\n }\n\n\n }",
"@Override\n public void robotInit() {\n // Hardware.getInstance().init();\n hardware.init();\n\n controllerMap = ControllerMap.getInstance();\n controllerMap.controllerMapInit();\n\n controllerMap.intake.IntakeInit();\n\n m_chooser.setDefaultOption(\"Default Auto\", kDefaultAuto);\n m_chooser.addOption(\"My Auto\", kCustomAuto);\n SmartDashboard.putData(\"Auto choices\", m_chooser);\n\n intakeCam = CameraServer.getInstance().startAutomaticCapture(\"Driver Camera :)\", 0);\n intakeCam.setPixelFormat(PixelFormat.kMJPEG);\n intakeCam.setResolution(160, 120);\n intakeCam.setFPS(15);\n // climberCam = CameraServer.getInstance().startAutomaticCapture(1);\n\n }",
"@Override\n public void init() {\n /* Initialize the hardware variables.\n * The init() method of the hardware class does all the work here\n */\n robot.init(hardwareMap);\n robot.FL.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n robot.FL.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n }",
"public SimulationConfig() {\r\n\t}",
"@Override\n\tpublic void robotInit() {\n\t\tm_chooser.setDefaultOption(\"Default Auto\", kDefaultAuto);\n\t\tm_chooser.addOption(\"My Auto\", kCustomAuto);\n\t\tSmartDashboard.putData(\"Auto choices\", m_chooser);\n\n\t\tm_frontRight = new PWMVictorSPX(0);\n\t\tm_frontLeft = new PWMVictorSPX(2);\n\t\tm_backRight = new PWMVictorSPX(1);\n\t\tm_backLeft = new PWMVictorSPX(3);\n\n\t\tx_aligning = false;\n\n\t\tJoy = new Joystick(0);\n\t\tmyTimer = new Timer();\n\n\t\tfinal SpeedControllerGroup m_left = new SpeedControllerGroup(m_frontLeft, m_backLeft);\n\t\tfinal SpeedControllerGroup m_right = new SpeedControllerGroup(m_frontRight, m_backRight);\n\n\t\tm_drive = new DifferentialDrive(m_left, m_right);\n\n\t\tdistanceToTarget = 0;\n\n\t\tcounter = new Counter(9);\n\t\tcounter.setMaxPeriod(10.0);\n\t\tcounter.setSemiPeriodMode(true);\n\t\tcounter.reset();\n\t}",
"public Simulation() {\n ecosystem = new Ecosystem();\n weeksElapsed = 0;\n }",
"@Override public void init() {\n drive = MecanumDrive.standard(hardwareMap); // Comment this line if you, for some reason, don't need to use the drive motors\n\n // Uncomment the next three lines if you need to use the gyroscope\n // gyro = IMUGyro.standard(hardwareMap);\n // gyro.initialize();\n // gyro.calibrate();\n\n // Uncomment the next two lines if you need to use the vision system\n // vision = new Vision(hardwareMap);\n // vision.init();\n\n // Uncomment the next line if you have a servo\n // myServo = hardwareMap.get(Servo.class, \"myServo\");\n\n /** Place any code that should run when INIT is pressed here. **/\n }",
"protected void initialize() {\n \tSystem.out.println(\"initialize ReturnToStart\");\n \tRobot.claw.goRetract();\n \tRobot.claw.goUp();\n \tRobot.claw.goOpen();\n \tRobot.claw.spinStop();\n }",
"public void robotInit() {\n // Initialize all subsystems\n CommandBase.init();\n \n SmartDashboard.putNumber(RobotMap.Autonomous.MODE_KEY, 0);\n \n //temperary method to test door closing speeds\n SmartDashboard.putNumber(RobotMap.Force.DOOR_FORCE_KEY, 50);\n }",
"@Override\n public void robotInit() {\n m_chooser.setDefaultOption(\"Default Auto\", kDefaultAuto);\n m_chooser.addOption(\"My Auto\", kCustomAuto);\n SmartDashboard.putData(\"Auto choices\", m_chooser);\n SmartDashboard.putData(leftMotor1);\n SmartDashboard.putData(leftMotor2);\n SmartDashboard.putData(rightMotor1);\n SmartDashboard.putData(rightMotor2);\n SmartDashboard.putData(firstMotor);\n SmartDashboard.putData(secondMotor);\n \n\n\n\n }"
] | [
"0.7103385",
"0.69431365",
"0.6786856",
"0.6735354",
"0.67192423",
"0.6705072",
"0.6681061",
"0.66771865",
"0.66047853",
"0.6496921",
"0.64274704",
"0.63943595",
"0.62766606",
"0.62618184",
"0.625318",
"0.62402016",
"0.6232433",
"0.6200221",
"0.6194658",
"0.6183852",
"0.6168907",
"0.61685497",
"0.6148562",
"0.6123108",
"0.6108913",
"0.6105897",
"0.61014354",
"0.6090455",
"0.60775363",
"0.6073418",
"0.6063842",
"0.6056922",
"0.6056146",
"0.6045175",
"0.60414153",
"0.6015454",
"0.60128903",
"0.6008532",
"0.60082525",
"0.6006093",
"0.60042214",
"0.5995667",
"0.5990709",
"0.5983452",
"0.59800184",
"0.59725726",
"0.5966615",
"0.5962933",
"0.5961309",
"0.5956221",
"0.5955577",
"0.5953471",
"0.5950592",
"0.5949958",
"0.59454054",
"0.59344155",
"0.58993816",
"0.58814883",
"0.5879308",
"0.5879308",
"0.58728194",
"0.5869976",
"0.5868025",
"0.5866939",
"0.5865383",
"0.58649415",
"0.585764",
"0.5855679",
"0.5852065",
"0.5851075",
"0.58471406",
"0.58456695",
"0.5845463",
"0.58442014",
"0.5842562",
"0.5838651",
"0.5833915",
"0.58259773",
"0.58229953",
"0.58204067",
"0.58061147",
"0.58015096",
"0.57997066",
"0.57963014",
"0.57948923",
"0.5793364",
"0.57921714",
"0.57893103",
"0.5782594",
"0.5777731",
"0.5776924",
"0.57745075",
"0.57647294",
"0.5763406",
"0.57629186",
"0.576287",
"0.5754671",
"0.5754448",
"0.575419",
"0.5754041"
] | 0.81990445 | 0 |
initialize the simulated mode label appearance | private void initSimulateModeView() {
simulateMode = new Label("SIMULATE");
simulateMode.setPrefSize(200, 100);
simulateMode.setFont(Font.font(null, FontWeight.BOLD, 30));
simulateMode.setTextFill(Color.ORANGE);
simulateMode.setEffect(getDropShadow());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void initSimulateMode() {\n initSimulateModeView();\n initSimulateModeController();\n }",
"public void modeColor(Graphics2D g2d) { g2d.setColor(RTColorManager.getColor(\"label\", \"default\")); }",
"private void initSimulateModeController() {\n simulateMode.setOnMouseClicked(event -> {\n SimulatorMain sm = null;\n try { sm = new SimulatorMain(); }\n catch (Exception e) { e.printStackTrace(); }\n sm.start(SimulatorMain.stage);\n });\n simulateMode.setOnMouseEntered(event -> { simulateMode.setGraphic(new Circle(5)); });\n simulateMode.setOnMouseExited(event -> { simulateMode.setGraphic(null); });\n }",
"private void initializeLabels() {\n labelVertexA = new Label(\"Vertex A\");\n labelVertexB = new Label(\"Vertex B\");\n labelVertexA.setTextFill(Color.web(\"#ffffff\"));\n labelVertexB.setTextFill(Color.web(\"#ffffff\"));\n }",
"private void initializeControls() {\n\t\tlabel = new Label(status.toString());\n\t}",
"private void initPlayModeView() {\n playMode = new Label(\"PLAY\");\n playMode.setPrefSize(200,100);\n playMode.setFont(Font.font(null, FontWeight.BOLD, 30));\n playMode.setTextFill(Color.BLUE);\n playMode.setEffect(getDropShadow());\n }",
"private void fillLabelsTabel() {\n }",
"private void initialize() {\r\n label = new JLabel();\r\n panel = new JPanel();\r\n }",
"private void initialize() {\n\t\tsetModal(true);\n\t\tsetTitle(\"Mode Selector\");\n\t\tsetBounds(100, 100, 550, 343);\n\t\tsetDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);\n\t\tToolkit toolkit = Toolkit.getDefaultToolkit();\n\t\tImage image = toolkit.getImage(ConfigFilePath.SWING_PATH);\n\t\tsetIconImage(image);\n\t\tgetContentPane().setLayout(null);\n\t\tsetLocationRelativeTo(null);\n\t\tsetResizable(false);\n\t\tJPanel panel = new JPanel();\n\t\tpanel.setBounds(0, 0, 534, 304);\n\t\tgetContentPane().add(panel);\n\t\tpanel.setLayout(null);\n\t\tbtnMes.setFont(new Font(\"宋体\", Font.PLAIN, 27));\n\t\tbtnMes.setBounds(280, 104, 163, 75);\n\t\tpanel.add(btnMes);\n\t\tbtnOperator.setFont(new Font(\"宋体\", Font.PLAIN, 25));\n\t\tbtnOperator.setBounds(80, 104, 163, 75);\n\t\tpanel.add(btnOperator);\n\n\t\t// mes监听\n\t\tbtnMes.addActionListener(new ModeMesAction(this));\n\t\t// op监听\n\t\tbtnOperator.addActionListener(new ModeOpAction(this));\n\t}",
"private void initialize() {\r\n\t\tsetLabels();\r\n\t\tinitPoints();\r\n\t\tsetButtons();\r\n\t\tthis.setTitle(\"Digite os pesos dos pontos\");\r\n\t\tthis.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);\r\n\t}",
"private void setModeUI(){\n\n if (this.inManualMode == true){ this.enableRadioButtons(); } // manual mode\n else if (this.inManualMode == false){ this.disableRadioButtons(); } // automatic mode\n }",
"public stat() {\n initComponents();\n \n jLabel4.setVisible(false);\n jLabel5.setVisible(false);\n jLabel14.setText(System.getProperty(\"user.name\" ));\n jLabel15.setText(System.getProperty(\"os.name\"));\n \n }",
"public void setLabels() {\n setTimeLabel();\n setDayLabel();\n setDateLabel();\n //setImage();\n }",
"private void resetLabelColor(){\n setLabelColorStandard(nameLabel, normalColor);\n setLabelColorStandard(xLabel, Color.red);\n setLabelColorStandard(yLabel, Color.blue);\n setLabelColorStandard(zLabel, Color.green);\n setLabelColorStandard(rotXLabel, Color.red);\n setLabelColorStandard(rotYLabel, Color.blue);\n setLabelColorStandard(rotZLabel, Color.green);\n setLabelColorStandard(scaleLabel, normalColor);\n }",
"public void createLabels()\n {\n title = new JLabel(\"Game Over\");\n title.setForeground(Color.RED);\n title.setFont(new Font(title.getFont().getName(), Font.PLAIN, 42));\n title.setAlignmentX(Component.CENTER_ALIGNMENT);\n\n roundLabel = new JLabel(\"CPU was infected on round \"+roundLost);\n roundLabel.setForeground(Color.RED);\n roundLabel.setFont(new Font(title.getFont().getName(), Font.PLAIN, 18));\n roundLabel.setAlignmentX(Component.CENTER_ALIGNMENT);\n }",
"private void initializeStateLabel() {\n colorLabel = new JLabel(\"Color: \");\n colorLabel.setBounds(200, 20, 100, 25);\n this.add(colorLabel);\n\n colorLabel2 = new JLabel();\n colorLabel2.setBounds(250, 20, 25, 25);\n colorLabel2.setOpaque(true);\n //colorLabel2.setBackground(java.awt.Color.black);\n this.add(colorLabel2);\n\n numberLabel = new JLabel();\n numberLabel.setBounds(300, 20, 200, 25);\n this.add(numberLabel);\n\n specialLabel = new JLabel();\n specialLabel.setBounds(400, 20, 200, 25);\n this.add(specialLabel);\n\n penaltyLabel = new JLabel();\n penaltyLabel.setBounds(600, 20, 200, 25);\n this.add(penaltyLabel);\n\n currPlayerLabel = new JLabel();\n currPlayerLabel.setBounds(0, 300, 200, 50);\n currPlayerLabel.setFont(new Font(\"Arial\", Font.PLAIN, 20));\n this.add(currPlayerLabel);\n\n errorMessage = new JLabel(\"Select a valid card, or draw a new card\");\n errorMessage.setBounds(400, 300, 300, 25);\n this.add(errorMessage);\n errorMessage.setVisible(false);\n }",
"@FXML\n public void init_labels() {\n name_output.setText(\"el que digui domini\");\n\n String quatri;\n int q = 1; // pillar de domini\n if(q == 1) quatri = \"Q1\";\n else if (q == 2) quatri =\"Q2\";\n else quatri = \"Q1 & Q2\";\n quatri_output.setText(quatri);\n\n String nivell;\n int n = 1; // pillar de domini\n if(n == 1) nivell = \"Inicial\";\n else if (n == 2) nivell =\"Troncal\";\n else nivell = \"Especialitat\";\n nivell_output.setText(nivell);\n\n boolean tmp = false; // pillar de domini i pot desapareixer aquest boolean tmp\n if(tmp) teo_output.setText(\"Sí\");\n else teo_output.setText(\"No\");\n\n // suposo que domini em retorna un array de bools\n boolean tmp_array[] = {true, false, true, false, true, false};\n String lab = \"\";\n if (tmp_array[0]) lab += \"Projector\\n\";\n if (tmp_array[1]) lab += \"Ubuntu\\n\";\n if (tmp_array[2]) lab += \"Linux/Windows\\n\";\n if (tmp_array[3]) lab += \"Física\\n\";\n if (tmp_array[4]) lab += \"Embeded\\n\";\n if (tmp_array[5]) lab += \"Xarxes\\n\";\n // lab_output.setWrapText(true);\n lab_output.setText(lab);\n }",
"private void _initLabels() \n {\n _lblName = _createNewLabel( \"Mother Teres@ Practice Management System\");\n _lblVersion = _createNewLabel(\"Version 1.0.1 (Beta)\");\n _lblAuthor = _createNewLabel( \"Company: Valkyrie Systems\" );\n _lblRealAuthor = _createNewLabel( \"Author: Hein Badenhorst\" );\n _lblDate = _createNewLabel( \"Build Date:\" );\n _lblRealDate = _createNewLabel( \"31 October 2010\");\n }",
"private Label createInitializingLabel(Composite parent)\n\t{\n\t\tLabel initializingMessageLabel = new Label(parent, SWT.NONE);\n\t\tinitializationFont = new Font(Display.getDefault(), new FontData(\"Arial\", 20,\n\t\t\t\tSWT.BOLD));\n\t\tinitializingMessageLabel.setFont(initializationFont);\n\t\tinitializingMessageLabel\n\t\t\t\t.setText(\"iDocIt! is initializing at the moment. Please wait ...\");\n\t\tinitializingMessageLabel.setBackground(Display.getDefault().getSystemColor(\n\t\t\t\tSWT.COLOR_WHITE));\n\t\tGridDataFactory.fillDefaults().align(SWT.CENTER, SWT.CENTER).grab(true, true)\n\t\t\t\t.applyTo(initializingMessageLabel);\n\n\t\treturn initializingMessageLabel;\n\t}",
"private void initPlayModeController() {\n playMode.setOnMouseClicked(event -> {\n MasterMindMain mm = null;\n try { mm = new MasterMindMain(); }\n catch (Exception e) { e.printStackTrace(); }\n mm.start(SimulatorMain.stage);\n });\n playMode.setOnMouseEntered(event -> { playMode.setGraphic(new Circle(5)); });\n playMode.setOnMouseExited(event -> { playMode.setGraphic(null); });\n }",
"public void autonomousInit() {\n\t\ttimer.start();\n\t\tautonomousCommand = autoChooser.getSelected();\n\t\t//This outputs what we've chosen in the SmartDashboard as a string.\n\t\tSystem.out.println(autonomousCommand);\n\t\tif (DriverStation.getInstance().isFMSAttached()) {\n\t\t\tgameData = DriverStation.getInstance().getGameSpecificMessage();\n\t\t}\n\t\telse {\n\t\t\tgameData=\"RLR\";\n\t\t}\n\t\t//armSwing.setAngle(90); //hopefully this will swing the arms down. not sure what angle it wants though\n\t}",
"private void initUI()\r\n\t{\r\n\t\tthis.label = new Label();\r\n\t\t\r\n\t\tthis.label.setText(\"This view is also saveable\");\r\n\t\t\r\n\t\tthis.label.setSizeUndefined();\r\n\t\tthis.add(this.label);\r\n\t\tthis.setSizeFull();\r\n\t}",
"private void drawModesHub(Renderer r) {\n r.drawText(\"F1: SAT\", 8, 10, (mode == 0 ? HexColors.RED : HexColors.YELLOW));\n r.drawText(\"F2: SAT/STATIC\", 8, 40, (mode == 1 ? HexColors.RED : HexColors.YELLOW));\n r.drawText(\"F3: DIAG\", 8, 70, (mode == 2 ? HexColors.RED : HexColors.YELLOW));\n r.drawText(\"F4: DIAG/STATIC\", 8, 100, (mode == 3 ? HexColors.RED : HexColors.YELLOW));\n }",
"private void appearance()\r\n\t\t{\n\t\tgridLayout.setHgap(5);\r\n\t\tgridLayout.setVgap(5);\r\n\r\n\t\t//set the padding + external border with title inside the box\r\n\t\tBorder lineBorder = BorderFactory.createLineBorder(Color.BLACK);\r\n\t\tBorder outsideBorder = BorderFactory.createTitledBorder(lineBorder, title, TitledBorder.CENTER, TitledBorder.TOP);\r\n\t\tBorder marginBorder = BorderFactory.createEmptyBorder(5, 5, 5, 5);\r\n\t\tthis.setBorder(BorderFactory.createCompoundBorder(outsideBorder, marginBorder));\r\n\r\n\t\t//set initial value to builder\r\n\t\tdiceBuilder.setInterval(min, max);\r\n\t\t}",
"@Override\n public void simpleInitApp() {\n setDisplayStatView(false);\n setDisplayFps(false);\n\n // just a blue box\n Box mesh = new Box(1, 1, 1);\n Geometry geom = new Geometry(\"Box\", mesh);\n Material mat = new Material(assetManager,\n \"Common/MatDefs/Misc/Unshaded.j3md\");\n mat.setColor(\"Color\", ColorRGBA.Blue);\n geom.setMaterial(mat);\n rootNode.attachChild(geom);\n\n // Display a line of text in the default font on depth layer 0\n guiFont = assetManager.loadFont(\"Interface/Fonts/Default.fnt\");\n distanceText = new BitmapText(guiFont);\n distanceText.setSize(guiFont.getCharSet().getRenderedSize());\n distanceText.move( // x/y coordinates and z = depth layer 0\n settings.getWidth() / 2 + 50,\n distanceText.getLineHeight() + 20,\n 0);\n guiNode.attachChild(distanceText);\n\n // Display a 2D image or icon on depth layer -2\n Picture frame = new Picture(\"User interface frame\");\n frame.setImage(assetManager, \"Interface/frame.png\", false);\n frame.move(settings.getWidth() / 2 - 265, 0, -2);\n frame.setWidth(530);\n frame.setHeight(10);\n guiNode.attachChild(frame);\n\n // Display a 2D image or icon on depth layer -1\n Picture logo = new Picture(\"logo\");\n logo.setImage(assetManager, \"Interface/Monkey.png\", true);\n logo.move(settings.getWidth() / 2 - 47, 2, -1);\n logo.setWidth(95);\n logo.setHeight(75);\n guiNode.attachChild(logo);\n }",
"public void autonomousInit() {\n Jagbot.isAutonomous = true;\n int mode = (int)SmartDashboard.getNumber(RobotMap.Autonomous.MODE_KEY);\n switch (mode) {\n case 0:\n System.out.println(\"Standing still\");\n new StandStill().start();\n break;\n case 1:\n System.out.println(\"Driving forward\");\n new DriveStraight(1).start();\n break;\n \n case 2:\n System.out.println(\"Turning left and shooting to score\");\n new TurnAndScore(-1).start();\n break;\n case 3:\n System.out.println(\"Turning right and shooting to score\");\n new TurnAndScore(1).start();\n break;\n }\n }",
"private void createNodeLabel(NodeAppearanceCalculator nac) {\r\n\t PassThroughMapping passThroughMapping = new PassThroughMapping(\"\",\r\n\t ObjectMapping.NODE_MAPPING);\r\n\t \r\n\t // change canonicalName to Label\r\n//\t passThroughMapping.setControllingAttributeName\r\n//\t (\"canonicalName\", null, false);\r\n\t passThroughMapping.setControllingAttributeName\r\n// (Semantics.LABEL, null, false);\r\n\t (Semantics.CANONICAL_NAME, null, false);\r\n\t\r\n\t GenericNodeLabelCalculator nodeLabelCalculator =\r\n\t new GenericNodeLabelCalculator(\"SimpleBioMoleculeEditor ID Label\"\r\n\t , passThroughMapping);\r\n\t nac.setNodeLabelCalculator(nodeLabelCalculator);\r\n\t }",
"private void setPromptLabels()\n\t{\n\t\tpromptLabels = new JLabel[promptNum];\n\t\tpromptLabels[0] = new JLabel(\"Seconds To Next Person\");\n\t\tpromptLabels[1] = new JLabel(\"Average Seconds Per Eatery\");\n\t\tpromptLabels[2] = new JLabel(\"Average Seconds Per Cashier\");\n\t\tpromptLabels[3] = new JLabel(\"Seconds Before Person Leaves\");\n\t\tpromptLabels[4] = new JLabel(\"Number of Eateries\");\n\t\tpromptLabels[5] = new JLabel(\"Number of Cashiers\");\n\t}",
"public abstract void initMode();",
"public void init() {\r\n\r\n\t\tJLabel lbl = new JLabel(\"Hello World\");\r\n\t\tadd(lbl);\r\n\r\n\t}",
"private void setLabelsTODefaultValues(){\r\n\t\tlblTempitem1.setText(\"NONE\"); //first temp item\r\n\t\tlblTempitem_2_1.setText(\"\"); //2nd temp item\r\n\t\tlblTempitem_3_1.setText(\"\"); //3rd item in temperature list\r\n\t\tlblTempitem_4.setText(\"\"); //4th...\r\n\t\tlblTempitem_5.setText(\"\"); //5th item in temperature list.\r\n\t\tlblTempitem_6.setText(\"\");\r\n\t\tlblPackv1.setText(\"NONE\"); //first item in voltage pack list\r\n\t\tlblPackv2.setText(\"\"); //second item in voltage pack list\r\n\t\tlblPackv_3.setText(\"\"); //the thirdf\r\n\t\tlblPackv_4.setText(\"\"); //and fourth. Can add more as needed \r\n\t\tlblSpeed.setText(\"NONE\");; //the label showing speed (update this one!)\r\n\t\tlblLastDataReceived.setText(\"Last Received: NONE\"); //Time of last data received\r\n\t\tlblCarLoadedName.setText(\"No Car Connected\");; // the name of the currently loaded car. \r\n\t\tSoC.setText(\"N/A\"); //the default text for state of charge\r\n\t}",
"public void resetLabel(){\r\n if(sc!= null && sc.getProperties().getAttribute(\"Label\") != null){\r\n sc.getProperties().getAttribute(\"Label\").changeValue(\"\");\r\n }\r\n }",
"final void setup() {\n frame.add(label, BorderLayout.CENTER);\n }",
"protected void setupImpl()\n {\n hint(DISABLE_DEPTH_TEST);\n font = loadFont(\"Futura-CondensedExtraBold-200.vlw\");\n textFont(font, 200);\n mode = 0;\n\n // Mode 3\n w = width * 2;\n dx = (TWO_PI / period) * xspacing;\n yvalues = new float[w/xspacing];\n\n // Mode 5\n mod = loadImage(\"mod.png\");\n modSizes = new int[scaledBandLevels.length];\n }",
"public void setLabels() {\n gameLabel.setText(gameString);\n playerLabel.setText(playerPlays);\n computerLabel.setText(computerPlays);\n pScoreLabel.setText(\"Player: \" + pScore);\n cScoreLabel.setText(\"Computer: \" + cScore);\n }",
"public void setSwingCharacteristics() {\n\t\tcharacterName.setPreferredSize(new Dimension(1050, 100));\n\t\tcharacterName.setFont(f);\n\n\t\talignment.setPreferredSize(new Dimension(400, 100));\n\t\talignment.setFont(f);\n\n\t\tplayerName.setPreferredSize(new Dimension(500, 100));\n\t\tplayerName.setFont(f);\n\n\t\tmultiClassLabel.setPreferredSize(new Dimension(200, 100));\n\t\tmultiClassLabel\n\t\t\t\t.setForeground(new Color(Colors.WHITE.getColorR(), Colors.WHITE.getColorG(), Colors.WHITE.getColorB()));\n\t\tmultiClassLabel.setFont(f);\n\n\t\tmultiClass.setPreferredSize(new Dimension(100, 100));\n\t\tmultiClass.setFont(f);\n\n\t\traceLabel.setPreferredSize(new Dimension(150, 100));\n\t\traceLabel.setFont(f);\n\n\t\trace.setPreferredSize(new Dimension(300, 100));\n\t\trace.setFont(f);\n\n\t\tsize.setPreferredSize(new Dimension(250, 100));\n\t\tsize.setFont(f);\n\n\t\tgender.setPreferredSize(new Dimension(200, 100));\n\t\tgender.setFont(f);\n\n\t\tgenderLabel.setPreferredSize(new Dimension(150, 100));\n\t\tgenderLabel.setFont(f);\n\n\t\tageRollOrInput.add(ageRollSelection);\n\t\tageRollOrInput.add(ageInputSelection);\n\n\t\tageRollSelection.setPreferredSize(new Dimension(200, 100));\n\t\tageRollSelection.setFont(f);\n\t\tageRollSelection.setBackground(lightGray);\n\n\t\tageInputSelection.setPreferredSize(new Dimension(240, 100));\n\t\tageInputSelection.setFont(f);\n\t\tageInputSelection.setBackground(lightGray);\n\n\t\tageRoll.setPreferredSize(new Dimension(150, 100));\n\t\tageRoll.setFont(f);\n\n\t\tageInput.setPreferredSize(new Dimension(200, 100));\n\t\tageInput.setFont(f);\n\n\t\tageRange.add(intuitive);\n\t\tageRange.add(selfTaught);\n\t\tageRange.add(trained);\n\n\t\tageLabel.setPreferredSize(new Dimension(75, 100));\n\t\tageLabel.setFont(f);\n\n\t\tintuitive.setPreferredSize(new Dimension(350, 100));\n\t\tintuitive.setFont(f);\n\n\t\tselfTaught.setPreferredSize(new Dimension(400, 100));\n\t\tselfTaught.setFont(f);\n\n\t\ttrained.setPreferredSize(new Dimension(350, 100));\n\t\ttrained.setFont(f);\n\n\t\theightRollOrInput.add(heightInputSelection);\n\t\theightRollOrInput.add(heightRollSelection);\n\n\t\theightInputSelection.setPreferredSize(new Dimension(300, 100));\n\t\theightInputSelection.setFont(f);\n\n\t\theightRollSelection.setPreferredSize(new Dimension(300, 100));\n\t\theightRollSelection.setFont(f);\n\n\t\theightRoll.setPreferredSize(new Dimension(150, 100));\n\t\theightRoll.setFont(f);\n\n\t\theightInput.setPreferredSize(new Dimension(150, 100));\n\t\theightInput.setFont(f);\n\n\t\theightLabel.setPreferredSize(new Dimension(150, 100));\n\t\theightLabel.setFont(f);\n\n\t\tweightRollOrInput.add(weightInputSelection);\n\t\tweightRollOrInput.add(weightRollSelection);\n\n\t\tweightInputSelection.setPreferredSize(new Dimension(300, 100));\n\t\tweightInputSelection.setFont(f);\n\n\t\tweightRollSelection.setPreferredSize(new Dimension(300, 100));\n\t\tweightRollSelection.setFont(f);\n\n\t\tweightRoll.setPreferredSize(new Dimension(200, 100));\n\t\tweightRoll.setFont(f);\n\n\t\tweightInput.setPreferredSize(new Dimension(150, 100));\n\t\tweightInput.setFont(f);\n\n\t\tweightLabel.setPreferredSize(new Dimension(150, 100));\n\t\tweightLabel.setFont(f);\n\n\t\thairLabel.setPreferredSize(new Dimension(200, 100));\n\t\thairLabel.setFont(f);\n\n\t\thairColor.setPreferredSize(new Dimension(400, 100));\n\t\thairColor.setFont(f);\n\n\t\teyeLabel.setPreferredSize(new Dimension(200, 100));\n\t\teyeLabel.setFont(f);\n\n\t\teyeColor.setPreferredSize(new Dimension(400, 100));\n\t\teyeColor.setFont(f);\n\n\t\tstrengthSpinner.setValue(10);\n\t\tstrengthSpinner.setPreferredSize(new Dimension(200, 150));\n\t\tstrengthSpinner.setFont(f);\n\n\t\tdexteritySpinner.setValue(10);\n\t\tdexteritySpinner.setPreferredSize(new Dimension(200, 150));\n\t\tdexteritySpinner.setFont(f);\n\n\t\tconstitutionSpinner.setValue(10);\n\t\tconstitutionSpinner.setPreferredSize(new Dimension(200, 150));\n\t\tconstitutionSpinner.setFont(f);\n\n\t\tintelligenceSpinner.setValue(10);\n\t\tintelligenceSpinner.setPreferredSize(new Dimension(200, 150));\n\t\tintelligenceSpinner.setFont(f);\n\n\t\twisdomSpinner.setValue(10);\n\t\twisdomSpinner.setPreferredSize(new Dimension(200, 150));\n\t\twisdomSpinner.setFont(f);\n\n\t\tcharismaSpinner.setValue(10);\n\t\tcharismaSpinner.setPreferredSize(new Dimension(200, 150));\n\t\tcharismaSpinner.setFont(f);\n\n\t\tstrengthLabel.setPreferredSize(new Dimension(200, 150));\n\t\tstrengthLabel.setFont(f);\n\t\tstrengthLabel.setOpaque(true);\n\t\tstrengthLabel.setBackground(black);\n\t\tstrengthLabel.setForeground(white);\n\n\t\tdexterityLabel.setPreferredSize(new Dimension(200, 150));\n\t\tdexterityLabel.setFont(f);\n\t\tdexterityLabel.setOpaque(true);\n\t\tdexterityLabel.setBackground(black);\n\t\tdexterityLabel.setForeground(white);\n\n\t\tconstitutionLabel.setPreferredSize(new Dimension(220, 150));\n\t\tconstitutionLabel.setFont(f);\n\t\tconstitutionLabel.setOpaque(true);\n\t\tconstitutionLabel.setBackground(black);\n\t\tconstitutionLabel.setForeground(white);\n\n\t\tintelligenceLabel.setPreferredSize(new Dimension(200, 150));\n\t\tintelligenceLabel.setFont(f);\n\t\tintelligenceLabel.setOpaque(true);\n\t\tintelligenceLabel.setBackground(black);\n\t\tintelligenceLabel.setForeground(white);\n\n\t\twisdomLabel.setPreferredSize(new Dimension(200, 150));\n\t\twisdomLabel.setFont(f);\n\t\twisdomLabel.setOpaque(true);\n\t\twisdomLabel.setBackground(black);\n\t\twisdomLabel.setForeground(white);\n\n\t\tcharismaLabel.setPreferredSize(new Dimension(200, 150));\n\t\tcharismaLabel.setFont(f);\n\t\tcharismaLabel.setOpaque(true);\n\t\tcharismaLabel.setBackground(black);\n\t\tcharismaLabel.setForeground(white);\n\n\t\tstrengthInput.setPreferredSize(new Dimension(200, 150));\n\t\tstrengthInput.setFont(f);\n\n\t\tdexterityInput.setPreferredSize(new Dimension(200, 150));\n\t\tdexterityInput.setFont(f);\n\n\t\tconstitutionInput.setPreferredSize(new Dimension(200, 150));\n\t\tconstitutionInput.setFont(f);\n\n\t\tintelligenceInput.setPreferredSize(new Dimension(200, 150));\n\t\tintelligenceInput.setFont(f);\n\n\t\twisdomInput.setPreferredSize(new Dimension(200, 150));\n\t\twisdomInput.setFont(f);\n\n\t\tcharismaInput.setPreferredSize(new Dimension(200, 150));\n\t\tcharismaInput.setFont(f);\n\n\t\tstrengthRoll.setPreferredSize(new Dimension(200, 150));\n\t\tstrengthRoll.setFont(f);\n\n\t\tdexterityRoll.setPreferredSize(new Dimension(200, 150));\n\t\tdexterityRoll.setFont(f);\n\n\t\tconstitutionRoll.setPreferredSize(new Dimension(250, 150));\n\t\tconstitutionRoll.setFont(f);\n\n\t\tintelligenceRoll.setPreferredSize(new Dimension(240, 150));\n\t\tintelligenceRoll.setFont(f);\n\n\t\twisdomRoll.setPreferredSize(new Dimension(180, 150));\n\t\twisdomRoll.setFont(f);\n\n\t\tcharismaRoll.setPreferredSize(new Dimension(220, 150));\n\t\tcharismaRoll.setFont(f);\n\n\t\ttemporaryStrengthInput.setPreferredSize(new Dimension(150, 150));\n\t\ttemporaryStrengthInput.setFont(f);\n\n\t\ttemporaryDexterityInput.setPreferredSize(new Dimension(150, 150));\n\t\ttemporaryDexterityInput.setFont(f);\n\n\t\ttemporaryConstitutionInput.setPreferredSize(new Dimension(150, 150));\n\t\ttemporaryConstitutionInput.setFont(f);\n\n\t\ttemporaryIntelligenceInput.setPreferredSize(new Dimension(150, 150));\n\t\ttemporaryIntelligenceInput.setFont(f);\n\n\t\ttemporaryWisdomInput.setPreferredSize(new Dimension(150, 150));\n\t\ttemporaryWisdomInput.setFont(f);\n\n\t\ttemporaryCharismaInput.setPreferredSize(new Dimension(150, 150));\n\t\ttemporaryCharismaInput.setFont(f);\n\n\t\ttemporaryStrengthLabel.setPreferredSize(new Dimension(200, 150));\n\t\ttemporaryStrengthLabel.setFont(f);\n\n\t\ttemporaryDexterityLabel.setPreferredSize(new Dimension(200, 150));\n\t\ttemporaryDexterityLabel.setFont(f);\n\n\t\ttemporaryConstitutionLabel.setPreferredSize(new Dimension(200, 150));\n\t\ttemporaryConstitutionLabel.setFont(f);\n\n\t\ttemporaryIntelligenceLabel.setPreferredSize(new Dimension(200, 150));\n\t\ttemporaryIntelligenceLabel.setFont(f);\n\n\t\ttemporaryWisdomLabel.setPreferredSize(new Dimension(200, 150));\n\t\ttemporaryWisdomLabel.setFont(f);\n\n\t\ttemporaryCharismaLabel.setPreferredSize(new Dimension(200, 150));\n\t\ttemporaryCharismaLabel.setFont(f);\n\n\t\tstrengthModifierLabel.setPreferredSize(new Dimension(200, 200));\n\t\tstrengthModifierLabel.setFont(f);\n\t\tstrengthModifierLabel.setText(\"<html>Modifier: \" + \"<br>\"\n\t\t\t\t+ String.valueOf((Integer.parseInt(strengthInput.getText()) - abilityScoreBaseValue) / 2) + \"</html>\");\n\n\t\tdexterityModifierLabel.setPreferredSize(new Dimension(200, 200));\n\t\tdexterityModifierLabel.setFont(f);\n\t\tdexterityModifierLabel.setText(\"<html>Modifier: \" + \"<br>\"\n\t\t\t\t+ String.valueOf((Integer.parseInt(dexterityInput.getText()) - abilityScoreBaseValue) / 2) + \"</html>\");\n\n\t\tconstitutionModifierLabel.setPreferredSize(new Dimension(200, 200));\n\t\tconstitutionModifierLabel.setFont(f);\n\t\tconstitutionModifierLabel.setText(\"<html>Modifier: \" + \"<br>\"\n\t\t\t\t+ String.valueOf((Integer.parseInt(constitutionInput.getText()) - abilityScoreBaseValue) / 2)\n\t\t\t\t+ \"</html>\");\n\n\t\tintelligenceModifierLabel.setPreferredSize(new Dimension(200, 200));\n\t\tintelligenceModifierLabel.setFont(f);\n\t\tintelligenceModifierLabel.setText(\"<html>Modifier: \" + \"<br>\"\n\t\t\t\t+ String.valueOf((Integer.parseInt(intelligenceInput.getText()) - abilityScoreBaseValue) / 2)\n\t\t\t\t+ \"</html>\");\n\n\t\twisdomModifierLabel.setPreferredSize(new Dimension(200, 200));\n\t\twisdomModifierLabel.setFont(f);\n\t\twisdomModifierLabel.setText(\"<html>Modifier: \" + \"<br>\"\n\t\t\t\t+ String.valueOf((Integer.parseInt(wisdomInput.getText()) - abilityScoreBaseValue) / 2) + \"</html>\");\n\n\t\tcharismaModifierLabel.setPreferredSize(new Dimension(200, 200));\n\t\tcharismaModifierLabel.setFont(f);\n\t\tcharismaModifierLabel.setText(\"<html>Modifier: \" + \"<br>\"\n\t\t\t\t+ String.valueOf((Integer.parseInt(charismaInput.getText()) - abilityScoreBaseValue) / 2) + \"</html>\");\n\n\t\ttemporaryStrengthModifierLabel.setPreferredSize(new Dimension(200, 150));\n\t\ttemporaryStrengthModifierLabel.setFont(f);\n\n\t\ttemporaryDexterityModifierLabel.setPreferredSize(new Dimension(200, 150));\n\t\ttemporaryDexterityModifierLabel.setFont(f);\n\n\t\ttemporaryConstitutionModifierLabel.setPreferredSize(new Dimension(200, 150));\n\t\ttemporaryConstitutionModifierLabel.setFont(f);\n\n\t\ttemporaryIntelligenceModifierLabel.setPreferredSize(new Dimension(200, 150));\n\t\ttemporaryIntelligenceModifierLabel.setFont(f);\n\n\t\ttemporaryWisdomModifierLabel.setPreferredSize(new Dimension(200, 150));\n\t\ttemporaryWisdomModifierLabel.setFont(f);\n\n\t\ttemporaryCharismaModifierLabel.setPreferredSize(new Dimension(200, 150));\n\t\ttemporaryCharismaModifierLabel.setFont(f);\n\n\t\tabilitySelection.add(abilityRoll);\n\t\tabilitySelection.add(abilityInput);\n\n\t\tabilityRoll.setPreferredSize(new Dimension(400, 100));\n\t\tabilityRoll.setFont(f);\n\n\t\tabilityInput.setPreferredSize(new Dimension(400, 100));\n\t\tabilityInput.setFont(f);\n\n\t\tfantasySelection.add(lowFantasy);\n\t\tfantasySelection.add(standardFantasy);\n\t\tfantasySelection.add(highFantasy);\n\t\tfantasySelection.add(epicFantasy);\n\n\t\tlowFantasy.setPreferredSize(new Dimension(450, 100));\n\t\tlowFantasy.setFont(f);\n\n\t\tstandardFantasy.setPreferredSize(new Dimension(550, 100));\n\t\tstandardFantasy.setFont(f);\n\n\t\thighFantasy.setPreferredSize(new Dimension(450, 100));\n\t\thighFantasy.setFont(f);\n\n\t\tepicFantasy.setPreferredSize(new Dimension(450, 100));\n\t\tepicFantasy.setFont(f);\n\n\t\tfantasyPointsLabel.setPreferredSize(new Dimension(400, 100));\n\t\tfantasyPointsLabel.setFont(f);\n\n\t\tsaveProgress.setPreferredSize(new Dimension(700, 100));\n\t\tsaveProgress.setFont(f);\n\n\t\tsaveAbility.setPreferredSize(new Dimension(300, 100));\n\t\tsaveAbility.setFont(f);\n\n\t}",
"private void initialize() {\n\t\tjLabel3 = new JLabel();\n\t\tjLabel = new JLabel();\n\t\tthis.setLayout(null);\n\t\tthis.setBounds(new java.awt.Rectangle(0, 0, 486, 377));\n\t\tjLabel.setText(PluginServices.getText(this,\n\t\t\t\t\"Areas_de_influencia._Introduccion_de_datos\") + \":\");\n\t\tjLabel.setBounds(5, 20, 343, 21);\n\t\tjLabel3.setText(PluginServices.getText(this, \"Cobertura_de_entrada\")\n\t\t\t\t+ \":\");\n\t\tjLabel3.setBounds(6, 63, 190, 21);\n\t\tthis.add(jLabel, null);\n\t\tthis.add(jLabel3, null);\n\t\tthis.add(getLayersComboBox(), null);\n\t\tthis.add(getSelectedOnlyCheckBox(), null);\n\t\tthis.add(getMethodSelectionPanel(), null);\n\t\tthis.add(getResultSelectionPanel(), null);\n\t\tthis.add(getExtendedOptionsPanel(), null);\n\t\tconfButtonGroup();\n\t\tlayersComboBox.setSelectedIndex(0);\n\t\tinitSelectedItemsJCheckBox();\n\t\tdistanceBufferRadioButton.setSelected(true);\n\t\tlayerFieldsComboBox.setEnabled(false);\n\t\tverifyTypeBufferComboEnabled();\n\t}",
"void setShapeLabel(String Label);",
"private void initializeDisplayText() {\n // Title and field labels\n Stage stage = (Stage) titleLabel.getScene().getWindow();\n stage.setTitle(rb.getString(\"windowTitle\"));\n if (action.equals(Constants.ADD)) {\n titleLabel.setText(rb.getString(\"addTitleLabel\"));\n } else if (action.equals(Constants.UPDATE)) {\n titleLabel.setText(rb.getString(\"updateTitleLabel\"));\n }\n idLabel.setText(rb.getString(\"idLabel\"));\n nameLabel.setText(rb.getString(\"nameLabel\"));\n addressLabel.setText(rb.getString(\"addressLabel\"));\n cityLabel.setText(rb.getString(\"cityLabel\"));\n countryLabel.setText(rb.getString(\"countryLabel\"));\n divisionLabel.setText(rb.getString(\"divisionLabel\"));\n postalLabel.setText(rb.getString(\"postalLabel\"));\n phoneLabel.setText(rb.getString(\"phoneLabel\"));\n\n // Prompt text\n idField.setPromptText(rb.getString(\"idPrompt\"));\n nameField.setPromptText(rb.getString(\"namePrompt\"));\n addressField.setPromptText(rb.getString(\"addressPrompt\"));\n cityField.setPromptText(rb.getString(\"cityPrompt\"));\n countryComboBox.setPromptText(rb.getString(\"countryPrompt\"));\n divisionComboBox.setPromptText(rb.getString(\"divisionPrompt\"));\n postalField.setPromptText(rb.getString(\"postalPrompt\"));\n phoneField.setPromptText(rb.getString(\"phonePrompt\"));\n\n // Button labels\n Common.scaleButton(saveBtn, rb.getString(\"saveBtn\"));\n Common.scaleButton(cancelBtn, rb.getString(\"cancelBtn\"));\n\n // Error label; initially blank\n errorLabel.setText(\"\");\n }",
"public void setValuesForDisplay() {\n \tthis.trainModelGUI.tempLabel.setText(Integer.toString(this.temperature) + DEGREE + \"F\");\n\n //this.trainCars = this.trainModelGUI.numCars();\n this.trainWheels = this.trainCars * TRAIN_NUM_WHEELS;\n this.trainModelGUI.crewCountLabel.setText(Integer.toString(crew));\n this.trainModelGUI.heightVal.setText(Double.toString(truncateTo(this.trainHeight, 2)));\n this.trainModelGUI.widthVal.setText(Double.toString(truncateTo(this.trainWidth, 2)));\n this.trainModelGUI.lengthVal.setText(Double.toString(truncateTo(this.trainLength, 2)));\n this.trainModelGUI.weightVal.setText(Integer.toString(((int)this.trainWeight)));\n this.trainModelGUI.capacityVal.setText(Integer.toString(this.trainCapacity));\n this.trainModelGUI.powerVal.setText(Double.toString(truncateTo(this.powerIn/1000,2)));\n \n GPSAntenna = this.trainModelGUI.signalFailStatus();\n if(!GPSAntenna) {\n \tthis.trainModelGUI.gpsAntennaStatusLabel.setText(\"ON\");\n } else {\n \tthis.trainModelGUI.gpsAntennaStatusLabel.setText(\"OFF\");\n }\n MBOAntenna = this.trainModelGUI.signalFailStatus();\n if(!MBOAntenna) {\n \tthis.trainModelGUI.mboAntennaStatusLabel.setText(\"ON\");\n } else {\n \tthis.trainModelGUI.mboAntennaStatusLabel.setText(\"OFF\");\n }\n \t\n \tthis.trainModelGUI.timeVal.setText(trnMdl.currentTime.toString());\n \tthis.trainModelGUI.stationVal.setText(this.station);\n \t\n \tif(rightDoorIsOpen == true) {\n \tthis.trainModelGUI.rightDoorStatusLabel.setText(\"OPEN\");\n } else {\n \tthis.trainModelGUI.rightDoorStatusLabel.setText(\"CLOSED\");\n }\n \tif(leftDoorIsOpen == true) {\n \tthis.trainModelGUI.leftDoorStatusLabel.setText(\"OPEN\");\n } else {\n \tthis.trainModelGUI.leftDoorStatusLabel.setText(\"CLOSED\");\n }\n\n \tif(lightsAreOn == true) {\n \t\tthis.trainModelGUI.lightStatusLabel.setText(\"ON\");\n } else {\n \tthis.trainModelGUI.lightStatusLabel.setText(\"OFF\");\n }\n \t\n \tthis.trainModelGUI.numPassengers.setText(Integer.toString(this.numPassengers));\n \tthis.trainModelGUI.numCarsSpinner.setText(Integer.toString(this.trainCars));\n \tthis.trainModelGUI.authorityVal.setText(Double.toString(truncateTo(this.CTCAuthority/METERS_PER_MILE,2)));\n \tthis.trainModelGUI.ctcSpeedLabel.setText(Double.toString(truncateTo(this.CTCSpeed*KPH_TO_MPH,2)));\n \t\n \tif(serviceBrake) {\n \t\tthis.trainModelGUI.serviceLabel.setText(\"ON\");\n } else {\n \tthis.trainModelGUI.serviceLabel.setText(\"OFF\");\n }\n \tif(emerBrake) {\n \t\tthis.trainModelGUI.emergencyLabel.setText(\"ON\");\n } else {\n \tthis.trainModelGUI.emergencyLabel.setText(\"OFF\");\n }\n \t\n \tif(this.arrivalStatus == ARRIVING) {\n \t\tthis.trainModelGUI.arrivalStatusLabel.setText(\"ARRIVING\");\n \t} else if (this.arrivalStatus == EN_ROUTE) {\n \t\tthis.trainModelGUI.arrivalStatusLabel.setText(\"EN ROUTE\");\n \t} else if (this.arrivalStatus == APPROACHING) {\n \t\tthis.trainModelGUI.arrivalStatusLabel.setText(\"APPROACHING\");\n \t} else {\n \t\tthis.trainModelGUI.arrivalStatusLabel.setText(\"DEPARTING\");\n embarkingPassengersSet = false;\n \t}\n\n \tthis.trainModelGUI.currentSpeedLabel.setText(Double.toString(truncateTo((this.currentSpeed*MS_TO_MPH), 2)));\n \n \tif (this.lineColor.equals(\"GREEN\")) {\n \t\tthis.trainModelGUI.lblLine.setText(lineColor);\n \t\tthis.trainModelGUI.lblLine.setForeground(Color.GREEN);\n \t} else {\n \t\tthis.trainModelGUI.lblLine.setText(\"RED\");\n \t\tthis.trainModelGUI.lblLine.setForeground(Color.RED);\n }\n \t\n }",
"public void initComponent(){\n\t\t\n\t\tpanelMiddle.setCaption(\"PROSES:\");\n\t\t\n\t\t//INIT COMPONENT BAWAH\t\n\t\tlabelNotes.setContentMode(ContentMode.HTML);\n\t\tlabelNotes.setValue(\"Notes: <br> Perubahan pada Calender Kerja akan mempengaruhi seluruh sistem <br>.\" );\n\t}",
"@FXML\n public void initialize()\n {\n randomlyChooseWord();\n setHangmanWord();\n\n hangmanShapes[0] = hangman1;\n hangmanShapes[1] = hangman2;\n hangmanShapes[2] = hangman3;\n hangmanShapes[3] = hangman4;\n hangmanShapes[4] = hangman5;\n hangmanShapes[5] = hangman6;\n hangmanShapes[6] = hangman7;\n hangmanShapes[7] = hangman8;\n hangmanShapes[8] = hangman9;\n hangmanShapes[9] = hangman10;\n }",
"private void initializeAttributes() {\n\t language.setMinWidth(200);//250\n\t language.setAlignment(Pos.CENTER);\n\t language.getStyleClass().clear();\n\t language.getStyleClass().add(\"menuButton\");\n\t \n\t // Set history button properties\n\t history.setMinWidth(200);//250\n\t history.setAlignment(Pos.CENTER);\n\t history.getStyleClass().clear();\n\t history.getStyleClass().add(\"menuButton\");\n\t \n\t // Set closing button button properties\n\t closingButton.getStyleClass().clear();\n\t closingButton.getStyleClass().add(\"menuButton\");\n\t \n\t // Set reducing button button properties\n\t reducingButton.getStyleClass().clear();\n\t reducingButton.getStyleClass().add(\"menuButton\");\n\t \n\t // Close window/application on click\n\t closingButton.setOnAction(new EventHandler<ActionEvent>() {\n public void handle(ActionEvent e) {\n \tgameMainStage.close();\n }\n });\n\t \n\t // Reduce window/application on click\n\t reducingButton.setOnAction(new EventHandler<ActionEvent>() {\n public void handle(ActionEvent e) {\n \tgameMainStage.setIconified(true);\n }\n });\n\t \n\t // Switch to the language part of the application on click\n\t language.setOnAction(new EventHandler<ActionEvent>() {\n public void handle(ActionEvent e) {\n if (currentTab == null || currentTab.equals(\"history\")) {\n \tcurrentTab = \"language\";\n \tupdateTabButtons();\n \twindowMainPane.setCenter(new Language());\n }\n }\n });\n\t \n\t\t// Switch to the history part of the application on click\n\t history.setOnAction(new EventHandler<ActionEvent>() {\n public void handle(ActionEvent e) {\n \tif (currentTab == null || currentTab.equals(\"language\")) {\n \t\tcurrentTab = \"history\";\n \t\tupdateTabButtons();\n \t\twindowMainPane.setCenter(new History(0));\n \t}\n }\n });\n\t}",
"private void initNoti() {\n lblNoti = new JLabel(\"\");\n\n springLayout.putConstraint(SpringLayout.WEST, lblNoti, 335, SpringLayout.WEST, estimationGame.getContentPane());\n springLayout.putConstraint(SpringLayout.SOUTH, lblNoti, -10, SpringLayout.NORTH, btnAvatarA);\n lblNoti.setForeground(new Color(224, 255, 255));\n lblNoti.setFont(new Font(\"Tahoma\", Font.PLAIN, 15));\n\n estimationGame.getContentPane().add(lblNoti);\n\t}",
"@Override\n public void init() {\n super.init();\n prev1 = new Gamepad();\n prev2 = new Gamepad();\n armExtended = false;\n\n glyphLiftState = GlyphLiftState.ASCENDING;\n }",
"boolean labelColor(String mode);",
"public Ventana() {\n initComponents();\n this.tipos.add(GD_C);\n this.tipos.add(GD_S);\n this.tipos.add(GND_C);\n this.tipos.add(GND_S);\n this.panel.setArea_text(text);\n\n }",
"public Display(){\n GridLayout layout = new GridLayout(1,DIGIT_COUNT);\n setLayout(layout);\n for (int i = 0; i < labels.length; i++) {\n labels[i] = new JLabel();\n labels[i].setIcon(numbers[0]);\n add(labels[i]);\n }\n\n setNumber(0);\n }",
"private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.getContentPane().setBackground(Color.BLACK);\n\t\tframe.setBounds(100, 100, 450, 300);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(null);\n\t\t\n\t\tJButton btnNewButton = new JButton(\"Play\");\n\t\tbtnNewButton.setFont(new Font(\"Bodoni 72\", Font.BOLD, 13));\n\t\tbtnNewButton.setBounds(frame.getWidth() / 2 - 60, 195, 120, 30);\n\t\tframe.getContentPane().add(btnNewButton);\n\t\t\n\t\tJLabel lblNewLabel = new JLabel(\"Space Escape\");\n\t\tlblNewLabel.setForeground(Color.WHITE);\n\t\tlblNewLabel.setFont(new Font(\"Bodoni 72\", Font.BOLD, 24));\n\t\tlblNewLabel.setBounds(frame.getWidth() / 2 - 60, 30, 135, 25);\n\t\tframe.getContentPane().add(lblNewLabel);\n\t\t\n\t\tJLabel lblNewLabel_1 = new JLabel(\"New label\");\n\t\tlblNewLabel_1.setBounds(0, 0, frame.getWidth(), frame.getHeight());\n\t\tframe.getContentPane().add(lblNewLabel_1);\n\t}",
"private void initialize() {\n\t\tfrmTrainmodelmodule = new JFrame();\n\t\tfrmTrainmodelmodule.setTitle(\"TrainModelModule\");\n\t\tfrmTrainmodelmodule.setBounds(100, 100, 1161, 579);\n\t\tfrmTrainmodelmodule.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tfrmTrainmodelmodule.getContentPane().setLayout(null);\n\t\t\n\t\t\n\t\t\n\t\t/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t\tJPanel failureModesPanel = new JPanel();\n\t\tfailureModesPanel.setBorder(new LineBorder(new Color(0, 0, 0), 2));\n\t\tfailureModesPanel.setBounds(12, 23, 219, 347);\n\t\tfrmTrainmodelmodule.getContentPane().add(failureModesPanel);\n\t\tfailureModesPanel.setLayout(null);\n\t\t\n\t\tJLabel lblFailModes = new JLabel(\"Failure Modes\");\n\t\tlblFailModes.setBounds(30, 0, 164, 48);\n\t\tfailureModesPanel.add(lblFailModes);\n\t\tlblFailModes.setFont(new Font(\"Times New Roman\", Font.BOLD, 18));\n\t\tlblFailModes.setHorizontalAlignment(SwingConstants.CENTER);\n\t\t\n\t\tJButton engineFailureButton = new JButton(\"Engine Failure\");\n\t\tengineFailureButton.setFont(new Font(\"Times New Roman\", Font.PLAIN, 13));\n\t\tengineFailureButton.setBounds(30, 61, 164, 54);\n\t\tfailureModesPanel.add(engineFailureButton);\n\t\tengineFailureButton.setForeground(Color.BLACK);\n\t\t\n\t\tJButton brakeFailureButton = new JButton(\"Brake Failure\");\n\t\tbrakeFailureButton.setFont(new Font(\"Times New Roman\", Font.PLAIN, 13));\n\t\tbrakeFailureButton.setBounds(30, 130, 164, 54);\n\t\tfailureModesPanel.add(brakeFailureButton);\n\t\t\n\t\tJButton signalPickupFailureButton = new JButton(\"Signal Pickup Failure\");\n\t\tsignalPickupFailureButton.setFont(new Font(\"Times New Roman\", Font.PLAIN, 13));\n\t\tsignalPickupFailureButton.setBounds(30, 208, 164, 54);\n\t\tfailureModesPanel.add(signalPickupFailureButton);\n\t\t\n\t\tJButton resetButton = new JButton(\"Reset\");\n\t\tresetButton.setFont(new Font(\"Times New Roman\", Font.PLAIN, 13));\n\t\tresetButton.setBounds(30, 289, 164, 45);\n\t\tfailureModesPanel.add(resetButton);\n\t\t\n\t\tengineFailureButton.addMouseListener(new MouseAdapter() {\n\t\t\t@Override\n\t\t\tpublic void mouseClicked(MouseEvent arg0) {\n\t\t\t\n\t\t\t\t\n\t\t\t\tbrakeFailureButton.setEnabled(false);\n\t\t\t\tsignalPickupFailureButton.setEnabled(false);\n\t\t\t\ttrain.activateEngineFailure();\n\t\t\t}\n\t\t});\n\t\t\n\t\tbrakeFailureButton.addMouseListener(new MouseAdapter() {\n\t\t\t@Override\n\t\t\tpublic void mouseClicked(MouseEvent arg0) {\n\t\t\t\n\t\t\t\tengineFailureButton.setEnabled(false);\n\t\t\t\tsignalPickupFailureButton.setEnabled(false);\n\t\t\t\ttrain.activateBrakeFailure();\n\t\t\t}\n\t\t});\n\t\t\n\t\tsignalPickupFailureButton.addMouseListener(new MouseAdapter() {\n\t\t\t@Override\n\t\t\tpublic void mouseClicked(MouseEvent arg0) {\n\t\t\t\n\t\t\t\tbrakeFailureButton.setEnabled(false);\n\t\t\t\tengineFailureButton.setEnabled(false);\n\t\t\t\ttrain.activateSignalPickupFailure();\n\t\t\t}\n\t\t});\n\t\t\n\t\tresetButton.addMouseListener(new MouseAdapter() {\n\t\t\t@Override\n\t\t\tpublic void mouseClicked(MouseEvent arg0) {\n\t\t\t\n\t\t\t\tbrakeFailureButton.setEnabled(true);\n\t\t\t\tengineFailureButton.setEnabled(true);\n\t\t\t\tsignalPickupFailureButton.setEnabled(true);\n\t\t\t\ttrain.deactivateEngineFailure();\n\t\t\t\ttrain.deactivateBrakeFailure();\n\t\t\t\ttrain.deactivateSignalPickupFailure();\n\t\t\t}\n\t\t});\n\t\t\n\t\tJPanel enginePwrPanel = new JPanel();\n\t\tenginePwrPanel.setBorder(new LineBorder(new Color(0, 0, 0), 2));\n\t\tenginePwrPanel.setBounds(506, 23, 144, 70);\n\t\tfrmTrainmodelmodule.getContentPane().add(enginePwrPanel);\n\t\tenginePwrPanel.setLayout(null);\n\t\t\n\t\tJLabel lblEnginePwr = new JLabel(\"Engine Power\");\n\t\tlblEnginePwr.setBounds(19, 0, 106, 22);\n\t\tenginePwrPanel.add(lblEnginePwr);\n\t\tlblEnginePwr.setFont(new Font(\"Times New Roman\", Font.BOLD, 18));\n\t\tlblEnginePwr.setHorizontalAlignment(SwingConstants.CENTER);\n\t\t\n\t\ttxtEnginePower = new JTextField();\n\t\ttxtEnginePower.setBounds(6, 28, 131, 28);\n\t\tenginePwrPanel.add(txtEnginePower);\n\t\ttxtEnginePower.setEditable(false);\n\t\ttxtEnginePower.setHorizontalAlignment(SwingConstants.CENTER);\n\t\ttxtEnginePower.setFont(new Font(\"Times New Roman\", Font.PLAIN, 18));\n\t\ttxtEnginePower.setColumns(10);\n\t\t\n\t\tJPanel brkInputPanel = new JPanel();\n\t\tbrkInputPanel.setBorder(new LineBorder(new Color(0, 0, 0), 2));\n\t\tbrkInputPanel.setBounds(243, 23, 251, 347);\n\t\tfrmTrainmodelmodule.getContentPane().add(brkInputPanel);\n\t\tbrkInputPanel.setLayout(null);\n\t\t\n\t\tJLabel lblBrkInputs = new JLabel(\"Brake Inputs\");\n\t\tlblBrkInputs.setBounds(71, 13, 101, 22);\n\t\tbrkInputPanel.add(lblBrkInputs);\n\t\tlblBrkInputs.setFont(new Font(\"Times New Roman\", Font.BOLD, 18));\n\t\tlblBrkInputs.setHorizontalAlignment(SwingConstants.CENTER);\n\t\t\n\t\tJButton tglbtnServiceBrake = new JButton(\"Service Brake\");\n\t\ttglbtnServiceBrake.setFont(new Font(\"Times New Roman\", Font.PLAIN, 13));\n\t\ttglbtnServiceBrake.addMouseListener(new MouseAdapter() {\n\t\t\t@Override\n\t\t\tpublic void mouseClicked(MouseEvent o) {\n\t\t\t\tswitchServiceBrakeStatus();\n\t\t\t}\n\t\t});\n\t\ttglbtnServiceBrake.setSelected(false);\n\t\ttglbtnServiceBrake.setBounds(12, 213, 228, 121);\n\t\tbrkInputPanel.add(tglbtnServiceBrake);\n\t\t\n\t\tJButton tglbtnEmergencyBrake = new JButton(\"Passenger Emergency Brake\");\n\t\ttglbtnEmergencyBrake.setFont(new Font(\"Times New Roman\", Font.PLAIN, 13));\n\t\ttglbtnEmergencyBrake.addMouseListener(new MouseAdapter() {\n\t\t\t@Override\n\t\t\tpublic void mouseClicked(MouseEvent y) {\n\t\t\tswitchEmergencyBrakeStatus();\n\t\t\t}\n\t\t});\n\t\ttglbtnEmergencyBrake.setSelected(false);\n\t\ttglbtnEmergencyBrake.setBounds(12, 56, 228, 121);\n\t\tbrkInputPanel.add(tglbtnEmergencyBrake);\n\t\t\n\t\t////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t\t////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t\t//Fixed values on the gui\n\t\tJLabel lblLength = new JLabel(\"Length:\");\n\t\tlblLength.setHorizontalAlignment(SwingConstants.LEFT);\n\t\tlblLength.setFont(new Font(\"Times New Roman\", Font.BOLD, 18));\n\t\tlblLength.setBounds(47, 398, 60, 22);\n\t\tfrmTrainmodelmodule.getContentPane().add(lblLength);\n\t\t\n\t\tJLabel lblWidth = new JLabel(\"Width:\");\n\t\tlblWidth.setFont(new Font(\"Times New Roman\", Font.BOLD, 18));\n\t\tlblWidth.setBounds(54, 430, 53, 22);\n\t\tfrmTrainmodelmodule.getContentPane().add(lblWidth);\n\t\t\n\t\tJLabel lblHeight = new JLabel(\"Height:\");\n\t\tlblHeight.setFont(new Font(\"Times New Roman\", Font.BOLD, 18));\n\t\tlblHeight.setBounds(50, 462, 57, 22);\n\t\tfrmTrainmodelmodule.getContentPane().add(lblHeight);\n\t\t\n\t\tJLabel lblEmptyMass = new JLabel(\"Empty Mass:\");\n\t\tlblEmptyMass.setFont(new Font(\"Times New Roman\", Font.BOLD, 18));\n\t\tlblEmptyMass.setBounds(6, 493, 101, 22);\n\t\tfrmTrainmodelmodule.getContentPane().add(lblEmptyMass);\n\t\t\n\t\tJLabel lblEmergencyBrakeDeceleration = new JLabel(\"Emergency Brake Deceleration Limit:\");\n\t\tlblEmergencyBrakeDeceleration.setHorizontalAlignment(SwingConstants.LEFT);\n\t\tlblEmergencyBrakeDeceleration.setFont(new Font(\"Times New Roman\", Font.BOLD, 18));\n\t\tlblEmergencyBrakeDeceleration.setBounds(285, 394, 291, 22);\n\t\tfrmTrainmodelmodule.getContentPane().add(lblEmergencyBrakeDeceleration);\n\t\t\n\t\tJLabel lblServiceBrakeAcceleration = new JLabel(\"Service Brake Deceleration Limit:\");\n\t\tlblServiceBrakeAcceleration.setFont(new Font(\"Times New Roman\", Font.BOLD, 18));\n\t\tlblServiceBrakeAcceleration.setBounds(315, 429, 261, 22);\n\t\tfrmTrainmodelmodule.getContentPane().add(lblServiceBrakeAcceleration);\n\t\t\n\t\tJLabel lblAccelerationLimit = new JLabel(\"Acceleration Limit:\");\n\t\tlblAccelerationLimit.setFont(new Font(\"Times New Roman\", Font.BOLD, 18));\n\t\tlblAccelerationLimit.setBounds(426, 462, 150, 22);\n\t\tfrmTrainmodelmodule.getContentPane().add(lblAccelerationLimit);\n\t\t\n\t\tJLabel lblMaxEnginePower = new JLabel(\"Max Engine Power:\");\n\t\tlblMaxEnginePower.setFont(new Font(\"Times New Roman\", Font.BOLD, 18));\n\t\tlblMaxEnginePower.setBounds(771, 394, 151, 22);\n\t\tfrmTrainmodelmodule.getContentPane().add(lblMaxEnginePower);\n\t\t\n\t\tJLabel lblMaxSpeed = new JLabel(\"Max Speed:\");\n\t\tlblMaxSpeed.setHorizontalAlignment(SwingConstants.LEFT);\n\t\tlblMaxSpeed.setFont(new Font(\"Times New Roman\", Font.BOLD, 18));\n\t\tlblMaxSpeed.setBounds(831, 428, 91, 22);\n\t\tfrmTrainmodelmodule.getContentPane().add(lblMaxSpeed);\n\t\t\n\t\ttxtLength = new JTextField();\n\t\ttxtLength.setFont(new Font(\"Times New Roman\", Font.PLAIN, 18));\n\t\ttxtLength.setText(\"105.64 ft\");\n\t\ttxtLength.setEditable(false);\n\t\ttxtLength.setBounds(115, 397, 116, 22);\n\t\tfrmTrainmodelmodule.getContentPane().add(txtLength);\n\t\ttxtLength.setColumns(10);\n\t\t\n\t\ttxtWidth = new JTextField();\n\t\ttxtWidth.setFont(new Font(\"Times New Roman\", Font.PLAIN, 18));\n\t\ttxtWidth.setText(\"8.69 ft\");\n\t\ttxtWidth.setEditable(false);\n\t\ttxtWidth.setColumns(10);\n\t\ttxtWidth.setBounds(115, 431, 116, 22);\n\t\tfrmTrainmodelmodule.getContentPane().add(txtWidth);\n\t\t\n\t\ttxtHeight = new JTextField();\n\t\ttxtHeight.setFont(new Font(\"Times New Roman\", Font.PLAIN, 18));\n\t\ttxtHeight.setText(\"11.22 ft\");\n\t\ttxtHeight.setEditable(false);\n\t\ttxtHeight.setColumns(10);\n\t\ttxtHeight.setBounds(115, 463, 116, 22);\n\t\tfrmTrainmodelmodule.getContentPane().add(txtHeight);\n\t\t\n\t\ttxtEmptyMass = new JTextField();\n\t\ttxtEmptyMass.setFont(new Font(\"Times New Roman\", Font.PLAIN, 18));\n\t\ttxtEmptyMass.setText(\"90169.07 lbs\");\n\t\ttxtEmptyMass.setEditable(false);\n\t\ttxtEmptyMass.setColumns(10);\n\t\ttxtEmptyMass.setBounds(115, 494, 116, 22);\n\t\tfrmTrainmodelmodule.getContentPane().add(txtEmptyMass);\n\t\t\n\t\ttxtEBrakeDecel = new JTextField();\n\t\ttxtEBrakeDecel.setFont(new Font(\"Times New Roman\", Font.PLAIN, 18));\n\t\ttxtEBrakeDecel.setText(\"- 8.96 (ft)/(s^2)\");\n\t\ttxtEBrakeDecel.setEditable(false);\n\t\ttxtEBrakeDecel.setColumns(10);\n\t\ttxtEBrakeDecel.setBounds(584, 397, 127, 22);\n\t\tfrmTrainmodelmodule.getContentPane().add(txtEBrakeDecel);\n\t\t\n\t\ttxtSBrakeDecel = new JTextField();\n\t\ttxtSBrakeDecel.setFont(new Font(\"Times New Roman\", Font.PLAIN, 18));\n\t\ttxtSBrakeDecel.setText(\"- 3.94 (ft)/(s^2)\");\n\t\ttxtSBrakeDecel.setEditable(false);\n\t\ttxtSBrakeDecel.setColumns(10);\n\t\ttxtSBrakeDecel.setBounds(584, 431, 127, 22);\n\t\tfrmTrainmodelmodule.getContentPane().add(txtSBrakeDecel);\n\t\t\n\t\ttxtAccelLim = new JTextField();\n\t\ttxtAccelLim.setFont(new Font(\"Times New Roman\", Font.PLAIN, 18));\n\t\ttxtAccelLim.setText(\"1.64 (ft)/(s^2)\");\n\t\ttxtAccelLim.setEditable(false);\n\t\ttxtAccelLim.setColumns(10);\n\t\ttxtAccelLim.setBounds(584, 463, 127, 22);\n\t\tfrmTrainmodelmodule.getContentPane().add(txtAccelLim);\n\t\t\n\t\ttxtMaxEnginePwr = new JTextField();\n\t\ttxtMaxEnginePwr.setFont(new Font(\"Times New Roman\", Font.PLAIN, 18));\n\t\ttxtMaxEnginePwr.setText(\"120000 W\");\n\t\ttxtMaxEnginePwr.setEditable(false);\n\t\ttxtMaxEnginePwr.setColumns(10);\n\t\ttxtMaxEnginePwr.setBounds(927, 396, 116, 22);\n\t\tfrmTrainmodelmodule.getContentPane().add(txtMaxEnginePwr);\n\t\t\n\t\ttxtMaxSpeed = new JTextField();\n\t\ttxtMaxSpeed.setFont(new Font(\"Times New Roman\", Font.PLAIN, 18));\n\t\ttxtMaxSpeed.setText(\"43.50 mph\");\n\t\ttxtMaxSpeed.setEditable(false);\n\t\ttxtMaxSpeed.setColumns(10);\n\t\ttxtMaxSpeed.setBounds(927, 430, 116, 22);\n\t\tfrmTrainmodelmodule.getContentPane().add(txtMaxSpeed);\n\t\t////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t\t////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t\t\n\t\tJPanel doorPanel = new JPanel();\n\t\tdoorPanel.setBorder(new LineBorder(new Color(0, 0, 0), 2));\n\t\tdoorPanel.setBounds(506, 252, 272, 118);\n\t\tfrmTrainmodelmodule.getContentPane().add(doorPanel);\n\t\tdoorPanel.setLayout(null);\n\t\t\n\t\tJLabel lblLeftDoorsStatus = new JLabel(\"Left Doors Status:\");\n\t\tlblLeftDoorsStatus.setBounds(23, 44, 142, 22);\n\t\tdoorPanel.add(lblLeftDoorsStatus);\n\t\tlblLeftDoorsStatus.setFont(new Font(\"Times New Roman\", Font.BOLD, 18));\n\t\t\n\t\tJLabel lblRightDoorsStatus = new JLabel(\"Right Doors Status:\");\n\t\tlblRightDoorsStatus.setBounds(12, 70, 153, 22);\n\t\tdoorPanel.add(lblRightDoorsStatus);\n\t\tlblRightDoorsStatus.setHorizontalAlignment(SwingConstants.LEFT);\n\t\tlblRightDoorsStatus.setFont(new Font(\"Times New Roman\", Font.BOLD, 18));\n\t\t\n\t\tJLabel lblNewLabel_5 = new JLabel(\"Doors\");\n\t\tlblNewLabel_5.setFont(new Font(\"Times New Roman\", Font.BOLD, 18));\n\t\tlblNewLabel_5.setBounds(112, 13, 56, 16);\n\t\tdoorPanel.add(lblNewLabel_5);\n\t\t\n\t\ttextLeftDoorStat = new JTextField();\n\t\ttextLeftDoorStat.setHorizontalAlignment(SwingConstants.CENTER);\n\t\ttextLeftDoorStat.setFont(new Font(\"Times New Roman\", Font.PLAIN, 13));\n\t\ttextLeftDoorStat.setEditable(false);\n\t\ttextLeftDoorStat.setColumns(10);\n\t\ttextLeftDoorStat.setBounds(176, 45, 84, 22);\n\t\tdoorPanel.add(textLeftDoorStat);\n\t\t\n\t\ttextRightDoorStat = new JTextField();\n\t\ttextRightDoorStat.setHorizontalAlignment(SwingConstants.CENTER);\n\t\ttextRightDoorStat.setFont(new Font(\"Times New Roman\", Font.PLAIN, 13));\n\t\ttextRightDoorStat.setEditable(false);\n\t\ttextRightDoorStat.setColumns(10);\n\t\ttextRightDoorStat.setBounds(176, 71, 84, 22);\n\t\tdoorPanel.add(textRightDoorStat);\n\t\t\n\t\tJPanel brakePanel = new JPanel();\n\t\tbrakePanel.setLayout(null);\n\t\tbrakePanel.setBorder(new LineBorder(new Color(0, 0, 0), 2));\n\t\tbrakePanel.setBounds(790, 252, 338, 118);\n\t\tfrmTrainmodelmodule.getContentPane().add(brakePanel);\n\t\t\n\t\tJLabel lblEmergencyBrakeStatus = new JLabel(\"Emergency Brake Status:\");\n\t\tlblEmergencyBrakeStatus.setFont(new Font(\"Times New Roman\", Font.BOLD, 18));\n\t\tlblEmergencyBrakeStatus.setBounds(12, 44, 194, 22);\n\t\tbrakePanel.add(lblEmergencyBrakeStatus);\n\t\t\n\t\tJLabel lblServiceBrakeStatus = new JLabel(\"Service Brake Status:\");\n\t\tlblServiceBrakeStatus.setHorizontalAlignment(SwingConstants.LEFT);\n\t\tlblServiceBrakeStatus.setFont(new Font(\"Times New Roman\", Font.BOLD, 18));\n\t\tlblServiceBrakeStatus.setBounds(42, 76, 164, 22);\n\t\tbrakePanel.add(lblServiceBrakeStatus);\n\t\t\n\t\tJLabel lblBrakes = new JLabel(\"Brakes\");\n\t\tlblBrakes.setFont(new Font(\"Times New Roman\", Font.BOLD, 18));\n\t\tlblBrakes.setBounds(159, 13, 56, 16);\n\t\tbrakePanel.add(lblBrakes);\n\t\ttrainSelectBox.setFont(new Font(\"Times New Roman\", Font.PLAIN, 13));\n\t\ttrainSelectBox.addItemListener(new ItemListener() {\n\t\t\tpublic void itemStateChanged(ItemEvent arg0) {\n\t\t\t\tif (arg0.getStateChange() == ItemEvent.SELECTED) {\n\t\t\t Integer trainID = (Integer) arg0.getItem();\n\t\t\t switchTrain(trainID);\n\t\t\t }\n\t\t\t}\n\t\t});\n\t\t\n\t\ttrainSelectBox.setBounds(1060, 23, 58, 20);\n\t\tfrmTrainmodelmodule.getContentPane().add(trainSelectBox);\n\t\t\n\t\ttxtEBrkStat = new JTextField();\n\t\ttxtEBrkStat.setHorizontalAlignment(SwingConstants.CENTER);\n\t\ttxtEBrkStat.setFont(new Font(\"Times New Roman\", Font.PLAIN, 13));\n\t\ttxtEBrkStat.setEditable(false);\n\t\ttxtEBrkStat.setColumns(10);\n\t\ttxtEBrkStat.setBounds(209, 45, 116, 22);\n\t\tbrakePanel.add(txtEBrkStat);\n\t\t\n\t\ttxtSBrkStat = new JTextField();\n\t\ttxtSBrkStat.setHorizontalAlignment(SwingConstants.CENTER);\n\t\ttxtSBrkStat.setFont(new Font(\"Times New Roman\", Font.PLAIN, 13));\n\t\ttxtSBrkStat.setEditable(false);\n\t\ttxtSBrkStat.setColumns(10);\n\t\ttxtSBrkStat.setBounds(209, 77, 116, 22);\n\t\tbrakePanel.add(txtSBrkStat);\n\t\t\n\t\tJPanel setSpdPanel = new JPanel();\n\t\tsetSpdPanel.setLayout(null);\n\t\tsetSpdPanel.setBorder(new LineBorder(new Color(0, 0, 0), 2));\n\t\tsetSpdPanel.setBounds(662, 23, 144, 70);\n\t\tfrmTrainmodelmodule.getContentPane().add(setSpdPanel);\n\t\t\n\t\tJLabel lblSetSpd = new JLabel(\"Target Speed\");\n\t\tlblSetSpd.setHorizontalAlignment(SwingConstants.CENTER);\n\t\tlblSetSpd.setFont(new Font(\"Times New Roman\", Font.BOLD, 18));\n\t\tlblSetSpd.setBounds(19, 0, 106, 22);\n\t\tsetSpdPanel.add(lblSetSpd);\n\t\t\n\t\ttxtSetSpd = new JTextField();\n\t\ttxtSetSpd.setHorizontalAlignment(SwingConstants.CENTER);\n\t\ttxtSetSpd.setFont(new Font(\"Times New Roman\", Font.PLAIN, 18));\n\t\ttxtSetSpd.setEditable(false);\n\t\ttxtSetSpd.setColumns(10);\n\t\ttxtSetSpd.setBounds(6, 28, 131, 28);\n\t\tsetSpdPanel.add(txtSetSpd);\n\t\t\n\t\tJPanel Authoritypanel = new JPanel();\n\t\tAuthoritypanel.setLayout(null);\n\t\tAuthoritypanel.setBorder(new LineBorder(new Color(0, 0, 0), 2));\n\t\tAuthoritypanel.setBounds(818, 23, 144, 70);\n\t\tfrmTrainmodelmodule.getContentPane().add(Authoritypanel);\n\t\t\n\t\tJLabel lblAuthority = new JLabel(\"Authority\");\n\t\tlblAuthority.setHorizontalAlignment(SwingConstants.CENTER);\n\t\tlblAuthority.setFont(new Font(\"Times New Roman\", Font.BOLD, 18));\n\t\tlblAuthority.setBounds(19, 0, 106, 22);\n\t\tAuthoritypanel.add(lblAuthority);\n\t\t\n\t\ttxtAuthority = new JTextField();\n\t\ttxtAuthority.setHorizontalAlignment(SwingConstants.CENTER);\n\t\ttxtAuthority.setFont(new Font(\"Times New Roman\", Font.PLAIN, 18));\n\t\ttxtAuthority.setEditable(false);\n\t\ttxtAuthority.setColumns(10);\n\t\ttxtAuthority.setBounds(6, 28, 131, 28);\n\t\tAuthoritypanel.add(txtAuthority);\n\t\t\n\t\tJPanel blkSpdLimPanel = new JPanel();\n\t\tblkSpdLimPanel.setLayout(null);\n\t\tblkSpdLimPanel.setBorder(new LineBorder(new Color(0, 0, 0), 2));\n\t\tblkSpdLimPanel.setBounds(506, 135, 144, 70);\n\t\tfrmTrainmodelmodule.getContentPane().add(blkSpdLimPanel);\n\t\t\n\t\tJLabel lblBlockSpeedLimit = new JLabel(\"Block Speed Limit\");\n\t\tlblBlockSpeedLimit.setHorizontalAlignment(SwingConstants.CENTER);\n\t\tlblBlockSpeedLimit.setFont(new Font(\"Times New Roman\", Font.BOLD, 16));\n\t\tlblBlockSpeedLimit.setBounds(6, 0, 131, 22);\n\t\tblkSpdLimPanel.add(lblBlockSpeedLimit);\n\t\t\n\t\ttxtBockSpdLim = new JTextField();\n\t\ttxtBockSpdLim.setHorizontalAlignment(SwingConstants.CENTER);\n\t\ttxtBockSpdLim.setFont(new Font(\"Times New Roman\", Font.PLAIN, 18));\n\t\ttxtBockSpdLim.setEditable(false);\n\t\ttxtBockSpdLim.setColumns(10);\n\t\ttxtBockSpdLim.setBounds(6, 28, 131, 28);\n\t\tblkSpdLimPanel.add(txtBockSpdLim);\n\t\t\n\t\tJPanel currSpeedPanel = new JPanel();\n\t\tcurrSpeedPanel.setLayout(null);\n\t\tcurrSpeedPanel.setBorder(new LineBorder(new Color(0, 0, 0), 2));\n\t\tcurrSpeedPanel.setBounds(662, 135, 144, 70);\n\t\tfrmTrainmodelmodule.getContentPane().add(currSpeedPanel);\n\t\t\n\t\tJLabel lblCurrSpd = new JLabel(\"Current Speed\");\n\t\tlblCurrSpd.setHorizontalAlignment(SwingConstants.CENTER);\n\t\tlblCurrSpd.setFont(new Font(\"Times New Roman\", Font.BOLD, 18));\n\t\tlblCurrSpd.setBounds(6, 0, 131, 22);\n\t\tcurrSpeedPanel.add(lblCurrSpd);\n\t\t\n\t\ttxtCurrSpd = new JTextField();\n\t\ttxtCurrSpd.setHorizontalAlignment(SwingConstants.CENTER);\n\t\ttxtCurrSpd.setFont(new Font(\"Times New Roman\", Font.PLAIN, 18));\n\t\ttxtCurrSpd.setEditable(false);\n\t\ttxtCurrSpd.setColumns(10);\n\t\ttxtCurrSpd.setBounds(6, 28, 131, 28);\n\t\tcurrSpeedPanel.add(txtCurrSpd);\n\t\t\n\t\tJPanel accelPanel = new JPanel();\n\t\taccelPanel.setLayout(null);\n\t\taccelPanel.setBorder(new LineBorder(new Color(0, 0, 0), 2));\n\t\taccelPanel.setBounds(818, 135, 144, 70);\n\t\tfrmTrainmodelmodule.getContentPane().add(accelPanel);\n\t\t\n\t\tJLabel lblAcceleration = new JLabel(\"Acceleration\");\n\t\tlblAcceleration.setHorizontalAlignment(SwingConstants.CENTER);\n\t\tlblAcceleration.setFont(new Font(\"Times New Roman\", Font.BOLD, 18));\n\t\tlblAcceleration.setBounds(19, 0, 106, 22);\n\t\taccelPanel.add(lblAcceleration);\n\t\t\n\t\ttxtAccel = new JTextField();\n\t\ttxtAccel.setHorizontalAlignment(SwingConstants.CENTER);\n\t\ttxtAccel.setFont(new Font(\"Times New Roman\", Font.PLAIN, 18));\n\t\ttxtAccel.setEditable(false);\n\t\ttxtAccel.setColumns(10);\n\t\ttxtAccel.setBounds(6, 28, 131, 28);\n\t\taccelPanel.add(txtAccel);\n\t\t\n\t\tJPanel panel_5 = new JPanel();\n\t\tpanel_5.setLayout(null);\n\t\tpanel_5.setBorder(new LineBorder(new Color(0, 0, 0), 2));\n\t\tpanel_5.setBounds(974, 135, 144, 70);\n\t\tfrmTrainmodelmodule.getContentPane().add(panel_5);\n\t\t\n\t\tJLabel lblGrade = new JLabel(\"Grade\");\n\t\tlblGrade.setHorizontalAlignment(SwingConstants.CENTER);\n\t\tlblGrade.setFont(new Font(\"Times New Roman\", Font.BOLD, 18));\n\t\tlblGrade.setBounds(19, 0, 106, 22);\n\t\tpanel_5.add(lblGrade);\n\t\t\n\t\ttxtGrade = new JTextField();\n\t\ttxtGrade.setHorizontalAlignment(SwingConstants.CENTER);\n\t\ttxtGrade.setFont(new Font(\"Times New Roman\", Font.PLAIN, 18));\n\t\ttxtGrade.setEditable(false);\n\t\ttxtGrade.setColumns(10);\n\t\ttxtGrade.setBounds(6, 28, 131, 28);\n\t\tpanel_5.add(txtGrade);\n\t\t\n\t\tJLabel lblTrainId = new JLabel(\"Train ID:\");\n\t\tlblTrainId.setFont(new Font(\"Times New Roman\", Font.BOLD, 18));\n\t\tlblTrainId.setBounds(985, 22, 74, 20);\n\t\tfrmTrainmodelmodule.getContentPane().add(lblTrainId);\n\t\t\n\t}",
"private void initialize() {\n\t\t\n\t\tsuperHeroes = new String [] {\"Kryptoniano\",\"Super Soldado\",\"Velocista\"};\n\t\ttipoHeroe = new String [] {\"Fuerte\",\"Manipular tiempo\",\"Regeneración\",\"Super Velocidad\",\"Volador\"};\n\t\tsuperPoderesKriptoniano = new String [] {\"Golpear\",\"Levantar peso\",\"Empujar\",\"Lanzar\",\"Volar\",\"Aterrizar\",\"Flotar\",\"Despegar\",\"Curación\",\"Dejar de envejecer\",\"Recuperación rapida\",\"Saludable\",\"Correr rapido\",\"Ondas sonicas\",\"Aceleración Metabolismo\",\"Velocidad de la luz\"};\n\t\tsuperPoderesVelocista = new String [] {\"Viajar al pasado\",\"Viajar al futuro\",\"Dobles de tiempo\",\"Crear lineas de tiempo\",\"Correr rapido\",\"Ondas sonicas\",\"Aceleración Metabolismo\",\"Velocidad de la luz\",\"Curación\",\"Dejar de envejecer\",\"Recuperación rapida\",\"Saludable\"};\n\t\tsuperPoderSuperSoldado = new String [] {\"Curación\",\"Dejar de envejecer\",\"Recuperación rapida\",\"Saludable\",\"Golpear\",\"Levantar peso\",\"Empujar\",\"Lanzar\"};\n\t\t\n\t\tframe = new JFrame();\n\t\tframe.setBounds(100, 100, 1160, 800);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.setUndecorated(true);\n\t\tframe.setBackground(new Color(1.0f,1.0f,1.0f,0.0f));\n\t\tframe.getContentPane().setLayout(null);\n\t\t\n\t\tJLabel lblNewLabel_4 = new JLabel(\"\");\n\t\tlblNewLabel_4.setIcon(new ImageIcon(SuperInterfas.class.getResource(\"superhero-png-1123213.png\")));\n\t\tlblNewLabel_4.setBounds(319, 314, 284, 311);\n\t\tlblNewLabel_4.setVisible(false);\n\t\tframe.getContentPane().add(lblNewLabel_4);\n\t\t\n\t\t\n\t\tJLabel lblNewLabel_3 = new JLabel(\"\");\n\t\tlblNewLabel_3.setBounds(155, 727, 700, 62);\n\t\tframe.getContentPane().add(lblNewLabel_3);\n\t\t\n\t\t\n\t\t\n\t\tJLabel lblNewLabel_2_1 = new JLabel(\"Elija clase de heroe\");\n\t\tlblNewLabel_2_1.setBounds(289, 690, 124, 26);\n\t\tlblNewLabel_2_1.setForeground(new Color(0, 0, 255));\n\t\tframe.getContentPane().add(lblNewLabel_2_1);\n\t\t\n\t\t\n\t\tJLabel lblNewLabel_2 = new JLabel(\"Elija super poder\");\n\t\tlblNewLabel_2.setBounds(289, 653, 124, 26);\n\t\tlblNewLabel_2.setForeground(new Color(0, 0, 255));\n\t\tframe.getContentPane().add(lblNewLabel_2);\n\t\t\n\t\tJComboBox comboBox_1_1 = new JComboBox(new Object[]{});\n\t\tcomboBox_1_1.setBackground(UIManager.getColor(\"CheckBoxMenuItem.selectionBackground\"));\n\t\tcomboBox_1_1.setBounds(155, 646, 124, 41);\n\t\tframe.getContentPane().add(comboBox_1_1);\n\t\t\n\t\tJComboBox comboBox = new JComboBox(superHeroes);\n\t\tcomboBox.setBackground(UIManager.getColor(\"InternalFrame.activeTitleGradient\"));\n\t\tcomboBox.setBounds(155, 686, 124, 41);\n\t\tcomboBox.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\n\t\t\t\tswitch(comboBox.getSelectedIndex()) {\n\t\t\t\t\n\t\t\t\tcase 0: comboBox_1_1.removeAllItems();\n\t\t\t\t\t\tcomboBox_1_1.setModel(new DefaultComboBoxModel(superPoderesKriptoniano));\n\t\t\t\t\t\tcomboBox_1_1.addActionListener(new ActionListener() {\n\t\t\t\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(comboBox_1_1.getSelectedItem() == \"Golpear\") {\n\t\t\t\t\t\t\t\t\tlblNewLabel_4.setVisible(true);\n\t\t\t\t\t\t\t\t\tlblNewLabel_3.setText(krp.golpear());\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}else if(comboBox_1_1.getSelectedItem() == \"Levantar peso\") {\n\t\t\t\t\t\t\t\t\tlblNewLabel_4.setVisible(true);\n\t\t\t\t\t\t\t\t\tlblNewLabel_3.setText(krp.levantarPeso());\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}else if(comboBox_1_1.getSelectedItem() == \"Empujar\") {\n\t\t\t\t\t\t\t\t\tlblNewLabel_4.setVisible(true);\n\t\t\t\t\t\t\t\t\tlblNewLabel_3.setText(krp.empujar());\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}else if(comboBox_1_1.getSelectedItem() == \"Lanzar\") {\n\t\t\t\t\t\t\t\t\tlblNewLabel_4.setVisible(true);\n\t\t\t\t\t\t\t\t\tlblNewLabel_3.setText(krp.lanzar());\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}else if(comboBox_1_1.getSelectedItem() == \"Volar\") {\n\t\t\t\t\t\t\t\t\tlblNewLabel_4.setVisible(true);\n\t\t\t\t\t\t\t\t\tlblNewLabel_3.setText(krp.volar());\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}else if(comboBox_1_1.getSelectedItem() == \"Aterrizar\") {\n\t\t\t\t\t\t\t\t\tlblNewLabel_4.setVisible(true);\n\t\t\t\t\t\t\t\t\tlblNewLabel_3.setText(krp.aterrizar());\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}else if(comboBox_1_1.getSelectedItem() == \"Flotar\") {\n\t\t\t\t\t\t\t\t\tlblNewLabel_4.setVisible(true);\n\t\t\t\t\t\t\t\t\tlblNewLabel_3.setText(krp.flotar());\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}else if(comboBox_1_1.getSelectedItem() == \"Despegar\") {\n\t\t\t\t\t\t\t\t\tlblNewLabel_4.setVisible(true);\n\t\t\t\t\t\t\t\t\tlblNewLabel_3.setText(krp.despegar());\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}else if(comboBox_1_1.getSelectedItem() == \"Curación\") {\n\t\t\t\t\t\t\t\t\tlblNewLabel_4.setVisible(true);\n\t\t\t\t\t\t\t\t\tlblNewLabel_3.setText(krp.curacion());\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}else if(comboBox_1_1.getSelectedItem() == \"Dejar de envejecer\") {\n\t\t\t\t\t\t\t\t\tlblNewLabel_4.setVisible(true);\n\t\t\t\t\t\t\t\t\tlblNewLabel_3.setText(krp.dEvejecer());\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}else if(comboBox_1_1.getSelectedItem() == \"Recuperación rapida\") {\n\t\t\t\t\t\t\t\t\tlblNewLabel_4.setVisible(true);\n\t\t\t\t\t\t\t\t\tlblNewLabel_3.setText(krp.rRapida());\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}else if(comboBox_1_1.getSelectedItem() == \"Saludable\") {\n\t\t\t\t\t\t\t\t\tlblNewLabel_4.setVisible(true);\n\t\t\t\t\t\t\t\t\tlblNewLabel_3.setText(krp.saludable());\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}else if(comboBox_1_1.getSelectedItem() == \"Correr rapido\") {\n\t\t\t\t\t\t\t\t\tlblNewLabel_4.setVisible(true);\n\t\t\t\t\t\t\t\t\tlblNewLabel_3.setText(krp.correr_volar());\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}else if(comboBox_1_1.getSelectedItem() == \"Ondas sonicas\") {\n\t\t\t\t\t\t\t\t\tlblNewLabel_4.setVisible(true);\n\t\t\t\t\t\t\t\t\tlblNewLabel_3.setText(krp.ondasSonicas());\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}else if(comboBox_1_1.getSelectedItem() == \"Aceleración Metabolismo\") {\n\t\t\t\t\t\t\t\t\tlblNewLabel_4.setVisible(true);\n\t\t\t\t\t\t\t\t\tlblNewLabel_3.setText(krp.aMetabolismo());\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}else if(comboBox_1_1.getSelectedItem() == \"Velocidad de la Luz\") {\n\t\t\t\t\t\t\t\t\tlblNewLabel_4.setVisible(true);\n\t\t\t\t\t\t\t\t\tlblNewLabel_3.setText(krp.velocidadLuz());\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\tcase 1: comboBox_1_1.removeAllItems();\n\t\t\t\tcomboBox_1_1.setModel(new DefaultComboBoxModel(superPoderesVelocista));\n\t\t\t\tcomboBox_1_1.addActionListener(new ActionListener() {\n\t\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t if(comboBox_1_1.getSelectedItem() == \"Correr rapido\") {\n\t\t\t\t\t\t\tlblNewLabel_4.setVisible(true);\n\t\t\t\t\t\t\tlblNewLabel_3.setText(vl.correr_volar());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}else if(comboBox_1_1.getSelectedItem() == \"Ondas sonicas\") {\n\t\t\t\t\t\t\tlblNewLabel_4.setVisible(true);\n\t\t\t\t\t\t\tlblNewLabel_3.setText(vl.ondasSonicas());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}else if(comboBox_1_1.getSelectedItem() == \"Aceleración Metabolismo\") {\n\t\t\t\t\t\t\tlblNewLabel_4.setVisible(true);\n\t\t\t\t\t\t\tlblNewLabel_3.setText(vl.aMetabolismo());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}else if(comboBox_1_1.getSelectedItem() == \"Velocidad de la Luz\") {\n\t\t\t\t\t\t\tlblNewLabel_4.setVisible(true);\n\t\t\t\t\t\t\tlblNewLabel_3.setText(vl.velocidadLuz());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}else if(comboBox_1_1.getSelectedItem() == \"Curación\") {\n\t\t\t\t\t\t\tlblNewLabel_4.setVisible(true);\n\t\t\t\t\t\t\tlblNewLabel_3.setText(vl.curacion());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}else if(comboBox_1_1.getSelectedItem() == \"Dejar de envejecer\") {\n\t\t\t\t\t\t\tlblNewLabel_4.setVisible(true);\n\t\t\t\t\t\t\tlblNewLabel_3.setText(vl.dEvejecer());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}else if(comboBox_1_1.getSelectedItem() == \"Recuperación rapida\") {\n\t\t\t\t\t\t\tlblNewLabel_4.setVisible(true);\n\t\t\t\t\t\t\tlblNewLabel_3.setText(vl.rRapida());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}else if(comboBox_1_1.getSelectedItem() == \"Saludable\") {\n\t\t\t\t\t\t\tlblNewLabel_4.setVisible(true);\n\t\t\t\t\t\t\tlblNewLabel_3.setText(vl.saludable());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}else if(comboBox_1_1.getSelectedItem() == \"Viajar al pasado\") {\n\t\t\t\t\t\t\tlblNewLabel_4.setVisible(true);\n\t\t\t\t\t\t\tlblNewLabel_3.setText(vl.vPasado());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(comboBox_1_1.getSelectedItem() == \"Viajar al futuro\") {\n\t\t\t\t\t\t\tlblNewLabel_4.setVisible(true);\n\t\t\t\t\t\t\tlblNewLabel_3.setText(vl.vFuturo());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}else if(comboBox_1_1.getSelectedItem() == \"Dobles de tiempo\") {\n\t\t\t\t\t\t\tlblNewLabel_4.setVisible(true);\n\t\t\t\t\t\t\tlblNewLabel_3.setText(vl.doblesTiempo());\n\t\t\t\t\t\t\n\t\t\t\t\t\t}else if(comboBox_1_1.getSelectedItem() == \"Crear lineas de tiempo\") {\n\t\t\t\t\t\t\tlblNewLabel_4.setVisible(true);\n\t\t\t\t\t\t\tlblNewLabel_3.setText(vl.clineasT());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\t\n\t\t\t\tcase 2: comboBox_1_1.removeAllItems();\n\t\t\t\tcomboBox_1_1.setModel(new DefaultComboBoxModel(superPoderSuperSoldado));\n\t\t\t\tcomboBox_1_1.addActionListener(new ActionListener() {\n\t\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t if(comboBox_1_1.getSelectedItem() == \"Golpear\") {\n\t\t\t\t\t\t\tlblNewLabel_4.setVisible(true);\n\t\t\t\t\t\t\tlblNewLabel_3.setText(sld.golpear());\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}else if(comboBox_1_1.getSelectedItem() == \"Levantar peso\") {\n\t\t\t\t\t\t\tlblNewLabel_4.setVisible(true);\n\t\t\t\t\t\t\tlblNewLabel_3.setText(sld.levantarPeso());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}else if(comboBox_1_1.getSelectedItem() == \"Empujar\") {\n\t\t\t\t\t\t\tlblNewLabel_4.setVisible(true);\n\t\t\t\t\t\t\tlblNewLabel_3.setText(sld.empujar());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}else if(comboBox_1_1.getSelectedItem() == \"Lanzar\") {\n\t\t\t\t\t\t\tlblNewLabel_4.setVisible(true);\n\t\t\t\t\t\t\tlblNewLabel_3.setText(sld.lanzar());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}if(comboBox_1_1.getSelectedItem() == \"Curación\") {\n\t\t\t\t\t\t\tlblNewLabel_4.setVisible(true);\n\t\t\t\t\t\t\tlblNewLabel_3.setText(sld.curacion());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}else if(comboBox_1_1.getSelectedItem() == \"Dejar de envejecer\") {\n\t\t\t\t\t\t\tlblNewLabel_4.setVisible(true);\n\t\t\t\t\t\t\tlblNewLabel_3.setText(sld.dEvejecer());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}else if(comboBox_1_1.getSelectedItem() == \"Recuperación rapida\") {\n\t\t\t\t\t\t\tlblNewLabel_4.setVisible(true);\n\t\t\t\t\t\t\tlblNewLabel_3.setText(sld.rRapida());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}else if(comboBox_1_1.getSelectedItem() == \"Saludable\") {\n\t\t\t\t\t\t\tlblNewLabel_4.setVisible(true);\n\t\t\t\t\t\t\tlblNewLabel_3.setText(sld.saludable());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t\tframe.getContentPane().add(comboBox);\n\t\t\n\t\tJButton btnNewButton = new JButton(\"Reiniciar super heroe\");\n\t\tbtnNewButton.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\n\t\t\t\tcomboBox_1_1.removeAllItems();\n\t\t\t\tlblNewLabel_3.setText(\"\");\n\t\t\t\tlblNewLabel_4.setVisible(false);\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t\tbtnNewButton.setBounds(506, 646, 124, 41);\n\t\tframe.getContentPane().add(btnNewButton);\n\t\t\n\t\n\t\tJPanel panel = new JPanel();\n\t\tpanel.setBackground(new Color(170, 255, 255));\n\t\tpanel.setBounds(151, 623, 768, 177);\n\t\tframe.getContentPane().add(panel);\n\t\t\n\t\tJLabel lblNewLabel = new JLabel(\"\");\n\t\tlblNewLabel.setIcon(new ImageIcon(SuperInterfas.class.getResource(\"Border final.png\")));\n\t\tlblNewLabel.setBounds(96, 224, 700, 700);\n\t\tframe.getContentPane().add(lblNewLabel);\n\t\t\n\t\tJLabel lblNewLabel_1 = new JLabel(\"\");\n\t\tlblNewLabel_1.setIcon(new ImageIcon(SuperInterfas.class.getResource(\"fin logo 2.png\")));\n\t\tlblNewLabel_1.setBounds(270, 11, 400, 266);\n\t\tframe.getContentPane().add(lblNewLabel_1);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\t\t\n\t\t\n\t\t\n\t}",
"public void initial() {\r\n Timer timer;\r\n setPreferredSize(new Dimension(this.model.maxX() + 50, this.model.maxY() + 50));\r\n setLocation(this.model.getXBounds(), this.model.getYBounds());\r\n timer = new Timer(1000 / this.ticksMultiplier, this);\r\n timer.setInitialDelay(0);\r\n timer.start();\r\n }",
"private void initGUI() {\n statusLabel = new JLabel();\n add(statusLabel);\n updateStatus();\n }",
"private void initialize() {\r\n\t\tframe = new JFrame();\r\n\t\tframe.setBounds(100, 100, 1172, 608);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tframe.getContentPane().setLayout(null);\r\n\t\t\r\n\t\tJLabel lblNewLabel = new JLabel(\"Medicine Distribution System\");\r\n\t\tlblNewLabel.setFont(new Font(\"Tahoma\", Font.BOLD, 40));\r\n\t\tlblNewLabel.setBounds(267, 25, 639, 82);\r\n\t\tframe.getContentPane().add(lblNewLabel);\r\n\t\t\r\n\t\tJSeparator separator = new JSeparator();\r\n\t\tseparator.setForeground(Color.BLACK);\r\n\t\tseparator.setBounds(56, 102, 995, 2);\r\n\t\tframe.getContentPane().add(separator);\r\n\t\t\r\n\t\tJLabel lblNewLabel_1 = new JLabel(\"Types Of Meds\");\r\n\t\tlblNewLabel_1.setFont(new Font(\"Tahoma\", Font.BOLD, 24));\r\n\t\tlblNewLabel_1.setBounds(56, 104, 258, 54);\r\n\t\tframe.getContentPane().add(lblNewLabel_1);\r\n\t\t\r\n\t\tJRadioButton syrup = new JRadioButton(\"Syrup\");\r\n\t\tsyrup.setFont(new Font(\"Tahoma\", Font.BOLD, 15));\r\n\t\tsyrup.setBounds(56, 164, 88, 21);\r\n\t\tframe.getContentPane().add(syrup);\r\n\t\t\r\n\t\tJRadioButton capsule = new JRadioButton(\"Capsule\");\r\n\t\tcapsule.setFont(new Font(\"Tahoma\", Font.BOLD, 15));\r\n\t\tcapsule.setBounds(166, 164, 103, 21);\r\n\t\tframe.getContentPane().add(capsule);\r\n\t\t\r\n\t\tJRadioButton powder = new JRadioButton(\"Powder\");\r\n\t\tpowder.setFont(new Font(\"Tahoma\", Font.BOLD, 15));\r\n\t\tpowder.setBounds(56, 219, 88, 21);\r\n\t\tframe.getContentPane().add(powder);\r\n\t\t\r\n\t\tJComboBox combobox = new JComboBox();\r\n\t\tcombobox.setMaximumRowCount(18);\r\n\t\tcombobox.setFont(new Font(\"Tahoma\", Font.BOLD, 16));\r\n\t\tcombobox.setModel(new DefaultComboBoxModel(new String[] {\"ELECTROL POWER\", \"PANTOCID 40\", \"LIV 52 TAB\", \"LIB 52 SYRUP\", \"SOBILIN SYRUP\", \"DEXORANGE SYRUP\", \"GLYCOMET 500 MG TAB\", \"TELMA 20 TAB\", \"TELMA 40 TAB\", \"PAN 40 TAB\", \"PAN D TAB\", \"OMEZ TAB\", \"NIZE TAB\", \"STAMLO 5 TAB\", \"SINAREST TAB\", \"SINAREST SYP\", \"MMOOV OINT\", \"VOLINI GEL\", \"SORIDON TAB\", \"DISPRIN TAB\", \"NEOSPORIN POWDER\", \"NEOSPORIN OINT\"}));\r\n\t\tcombobox.setBounds(361, 137, 201, 21);\r\n\t\tframe.getContentPane().add(combobox);\r\n\t\t\r\n\t\tJSeparator separator_1 = new JSeparator();\r\n\t\tseparator_1.setForeground(Color.BLACK);\r\n\t\tseparator_1.setBounds(56, 284, 292, 2);\r\n\t\tframe.getContentPane().add(separator_1);\r\n\t\t\r\n\t\tJLabel lblNewLabel_2 = new JLabel(\"Tax\");\r\n\t\tlblNewLabel_2.setFont(new Font(\"Tahoma\", Font.BOLD, 18));\r\n\t\tlblNewLabel_2.setBounds(71, 316, 100, 37);\r\n\t\tframe.getContentPane().add(lblNewLabel_2);\r\n\t\t\r\n\t\ttaxbox = new JTextField();\r\n\t\ttaxbox.setBounds(214, 324, 134, 28);\r\n\t\tframe.getContentPane().add(taxbox);\r\n\t\ttaxbox.setColumns(10);\r\n\t\t\r\n\t\t\r\n//\t\tcreate every column to show in the jpanel\r\n\t\tDefaultTableModel dm = new DefaultTableModel();\r\n\t\ttable = new JTable(dm);\r\n\t\tdm.addColumn(\"syrup\");\r\n\t\tdm.addColumn(\"capsule\");\r\n\t\tdm.addColumn(\"power\");\r\n\t\tdm.addColumn(\"med_name\");\r\n\t\tdm.addColumn(\"tax\");\r\n\t\tdm.addColumn(\"total\");\r\n\t\tdm.addRow(new Object[] {\"syrup\",\"capsule\",\"power\",\"med_name\",\"tax\",\"total\"});\r\n\t\tdm.addRow(new Object[] {\"\",\"\",\"\",\"\",\"\",\"\",\"\"}); \r\n\t\t\r\n\t\tJButton btnNewButton = new JButton(\"Total\");\r\n\t\tbtnNewButton.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n//\t\t\t\tadd data to the retail table\r\n\t\t\t\ttry {\r\n\t\t\t\t\tClass.forName(\"com.mysql.cj.jdbc.Driver\");\r\n\t\t\t\t\tConnection conn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/medic_crud\",\"root\",\"\");\r\n\t\t\t\t\tPreparedStatement ps = conn.prepareStatement(\"insert into retail(syrup,capsule,power,med_name,tax,total) values(?,?,?,?,?,?);\");\t\r\n\t\t\t\t\tif(syrup.isSelected())\r\n\t\t\t\t\t{\t\t\t\t\t\r\n\t\t\t\t\t\tps.setString(1, syrup.getText());\r\n\t\t\t\t\t\tps.setString(2, \"\");\r\n\t\t\t\t\t\tps.setString(3, \"\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(capsule.isSelected())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tps.setString(1, \"\");\r\n\t\t\t\t\t\tps.setString(2, capsule.getText());\r\n\t\t\t\t\t\tps.setString(3, \"\");\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(powder.isSelected())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tps.setString(1, \"\");\r\n\t\t\t\t\t\tps.setString(2, \"\");\r\n\t\t\t\t\t\tps.setString(3, powder.getText());\r\n\t\t\t\t\t}\r\n\t\t\t\t\tps.setString(4, combobox.getSelectedItem().toString());\r\n\t\t\t\t\tps.setString(5, taxbox.getText());\r\n\t\t\t\t\tps.setString(6, totalbox.getText());\r\n\r\n\t\t\t\t\tsyrup.requestFocus();\r\n\t\t\t\t\tint x = ps.executeUpdate();\r\n\t\t\t\t\tif(x > 0)\r\n\t\t\t\t\t{\r\n//\t\t\t\t\t\tSystem.out.println(\"data added seccessfully\");\r\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Record added !!!\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n//\t\t\t\t\t\tthis is display\r\n\t\t\t\t\t\ttry {\r\n//\t\t\t\t\t\t\tClass.forName(\"com.mysql.cj.jdbs.Driver\");\r\n\t\t\t\t\t\t\tconn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/medic_crud\",\"root\",\"\");\r\n\t\t\t\t\t\t\tString sql =\"select * from retail\";\r\n\t\t\t\t\t\t\tps = conn.prepareStatement(sql);\t\r\n\t\t\t\t\t\t\tResultSet rs = ps.executeQuery();\r\n\t\t\t\t\t\t\t//bikas\r\n\t\t\t\t\t\t\tdm.setRowCount(0);\r\n\t\t\t\t\t\t\twhile (rs.next()) {\t\t\t\r\n\t\t\t\t\t\t\t\tdm.addRow(new Object[] {rs.getString(\"syrup\"),rs.getString(\"capsule\"),rs.getString(\"power\"),rs.getString(\"med_name\"),rs.getInt(\"tax\"),rs.getInt(\"total\")});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t//end bikas\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcatch(Exception e2)\r\n\t\t\t\t\t\t{\r\n//\t\t\t\t\t\t\tSystem.out.println(e1);\r\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, e2);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}else\r\n\t\t\t\t\t{\r\n\t\t\t\t\t}\r\n//\t\t\t\t\tsyrup.setText(\"\");\r\n//\t\t\t\t\tcapsule.setText(\"\");\r\n//\t\t\t\t\tpowder.setText(\"\");\r\n//\t\t\t\t\tcombobox.setText(\"\");\r\n\t\t\t\t\ttaxbox.setText(\"\");\r\n\t\t\t\t\ttotalbox.setText(\"\");\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e1)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(e1);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnNewButton.setFont(new Font(\"Tahoma\", Font.BOLD, 15));\r\n\t\tbtnNewButton.setBounds(68, 500, 103, 42);\r\n\t\tframe.getContentPane().add(btnNewButton);\r\n\t\t\r\n\t\tJButton btnReset = new JButton(\"Reset\");\r\n\t\tbtnReset.setFont(new Font(\"Tahoma\", Font.BOLD, 15));\r\n\t\tbtnReset.setBounds(212, 500, 103, 42);\r\n\t\tframe.getContentPane().add(btnReset);\r\n\t\t\r\n\t\tJButton btnNewButton_1_1 = new JButton(\"Exit\");\r\n\t\tbtnNewButton_1_1.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tframe = new JFrame(\"Exit\");\r\n\t\t\t\tif(JOptionPane.showConfirmDialog(frame, \"Confirm if you want to exit\", \"Login System\",\r\n\t\t\t\t\tJOptionPane.YES_NO_OPTION)==JOptionPane.YES_NO_OPTION)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.exit(0);\r\n\t\t\t\t}\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.exit(0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnNewButton_1_1.setFont(new Font(\"Tahoma\", Font.BOLD, 15));\r\n\t\tbtnNewButton_1_1.setBounds(1045, 519, 103, 42);\r\n\t\tframe.getContentPane().add(btnNewButton_1_1);\r\n\t\t\r\n//\t\ttable = new JTable();\r\n\t\ttable.setBounds(575, 130, 573, 382);\r\n\t\tframe.getContentPane().add(table);\r\n\t\t\r\n\t\ttotalbox = new JTextField();\r\n\t\ttotalbox.setColumns(10);\r\n\t\ttotalbox.setBounds(214, 407, 134, 28);\r\n\t\tframe.getContentPane().add(totalbox);\r\n\t\t\r\n\t\tJLabel lblNewLabel_2_1 = new JLabel(\"Total\");\r\n\t\tlblNewLabel_2_1.setFont(new Font(\"Tahoma\", Font.BOLD, 18));\r\n\t\tlblNewLabel_2_1.setBounds(68, 399, 103, 37);\r\n\t\tframe.getContentPane().add(lblNewLabel_2_1);\r\n\t\t\r\n\t\tJLabel lblNewLabel_3 = new JLabel(\"\");\r\n\t\tlblNewLabel_3.setIcon(new ImageIcon(\"C:\\\\Users\\\\Asus\\\\Downloads\\\\med bag.png\"));\r\n\t\tlblNewLabel_3.setBounds(41, 0, 125, 105);\r\n\t\tframe.getContentPane().add(lblNewLabel_3);\r\n\t\t\r\n\t\t\r\n//\t\tthis is to refesh the panel\r\n\t\ttry {\r\n//\t\t\tClass.forName(\"com.mysql.cj.jdbs.Driver\");\r\n\t\t\tConnection conn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/medic_crud\",\"root\",\"\");\r\n\t\t\tString sql =\"select * from retail\";\r\n\t\t\tPreparedStatement ps = conn.prepareStatement(sql);\t\r\n\t\t\tResultSet rs = ps.executeQuery();\r\n\t\t\t//bikas\r\n\t\t\tdm.setRowCount(0);\r\n\t\t\twhile (rs.next()) {\t\t\t\r\n\t\t\t\tdm.addRow(new Object[] {rs.getString(\"syrup\"),rs.getString(\"capsule\"),rs.getString(\"power\"),rs.getString(\"med_name\"),rs.getInt(\"tax\"),rs.getInt(\"total\")});\r\n\t\t\t}\r\n\t\t\t//end bikas\r\n\t\t}\r\n\t\tcatch(Exception e2)\r\n\t\t{\r\n//\t\t\tSystem.out.println(e1);\r\n\t\t\tJOptionPane.showMessageDialog(null, e2);\r\n\t\t}\r\n\t}",
"private void setUpNutritionLabel(Label l1, String color, String text){\n l1.setText(text);\n l1.setTextFill(Paint.valueOf(color));\n l1.setFont(InterfaceStyling.systemFont);\n }",
"public void Initialize1(GraphicsLayer.RenderingMode mode)\n\t{\n\t\tsetObject(new GraphicsLayer(mode));\n\t}",
"public void initialize() {\r\n\t\tframe = new JFrame();\r\n\t\tframe.setTitle(\"\\u6CE8\\u518C\");\r\n\t\t\r\n\t\tToolkit kit = Toolkit.getDefaultToolkit();\r\n\t\tDimension screensize = kit.getScreenSize();\r\n\t\tint screenWIDE = screensize.width;\r\n\t\tint screenHIGH = screensize.height;\r\n\t\tint FrameWith = 450;\r\n\t\tint FrameHith = 412;\r\n\t\tframe.setBounds((screenWIDE - FrameWith) / 2, (screenHIGH - FrameHith) / 2,\r\n\t\t\t\tFrameWith, FrameHith);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tframe.getContentPane().setLayout(null);\r\n\t\tframe.setIconImage(Toolkit.getDefaultToolkit().getImage(\"icon.png\"));\r\n\r\n\t\tJLabel label = new JLabel(\"\\u6CE8\\u518C\\u540D\");\r\n\t\tlabel.setBounds(29, 25, 61, 27);\r\n\t\tframe.getContentPane().add(label);\r\n\t\tlblNewLabel.setForeground(Color.RED);\r\n\t\tlblNewLabel.setBounds(300, 31, 124, 15);\r\n\t\tframe.getContentPane().add(lblNewLabel);\r\n\t\t\r\n\t\t\r\n\t\tlabel_1.setForeground(Color.RED);\r\n\t\tlabel_1.setBounds(300, 143, 124, 15);\r\n\t\tframe.getContentPane().add(label_1);\r\n\t\tlblNewLabel_1.setForeground(Color.RED);\r\n\t\tlblNewLabel_1.setBounds(300, 68, 124, 15);\r\n\t\tframe.getContentPane().add(lblNewLabel_1);\r\n\t\tlblNewLabel_2.setForeground(Color.RED);\r\n\t\tlblNewLabel_2.setBounds(300, 105, 124, 15);\r\n\t\tframe.getContentPane().add(lblNewLabel_2);\r\n\t\t\r\n\t\ttextField = new JTextField();\r\n\t\ttextField.setBounds(122, 28, 146, 21);\r\n\t\tframe.getContentPane().add(textField);\r\n\t\ttextField.setColumns(10);\r\n\t\t\r\n\t\tJLabel label_2 = new JLabel(\"密码\");\r\n\t\tlabel_2.setBounds(29, 132, 54, -19);\r\n\t\tframe.getContentPane().add(label_2);\r\n\t\t\r\n\t\tJLabel label_3 = new JLabel(\"\\u786E\\u8BA4\\u5BC6\\u7801\");\r\n\t\tlabel_3.setBounds(29, 105, 54, 15);\r\n\t\tframe.getContentPane().add(label_3);\r\n\t\t\r\n\t\tJLabel label_4 = new JLabel(\"密码\");\r\n\t\tlabel_4.setBounds(29, 62, 54, 15);\r\n\t\tframe.getContentPane().add(label_4);\r\n\t\t\r\n\t\ttextField_5 = new JTextField();\r\n\t\ttextField_5.setBounds(122, 140, 146, 21);\r\n\t\tframe.getContentPane().add(textField_5);\r\n\t\ttextField_5.setColumns(10);\r\n\t\t\r\n\t\tJLabel label_5 = new JLabel(\"\\u90AE\\u7BB1\");\r\n\t\tlabel_5.setBounds(29, 143, 54, 15);\r\n\t\tframe.getContentPane().add(label_5);\r\n\t\t\r\n\t\tJButton button = new JButton(\"注册\");\r\n\t\r\n\t\tbutton.addActionListener(this);\r\n\r\n\t\tbutton.setBounds(77, 262, 93, 23);\r\n\t\tframe.getContentPane().add(button);\r\n\t\t\r\n\t\tJButton button_1 = new JButton(\"\\u53D6\\u6D88\");\r\n\t\t\r\n\t\tbutton_1.addActionListener(new ActionListener(){\r\n\t\t\tpublic void actionPerformed(ActionEvent e)\r\n\t\t\t{\r\n\t\t\t\tLogin window = null;\r\n\t\t\t\ttry {\r\n\t\t\t\t\twindow = new Login();\r\n\t\t\t\t\twindow.frmLogin.setVisible(true);\r\n\t\t\t\t} catch (SQLException e1) {\r\n\t\t\t\t\t// TODO 自动生成的 catch 块\r\n\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t\tframe.setVisible(false);\r\n\t\t\t\treturn ;\r\n\t\t\t}\r\n\t\t});\r\n\t\tbutton_1.setBounds(261, 262, 93, 23);\r\n\t\tframe.getContentPane().add(button_1);\r\n\t\t\r\n\t\tpasswordField = new JPasswordField();\r\n\t\tpasswordField.setBounds(122, 56, 146, 27);\r\n\t\tframe.getContentPane().add(passwordField);\r\n\t\t\r\n\t\tpasswordField_1 = new JPasswordField();\r\n\r\n\t\r\n\t\tpasswordField_1.setBounds(122, 99, 146, 27);\r\n\t\tframe.getContentPane().add(passwordField_1);\r\n\t\ttextField.addFocusListener(this);\r\n\t\tpasswordField.addFocusListener(this);\r\n\t\tpasswordField_1.addFocusListener(this);\r\n\t\ttextField_5.addFocusListener(this);\r\n\t}",
"public JPanelGameState() {\n initComponents();\n initLabelsArray();\n }",
"public void initializeText(){\n\t\tfont = new BitmapFont();\n\t\tfont1 = new BitmapFont();\n\t\tfont1.setColor(Color.BLUE);\n\t\tfont2 = new BitmapFont();\n\t\tfont2.setColor(Color.BLACK);\n\t}",
"private void initComponents_label(){\n label_today_date.setText(\"Today Date : \" + Main.DATE_FORMAT.format(Main.getToday_date()));\n this.neon.setIcon(new ImageIcon(Interface_Payment.getScaledImage(new ImageIcon(\"resource/neon.png\").getImage(), 524, 160)));\n this.menu_lable_1.setIcon(new ImageIcon(new ImageIcon(\"resource/menu_button/pos_main_menu.png\").getImage().getScaledInstance(485, 60, Image.SCALE_DEFAULT)));\n this.menu_lable_2.setIcon(new ImageIcon(new ImageIcon(\"resource/menu_button/customer_manager.png\").getImage().getScaledInstance(485, 60, Image.SCALE_DEFAULT)));\n this.menu_lable_3.setIcon(new ImageIcon(new ImageIcon(\"resource/menu_button/order_manager.png\").getImage().getScaledInstance(485, 60, Image.SCALE_DEFAULT)));\n this.menu_lable_4.setIcon(new ImageIcon(new ImageIcon(\"resource/menu_button/exit.png\").getImage().getScaledInstance(485, 60, Image.SCALE_DEFAULT)));\n this.menu_lable_1.setCursor(new Cursor(Cursor.HAND_CURSOR));\n this.menu_lable_2.setCursor(new Cursor(Cursor.HAND_CURSOR));\n this.menu_lable_3.setCursor(new Cursor(Cursor.HAND_CURSOR));\n this.menu_lable_4.setCursor(new Cursor(Cursor.HAND_CURSOR)); \n }",
"private static void setNormalState() {\n InitialClass.arduino.serialWrite('0');\n InitialClass.arduino.serialWrite('6');\n InitialClass.arduino.serialWrite('2');\n InitialClass.arduino.serialWrite('8');\n InitialClass.arduino.serialWrite('C');\n InitialClass.arduino.serialWrite('A');\n InitialClass.arduino.serialWrite('4');\n /// hide animated images of scada\n pumpForSolutionOn.setVisible(false);\n pumpForTitrationOn.setVisible(false);\n mixerOn.setVisible(false);\n valveTitrationOpened.setVisible(false);\n valveSolutionOpened.setVisible(false);\n valveWaterOpened.setVisible(false);\n valveOutOpened.setVisible(false);\n\n log.append(\"Клапана закрыты\\nдвигатели выключены\\n\");\n\n }",
"private void applyInitialLook() {\r\n\t\tthis.control.setFont(this.initialFont);\r\n\t\tthis.control.setBackground(this.initialBackgroundColor);\r\n\t\tthis.control.setForeground(this.initialForegroundColor);\r\n\t}",
"private void createSimulatorMode() {\n setSize(1000, 750);\n setLocation(new Point(200, 100));\n setDefaultCloseOperation(EXIT_ON_CLOSE);\n\n Container content = getContentPane();\n content.setLayout(new GridBagLayout());\n \n GridBagConstraints c = new GridBagConstraints();\n \n map = new UAVMap(this, UAVModes.SIMULATION, false);\n smenu = new SimUAVMenu();\n toolBar = new SimUAVToolBar();\n map.addConnections(toolBar, smenu);\n smenu.addConnections(toolBar, map);\n toolBar.addConnections(smenu, map);\n \n c.gridy = 0;\n c.fill = GridBagConstraints.HORIZONTAL;\n c.weightx = 1;\n c.weighty = 0;\n content.add(smenu, c);\n \n c.gridy = 1;\n c.fill = GridBagConstraints.BOTH;\n c.weightx = 1;\n c.weighty = 0;\n content.add(toolBar, c);\n \n c.gridy = 2;\n c.fill = GridBagConstraints.BOTH;\n c.weightx = 1;\n c.weighty = 1;\n content.add(map.getCanvas(), c);\n \n setVisible(true);\n map.initializeSimulation();\n map.startTimer();\n }",
"@Override\n public void simpleInitApp()\n {\n stateManager.detach(stateManager.getState(StatsAppState.class));\n\n viewPort.setBackgroundColor(new ColorRGBA(0.7f, 0.9f, 1, 1));\n\n initBoard();\n\n rootNode.attachChild(board);\n rootNode.addLight(createDirectionalLight());\n rootNode.addLight(createAmbientLight());\n\n initKeys();\n }",
"@Override\n\tpublic void robotInit() {\n\t\tm_chooser.addDefault(\"Default Auto\", kDefaultAuto);\n\t\tm_chooser.addObject(\"My Auto\", kCustomAuto);\n\t\tSmartDashboard.putData(\"Auto choices\", m_chooser);\n\t\t\n\t\ttalonMotor10.setNeutralMode(NeutralMode.Brake);\n\t\ttalonMotor11.setNeutralMode(NeutralMode.Brake);\n\t\ttalonMotor12.setNeutralMode(NeutralMode.Brake);\n\t\ttalonMotor13.setNeutralMode(NeutralMode.Brake);\n\t\ttalonMotor14.setNeutralMode(NeutralMode.Brake);\n\t\ttalonMotor15.setNeutralMode(NeutralMode.Brake);\n\t}",
"@Override\n public void simpleInitApp() {\n configureCamera();\n configureMaterials();\n viewPort.setBackgroundColor(new ColorRGBA(0.5f, 0.2f, 0.2f, 1f));\n configurePhysics();\n initializeHeightData();\n addTerrain();\n showHints();\n }",
"public void setLabeled(){\n\t\tthis._isLabeled = true;\n\t}",
"public void robotInit(){\n\t\tSmartDashboard.putNumber(\"Climber Arm Speed: \", 0.5);\n\t\tSmartDashboard.putNumber(\"Climber Winch Speed: \", 0.25);\n\t}",
"public Logo() {\n initComponents();\n this.setTitle(this.getClass().getSimpleName()+\" ::: \"+\"E- Learning :::\");\n this.getContentPane().setBackground(ELearning.sc.getDefaultColor());\n }",
"@Override\n public void simpleInitApp()\n {\n makeInitialWorld();\n \tAudio audio = new Audio(assetManager, rootNode);\n inputManager.setCursorVisible(false);\n \trootNode.attachChild(overlayNode);\n\n \tflyCam.setEnabled(true);\n flyCam.setMoveSpeed(25);\n\n setDisplayFps(true);\n setDisplayStatView(true);\n\n GUIInfo guiInfo = new GUIInfo(guiNode, assetManager.loadFont(\"Interface/Fonts/Console.fnt\"));\n guiNode.addControl(guiInfo);\n }",
"private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setBounds(100, 100, 450, 300);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\t\n\t\tJLabel lblNewLabel = new JLabel(\"\\u5E78\\u8FD0\\u8F6C\\u76D8\");\n\t\tlblNewLabel.setBounds(131, 13, 208, 35);\n\t\tlblNewLabel.setIcon(new ImageIcon(RandomCall.class.getResource(\"/images/\\u968F\\u673A\\u7528\\u6237.png\")));\n\t\tlblNewLabel.setFont(new Font(\"宋体\", Font.BOLD, 30));\n\t\t\n\t\tframe.setLocationRelativeTo(null);\n\t\tframe.getContentPane().setLayout(null);\n\t\tframe.getContentPane().add(lblNewLabel);\n\t\t\n\t\t/*\n\t\t *名字显示区域\n\t\t */\n\t\tlblNewLabel_1 = new JLabel(\"name\");\n\t\tlblNewLabel_1.setFont(new Font(\"宋体\", Font.ITALIC, 30));\n\t\tlblNewLabel_1.setBounds(178, 91, 113, 52);\n\t\tframe.getContentPane().add(lblNewLabel_1);\n\t\t\n\t\t/*\n\t\t * 开始按钮\n\t\t */\n\t\tstart = new JButton(\"\\u5F00\\u59CB\");\n\t\tstart.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tstartAction(e); \n\t\t\t}\n\t\t});\n\t\tstart.setBounds(14, 198, 113, 27);\n\t\tframe.getContentPane().add(start);\n\t\t\n\t\t/*\n\t\t * 停止按钮\n\t\t */\n\t\tJButton stop = new JButton(\"\\u6682\\u505C\");\n\t\tstop.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tstopAction(e); \n\t\t\t}\n\n\t\t\t\n\t\t});\n\t\tstop.setBounds(165, 198, 113, 27);\n\t\tframe.getContentPane().add(stop);\n\t\t\n\t\tJButton back = new JButton(\"\\u8FD4\\u56DE\\u4E3B\\u754C\\u9762\");\n\t\tback.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tIndex index = new Index(); \n\t\t\t\tindex.getFrame().setVisible(true);\n\t\t\t\tframe.setVisible(false);\n\t\t\t}\n\t\t});\n\t\tback.setBounds(305, 198, 113, 27);\n\t\tframe.getContentPane().add(back);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t}",
"private void createStartingLabel() {\n \tcreateLabel(myResources.getString(\"title\"), 1, 0, TITLE_FONT);\n }",
"private void initDesign(){\n\t\tlabel.setLayoutX(xPos);\n\t\tlabel.setLayoutY(yPos);\n\t\tlabel.setStyle(\"-fx-border-color: green\");\n\t}",
"private void initialize() {\r\n\t\tframe = new JFrame();\r\n\t\tframe.getContentPane().setBackground(Color.BLUE);\r\n\t\tframe.setBounds(100, 100, 450, 300);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tframe.getContentPane().setLayout(null);\r\n\t\t\r\n\t\tJLabel lblNewLabel = new JLabel(\"Reiner Hotel Kiosk\");\r\n\t\tlblNewLabel.setFont(new Font(\"Tahoma\", Font.BOLD, 25));\r\n\t\tlblNewLabel.setBounds(81, 11, 305, 89);\r\n\t\tframe.getContentPane().add(lblNewLabel);\r\n\t\t\r\n\t\tJButton btnNewButton = new JButton(\"Notify Managers\");\r\n\t\tbtnNewButton.setBounds(63, 137, 137, 23);\r\n\t\tframe.getContentPane().add(btnNewButton);\r\n\t\t\r\n\t\tJButton btnNewButton_1 = new JButton(\"Track Room Availability\");\r\n\t\tbtnNewButton_1.setBounds(231, 137, 166, 23);\r\n\t\tframe.getContentPane().add(btnNewButton_1);\r\n\t}",
"public void init(){\n\t\tsetBackground(Color.green);\n\t\tmsg = \"Let's Play\";\n//\t\tmsg1 = \"Your Frinds Choice\";\n\t\tSystem.out.println(cpu);\n\t\tb1 = new Button(\"Stone\");\n\t\tb2 = new Button(\"Paper\");\n\t\tb3 = new Button(\"Seaser\");\n\t\tb1.addActionListener(this);\n\t\tb2.addActionListener(this);\n\t\tb3.addActionListener(this);\n\t\tadd(b1);\n\t\tadd(b2);\n\t\tadd(b3);\n\t}",
"void setLabel(Label label);",
"void setNilLabel();",
"@Override\n public void setup() {\n strokeWeight(1);\n smooth();\n textMode(SHAPE);\n origin = new PVector(width / 2, height / 2,0);\n size = 2000;\n zoom = 1.5f;\n rX = -0.51f;\n rY = -0.65f;\n arm = new Arm(this);\n ik = new InverseK(arm.getL());\n angles = new double[]{0,0,0};\n }",
"private void initialize() {\n\t\tthis.setLayout(null);\n\t\tthis.setBackground(Color.white);\n\t\tthis.setBounds(new Rectangle(0, 0, 943, 615));\n this.setPreferredSize(new Dimension(890,570));\n this.setMinimumSize(new Dimension(890,570));\n\n\t\tm_GraphControlGradient = new GraphControl();\n\t\tm_GraphControlGradient.setBounds(new Rectangle(4, 16, 461, 285));\n\t\tm_GraphControlGradient.setControlsEnabled(false);\n\n\t\tm_GraphControlFlowRate = new GraphControl();\n\t\tm_GraphControlFlowRate.setBounds(new Rectangle(3, 16, 462, 241));\n\t\tm_GraphControlFlowRate.setControlsEnabled(false);\n\n\t\tthis.add(getJbtnPreviousStep(), null);\n\t\tthis.add(getJpanelGradientProfile(), null);\n\t\tthis.add(getJpanelFlowProfile(), null);\n\t\tthis.setVisible(true);\n\t\tthis.add(getJbtnHelp(), null);\n\t\tthis.add(getJpanelStep5(), null);\n\t\t\n\t\tthis.tmOutputModel.addTableModelListener(this);\n\t\tthis.addComponentListener(this);\n\t}",
"public void\nsetNewLabel()\nthrows Exception\n{\n\tdouble lineLength = this.getNucLabelLineLength();\n\tif (lineLength <= 0.0)\n\t\tlineLength = ComplexDefines.NUCLABEL_LINE_LENGTH;\n\tthis.setNewLabel(\n\t\tnew Font(\"Helvetica\", Font.PLAIN, 12),\n\t\tthis.getParentSSData2D().getNucLabelLineWidth(),\n\t\tlineLength, Color.black, this.getID());\n}",
"private void createLabels() {\n addLabels(\"Dog Name:\", 160);\n addLabels(\"Weight:\", 180);\n addLabels(\"Food:\", 200);\n }",
"public void init()\n {\n setBackground(Color.YELLOW);\n setForeground(Color.RED);\n }",
"public void setMode(int mode) {\r\n switch (mode) {\r\n case CentroidUserObject.VARIANCES_MODE:\r\n setDrawVariances(true);\r\n setDrawValues(false);\r\n break;\r\n case CentroidUserObject.VALUES_MODE:\r\n setDrawVariances(false);\r\n setDrawValues(true);\r\n break;\r\n }\r\n }",
"void setBasicMode() {basicMode = true;}",
"public void initGame() {\r\n\t\tConsolaText consola = new ConsolaText();\r\n\t\tconsola.displayRules();\r\n\t\t// System.out.println(\"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\r\n\r\n\t}",
"public LabelAttributesPanel() {\n initComponents();\n selectedModel = nodesToggleButton.getModel();\n elementButtonGroup.setSelected(selectedModel, true);\n nodesToggleButton.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n if (nodesToggleButton.isSelected()) {\n selectedModel = nodesToggleButton.getModel();\n refresh();\n }\n }\n });\n edgesToggleButton.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n if (edgesToggleButton.isSelected()) {\n selectedModel = edgesToggleButton.getModel();\n refresh();\n }\n }\n });\n showPropertiesCheckbox.setSelected(showProperties);\n showPropertiesCheckbox.addItemListener(new ItemListener() {\n @Override\n public void itemStateChanged(ItemEvent e) {\n showProperties = showPropertiesCheckbox.isSelected();\n refresh();\n }\n });\n }",
"@Override\r\n\tprotected void onInitialize() {\n\t\tsuper.onInitialize();\r\n\t\tadd(new MultiLineLabel(LABEL_ID, LABEL_TEXT));\r\n\t}",
"private void setDefaultMode(GlobalState gs) {\n center = gs.cnt;\n double diagonal = gs.vDist * cos(gs.phi);\n double z = sin(gs.phi) * gs.vDist;\n double x = diagonal * cos(gs.theta);\n double y = diagonal * sin(gs.theta);\n \n eye = new Vector(x, y, z);\n \n }",
"public void initialize() {\r\n\t\t\tsetTextValue(!updateNoteEnabled);\r\n\t\t}",
"@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n\tprivate void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.getContentPane().setBackground(Color.LIGHT_GRAY);\n\t\tframe.setBounds(100, 100, 1000, 600);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(null);\n\t\tframe.setResizable(false); \n\n\n\t\tJLabel label = new JLabel(\"Gestionnaire de Cave\");\n\t\tlabel.setForeground(new Color(102, 0, 204));\n\t\tlabel.setHorizontalAlignment(SwingConstants.CENTER);\n\t\tlabel.setFont(new Font(\"Wide Latin\", Font.BOLD, 20));\n\t\tlabel.setBounds(0, 11, 982, 31);\n\t\tframe.getContentPane().add(label);\n\n\t\tJLabel lblNewLabel = new JLabel(\"Rechercher\");\n\t\tlblNewLabel.setFont(new Font(\"Tahoma\", Font.BOLD, 16));\n\t\tlblNewLabel.setBounds(284, 140, 104, 22);\n\t\tframe.getContentPane().add(lblNewLabel);\n\n\t\tJLabel lblParTypeDe = new JLabel(\"Par type de vin\");\n\t\tlblParTypeDe.setFont(new Font(\"Tahoma\", Font.BOLD, 16));\n\t\tlblParTypeDe.setBounds(284, 199, 136, 22);\n\t\tframe.getContentPane().add(lblParTypeDe);\n\n\t\tJLabel lblParFournisseur = new JLabel(\"Par Fournisseur\");\n\t\tlblParFournisseur.setFont(new Font(\"Tahoma\", Font.BOLD, 16));\n\t\tlblParFournisseur.setBounds(284, 232, 136, 22);\n\t\tframe.getContentPane().add(lblParFournisseur);\n\n\t\tJLabel lblParCuve = new JLabel(\"Par cuv\\u00E9e\");\n\t\tlblParCuve.setFont(new Font(\"Tahoma\", Font.BOLD, 16));\n\t\tlblParCuve.setBounds(284, 265, 136, 22);\n\t\tframe.getContentPane().add(lblParCuve);\n\n\t\tJLabel lblParRgion = new JLabel(\"Par R\\u00E9gion\");\n\t\tlblParRgion.setFont(new Font(\"Tahoma\", Font.BOLD, 16));\n\t\tlblParRgion.setBounds(284, 298, 136, 22);\n\t\tframe.getContentPane().add(lblParRgion);\n\n\t\tJLabel lblPar = new JLabel(\"Par Volume\\r\\n\");\n\t\tlblPar.setFont(new Font(\"Tahoma\", Font.BOLD, 16));\n\t\tlblPar.setBounds(284, 331, 136, 22);\n\t\tframe.getContentPane().add(lblPar);\n\n\t\tJLabel lblListeDesBouteilles = new JLabel(\"Liste des Bouteilles\");\n\t\tlblListeDesBouteilles.setFont(new Font(\"Tahoma\", Font.BOLD, 16));\n\t\tlblListeDesBouteilles.setBounds(682, 140, 163, 22);\n\t\tframe.getContentPane().add(lblListeDesBouteilles);\n\n\t\tJLabel lblVinBlanc = new JLabel(\"Vin Blanc :\");\n\t\tlblVinBlanc.setForeground(Color.WHITE);\n\t\tlblVinBlanc.setFont(new Font(\"Tahoma\", Font.BOLD, 16));\n\t\tlblVinBlanc.setBounds(10, 205, 97, 14);\n\t\tframe.getContentPane().add(lblVinBlanc);\n\n\t\tJLabel lblVinRouge = new JLabel(\"Vin Rouge :\");\n\t\tlblVinRouge.setForeground(Color.WHITE);\n\t\tlblVinRouge.setFont(new Font(\"Tahoma\", Font.BOLD, 16));\n\t\tlblVinRouge.setBounds(10, 238, 97, 22);\n\t\tframe.getContentPane().add(lblVinRouge);\n\n\t\tJLabel lblVinRos = new JLabel(\"Vin Ros\\u00E9 :\");\n\t\tlblVinRos.setForeground(Color.WHITE);\n\t\tlblVinRos.setFont(new Font(\"Tahoma\", Font.BOLD, 16));\n\t\tlblVinRos.setBounds(10, 271, 97, 14);\n\t\tframe.getContentPane().add(lblVinRos);\n\n\t\tJLabel lblVinE = new JLabel(\"Vin Effervescent :\");\n\t\tlblVinE.setForeground(Color.WHITE);\n\t\tlblVinE.setFont(new Font(\"Tahoma\", Font.BOLD, 16));\n\t\tlblVinE.setBounds(10, 304, 154, 14);\n\t\tframe.getContentPane().add(lblVinE);\n\n\t\tJLabel lblTotal = new JLabel(\"Total :\");\n\t\tlblTotal.setForeground(Color.WHITE);\n\t\tlblTotal.setFont(new Font(\"Tahoma\", Font.BOLD, 16));\n\t\tlblTotal.setBounds(10, 337, 86, 14);\n\t\tframe.getContentPane().add(lblTotal);\n\n\t\tJButton btnRetour = new JButton(\"Retour\");\n\t\tbtnRetour.setBackground(new Color(51, 102, 0));\n\t\tbtnRetour.setForeground(new Color(255, 255, 255));\n\t\tbtnRetour.addMouseListener(new MouseAdapter() {\n\t\t\t@Override\n\t\t\tpublic void mouseClicked(MouseEvent arg0) {\n\t\t\t\tframe.setVisible(false);\n\t\t\t\tAccueil.frame.setVisible(true);\n\t\t\t}\n\t\t});\n\t\tbtnRetour.setFont(new Font(\"Tw Cen MT Condensed Extra Bold\", Font.PLAIN, 20));\n\t\tbtnRetour.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}\n\t\t});\n\t\tbtnRetour.setBounds(413, 503, 89, 23);\n\t\tframe.getContentPane().add(btnRetour);\n\n\t\tJButton btnVoirLaBouteille = new JButton(\"Voir la bouteille\");\n\t\tbtnVoirLaBouteille.addMouseListener(new MouseAdapter() {\n\t\t\t@Override\n\t\t\tpublic void mouseClicked(MouseEvent arg0) {\n\t\t\t\tVuBouteille vue=new VuBouteille();\n\t\t\t\tframe.setVisible(false);\n\t\t\t\tVuBouteille.frame.setVisible(true);\n\t\t\t}\n\t\t});\n\t\tbtnVoirLaBouteille.setBackground(new Color(51, 102, 0));\n\t\tbtnVoirLaBouteille.setForeground(new Color(255, 255, 255));\n\t\tbtnVoirLaBouteille.setFont(new Font(\"Tw Cen MT Condensed Extra Bold\", Font.PLAIN, 20));\n\t\tbtnVoirLaBouteille.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t}\n\t\t});\n\t\tbtnVoirLaBouteille.setBounds(492, 393, 153, 23);\n\t\tframe.getContentPane().add(btnVoirLaBouteille);\n\n\t\tJButton btnAjouterUneBouteille = new JButton(\"Ajouter une bouteille\");\n\t\tbtnAjouterUneBouteille.setBackground(new Color(51, 102, 0));\n\t\tbtnAjouterUneBouteille.setForeground(new Color(255, 255, 255));\n\t\tbtnAjouterUneBouteille.addMouseListener(new MouseAdapter() {\n\t\t\t@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\tframe.setVisible(false);\n\t\t\t\tAdd_Bttl modif = new Add_Bttl();\n\t\t\t\tAdd_Bttl.frame.setVisible(true);\n\t\t\t}\n\t\t});\n\t\tbtnAjouterUneBouteille.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t}\n\t\t});\n\t\tbtnAjouterUneBouteille.setFont(new Font(\"Tw Cen MT Condensed Extra Bold\", Font.PLAIN, 20));\n\t\tbtnAjouterUneBouteille.setBounds(363, 452, 189, 23);\n\t\tframe.getContentPane().add(btnAjouterUneBouteille);\n\n\t\tJButton btnModifierUneBouteille = new JButton(\"Modifier une bouteille\");\n\t\tbtnModifierUneBouteille.setBackground(new Color(51, 102, 0));\n\t\tbtnModifierUneBouteille.setForeground(new Color(255, 255, 255));\n\t\tbtnModifierUneBouteille.setFont(new Font(\"Tw Cen MT Condensed Extra Bold\", Font.PLAIN, 20));\n\t\tbtnModifierUneBouteille.setBounds(657, 393, 223, 23);\n\t\tframe.getContentPane().add(btnModifierUneBouteille);\n\n\t\ttable = new JTable();\n\t\ttable.setBounds(657, 175, 285, 181);\n\t\tframe.getContentPane().add(table);\n\n\t\tJLabel lblStocks = new JLabel(\"Stocks\");\n\t\tlblStocks.setForeground(new Color(0, 0, 51));\n\t\tlblStocks.setHorizontalAlignment(SwingConstants.CENTER);\n\t\tlblStocks.setFont(new Font(\"Wide Latin\", Font.BOLD, 15));\n\t\tlblStocks.setBounds(0, 54, 982, 41);\n\t\tframe.getContentPane().add(lblStocks);\n\t\t\n\t/*\tConnection con =null;\n\t\ttry {\n\t\t\tcon =Connect.connect();\n\t\t} catch (SQLException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}*/\n\t\tJLabel lblTotal_1 = new JLabel(Integer.toString(nbBtlBlanc));\n\t\tlblTotal_1.setForeground(Color.WHITE);\n\t\tlblTotal_1.setFont(new Font(\"Tahoma\", Font.BOLD, 16));\n\t\tlblTotal_1.setBounds(176, 207, 46, 14);\n\t\tframe.getContentPane().add(lblTotal_1);\n\n\t\tJLabel label_1 = new JLabel(Integer.toString(nbBtlRouge));\n\t\tlabel_1.setForeground(Color.WHITE);\n\t\tlabel_1.setFont(new Font(\"Tahoma\", Font.BOLD, 16));\n\t\tlabel_1.setBounds(176, 240, 46, 14);\n\t\tframe.getContentPane().add(label_1);\n\n\t\tJLabel label_2 = new JLabel(Integer.toString(nbBtlRose));\n\t\tlabel_2.setForeground(Color.WHITE);\n\t\tlabel_2.setFont(new Font(\"Tahoma\", Font.BOLD, 16));\n\t\tlabel_2.setBounds(176, 273, 46, 14);\n\t\tframe.getContentPane().add(label_2);\n\n\t\tJLabel label_3 = new JLabel(Integer.toString(nbBtlEffer));\n\t\tlabel_3.setForeground(Color.WHITE);\n\t\tlabel_3.setFont(new Font(\"Tahoma\", Font.BOLD, 16));\n\t\tlabel_3.setBounds(176, 306, 46, 14);\n\t\tframe.getContentPane().add(label_3);\n\n\t\tJLabel label_4 = new JLabel(Integer.toString(totalBtl));\n\t\tlabel_4.setForeground(Color.WHITE);\n\t\tlabel_4.setFont(new Font(\"Tahoma\", Font.BOLD, 16));\n\t\tlabel_4.setBounds(176, 339, 46, 14);\n\t\tframe.getContentPane().add(label_4);\n\n\t\tJComboBox comboBox = new JComboBox(listeTypeVin);\n\t\tcomboBox.setBackground(Color.LIGHT_GRAY);\n\t\tcomboBox.setFont(new Font(\"Tw Cen MT Condensed Extra Bold\", Font.PLAIN, 20));\n\t\tcomboBox.setBounds(449, 200, 175, 20);\n\t\tframe.getContentPane().add(comboBox);\n\n\t\tJComboBox comboBox_1 = new JComboBox(listeFournisseur);\n\t\tcomboBox_1.setBackground(Color.LIGHT_GRAY);\n\t\tcomboBox_1.setFont(new Font(\"Tw Cen MT Condensed Extra Bold\", Font.PLAIN, 20));\n\t\tcomboBox_1.setBounds(449, 235, 175, 20);\n\t\tframe.getContentPane().add(comboBox_1);\n\n\t\tJComboBox comboBox_2 = new JComboBox(listeCuvee);\n\t\tcomboBox_2.setBackground(Color.LIGHT_GRAY);\n\t\tcomboBox_2.setFont(new Font(\"Tw Cen MT Condensed Extra Bold\", Font.PLAIN, 20));\n\t\tcomboBox_2.setBounds(449, 268, 175, 20);\n\t\tframe.getContentPane().add(comboBox_2);\n\n\t\tJComboBox comboBox_3 = new JComboBox(listeRegion);\n\t\tcomboBox_3.setBackground(Color.LIGHT_GRAY);\n\t\tcomboBox_3.setFont(new Font(\"Tw Cen MT Condensed Extra Bold\", Font.PLAIN, 20));\n\t\tcomboBox_3.setBounds(449, 301, 175, 20);\n\t\tframe.getContentPane().add(comboBox_3);\n\n\t\tJComboBox comboBox_4 = new JComboBox(listeVolume);\n\t\tcomboBox_4.setBackground(Color.LIGHT_GRAY);\n\t\tcomboBox_4.setFont(new Font(\"Tw Cen MT Condensed Extra Bold\", Font.PLAIN, 20));\n\t\tcomboBox_4.setBounds(449, 334, 175, 20);\n\t\tframe.getContentPane().add(comboBox_4);\n\n\t\t/*\n\t\t * Liste_Bttl = new TableModel[][] { {Bttl_1 = new\n\t\t * Bouteille(\"Chateau Lecroc\", \"Bordeau\", \"France\", null, 2000, \"rouge\",\n\t\t * 13, \"Cuvelier Fauvarque\", 10, 75, \"non\", 3, 4, \"oui\", 3, \"RAS\")},\n\t\t * {Bttl_2 = new Bouteille(\"Chateau Leduc\", \"Bourgogne\", \"France\", null,\n\t\t * 2001, \"rouge\", 13, \"Cuvelier Fauvarque\", 10, 75, \"non\", 3, 4, \"oui\",\n\t\t * 3, \"Bon avec de la viande Rouge\")}, {Bttl_3 = new\n\t\t * Bouteille(\"Chateau Leduc\", \"Bourgogne\", \"France\", \"medaille argent\",\n\t\t * 2001, \"rouge\", 13, \"Cuvelier Fauvarque\", 10, 75, \"non\", 3, 4, \"oui\",\n\t\t * 3, null)}, };\n\t\t * \n\t\t * String[] entete = { \"nom\", \"region\", \"pays\", \"millesime\", \"cuvee\",\n\t\t * \"robe\", \"temperature\", \"fournisseur\", \"degre\", \"volume\",\n\t\t * \"effervescent\", \"note\", \"quantite\", \"disponible\", \"emplacement\",\n\t\t * \"commentaire\" };\n\t\t */\n\t\ttable_2 = new JTable();\n\t\ttable_2.setBounds(640, 350, 274, -156);\n\t\tframe.getContentPane().add(table_2);\n\t\t\n\t\tJLabel label_5 = new JLabel(\"\");\n\t\tlabel_5.setIcon(new ImageIcon(\"verre_vin_qualit\\u00E9.jpg\"));\n\t\tlabel_5.setBounds(0, 0, 982, 553);\n\t\tframe.getContentPane().add(label_5);\n\n\t}",
"protected final void setGUIAttributes(){\r\n\t\t\r\n\t\tbtnOnOff.setEnabled( device.getOn() != null && device.getOn().getActor() != null);\r\n\t\tif(device.getOn() == null){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t// if the device is On\r\n\t\tif( device.getOnValue()){\r\n\t\t\tbtnOnOff.setText( \"Turn device Off\");\r\n\t\t// if the device is Off\r\n\t\t}else{\r\n\t\t\tbtnOnOff.setText( \"Turn device On\");\r\n\t\t}\r\n\t\tsetGUIAttributesHelper();\r\n\t}",
"private void setupMessage() {\n \tmessage = new GLabel(\"\");\n \tmessage.setFont(\"SansSerif-12\");\n }",
"void setLabel(String label);",
"public RobotNumInit() {\n initComponents();\n setName(\"InitRobotCard\");\n }",
"protected void initialize() {\r\n\t \tRobotMap.armarm_talon.changeControlMode(CANTalon.ControlMode.Position);\r\n\t }",
"public mythologyBattleGui() {\n initComponents();\n labelClear();\n groupBoardArea();\n playBoard.initGame();\n initRan(18);\n }",
"public void randomize(){\r\n Num1.setText(\"\"+((int) (Math.random() * 10 + 1)));\r\n Num2.setText(\"\"+((int) (Math.random() * 10 + 1)));\r\n Num3.setText(\"\"+((int) (Math.random() * 10 + 1)));\r\n }",
"private void initialize() {\n\t\n\t\t\n\t\t\n\t\t\n\t\tframe_RepresentationSpectacles = new JFrame();\n\t\tframe_RepresentationSpectacles.setTitle(\"SPECTACLES\");\n\t\t\n\t\n\t\tframe_RepresentationSpectacles.setIconImage(Toolkit.getDefaultToolkit().getImage(\"C:\\\\Users\\\\Berfin COSKUN\\\\Desktop\\\\79-790571_theatre-mask-icon-theatre-mask-icon-png-transparent.png\"));\n\t\tframe_RepresentationSpectacles.getContentPane().setBackground(new Color(255, 245, 238));\n\t\tframe_RepresentationSpectacles.setBackground(Color.BLACK);\n\t\tframe_RepresentationSpectacles.setBounds(100, 100, 1041, 697);\n\t\tframe_RepresentationSpectacles.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe_RepresentationSpectacles.getContentPane().setLayout(null);\n\t\t\n\t\tJLabel lblRpresentatinb = new JLabel(\"Spectacles\");\n\t\tlblRpresentatinb.setHorizontalAlignment(SwingConstants.CENTER);\n\t\tlblRpresentatinb.setFont(new Font(\"Tahoma\", Font.BOLD, 24));\n\t\tlblRpresentatinb.setBounds(0, 41, 1025, 78);\n\t\tframe_RepresentationSpectacles.getContentPane().add(lblRpresentatinb);\n\t\t\n\t\tJPanel panel = new JPanel();\n\t\tpanel.setBounds(10, 130, 1005, 517);\n\t\tframe_RepresentationSpectacles.getContentPane().add(panel);\n\t\tpanel.setLayout(null);\n\t\t\n\t\tJTextArea txtressaie = new JTextArea();\n\t\ttxtressaie.setEditable(false);\n\t\ttxtressaie.setBounds(0, 0, 1015, 517);\n\t\tpanel.add(txtressaie);\n\t\t\n\t\t\n\t\tString essaie = \"\";\n\t\tBDD.recuperer_données_representation();\n\t\tfor(Spectacle s : BDD.liste_spectacle) {\n\t\t\tessaie = essaie+\"\\n\"+s;\n\t\t}\n\n\n\t\ttxtressaie.setText(essaie);\n\t\t\n\t\tif(type==\"A\") {\n\t\t\tJMenuBar menuBar = new JMenuBar();\n\t\t\tmenuBar.setBackground(new Color(211, 211, 211));\n\t\t\tmenuBar.setForeground(new Color(0, 0, 0));\n\t\t\tmenuBar.setBounds(0, 0, 1025, 42);\n\t\t\tframe_RepresentationSpectacles.getContentPane().add(menuBar);\n\t\t\t\n\t\t\tJMenu mn_Perso = new JMenu(\"\\u2630\");\n\t\t\tmn_Perso.setBackground(new Color(211, 211, 211));\n\t\t\tmenuBar.add(mn_Perso);\n\t\t\t\n\t\t\tJMenuItem mntmNewMenuItem_Accueil = new JMenuItem(\"Accueil\");\n\t\t\tmn_Perso.add(mntmNewMenuItem_Accueil);\n\t\t\t\n\t\t\tJMenuItem mntmMonCompte = new JMenuItem(\"Mon compte\");\n\t\t\tmntmMonCompte.setBackground(new Color(128, 128, 128));\n\t\t\tmntmMonCompte.setForeground(new Color(0, 0, 0));\n\t\t\tmn_Perso.add(mntmMonCompte);\n\t\t\t\n\t\t\tJMenuItem mntmNewMenuItem_deconnexion = new JMenuItem(\"Deconnexion\");\n\t\t\tmn_Perso.add(mntmNewMenuItem_deconnexion);\n\t\t\t\n\t\t\tJMenu mn_Spectacle = new JMenu(\"Spectacles\");\n\t\t\tmn_Spectacle.setBackground(new Color(211, 211, 211));\n\t\t\tmn_Spectacle.setHorizontalAlignment(SwingConstants.CENTER);\n\t\t\tmn_Spectacle.setForeground(new Color(0, 0, 0));\n\t\t\tmn_Spectacle.setFont(new Font(\"Segoe UI\", Font.BOLD, 14));\n\t\t\tmenuBar.add(mn_Spectacle);\n\t\t\t\n\t\t\tJMenuItem mntmNewMenuItem_Spectacle = new JMenuItem(\"Afficher les spectacles\");\n\t\t\tmn_Spectacle.add(mntmNewMenuItem_Spectacle);\n\t\t\tmntmNewMenuItem_Spectacle.setHorizontalAlignment(SwingConstants.LEFT);\n\t\t\tmntmNewMenuItem_Spectacle.setFont(new Font(\"Segoe UI\", Font.PLAIN, 12));\n\t\t\tmntmNewMenuItem_Spectacle.setBackground(new Color(100, 149, 237));\n\t\t\t\n\t\t\tJMenuItem mntmNewMenuItem = new JMenuItem(\"Ajouter un nouveau spectacle\");\n\t\t\tmn_Spectacle.add(mntmNewMenuItem);\n\t\t\t\n\t\t\tJMenu mn_Representation = new JMenu(\"Representation\");\n\t\t\tmn_Representation.setBackground(new Color(211, 211, 211));\n\t\t\tmn_Representation.setFont(new Font(\"Segoe UI\", Font.BOLD, 14));\n\t\t\tmn_Representation.setForeground(new Color(0, 0, 0));\n\t\t\tmenuBar.add(mn_Representation);\n\t\t\t\n\t\t\tJMenuItem mntm_Representation = new JMenuItem(\"Afficher les representation\");\n\t\t\tmn_Representation.add(mntm_Representation);\n\t\t\tmntm_Representation.setHorizontalAlignment(SwingConstants.LEFT);\n\t\t\tmntm_Representation.setFont(new Font(\"Segoe UI\", Font.PLAIN, 13));\n\t\t\tmntm_Representation.setBackground(new Color(100, 149, 237));\n\t\t\t\n\t\t\tJMenuItem mntm_AjoutRepresentation = new JMenuItem(\"Ajouter une vouvelle representation\");\n\t\t\tmntm_AjoutRepresentation.setFont(new Font(\"Segoe UI\", Font.PLAIN, 13));\n\t\t\tmntm_AjoutRepresentation.setHorizontalAlignment(SwingConstants.LEFT);\n\t\t\tmn_Representation.add(mntm_AjoutRepresentation);\n\t\t\t\n\t\t\tJMenuItem mntmNewMenuItem_NvxCompte = new JMenuItem(\"Nouveau compte\");\n\t\t\tmntmNewMenuItem_NvxCompte.setHorizontalAlignment(SwingConstants.CENTER);\n\t\t\tmntmNewMenuItem_NvxCompte.setBackground(new Color(211, 211, 211));\n\t\t\tmntmNewMenuItem_NvxCompte.setFont(new Font(\"Segoe UI\", Font.BOLD, 14));\n\t\t\tmenuBar.add(mntmNewMenuItem_NvxCompte);\n\t\t\t\n\t\t\tJMenuItem mntmNewMenuItem_2 = new JMenuItem(\"Supprimer un compte\");\n\t\t\tmntmNewMenuItem_2.setBackground(new Color(211, 211, 211));\n\t\t\tmntmNewMenuItem_2.setFont(new Font(\"Segoe UI\", Font.BOLD, 14));\n\t\t\tmntmNewMenuItem_2.setHorizontalAlignment(SwingConstants.CENTER);\n\t\t\tmenuBar.add(mntmNewMenuItem_2);\n\t\t\t\n\t\t\tJMenuItem mntmNewMenuItem_1 = new JMenuItem(\"Reservation\");\n\t\t\tmntmNewMenuItem_1.setHorizontalAlignment(SwingConstants.CENTER);\n\t\t\tmntmNewMenuItem_1.setFont(new Font(\"Segoe UI\", Font.BOLD, 14));\n\t\t\tmntmNewMenuItem_1.setBackground(new Color(211, 211, 211));\n\t\t\tmenuBar.add(mntmNewMenuItem_1);\n\t\t}\n\t\telse if (type==\"G\") {\n\t\t\tJMenuBar menuBar = new JMenuBar();\n\t\t\tmenuBar.setBackground(new Color(211, 211, 211));\n\t\t\tmenuBar.setForeground(new Color(0, 0, 0));\n\t\t\tmenuBar.setBounds(0, 0, 1025, 42);\n\t\t\tframe_RepresentationSpectacles.getContentPane().add(menuBar);\n\t\t\t\n\t\t\tJMenu mn_Perso = new JMenu(\"\\u2630\");\n\t\t\tmn_Perso.setBackground(new Color(211, 211, 211));\n\t\t\tmenuBar.add(mn_Perso);\n\t\t\t\n\t\t\tJMenuItem mntmNewMenuItem_Accueil = new JMenuItem(\"Accueil\");\n\t\t\tmn_Perso.add(mntmNewMenuItem_Accueil);\n\t\t\t\n\t\t\tJMenuItem mntmMonCompte = new JMenuItem(\"Mon compte\");\n\t\t\tmntmMonCompte.setBackground(new Color(128, 128, 128));\n\t\t\tmntmMonCompte.setForeground(new Color(0, 0, 0));\n\t\t\tmn_Perso.add(mntmMonCompte);\n\t\t\t\n\t\t\tJMenuItem mntmNewMenuItem_deconnexion = new JMenuItem(\"Deconnexion\");\n\t\t\tmn_Perso.add(mntmNewMenuItem_deconnexion);\n\t\t\t\n\t\t\tJMenuItem mntm_Spectacles = new JMenuItem(\"Spectacles\");\n\t\t\tmntm_Spectacles.setHorizontalAlignment(SwingConstants.CENTER);\n\t\t\tmntm_Spectacles.setBackground(new Color(211, 211, 211));\n\t\t\tmntm_Spectacles.setFont(new Font(\"Segoe UI\", Font.BOLD, 14));\n\t\t\tmenuBar.add(mntm_Spectacles);\n\t\t\t\n\t\t\tJMenuItem mntm_Representation = new JMenuItem(\"Representation\");\n\t\t\tmntm_Representation.setBackground(new Color(211, 211, 211));\n\t\t\tmntm_Representation.setFont(new Font(\"Segoe UI\", Font.BOLD, 14));\n\t\t\tmntm_Representation.setHorizontalAlignment(SwingConstants.CENTER);\n\t\t\tmenuBar.add(mntm_Representation);\n\t\t\t\n\t\t\tJMenuItem mntmNewMenuItem_1 = new JMenuItem(\"Reservation\");\n\t\t\tmntmNewMenuItem_1.setHorizontalAlignment(SwingConstants.CENTER);\n\t\t\tmntmNewMenuItem_1.setFont(new Font(\"Segoe UI\", Font.BOLD, 14));\n\t\t\tmntmNewMenuItem_1.setBackground(new Color(211, 211, 211));\n\t\t\tmenuBar.add(mntmNewMenuItem_1);\n\t\t}\n\t\telse {\n\t\t\t\n\t\t\t\n\t\t}\n\t}",
"public SceneLabelObjectState(){\n\t\tsuper();\n\t\tsuper.setObjectsPrimaryType(SceneObjectType.Label);\n\n\t}",
"public void setLabel()\r\n {\r\n int i = Converter(Input);\r\n \r\n if(j<i && label.getText().equals(\"Player 1\"))\r\n {\r\n j++;\r\n label.setText(\"Player \"+j);\r\n \r\n }else if(j<i && label.getText().equals(\"Player 2\"))\r\n {\r\n j++;\r\n label.setText(\"Player \"+j);\r\n }else if(j<i && label.getText().equals(\"Player 3\"))\r\n {\r\n j++;\r\n label.setText(\"Player \"+j);\r\n }else if(j==i && label.getText().equals(\"Player \"+j))\r\n {\r\n j=1;\r\n label.setText(\"Player \"+j);\r\n }\r\n \r\n \r\n }"
] | [
"0.656844",
"0.6517029",
"0.6467335",
"0.6263048",
"0.6138681",
"0.60616475",
"0.60005605",
"0.59772617",
"0.5882609",
"0.5839086",
"0.5794727",
"0.57931376",
"0.57593536",
"0.57528",
"0.5749024",
"0.57452905",
"0.5731809",
"0.569517",
"0.5682251",
"0.56714314",
"0.5670365",
"0.5665587",
"0.566255",
"0.5657759",
"0.56214494",
"0.56176746",
"0.5612489",
"0.5601658",
"0.5583317",
"0.55806744",
"0.55539024",
"0.555264",
"0.5543273",
"0.55362093",
"0.5529452",
"0.5528411",
"0.5515849",
"0.55136436",
"0.5513244",
"0.5512712",
"0.55101675",
"0.5500461",
"0.54836094",
"0.5478723",
"0.5473389",
"0.54684544",
"0.5464144",
"0.54598063",
"0.5458009",
"0.5456547",
"0.54546493",
"0.5449764",
"0.54452276",
"0.54435164",
"0.54396236",
"0.54379034",
"0.54364175",
"0.54264075",
"0.54188627",
"0.54176813",
"0.5416423",
"0.5414096",
"0.5412948",
"0.54087037",
"0.54068595",
"0.54057205",
"0.5393255",
"0.53919244",
"0.5390616",
"0.53872216",
"0.53861207",
"0.5384866",
"0.5382523",
"0.5381499",
"0.5381358",
"0.53795266",
"0.5377266",
"0.5375678",
"0.53739476",
"0.53728",
"0.53644735",
"0.53632236",
"0.5361331",
"0.5360664",
"0.5353337",
"0.53528",
"0.53489536",
"0.53474987",
"0.5342504",
"0.5340535",
"0.5337745",
"0.53337806",
"0.5333279",
"0.5331666",
"0.5325612",
"0.53255683",
"0.5324563",
"0.53244406",
"0.53243494",
"0.5323657"
] | 0.7926995 | 0 |
setup the drop shadow the drop shadow | private DropShadow getDropShadow() {
DropShadow shadow = new DropShadow();
shadow.setOffsetX(10);
shadow.setOffsetY(10);
shadow.setHeight(10);
shadow.setHeight(10);
shadow.setBlurType(BlurType.THREE_PASS_BOX);
shadow.setColor(Color.GRAY);
return shadow;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void addShadow() {\n startShadow();\n }",
"private void setupShadow()\n {\n int maximumPortNumber = Math.max(module_.getInputs().size(), module_.getOutputs().size());\n shadow_ = new BufferedImage(200 + 1 + 20, maximumPortNumber * 20 + 30 + 1 + 20, BufferedImage.TYPE_INT_ARGB);\n Graphics2D g = (Graphics2D) shadow_.getGraphics();\n g.setBackground(Color.white);\n g.setColor(new Color(0.0f, 0.0f, 0.0f, 0.3f));\n g.fillRoundRect(3, 3, 200, maximumPortNumber * 20 + 30, 20, 20);\n g.setColor(Color.white);\n // Convolve the shadow image using a median kernel\n int kSize = 5;\n float[] data = new float[kSize * kSize];\n float value = (float) (1. / (float) (kSize * kSize));\n for (int i = 0; i < data.length; i++)\n {\n data[i] = value;\n }\n op_ = new ConvolveOp(new Kernel(kSize, kSize, data));\n }",
"public final native void setShadow(Shadow shadow) /*-{\n\t\tthis.setShadow({\n color: [email protected]::getColour()()[email protected]::toString()(),\n blur: [email protected]::getBlur()(),\n offset: [[email protected]::getOffset()()[email protected]::x, \n \t\t [email protected]::getOffset()()[email protected]::y],\n alpha: [email protected]::getAlpha()()\n });\n\t}-*/;",
"private void showShadow(Tile tile) {\n hoveredHex = tile.hex;\n hoverShadow.transform.setParent(tile.transform);\n }",
"public void setDropShadow(float xOffset, float yOffset, Color color) {\n this.dropShadowOffset.x = xOffset;\n this.dropShadowOffset.y = yOffset;\n this.dropShadowColor = color;\n this.dropShadow = true;\n }",
"@Override\n\t public void onProvideShadowMetrics (Point size, Point touch){\n\t // Defines local variables\n\t int width;\n\t\t\t\tint height;\n\n\t // Sets the width of the shadow to half the width of the original View\n\t width = getView().getWidth() / 2;\n\n\t // Sets the height of the shadow to half the height of the original View\n\t height = getView().getHeight() / 2;\n\n\t // The drag shadow is a ColorDrawable. This sets its dimensions to be the same as the\n\t // Canvas that the system will provide. As a result, the drag shadow will fill the\n\t // Canvas.\n\t shadow.setBounds(0, 0, width, height);\n\n\t // Sets the size parameter's width and height values. These get back to the system\n\t // through the size parameter.\n\t size.set(width, height);\n\n\t // Sets the touch point's position to be in the middle of the drag shadow\n\t touch.set(width / 2, height / 2);\n\t }",
"public void setShadow(float xOffset, float yOffset, Colour c) {\n shadow = new Box(x + xOffset, y + yOffset, w, h, 0, c);\r\n }",
"public static DirectionalLightShadowFilter addShadow(DirectionalLight light)\n\t{\n\n DirectionalLightShadowFilter dlsf = new DirectionalLightShadowFilter(GVars_Soul_Model.app.getAssetManager(), SHADOWMAP_SIZE, 1);\n dlsf.setLight(light);\n dlsf.setLambda(0.55f);\n dlsf.setShadowIntensity(1.0f);\n dlsf.setEdgeFilteringMode(EdgeFilteringMode.Nearest);\n dlsf.setEnabled(true);\n\n volatileFPP.addFilter(dlsf);\n\n //GVars_Soul_Model.app.getViewPort().addProcessor(volatileFPP);\n \n return dlsf ;\n\t}",
"private void initStyles(){\n Shadow shadowEffect = new Shadow();\n shadowEffect.setBlurType(BlurType.GAUSSIAN);\n shadowEffect.setHeight(0);\n shadowEffect.setWidth(5.93);\n shadowEffect.setColor(Color.color(0.5, 0, 1.0));\n openAboutText.setOnMouseEntered(mouseEvent -> openAboutText.setEffect(shadowEffect));//#2f00ff\n openAboutText.setOnMouseExited(mouseEvent -> openAboutText.setEffect(null) );//#9277ff\n\n openSetingsText.setOnMouseEntered(mouseEvent -> {openSetingsText.setEffect(shadowEffect);});\n openSetingsText.setOnMouseExited(mouseEvent -> {openSetingsText.setEffect(null);});\n\n openAlarmsText.setOnMouseEntered(mouseEvent -> {openAlarmsText.setEffect(shadowEffect);});\n openAlarmsText.setOnMouseExited(mouseEvent -> {openAlarmsText.setEffect(null);});\n\n exitText.setOnMouseEntered(mouseEvent ->{\n shadowEffect.setColor(Color.color(1,0,0));\n exitText.setEffect(shadowEffect); });\n exitText.setOnMouseExited(mouseEvent -> {\n shadowEffect.setColor(Color.color(0.5, 0, 1.0));\n exitText.setEffect(null);\n } );\n }",
"@Override\n\t public void onDrawShadow(Canvas canvas) {\n\n\t // Draws the ColorDrawable in the Canvas passed in from the system.\n\t shadow.draw(canvas);\n\t }",
"public ShadowLinearLayout(@NotNull Context context, @Nullable AttributeSet attributeSet, int i) {\n super(context, attributeSet, i);\n Intrinsics.checkNotNullParameter(context, \"context\");\n setWillNotDraw(false);\n setLayerType(1, null);\n this.a = new Rect();\n this.e = true;\n TypedArray obtainStyledAttributes = getContext().obtainStyledAttributes(attributeSet, R.styleable.ShadowLayout, i, R.style.Design_Widget_ShadowLayout);\n int dimensionPixelOffset = obtainStyledAttributes.getDimensionPixelOffset(R.styleable.ShadowLayout_shadowLayout_shadowDx, 0);\n int dimensionPixelOffset2 = obtainStyledAttributes.getDimensionPixelOffset(R.styleable.ShadowLayout_shadowLayout_shadowDy, 0);\n int i2 = R.styleable.ShadowLayout_shadowLayout_shadowColor;\n Context context2 = getContext();\n Intrinsics.checkNotNullExpressionValue(context2, \"context\");\n int color = obtainStyledAttributes.getColor(i2, Contexts.getColorByAttr(context2, R.attr.black));\n int dimensionPixelSize = obtainStyledAttributes.getDimensionPixelSize(R.styleable.ShadowLayout_shadowLayout_shadowBlurRadius, 0);\n boolean z = obtainStyledAttributes.getBoolean(R.styleable.ShadowLayout_shadowLayout_shadowEnabled, true);\n obtainStyledAttributes.recycle();\n Paint paint = new Paint(1);\n paint.setMaskFilter(new BlurMaskFilter((float) dimensionPixelSize, BlurMaskFilter.Blur.NORMAL));\n paint.setColor(color);\n Unit unit = Unit.INSTANCE;\n this.b = paint;\n this.c = dimensionPixelOffset;\n this.d = dimensionPixelOffset2;\n this.e = z;\n }",
"@Override\r\n\tpublic void renderShadow(float[] vpMatrix) {\n\t\t\r\n\t}",
"private void initialize_gallery() {\n\t DropShadow dropShadow = new DropShadow(); \r\n\t //setting the type of blur for the shadow \r\n\t dropShadow.setBlurType(BlurType.GAUSSIAN); \r\n\t //Setting colour for the shadow \r\n\t dropShadow.setColor(Color.BLACK); \r\n\t //Setting the height of the shadow\r\n\t dropShadow.setHeight(5); \r\n\t //Setting the width of the shadow \r\n\t dropShadow.setWidth(5); \r\n\t //Setting the radius of the shadow \r\n\t dropShadow.setRadius(5); \r\n\t //setting the offset of the shadow \r\n\t dropShadow.setOffsetX(3); \r\n\t dropShadow.setOffsetY(2); \r\n\t //Setting the spread of the shadow \r\n\t dropShadow.setSpread(12); \r\n\r\n\t\ttry {\r\n\t\t\tfor (int i = 0; i < numOfImages; i++){\r\n\t\t\t\t//Folder \"image\" is in project folder\r\n\t\t\t\timageFiles = new File(\"Resources/imagesGallery/\"+i+\".png\");\r\n\t\t\t\timageList[i] = new Image(\"file:\"+imageFiles.getAbsolutePath());\r\n\t\t\t\tSystem.out.println(imageFiles.getAbsolutePath());\r\n\t\t\t\t\r\n\t\t\t\t//Create list of ImageView nodes of size 100x100 for image gallery\r\n\t\t\t\timageGalleryNodeList[i] = new ImageView(imageList[i]);\r\n\t\t\t\timageGalleryNodeList[i].setPreserveRatio(true);\r\n\t\t\t\timageGalleryNodeList[i].setFitWidth(150);\r\n\t\t\t\timageGalleryNodeList[i].setFitHeight(150);\r\n\t\t\t\timageGalleryNodeList[i].setEffect(dropShadow);\r\n\t\t\t\t\r\n\t\t\t\t//Create list of ImageView nodes with image ratio preserved and 300 width\r\n\t\t\t\timageLargeNodeList[i] = new ImageView(imageList[i]);\r\n\t\t\t\timageLargeNodeList[i].setPreserveRatio(true);\r\n\t\t\t\timageLargeNodeList[i].setFitHeight(300);\r\n\t\t\t\timageLargeNodeList[i].setEffect(dropShadow);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfillGrid(gridStartIndex);\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"@Override\n \t\t\t\tpublic void doCreateDirectionalLight() {\n \n \t\t\t\t}",
"public void showShadow(boolean z, boolean z2) {\n if (z && this.shadowView.getTag() == null) {\n return;\n }\n if (z || this.shadowView.getTag() == null) {\n AnimatorSet animatorSet = this.shadowAnimator;\n int i = null;\n if (animatorSet != null) {\n animatorSet.cancel();\n this.shadowAnimator = null;\n }\n View view = this.shadowView;\n if (!z) {\n i = 1;\n }\n view.setTag(i);\n float f = 1.0f;\n if (z2) {\n AnimatorSet animatorSet2 = new AnimatorSet();\n this.shadowAnimator = animatorSet2;\n Animator[] animatorArr = new Animator[1];\n View view2 = this.shadowView;\n Property property = View.ALPHA;\n float[] fArr = new float[1];\n if (!z) {\n f = 0.0f;\n }\n fArr[0] = f;\n animatorArr[0] = ObjectAnimator.ofFloat(view2, property, fArr);\n animatorSet2.playTogether(animatorArr);\n this.shadowAnimator.setDuration(200);\n this.shadowAnimator.setInterpolator(CubicBezierInterpolator.EASE_OUT);\n this.shadowAnimator.addListener(new AnimatorListenerAdapter() {\n public void onAnimationEnd(Animator animator) {\n AnimatorSet unused = SearchField.this.shadowAnimator = null;\n }\n });\n this.shadowAnimator.start();\n return;\n }\n View view3 = this.shadowView;\n if (!z) {\n f = 0.0f;\n }\n view3.setAlpha(f);\n }\n }",
"public float getSoftShadowLength();",
"private void drawThumbShadow(float screenCoord, Canvas canvas) {\n mThumbShadowMatrix.setTranslate(screenCoord + mThumbShadowXOffset, mTextOffset + mThumbHalfHeight + mThumbShadowYOffset);\n mTranslatedThumbShadowPath.set(mThumbShadowPath);\n mTranslatedThumbShadowPath.transform(mThumbShadowMatrix);\n canvas.drawPath(mTranslatedThumbShadowPath, shadowPaint);\n }",
"protected void setupSky() {\r\n\t\t// Change atmosphere SkyGradientLayer for SkyColorLayer\r\n\t\tLayerList layers = getWWD().getModel().getLayers();\r\n\t\tfor (int i = 0; i < layers.size(); i++) {\r\n\t\t\tif (layers.get(i) instanceof SkyGradientLayer) {\r\n\t\t\t\tlayers.set(i, new SkyColorLayer());\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void setSoftnessLength(float softShadowLength);",
"public void setDrawShadows(boolean a) {\n\t\tthis.shadows = a;\n\t}",
"public void setShadowColor(int color){\r\n this.shadow.setColor(color);\r\n }",
"private void generateShadowVolumeStencil() {\n\t\tGL11.glColorMask(false, false, false, false);\n\t\tGL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT\n\t\t\t\t| GL11.GL_STENCIL_BUFFER_BIT);\n\t\tfor (PhysicsEntity<? extends RenderEntity> e : entities) {\n\t\t\tRenderEntity re = e.getWorldEntity();\n\t\t\tre.render(passThruContext);\n\t\t}\n\n\t\t// PERFORM STENCIL TEST OF OBJECTS THAT CAST SHADOWS\n\t\tGL11.glClear(GL11.GL_STENCIL_BUFFER_BIT);\n\t\tGL11.glEnable(GL11.GL_STENCIL_TEST);\n\t\tGL11.glStencilFunc(GL11.GL_ALWAYS, 1, 0xff);\n\t\tGL11.glEnable(GL11.GL_DEPTH_TEST);\n\t\tGL11.glDepthFunc(GL11.GL_LESS);\n\t\tGL11.glDepthMask(false);\n\t\tGL11.glEnable(GL11.GL_CULL_FACE);\n\n\t\t// pass 1 frontface culling\n\t\tGL11.glCullFace(GL11.GL_BACK);\n\t\tGL11.glStencilOp(GL11.GL_KEEP, GL11.GL_KEEP, GL11.GL_INCR);\n\n\t\tfor (PhysicsEntity<? extends RenderEntity> e : entities) {\n\t\t\tRenderEntity re = e.getWorldEntity();\n\t\t\tif (re.castShadows) {\n\t\t\t\tre.render(volumeShadowContext);\n\t\t\t}\n\t\t}\n\n\t\t// pass 2 backface culling\n\t\tGL11.glCullFace(GL11.GL_FRONT);\n\t\tGL11.glStencilOp(GL11.GL_KEEP, GL11.GL_KEEP, GL11.GL_DECR);\n\t\tfor (PhysicsEntity<? extends RenderEntity> e : entities) {\n\t\t\tRenderEntity re = e.getWorldEntity();\n\t\t\tif (re.castShadows) {\n\t\t\t\tre.render(volumeShadowContext);\n\t\t\t}\n\t\t}\n\t}",
"private void setup() {\n // init paint\n paint = new Paint();\n paint.setAntiAlias(true);\n\n paintBorder = new Paint();\n setBorderColor(Color.WHITE);\n paintBorder.setAntiAlias(true);\n }",
"@Override\n \t\t\t\tpublic void doCreatePointLight() {\n \n \t\t\t\t}",
"private void initPaint() {\n paint = new Paint();\n paint.setAntiAlias(true);\n Bitmap bitmap = Bitmap.createBitmap(starSize, starSize, Bitmap.Config.ARGB_8888);\n Canvas canvas = new Canvas(bitmap);\n lightDrawable.setBounds(0,0,starSize,starSize);\n lightDrawable.draw(canvas);\n paint.setShader(new BitmapShader(bitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP));\n }",
"private static void backButtonCreator(int backWidth, int backHeight){\n backButton = shadowEffect(configureImageView(\"\",\"button-back\",\".png\",backWidth,backHeight));\n }",
"public LayoutParams(@NotNull Context context, @NotNull AttributeSet attributeSet) {\n super(context, attributeSet);\n Intrinsics.checkNotNullParameter(context, \"context\");\n Intrinsics.checkNotNullParameter(attributeSet, \"attrs\");\n TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, R.styleable.ShadowLayout_Layout);\n this.a = obtainStyledAttributes.getBoolean(R.styleable.ShadowLayout_Layout_layout_shadowEnabled, false);\n obtainStyledAttributes.recycle();\n }",
"public void setGraphShadowWidth(int width) {\n mGraphicsRenderer.setGraphShadowWidth(width);\n }",
"void setupLights() {\n\n lightGroup = new Group();\n\n // Set up the ambient light\n lightAmbient = new AmbientLight(darkGrey);\n lightAmbient.setInfluencingBounds(infiniteBounds);\n lightAmbient.setCapability(Light.ALLOW_STATE_WRITE);\n lightAmbient.setEnable(true);\n lightGroup.addChild(lightAmbient);\n\n // Set up the directional light\n Vector3f lightDirection = new Vector3f(0.65f, -0.65f, -0.40f);\n lightDirectional = new DirectionalLight(white, lightDirection);\n lightDirectional.setInfluencingBounds(infiniteBounds);\n lightDirectional.setEnable(true);\n lightDirectional.setCapability(Light.ALLOW_STATE_WRITE);\n lightGroup.addChild(lightDirectional);\n\n // Set up the point light\n Point3f lightPosition = new Point3f(-1.0f, 1.0f, 0.6f);\n lightPoint = new PointLight(white, lightPosition, attenuation);\n lightPoint.setInfluencingBounds(infiniteBounds);\n lightPoint.setEnable(false);\n lightPoint.setCapability(Light.ALLOW_STATE_WRITE);\n lightPoint.setCapability(PointLight.ALLOW_ATTENUATION_WRITE);\n lightGroup.addChild(lightPoint);\n\n // Set up the spot light\n // Point the light back at the origin\n lightSpot = new SpotLight(white, lightPosition, attenuation,\n lightDirection, (float) Math.toRadians(spotSpreadAngle),\n spotConcentration);\n lightSpot.setInfluencingBounds(infiniteBounds);\n lightSpot.setEnable(false);\n lightSpot.setCapability(Light.ALLOW_STATE_WRITE);\n lightSpot.setCapability(PointLight.ALLOW_ATTENUATION_WRITE);\n lightSpot.setCapability(SpotLight.ALLOW_CONCENTRATION_WRITE);\n lightSpot.setCapability(SpotLight.ALLOW_SPREAD_ANGLE_WRITE);\n lightGroup.addChild(lightSpot);\n }",
"public void initVisualProperties(GraphicsDirector gDirector) {\n\n if (!getLocation().isTileMap()) {\n if (this.isMaster)\n gDirector.addDrawable(this.wotCharacter.getShadow()); // Drawable has already been added\n else {\n gDirector.addDrawable(this.wotCharacter.getDrawable(this));\n gDirector.addDrawable(this.wotCharacter.getShadow());\n }\n } else {\n gDirector.addDrawable(this.wotCharacter.getDrawable(this));\n }\n }",
"@Override\n public boolean onTouch(View v, MotionEvent arg1) {\n ClipData veri = ClipData.newPlainText(\"\", \"\");\n View.DragShadowBuilder golge = new View.DragShadowBuilder(yukari);\n v.startDrag(veri, golge, null, 0);\n return false;\n }",
"public final native Shadow getShadow() /*-{\n\t\tif (this.getShadow() != null) {\n\t\t\tvar shadow = @net.edzard.kinetic.Shadow::new()();\n\t\t\tif(this.getShadow().color != null)\n\t \t\t\[email protected]::setColour(Lnet/edzard/kinetic/Colour;)(@net.edzard.kinetic.Colour::new(Ljava/lang/String;)(this.getShadow().color));\n\t\t\tif(this.getShadow().blur != null) \n\t\t\t\[email protected]::setBlur(D)(this.getShadow().blur);\n\t\t\tif(this.getShadow().offset != null) \n\t\t\t\[email protected]::setOffset(Lnet/edzard/kinetic/Vector2d;)(@net.edzard.kinetic.Vector2d::new(DD)(this.getShadow().offset.x, this.getShadow().offset.y));\n\t\t\tif(this.getShadow().alpha != null) \n\t\t\t\[email protected]::setAlpha(D)(this.getShadow().alpha);\t\t\t\t\t\n\t\t\treturn shadow;\n\t\t} else return null;\n\t}-*/;",
"public void draw(Canvas canvas) {\n super.draw(canvas);\n if (this.getChildCount() <= 1) return;\n View view = this.getChildAt(1);\n if (view == null || this.mShadowDrawable == null) {\n return;\n }\n int n2 = this.mShadowDrawable.getIntrinsicWidth();\n int n3 = view.getLeft();\n int n4 = view.getTop();\n int n5 = view.getBottom();\n this.mShadowDrawable.setBounds(n3 - n2, n4, n3, n5);\n this.mShadowDrawable.draw(canvas);\n }",
"private void deleteShadows(DuplicateShadowsTreatmentInstruction instruction, StringBuilder sb, Task task, OperationResult result) {\n\n LOGGER.trace(\"Going to delete shadows:\\n{}\", instruction);\n if (instruction == null || instruction.getShadowsToDelete() == null) {\n return;\n }\n Collection<PrismObject<ShadowType>> shadowsToDelete = instruction.getShadowsToDelete();\n String shadowOidToReplaceDeleted = instruction.getShadowOidToReplaceDeletedOnes();\n\n for (PrismObject<ShadowType> shadowToDelete : shadowsToDelete) {\n LOGGER.info(\"Deleting redundant shadow{} {}\", skippedForDryRun(), ObjectTypeUtil.toShortString(shadowToDelete));\n sb.append(\" --> deleted redundant shadow\").append(skippedForDryRun()).append(\" \").append(ObjectTypeUtil.toShortString(shadowToDelete)).append(\"\\n\");\n String oid = shadowToDelete.getOid();\n\n List<PrismObject<FocusType>> owners;\n if (checkOwners) {\n owners = (List) shadowToDelete.getUserData(KEY_OWNERS);\n } else {\n owners = searchOwners(shadowToDelete, result);\n }\n\n if (!dryRun) {\n try {\n repositoryService.deleteObject(ShadowType.class, oid, result);\n task.recordObjectActionExecuted(shadowToDelete, ChangeType.DELETE, null);\n duplicateShadowsDeleted.add(oid);\n } catch (ObjectNotFoundException e) {\n // suspicious, but not a big deal\n task.recordObjectActionExecuted(shadowToDelete, ChangeType.DELETE, e);\n LoggingUtils.logExceptionAsWarning(LOGGER, \"Shadow {} couldn't be deleted, because it does not exist anymore\", e, ObjectTypeUtil.toShortString(shadowToDelete));\n continue;\n } catch (RuntimeException e) {\n task.recordObjectActionExecuted(shadowToDelete, ChangeType.DELETE, e);\n LoggingUtils.logUnexpectedException(LOGGER, \"Shadow {} couldn't be deleted because of an unexpected exception\", e, ObjectTypeUtil.toShortString(shadowToDelete));\n continue;\n }\n }\n\n if (owners == null || owners.isEmpty()) {\n continue;\n }\n\n for (PrismObject owner : owners) {\n List<ItemDelta> modifications = new ArrayList<>(2);\n ReferenceDelta deleteDelta = prismContext.deltaFactory().reference().createModificationDelete(FocusType.F_LINK_REF, owner.getDefinition(),\n prismContext.itemFactory().createReferenceValue(oid, ShadowType.COMPLEX_TYPE));\n modifications.add(deleteDelta);\n if (shadowOidToReplaceDeleted != null) {\n ReferenceDelta addDelta = prismContext.deltaFactory().reference().createModificationAdd(FocusType.F_LINK_REF, owner.getDefinition(),\n prismContext.itemFactory().createReferenceValue(shadowOidToReplaceDeleted, ShadowType.COMPLEX_TYPE));\n modifications.add(addDelta);\n }\n LOGGER.info(\"Executing modify delta{} for owner {}:\\n{}\", skippedForDryRun(), ObjectTypeUtil.toShortString(owner), DebugUtil.debugDump(modifications));\n if (!dryRun) {\n try {\n repositoryService.modifyObject((Class) owner.getClass(), owner.getOid(), modifications, result);\n task.recordObjectActionExecuted(owner, ChangeType.MODIFY, null);\n } catch (ObjectNotFoundException | SchemaException | ObjectAlreadyExistsException | RuntimeException e) {\n task.recordObjectActionExecuted(owner, ChangeType.MODIFY, e);\n LoggingUtils.logUnexpectedException(LOGGER, \"Focal object {} (owner of {}) couldn't be updated\", e, ObjectTypeUtil.toShortString(owner),\n ObjectTypeUtil.toShortString(shadowToDelete));\n }\n }\n }\n\n }\n }",
"@Override\n public void onProvideShadowMetrics(android.graphics.Point shadowSize,\n android.graphics.Point shadowTouchPoint) {\n\n // set shadow size to new rotated size\n shadowSize.set(width, height);\n\n // scale touch point\n shadowTouchPoint.set(shadowSize.x / 2, shadowSize.y / 2);\n }",
"private void initView() {\n BlurMaskFilterView view=new BlurMaskFilterView(this);\n root.addView(view, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));\n }",
"public int getChromeShadowColor() {\n return chromeShadowColor;\n }",
"private void initListeners() {\n this.setOnMousePressed((event -> {\n this.setPressedStyle();\n }));\n\n this.setOnMouseReleased((event -> {\n this.setReleasedStyle();\n }));\n\n this.setOnMouseEntered((event -> {\n this.setEffect(new DropShadow());\n }));\n\n this.setOnMouseExited((event -> {\n this.setEffect(null);\n }));\n }",
"@Override\n public boolean onTouch(View v, MotionEvent arg1) {\n ClipData veri = ClipData.newPlainText(\"\", \"\");\n View.DragShadowBuilder golge = new View.DragShadowBuilder(sag);\n v.startDrag(veri, golge, null, 0);\n return false;\n }",
"private BitmapDrawable generateArtworkStripBitmap(List<Bitmap> bitmapList) {\n Bitmap canvasBitmap = getBitmap();\n Canvas canvas = new Canvas(canvasBitmap);\n Paint paint = new Paint();\n paint.setAntiAlias(false);\n paint.setFilterBitmap(false);\n paint.setDither(false);\n float yOffset = canvasBitmap.getWidth() / bitmapList.size();\n\n Paint shadowPaint = new Paint();\n shadowPaint.setShadowLayer(20.0f, 0, 0, 0xff000000);\n for (int i = 0; i < bitmapList.size(); i++) {\n Bitmap bitmap = bitmapList.get(i);\n bitmap = cropBitmapToSquare(bitmap);\n bitmap = scaleBitmapToHeight(bitmap, canvasBitmap.getHeight());\n //draw a shadow under this layer\n float localYOffset = canvasBitmap.getWidth() - bitmap.getWidth() - (yOffset * i);\n canvas.drawRect(localYOffset, 0, localYOffset + bitmap.getWidth(), canvasBitmap.getHeight(), shadowPaint);\n\n canvas.drawBitmap(bitmap, localYOffset, 0, paint);\n }\n\n return new BitmapDrawable(canvasBitmap);\n }",
"public BaseShadowSystem () {\n\t\tthis(new AABBNearFarAnalyzer(),\n\t\t\tnew FixedShadowMapAllocator(FixedShadowMapAllocator.QUALITY_MED, FixedShadowMapAllocator.QUANTITY_MAP_MED),\n\t\t\tnew BoundingSphereDirectionalAnalyzer(), new FrustumLightFilter());\n\t}",
"public void blurShadow(Graphics2D g, Shape clipShape) {\n Rectangle tmp = clipShape.getBounds();\n int width = tmp.x + tmp.width;\n int height = tmp.y + tmp.height;\n tmp.setRect(0, 0, width + getEffectWidth() * 2 + 1,\n height + getEffectWidth() * 2 + 1);\n\n // Apply the border glow effect \n BufferedImage clipImage = getClipImage(tmp);\n Graphics2D g2dImage = clipImage.createGraphics();\n try {\n /* clear the buffer */\n g2dImage.setComposite(AlphaComposite.Clear);\n g2dImage.fillRect(0, 0, clipImage.getWidth(), clipImage.getHeight());\n /* translate with offset */\n g2dImage.translate(getEffectWidth() - getOffset().getX(),\n getEffectWidth() - getOffset().getY());\n /* */\n g2dImage.setComposite(AlphaComposite.Src);\n g2dImage.setPaint(getBrushColor());\n g2dImage.translate(offset.getX(), offset.getY());\n g2dImage.fill(clipShape);\n g2dImage.translate(-offset.getX(), -offset.getY());\n } finally {\n /* draw the final image */\n g2dImage.dispose();\n }\n g.drawImage(clipImage, blurKernel, -getEffectWidth() + (int) getOffset().getX(),\n -getEffectWidth() + (int) getOffset().getY());\n }",
"private void setBrushSettings(){\n touchArea.setRadius(brushSize);\n touchArea.setColor(brushColor);\n touchArea.setBackgroundColor(backgroundColor);\n }",
"private void initSun(){\n sun = new DirectionalLight();\n sun.setDirection(lightDir);\n sun.setColor(ColorRGBA.White.clone().multLocal(1.7f));\n rootNode.addLight(sun);\n \n }",
"public static BasicThumbnail getShadow(int thickness) {\n\t\tint[] i = new int[thickness];\n\t\tfor(int a = 0; a<i.length; a++) {\n\t\t\ti[a] = 6;\n\t\t}\n\t\treturn new BasicThumbnail(new Layer[] {\n\t\t\tnew Shadow(i, thickness, thickness*2 ),\n\t\t\tnew Image()\n\t\t}, 0);\n\t}",
"@Override\n public void onDrawShadow(Canvas canvas) {\n\n // scale the image relating to a pivot point (reference point)\n canvas.scale(view.getScaleX(), view.getScaleY(), width / 2, height / 2);\n\n // rotate the image relating to a pivot point (reference point)\n canvas.rotate(view.getRotation(), width / 2, height / 2);\n\n // Calculate the canvas matrix with the specified translation with given\n // distances to x and y\n canvas.translate((width - view.getWidth()) / 2,\n (height - view.getHeight()) / 2);\n\n // call parent onDrawShadow function\n super.onDrawShadow(canvas);\n }",
"@Override\n public void onDrawShadow(Canvas canvas) {\n\n // scale the image relating to a pivot point (reference point)\n canvas.scale(view.getScaleX(), view.getScaleY(), width / 2, height / 2);\n\n // rotate the image relating to a pivot point (reference point)\n canvas.rotate(view.getRotation(), width / 2, height / 2);\n\n // Calculate the canvas matrix with the specified translation with given\n // distances to x and y\n canvas.translate((width - view.getWidth()) / 2,\n (height - view.getHeight()) / 2);\n\n // call parent onDrawShadow function\n super.onDrawShadow(canvas);\n }",
"@Override\n public void onBindViewHolder(@NonNull IconAdapter.mViewHolder holder, int position) {\n final ImageView imageView = holder.image;\n TextView name = holder.name;\n name.setText(nameList.get(position));\n\n imageView.setImageDrawable(getDrawable(imageList.get(position)));\n imageView.setTag(nameList.get(position));\n\n\n imageView.setOnTouchListener(new View.OnTouchListener() {\n @Override\n public boolean onTouch(View v, MotionEvent event) {\n ClipData.Item item = new ClipData.Item((String) v.getTag());\n\n ClipData dragData = new ClipData((String) v.getTag(),new String[]{ClipDescription.MIMETYPE_TEXT_PLAIN},item);\n\n View.DragShadowBuilder myShadow = new MyDragShadowBuilder(imageView);\n\n v.startDragAndDrop(dragData,myShadow,null,0);\n\n dropOverlay.setVisibility(View.VISIBLE);\n return false;\n }\n });\n\n\n holder.parentView.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n\n }\n });\n }",
"@Override\n public void run() {\n overlay.remove(shadowContainerLayer);\n mViewToAnimate.setBackground(oldBackground);\n if (mViewBitmap != null) {\n mViewBitmap.recycle();\n }\n }",
"@Override\n public boolean onTouch(View v, MotionEvent arg1) {\n ClipData veri = ClipData.newPlainText(\"\", \"\");\n View.DragShadowBuilder golge = new View.DragShadowBuilder(sol);\n v.startDrag(veri, golge, null, 0);\n return false;\n }",
"public ShadowLinearLayout(@NotNull Context context, @Nullable AttributeSet attributeSet) {\n this(context, attributeSet, R.attr.shadowLayout);\n Intrinsics.checkNotNullParameter(context, \"context\");\n }",
"@Override\n\t\t\tpublic Render<EntitySaxtonHale> createRenderFor(RenderManager manager) {\n\t\t\t\treturn new RenderBiped<EntitySaxtonHale>(manager, new ModelBiped(), 0.5F, 1.0F){\n\t\t\t\t\tprivate final ResourceLocation TEXTURE=new ResourceLocation(TF2weapons.MOD_ID,\"textures/entity/tf2/SaxtonHale.png\");\n\t\t\t\t\tprotected ResourceLocation getEntityTexture(EntitySaxtonHale entity)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn TEXTURE;\n\t\t\t\t }\n\t\t\t\t};\n\t\t\t}",
"public final native void clearShadow() /*-{\n\t\tthis.attrs.shadow = undefined;\n\t}-*/;",
"public void addShadow(float radius, float offsetX, float offsetY, int color) {\n mPolygonShapeSpec.setShadowRadius(radius);\n mPolygonShapeSpec.setShadowXOffset(offsetX);\n mPolygonShapeSpec.setShadowYOffset(offsetY);\n mPolygonShapeSpec.setShadowColor(color);\n startShadow();\n }",
"public void addLightSource(Item lightSource) {\n/* 5374 */ if (lightSource.getTemplateId() == 1243)\n/* */ return; \n/* 5376 */ for (VirtualZone vz : getWatchers()) {\n/* */ \n/* */ \n/* */ try {\n/* 5380 */ if (lightSource.getColor() != -1)\n/* */ {\n/* 5382 */ int lightStrength = Math.max(WurmColor.getColorRed(lightSource.getColor()), \n/* 5383 */ WurmColor.getColorGreen(lightSource.getColor()));\n/* 5384 */ lightStrength = Math.max(lightStrength, WurmColor.getColorBlue(lightSource.getColor()));\n/* 5385 */ if (lightStrength == 0)\n/* 5386 */ lightStrength = 1; \n/* 5387 */ byte r = (byte)(WurmColor.getColorRed(lightSource.getColor()) * 128 / lightStrength);\n/* 5388 */ byte g = (byte)(WurmColor.getColorGreen(lightSource.getColor()) * 128 / lightStrength);\n/* 5389 */ byte b = (byte)(WurmColor.getColorBlue(lightSource.getColor()) * 128 / lightStrength);\n/* */ \n/* 5391 */ vz.sendAttachItemEffect(lightSource.getWurmId(), (byte)4, r, g, b, lightSource\n/* 5392 */ .getRadius());\n/* */ \n/* */ \n/* */ }\n/* 5396 */ else if (lightSource.isLightBright())\n/* */ {\n/* 5398 */ int lightStrength = (int)(80.0F + lightSource.getCurrentQualityLevel() / 100.0F * 40.0F);\n/* 5399 */ vz.sendAttachItemEffect(lightSource.getWurmId(), (byte)4, \n/* 5400 */ Item.getRLight(lightStrength), Item.getGLight(lightStrength), Item.getBLight(lightStrength), lightSource\n/* 5401 */ .getRadius());\n/* */ }\n/* */ else\n/* */ {\n/* 5405 */ vz.sendAttachItemEffect(lightSource.getWurmId(), (byte)4, (byte)80, (byte)80, (byte)80, lightSource\n/* 5406 */ .getRadius());\n/* */ }\n/* */ \n/* */ }\n/* 5410 */ catch (Exception e) {\n/* */ \n/* 5412 */ logger.log(Level.WARNING, e.getMessage(), e);\n/* */ } \n/* */ } \n/* */ }",
"private void renderShadowMap() {\n GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, fboId[0]);\n GLES20.glViewport(0, 0, mShadowMapWidth,\n mShadowMapHeight);\n // Clear color and buffers\n GLES20.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);\n GLES20.glClear(GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT);\n // Start using the shader\n GLES20.glUseProgram(mDepthMapProgram);\n float[] tempResultMatrix = new float[16];\n // Calculate matrices for standing objects\n // View matrix * Model matrix value is stored\n Matrix.multiplyMM(mLightMvpMatrix_staticShapes, 0, mLightViewMatrix, 0, mModelMatrix, 0);\n // Model * view * projection matrix stored and copied for use at rendering from camera point of view\n Matrix.multiplyMM(tempResultMatrix, 0, mLightProjectionMatrix, 0, mLightMvpMatrix_staticShapes, 0);\n System.arraycopy(tempResultMatrix, 0, mLightMvpMatrix_staticShapes, 0, 16);\n // Pass in the combined matrix.\n GLES20.glUniformMatrix4fv(mMVPMatrixHandleShadow, 1, false, mLightMvpMatrix_staticShapes, 0);\n // Render all stationary shapes on scene\n\n mDrawPlane.setDraw(mPositionHandleShadow, 0, 0, 0, true);\n mDrawPlane.draw();\n\n // Calculate matrices for moving objects\n // Rotate the model matrix with current rotation matrix\n Matrix.multiplyMM(tempResultMatrix, 0, mModelMatrix, 0, mCubeRotation, 0);\n // View matrix * Model matrix value is stored\n Matrix.multiplyMM(mLightMvpMatrix_dynamicShapes, 0, mLightViewMatrix, 0, tempResultMatrix, 0);\n // Model * view * projection matrix stored and copied for use at rendering from camera point of view\n Matrix.multiplyMM(tempResultMatrix, 0, mLightProjectionMatrix, 0, mLightMvpMatrix_dynamicShapes, 0);\n System.arraycopy(tempResultMatrix, 0, mLightMvpMatrix_dynamicShapes, 0, 16);\n // Pass in the combined matrix.\n GLES20.glUniformMatrix4fv(mMVPMatrixHandleShadow, 1, false, mLightMvpMatrix_dynamicShapes, 0);\n // Render all moving shapes on scene\n mDrawObj.setDraw(mPositionHandleShadow,0,0,0,true);\n }",
"public ShadowMap() throws Exception{\n // Create a FBO to render the depth map\n depthMapFBO = glGenFramebuffers();\n\n // Create the depth map texture\n depthMap = new Texture(SHADOW_MAP_WIDTH, SHADOW_MAP_HEIGHT, GL_DEPTH_COMPONENT);\n\n // Attach the the depth map texture to the FBO\n glBindFramebuffer(GL_FRAMEBUFFER, depthMapFBO);\n glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, depthMap.getId(), 0);\n // Set only depth\n glDrawBuffer(GL_NONE);\n glReadBuffer(GL_NONE);\n\n if(glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE){\n throw new Exception(\"Could not create FrameBuffer\");\n }\n\n // Unbind\n glBindFramebuffer(GL_FRAMEBUFFER, 0);\n }",
"private void filllightEffect(int barra) {\n float val = barra / 75f - 1.3333333f;\n Log.i(\"kike\", \"valor efecte: \" + val + \" barra: \" + barra);\n EffectFactory factory = effectContext.getFactory();\n effect = factory.createEffect(EffectFactory.EFFECT_FILLLIGHT);\n effect.setParameter(\"strength\", val);\n effect.apply(textures[0], photoWidth, photoHeight, textures[1]);\n }",
"@Override\n public int getShadowSize() {\n\treturn Geometry.getW(shadow.getElement());\n }",
"public void setDropActiveBackground() {\n setBackgroundDrawable(getDropActiveBgDrawable());\n }",
"@Override\n public void onProvideShadowMetrics(Point shadowSize,\n Point shadowTouchPoint) {\n\n // set shadow size to new rotated size\n shadowSize.set(width, height);\n\n // scale touch point\n shadowTouchPoint.set(shadowSize.x / 2, shadowSize.y / 2);\n }",
"public void setCastShadows(@EntityInstance int i, boolean enabled) {\n nSetCastShadows(mNativeObject, i, enabled);\n }",
"void setupFogs() {\n fogSwitch = new Switch(Switch.CHILD_NONE);\n fogSwitch.setCapability(Switch.ALLOW_SWITCH_WRITE);\n\n // set up the linear fog\n LinearFog fogLinear = new LinearFog(skyBlue, 6.0f, 12.0f);\n fogLinear.setInfluencingBounds(infiniteBounds);\n fogSwitch.addChild(fogLinear);\n\n // set up the exponential fog\n ExponentialFog fogExp = new ExponentialFog(skyBlue, 0.3f);\n fogExp.setInfluencingBounds(infiniteBounds);\n fogSwitch.addChild(fogExp);\n\n // Create the chooser GUI\n String[] fogNames = { \"None\", \"Linear\", \"Exponential\", };\n int[] fogValues = { Switch.CHILD_NONE, 0, 1 };\n\n fogChooser = new IntChooser(\"Fog:\", fogNames, fogValues, 0);\n fogChooser.addIntListener(new IntListener() {\n public void intChanged(IntEvent event) {\n int value = event.getValue();\n fogSwitch.setWhichChild(value);\n }\n });\n fogChooser.setValue(Switch.CHILD_NONE);\n }",
"@FXML\n\tprivate void desligarLuz(){\n\t boxEntity.setEffect(new Lighting()); \n\t\t\n\t\t\n\t\t\n\t}",
"public void setup() {\n self.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));\n // make dialog background unselectable\n self.setCanceledOnTouchOutside(false);\n }",
"public void setHasLightSource(Creature creature, @Nullable Item lightSource) {\n/* 5438 */ if (lightSource != null && lightSource.getTemplateId() == 1243)\n/* */ return; \n/* 5440 */ for (VirtualZone vz : getWatchers()) {\n/* */ \n/* */ \n/* */ try {\n/* 5444 */ if (lightSource == null) {\n/* */ \n/* 5446 */ if (vz.getWatcher().getWurmId() == creature.getWurmId()) {\n/* 5447 */ vz.sendRemoveEffect(-1L, (byte)0);\n/* */ } else {\n/* 5449 */ vz.sendRemoveEffect(creature.getWurmId(), (byte)0);\n/* */ }\n/* */ \n/* */ }\n/* 5453 */ else if (vz.getWatcher().getWurmId() == creature.getWurmId()) {\n/* */ \n/* 5455 */ if (lightSource.getColor() != -1) {\n/* */ \n/* 5457 */ int lightStrength = Math.max(WurmColor.getColorRed(lightSource.color), \n/* 5458 */ WurmColor.getColorGreen(lightSource.color));\n/* 5459 */ lightStrength = Math.max(lightStrength, WurmColor.getColorBlue(lightSource.color));\n/* 5460 */ byte r = (byte)(WurmColor.getColorRed(lightSource.color) * 128 / lightStrength);\n/* 5461 */ byte g = (byte)(WurmColor.getColorGreen(lightSource.color) * 128 / lightStrength);\n/* 5462 */ byte b = (byte)(WurmColor.getColorBlue(lightSource.color) * 128 / lightStrength);\n/* */ \n/* 5464 */ vz.sendAttachCreatureEffect(null, (byte)0, r, g, b, lightSource\n/* 5465 */ .getRadius());\n/* */ \n/* */ \n/* */ }\n/* 5469 */ else if (lightSource.isLightBright()) {\n/* */ \n/* 5471 */ int lightStrength = (int)(80.0F + lightSource.getCurrentQualityLevel() / 100.0F * 40.0F);\n/* 5472 */ vz.sendAttachCreatureEffect(null, (byte)0, \n/* 5473 */ Item.getRLight(lightStrength), Item.getGLight(lightStrength), \n/* 5474 */ Item.getBLight(lightStrength), lightSource.getRadius());\n/* */ } else {\n/* */ \n/* 5477 */ vz.sendAttachCreatureEffect(null, (byte)0, \n/* 5478 */ Item.getRLight(80), Item.getGLight(80), Item.getBLight(80), lightSource.getRadius());\n/* */ \n/* */ }\n/* */ \n/* */ }\n/* 5483 */ else if (lightSource.getColor() != -1) {\n/* */ \n/* 5485 */ int lightStrength = Math.max(WurmColor.getColorRed(lightSource.color), \n/* 5486 */ WurmColor.getColorGreen(lightSource.color));\n/* 5487 */ lightStrength = Math.max(lightStrength, WurmColor.getColorBlue(lightSource.color));\n/* 5488 */ byte r = (byte)(WurmColor.getColorRed(lightSource.color) * 128 / lightStrength);\n/* 5489 */ byte g = (byte)(WurmColor.getColorGreen(lightSource.color) * 128 / lightStrength);\n/* 5490 */ byte b = (byte)(WurmColor.getColorBlue(lightSource.color) * 128 / lightStrength);\n/* */ \n/* 5492 */ vz.sendAttachCreatureEffect(creature, (byte)0, r, g, b, lightSource\n/* 5493 */ .getRadius());\n/* */ \n/* */ \n/* */ }\n/* 5497 */ else if (lightSource.isLightBright()) {\n/* */ \n/* 5499 */ int lightStrength = (int)(80.0F + lightSource.getCurrentQualityLevel() / 100.0F * 40.0F);\n/* 5500 */ vz.sendAttachCreatureEffect(creature, (byte)0, \n/* 5501 */ Item.getRLight(lightStrength), Item.getGLight(lightStrength), \n/* 5502 */ Item.getBLight(lightStrength), lightSource.getRadius());\n/* */ } else {\n/* */ \n/* 5505 */ vz.sendAttachCreatureEffect(creature, (byte)0, \n/* 5506 */ Item.getRLight(80), Item.getGLight(80), Item.getBLight(80), lightSource.getRadius());\n/* */ \n/* */ }\n/* */ \n/* */ }\n/* 5511 */ catch (Exception e) {\n/* */ \n/* 5513 */ logger.log(Level.WARNING, e.getMessage(), e);\n/* */ } \n/* */ } \n/* */ }",
"private void initializeDragVars(MouseEvent me) { m_wx0 = m_wx1 = sxToWx(m_x0 = m_x1 = me.getX()); m_wy0 = m_wy1 = syToWy(m_y0 = m_y1 = me.getY()); }",
"public TransparencyDemo() {\r\n super();\r\n view3DButton.addItemListener(this);\r\n drawBehindButton.addItemListener(this);\r\n transparencySlider.addChangeListener(this);\r\n }",
"public void initializeFadingEdgesEx() {\n setVerticalFadingEdgeEnabled(true);\n setFadingEdgeLength(this.mGradientHeight);\n }",
"private void set_dnd() {\n \t\tcardDragController = new PickupDragController(RootPanel.get(), false);\n \t\tcardDragController.addDragHandler(new CardHandler());\n \t\tcardDropPanel = new VerticalPanelDropController(getView().getCards_panel());\n \n \t\t// TODO v�rifier si il y a des lag en utilisant l'application sur le\n \t\t// serveur\n \t\t// mettre en commentaire ces deux lignes\n \n \t\t// VerticalPanelDropController dropController = new\n \t\t// VerticalPanelDropController(getView().getDrop_cards_panel());\n \t\t// cardDragController.registerDropController(dropController);\n \n \t\t// dragController.makeDraggable(getView().getDndImage());\n \n \t\t// AbsolutePositionDropController sp = new\n \t\t// AbsolutePositionDropController(\n \t\t// getView().getDropPanel());\n \t\t// IndexedDropController dropController = new\n \t\t// IndexedDropController(getView().getDropPanel());\n \n \t\t// dragController.registerDropController(sp);\n \t\t// dragController.makeDraggable(getView().getMainLabel());\n \t\t// dragController.makeDraggable(getView().getHtml_panel());\n \t\t// for (CardPresenter c : allCards)\n \t\t// dragController.makeDraggable(c.getView().getWholePanel());\n \n \t}",
"public TMCropperPanel() {\n initComponents();\n this.setBorder(new WorkflowModuleBorder(WorkflowModuleBorder.BLUE_SHADOW));\n }",
"public void shadowDraw(int positionAttribute, int normalAttribute, int colorAttribute, boolean onlyPosition) {\n mCubeVertices.position(0);\n GLES20.glVertexAttribPointer(positionAttribute, 3, GLES20.GL_FLOAT, false,\n 0, mCubeVertices);\n\n GLES20.glEnableVertexAttribArray(positionAttribute);\n\n\n if (!onlyPosition) {\n // Pass in the normal information\n mCubeNormals.position(0);\n GLES20.glVertexAttribPointer(normalAttribute, 3, GLES20.GL_FLOAT, false,\n 0, mCubeNormals);\n\n GLES20.glEnableVertexAttribArray(normalAttribute);\n\n // Pass in the color information\n mCubeColours.position(0);\n GLES20.glVertexAttribPointer(colorAttribute, 4, GLES20.GL_FLOAT, false,\n 0, mCubeColours);\n\n GLES20.glEnableVertexAttribArray(colorAttribute);\n }\n\n\n \n // Draw the cube.\n GLES20.glDrawArrays(GLES20.GL_TRIANGLES, 0, 36);\n }",
"void drag(View v){\n\t ClipData.Item item = new ClipData.Item((CharSequence) v.getTag());\n\n\t // Create a new ClipData using the tag as a label, the plain text MIME type, and\n\t // the already-created item. This will create a new ClipDescription object within the\n\t // ClipData, and set its MIME type entry to \"text/plain\"\n\t ClipData dragData = new ClipData((CharSequence) v.getTag(),new String[]{ClipDescription.MIMETYPE_TEXT_PLAIN}, item);\n\n\t // Instantiates the drag shadow builder.\n\t View.DragShadowBuilder myShadow = new MyDragShadowBuilder(v);\n//\t View.DragShadowBuilder myShadow =new View.DragShadowBuilder(v);\n\n\t // Starts the drag\n\n\t v.startDrag(dragData, // the data to be dragged\n\t myShadow, // the drag shadow builder\n\t null, // no need to use local data\n\t 0 // flags (not currently used, set to 0)\n\t );\n\t}",
"public void setLight1(){\n }",
"private void setUpDragDrop() {\n\t\tsetUpDrop();\n\n\t\t// set up drag stuff\n\t\tdragSource = DragSource.getDefaultDragSource();\n\t\tdragGestureAdapter = new DragGestureAdapter(this);\n\t\tdragSourceAdapter = new DragSrcAdapter(this);\n\t\tdragSource.createDefaultDragGestureRecognizer(listingPanel.getFieldPanel(), dragAction,\n\t\t\tdragGestureAdapter);\n\t}",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_drag_and_drop);\n\n color=Color.BLACK; // default color\n\n Log.d(msg, \"The onCreate() event\");\n\n // Allowing a view to be dragged\n findViewById(tetris_baustein).setOnTouchListener(new MyTouchListener());\n\n // Defining drop target\n findViewById(R.id.topleft).setOnDragListener(new MyDragListener());\n findViewById(R.id.topmidle).setOnDragListener(new MyDragListener());\n findViewById(R.id.topright).setOnDragListener(new MyDragListener());\n findViewById(R.id.midleleft).setOnDragListener(new MyDragListener());\n findViewById(R.id.midlemidle).setOnDragListener(new MyDragListener());\n findViewById(R.id.midleright).setOnDragListener(new MyDragListener());\n findViewById(R.id.bottomleft).setOnDragListener(new MyDragListener());\n findViewById(R.id.bottommidle).setOnDragListener(new MyDragListener());\n findViewById(R.id.bottomright).setOnDragListener(new MyDragListener());\n\n findViewById(R.id.midleright).setOnLongClickListener(new MyLongClickListener());\n\n\n\n }",
"public void linkToDepthRenderer(Renderer renderer) {\n renderer.addUniform(new UniformMatrix4(renderer.getShader(),\"viewMatrix\",shadowBoxMatrix));\n }",
"private void registerGlow()\n {\n try {\n Field f = Enchantment.class.getDeclaredField(\"acceptingNew\");\n f.setAccessible(true);\n f.set(null, true);\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n try {\n GlowEnchantment glow = new GlowEnchantment(70);\n Enchantment.registerEnchantment(glow);\n }\n catch (IllegalArgumentException e){\n }\n catch(Exception e){\n e.printStackTrace();\n }\n }",
"private void init() {\n\n mCursorPaint = new Paint();\n mCursorPaint.setColor(Color.BLUE);\n\n mLimitPaint = new Paint();\n mLimitPaint.setColor(Color.YELLOW);\n\n mCoveredPaint = new Paint();\n mCoveredPaint.setColor(Color.CYAN);\n\n mRangePaint = new Paint();\n mRangePaint.setColor(Color.DKGRAY);\n\n mEraserPaint = new Paint();\n mEraserPaint.setColor(Color.TRANSPARENT);\n // ensure the erasing effect\n mEraserPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC));\n }",
"public void setDropTrashBackground() {\n setBackgroundColor(sDropTrashBgColor);\n }",
"private static void startButtonCreator(int startWidth, int startHeight){\n startButton = shadowEffect(configureImageView(\"\", \"button-start-game\", \".png\", 190, 90));\n }",
"@Override\n\t\t\tpublic boolean onTouch(View v, MotionEvent me) {\n\t\t\t\tint action = me.getAction();\n\t\t\t\t\n\t\t\t\tswitch(me.getAction()){\n\t\t\t\tcase MotionEvent.ACTION_DOWN:\n\t\t\t\t\tClipData data = ClipData.newPlainText(\"CREATEbooth\", \"hi\");\n\t\t\t\t DragShadowBuilder shadowBuilder = new View.DragShadowBuilder(v);\n\t\t\t\t v.startDrag(data, shadowBuilder, v, 0);\n\t\t\t\t return true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}",
"@NonNull\n public Builder receiveShadows(boolean enabled) {\n nBuilderReceiveShadows(mNativeBuilder, enabled);\n return this;\n }",
"public LabelBuilder setShadowBlur(int shadowBlur) {\n\t\tIsBuilder.checkIfValid(getOptionsBuilder());\n\t\tlabel.setShadowBlur(shadowBlur);\n\t\treturn this;\n\t}",
"public void linkToRenderer(Renderer renderer, int id) {\n renderer.addUniform(new UniformMatrix4(renderer.getShader(),\"shadowMatrix[\" + id + \"]\",biasShadowBoxMatrix));\n\n }",
"public void init() {\n createVertexShader(vertexShader(true));\n createFragmentShader(fragShader.SHADER_STRING);\n\n /* Binds the code and checks that everything has been done correctly. */\n link();\n\n createUniform(\"worldMatrix\");\n createUniform(\"modelMatrix\");\n createUniform(\"normalMatrix\");\n\n /* Initialization of the shadow map matrix uniform. */\n createUniform(\"directionalShadowMatrix\");\n\n /* Create uniform for material. */\n createMaterialUniform(\"material\");\n createUniform(\"texture_sampler\");\n /* Initialization of the light's uniform. */\n createUniform(\"camera_pos\");\n createUniform(\"specularPower\");\n createUniform(\"ambientLight\");\n createPointLightListUniform(\"pointLights\", LightModel.MAX_POINTLIGHT);\n createSpotLightUniformList(\"spotLights\", LightModel.MAX_SPOTLIGHT);\n createDirectionalLightUniform(\"directionalLight\");\n createUniform(\"shadowMapSampler\");\n createUniform(\"bias\");\n }",
"public void setBorderEffect(PDBorderEffectDictionary be) {\n/* 447 */ getCOSObject().setItem(COSName.BE, be);\n/* */ }",
"@Override\n public void init(Context context) {\n mShowBorder = true;\n mShowDp = false;\n mShowSp = true;\n mShowColor = false;\n }",
"private void init(final Context context, final AttributeSet attributeSet) {\n setLayerType(LAYER_TYPE_SOFTWARE, null);\n\n paint.setAntiAlias(true);\n paint.setTextSize(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, textSize, getResources().getDisplayMetrics()));\n paint.setFakeBoldText(true);\n\n //Set custom attributes\n final TypedArray typedArray = context.getTheme().obtainStyledAttributes(attributeSet, R.styleable.TreeView, 0, 0);\n try {\n touchEnabled = typedArray.getBoolean(R.styleable.TreeView_touchEnabled, true);\n exportOptions.imageBackgroundColor = typedArray.getColor(R.styleable.TreeView_backgroundColor, exportOptions.imageBackgroundColor);\n }finally {\n typedArray.recycle();\n }\n\n borderRadius = Utils.dpToPx(context, 12);\n\n exportOptions.itemTextColor = Utils.getColor(android.R.attr.textColorPrimary,context);\n exportOptions.primeFactorTextColor = ContextCompat.getColor(context, R.color.green);\n }",
"void paintViews() {\n\n //Paint the back button in white\n int paintColour = android.graphics.Color.rgb(253, 195, 204);\n Drawable d = VectorDrawableCompat.create(getResources(), R.drawable.kids_ui_back_anim, null);\n d = DrawableCompat.wrap(d);\n DrawableCompat.setTint(d, paintColour);\n back.setImageDrawable(d);\n }",
"@SuppressLint(\"NewApi\")\n private void init() {\n mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);\n mPaint.setPathEffect(new CornerPathEffect(mPolygonShapeSpec.getCornerRadius()));\n mBorderPaint = new Paint(Paint.ANTI_ALIAS_FLAG);\n mBorderPaint.setStyle(Paint.Style.STROKE);\n mBorderPaint.setPathEffect(new CornerPathEffect(mPolygonShapeSpec.getCornerRadius()));\n\n if(mPolygonShapeSpec.hasBorder()) {\n mBorderPaint.setColor(mPolygonShapeSpec.getBorderColor());\n mBorderPaint.setStrokeWidth(mPolygonShapeSpec.getBorderWidth());\n }\n\n if (mPolygonShapeSpec.hasShadow()) {\n //Shadow on border even if isBordered is false. Better effect and performance that\n //using shadow on main paint\n mBorderPaint.setShadowLayer(mPolygonShapeSpec.getShadowRadius(), mPolygonShapeSpec.getShadowXOffset(),\n mPolygonShapeSpec.getShadowYOffset(), mPolygonShapeSpec.getShadowColor());\n }\n\n //Avoid known shadow problems\n if (Build.VERSION.SDK_INT > 13)\n setLayerType(LAYER_TYPE_SOFTWARE, null);\n\n mPolygonShape = new RegularPolygonShape();\n }",
"public void init() {\n\t\tBitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.sb_thumb);\n\t\tLinearGradient colorGradient = new LinearGradient(0.f, 0.f, this.getMeasuredWidth() - bitmap.getWidth(), 0.f, new int[] { 0xFF000000,\n\t\t\t\t0xFF0000FF, 0xFF00FF00, 0xFF00FFFF, 0xFFFF0000, 0xFFFF00FF, 0xFFFFFF00, 0xFFFFFFFF }, null, Shader.TileMode.CLAMP);\n\t\tShapeDrawable shape = new ShapeDrawable(new RectShape(mContext));\n\t\tshape.getPaint().setShader(colorGradient);\n\t\tthis.setProgressDrawable(shape);\n\t\tthis.setMax(256 * 7 - 1);\n\t}",
"public void setDropDownBackgroundDrawable(Drawable d) {\n/* 277 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"private void MostrarSombra()\n {\n // Si tiene el valor por defecto\n if (EsDefecto())\n {\n // Si tenemos establecida la sombra \"defecto\"\n if (m_SombraD.m_nShadowColor != Color.TRANSPARENT)\n {\n setShadowLayer(m_SombraD.m_nShadowRadius, m_SombraD.m_nShadowDx,\n m_SombraD.m_nShadowDy, m_SombraD.m_nShadowColor);\n }\n else setShadowLayer(0, 0, 0, Color.TRANSPARENT);\n }\n else\n {\n // Si tenemos establecida la sombra \"normal\"\n if (m_SombraN.m_nShadowColor != Color.TRANSPARENT)\n {\n setShadowLayer(m_SombraN.m_nShadowRadius, m_SombraN.m_nShadowDx,\n m_SombraN.m_nShadowDy, m_SombraN.m_nShadowColor);\n }\n else setShadowLayer(0, 0, 0, Color.TRANSPARENT);\n }\n }",
"@Override\n\tprotected void draw(Canvas canvas) {\t\tcanvas.setColor(Color.DARK_GREEN);\n\t\tcanvas.drawRectangle(getBounds());\n\t\t\n/*\t\tRectangle originalClipping = canvas.getClipping();\n\t\tcanvas.setClipping(getBounds());\n\t\t\n\t\tTransformation originalTransformation = canvas.getTransformation();\n\n\t\tdrawWorld(new ShadowCanvas(canvas));\n\t\t\n\t\tcanvas.setAlpha(1.0f);\n\t\tcanvas.setTransformation(originalTransformation);\n\t\tcanvas.setClipping(getBounds());\n\t\t\n\t\tdrawWorld(canvas);\n\t\t\n\t\tcanvas.setClipping(originalClipping);\n*/\t}",
"@Override\r\n\tpublic void setUp() {\n\t\t\r\n\t\ttarget = pointEntity(caster,50);\r\n\t\tif (target == null) {\r\n\t\t\t\r\n\t\t\t\r\n\t\t\trefund = true;\r\n\t\t\tdead = true;\r\n\t\t\tif (refined)\r\n\t\t\t\tsteprange = 240;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tplaySound(Sound.BLOCK_CONDUIT_DEACTIVATE,caster.getLocation(),5,2F);\r\n\t\t\tplaySound(Sound.BLOCK_CONDUIT_ACTIVATE,caster.getLocation(),5,2F);\r\n\t\t\tParUtils.parKreisDot(Particles.END_ROD, caster.getLocation(), 0, 1, 0.3F, randVector());\r\n\t\t\tParUtils.parKreisDot(Particles.END_ROD, caster.getLocation(), 0, 1, 0.3F, randVector());\r\n\t\t\tParUtils.parKreisDot(Particles.END_ROD, caster.getLocation(), 0, 1, 0.3F, randVector());\r\n\t\t\tdist = target.getLocation().distance(caster.getLocation());\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}",
"public void setupHoverMainMenuButtons(){\n ingredBtn.hoverProperty().addListener(new ChangeListener<Boolean>() {\n @Override\n public void changed(ObservableValue<? extends Boolean> observableValue, Boolean notHover, Boolean hover) {\n if (hover){\n //increase the drop shadow effect if the mouse is hovering over the button\n InterfaceStyling.dropShadowSelect(ingredBtn);\n } else {\n //decrease the drop shadow effect if the mouse is no longer hovering over the button\n InterfaceStyling.dropShadowDeselect(ingredBtn);\n }\n }\n });\n\n mealsBtn.hoverProperty().addListener(new ChangeListener<Boolean>() {\n @Override\n public void changed(ObservableValue<? extends Boolean> observableValue, Boolean notHover, Boolean hover) {\n if (hover){\n InterfaceStyling.dropShadowSelect(mealsBtn);\n } else {\n InterfaceStyling.dropShadowDeselect(mealsBtn);\n }\n }\n });\n\n plannerBtn.hoverProperty().addListener(new ChangeListener<Boolean>() {\n @Override\n public void changed(ObservableValue<? extends Boolean> observableValue, Boolean notHover, Boolean hover) {\n if (hover){\n InterfaceStyling.dropShadowSelect(plannerBtn);\n } else {\n InterfaceStyling.dropShadowDeselect(plannerBtn);\n }\n }\n });\n\n }",
"private void setDrag(){\n\t\tBankControllerReader bank = myView.getBankControllerReader();\n\t\tString methodName = \"addToGrid\";\n\t\tmyRoot.setOnMouseMoved(e -> myHover.displayLocation(e));\n\t\t\n\t\tmyRoot.setOnDragOver(e -> e.acceptTransferModes(TransferMode.ANY));\n\t\tmyRoot.setOnDragDropped(e -> {\n\t\t\tString presetName = e.getDragboard().getString();\n\t\t\tAttributeOwnerReader presetAO = bank.getPreset(presetName);\n\t\t\tPoint2D pos = new Point2D(e.getX(), e.getY());\n\t\t\tfor(Class<?> inter : presetAO.getClass().getInterfaces()){\n\t\t\t\ttry {\n\t\t\t\t\tMethod toCall = myAdder.getClass().getDeclaredMethod(methodName, inter, Point2D.class);\n\t\t\t\t\ttoCall.invoke(myAdder, presetAO, pos);\n\t\t\t\t\tbreak;\n\t\t\t\t} catch (Exception e1) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}",
"@Override\n public void drawHeatFlux() {\n }",
"private void themeDynamicAdd() {\n try {\n Background=getBitmapFromURL(base_image);\n Drawable dr = new BitmapDrawable((Background));\n test_rules_background.setBackgroundDrawable(dr);\n\n Bitmap back_bitmap;\n String back_shrd= AarambhThemeSharedPrefreence.loadBackArrowIconFromPreference(this);\n back_bitmap = getBitmapFromURL(back_shrd);\n Drawable dr1 = new BitmapDrawable((back_bitmap));\n back_btn_test_rules.setBackgroundDrawable(dr1);\n }catch (Exception e){\n e.printStackTrace();\n }\n\n }"
] | [
"0.72321904",
"0.6806925",
"0.60420156",
"0.59717995",
"0.5939771",
"0.5933339",
"0.5874216",
"0.57700926",
"0.5738968",
"0.5696164",
"0.5571807",
"0.5457146",
"0.5412851",
"0.5331099",
"0.5325324",
"0.52984375",
"0.52772284",
"0.5245156",
"0.52305377",
"0.5225828",
"0.5214631",
"0.51786846",
"0.51493365",
"0.5145687",
"0.51060224",
"0.51038146",
"0.50824404",
"0.50731725",
"0.5004198",
"0.4980319",
"0.49666935",
"0.4954727",
"0.49534124",
"0.4932945",
"0.49222142",
"0.4920297",
"0.4913249",
"0.49035874",
"0.4898049",
"0.48875442",
"0.4878244",
"0.4868748",
"0.48637816",
"0.4855622",
"0.48447296",
"0.48336288",
"0.48336288",
"0.48277336",
"0.47958833",
"0.47862443",
"0.47803143",
"0.47771132",
"0.47759134",
"0.4756008",
"0.4755906",
"0.47553542",
"0.47521156",
"0.47045827",
"0.4700374",
"0.46992797",
"0.46979308",
"0.46978986",
"0.4694273",
"0.46939752",
"0.469334",
"0.46905604",
"0.46893224",
"0.46830553",
"0.4683007",
"0.46764523",
"0.46709502",
"0.46691692",
"0.46686184",
"0.46652284",
"0.46441627",
"0.46406555",
"0.46356812",
"0.46304464",
"0.4625649",
"0.4622953",
"0.46219313",
"0.46187145",
"0.4602177",
"0.45989022",
"0.45841417",
"0.45835772",
"0.45800135",
"0.456843",
"0.45680434",
"0.45423228",
"0.45413136",
"0.453716",
"0.4535063",
"0.4534002",
"0.4526881",
"0.45244274",
"0.45234534",
"0.45205936",
"0.45077133",
"0.44896156"
] | 0.64410853 | 2 |
initialize the play mode label | private void initPlayMode() {
initPlayModeView();
initPlayModeController();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void initPlayModeView() {\n playMode = new Label(\"PLAY\");\n playMode.setPrefSize(200,100);\n playMode.setFont(Font.font(null, FontWeight.BOLD, 30));\n playMode.setTextFill(Color.BLUE);\n playMode.setEffect(getDropShadow());\n }",
"public void initPlayerStateUI() {\n if (!playableMediaItem.getBitrate().isEmpty()) {\n tvTrackInfo.setText(playableMediaItem.getBitrate() + getString(R.string.kbps));\n } else {\n tvTrackInfo.setText(\"\");\n }\n\n if (universalPlayer.isPrepaired) {\n ((IToolbarHolder) getActivity()).getToolbar().setTitle(R.string.now_paying);\n if (btnPlay.isPlay() && universalPlayer.isPlaying()) {\n btnPlay.toggle();\n } else if (!btnPlay.isPlay() && !universalPlayer.isPlaying()) {\n btnPlay.toggle();\n }\n\n } else {\n ((IToolbarHolder) getActivity()).getToolbar().setTitle(R.string.buffering);\n if (!btnPlay.isPlay()) {\n btnPlay.toggle();\n }\n }\n }",
"private void initPlayModeController() {\n playMode.setOnMouseClicked(event -> {\n MasterMindMain mm = null;\n try { mm = new MasterMindMain(); }\n catch (Exception e) { e.printStackTrace(); }\n mm.start(SimulatorMain.stage);\n });\n playMode.setOnMouseEntered(event -> { playMode.setGraphic(new Circle(5)); });\n playMode.setOnMouseExited(event -> { playMode.setGraphic(null); });\n }",
"public void setLabel()\r\n {\r\n int i = Converter(Input);\r\n \r\n if(j<i && label.getText().equals(\"Player 1\"))\r\n {\r\n j++;\r\n label.setText(\"Player \"+j);\r\n \r\n }else if(j<i && label.getText().equals(\"Player 2\"))\r\n {\r\n j++;\r\n label.setText(\"Player \"+j);\r\n }else if(j<i && label.getText().equals(\"Player 3\"))\r\n {\r\n j++;\r\n label.setText(\"Player \"+j);\r\n }else if(j==i && label.getText().equals(\"Player \"+j))\r\n {\r\n j=1;\r\n label.setText(\"Player \"+j);\r\n }\r\n \r\n \r\n }",
"public void setTextOfStartPause() {\n if (play) {\n startButton.setText(\"Start\");\n } else {\n startButton.setText(\"Pause\");\n }\n }",
"public void display_game_start_text() {\n\n fill(150, 100);\n rect(0, 0, displayW, displayH);\n\n textFont(myFont);\n textAlign(CENTER);\n textSize(displayH/30);\n fill(255);\n text(\"Get Ready!\", displayW/2, displayH/2);\n\n mySound.play_opening_song();\n\n isKeyInputAllowed = false;\n }",
"public void play() \n{\n s = !s; \n if (s == false)\n {\n //pausets = millis()/4;\n controlP5.getController(\"play\").setLabel(\"Play\");\n } else if (s == true)\n {\n //origint = origint + millis()/4 - pausets;\n controlP5.getController(\"play\").setLabel(\"Pause\");\n }\n}",
"private void initializeControls() {\n\t\tlabel = new Label(status.toString());\n\t}",
"public void setUpSound() {\n try {\n generateTone();\n setFrequencyLabel();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }",
"public void setTitleAccordingToState(){\n String ts=null;\n switch(getPlayMode()){\n case LIVE:\n ts=\" LIVE\";\n break;\n case PLAYBACK:\n ts=currentFile.getName()+\" PLAYING\";\n break;\n case WAITING:\n ts=\"MotionViewer - WAITING\";\n break;\n }\n setTitle(ts);\n }",
"@Override\n public void initialize() {\n //talonOrchestra.playMusic();\n }",
"private void initializeVariable() {\n\n\t\tlearn = (Button) findViewById(R.id.learnButton);\n\t\tlearn.setOnClickListener(this);\n\t\tplay = (Button) findViewById(R.id.playButton);\n\t\tplay.setOnClickListener(this);\n\t\tmode = (Button) findViewById(R.id.b_mode);\n\t\tmode.setOnClickListener(this);\n\t\tmode.setText(Global.currentMode + \" MODE\");\n\t\tclassID_SD = \"com.example.northamericanwildlifesounds.SOUNDDISPLAY\";\n\t\tsetUpAnimalData();\n\t}",
"public String getPlayMode()\n {\n return playMode;\n }",
"public void togglePlay() { }",
"public void start(){\n\t\tif (host.getGameSettings().isMusicOn()) {\r\n\t\t\tspr_btnMute.setFrame(0);\r\n\t\t}else{\r\n\t\t\tspr_btnMute.setFrame(1);\r\n\t\t}\r\n\t}",
"public void setPlaying() {\n\t\tstate = State.INGAME;\n\t}",
"@Override\n public void playStart() {\n }",
"public void setLabels() {\n gameLabel.setText(gameString);\n playerLabel.setText(playerPlays);\n computerLabel.setText(computerPlays);\n pScoreLabel.setText(\"Player: \" + pScore);\n cScoreLabel.setText(\"Computer: \" + cScore);\n }",
"public void play() {\n\t\tSystem.out.println(\"playing \"+title);\r\n\t}",
"private void initSimulateModeView() {\n simulateMode = new Label(\"SIMULATE\");\n simulateMode.setPrefSize(200, 100);\n simulateMode.setFont(Font.font(null, FontWeight.BOLD, 30));\n simulateMode.setTextFill(Color.ORANGE);\n simulateMode.setEffect(getDropShadow());\n }",
"public void initializePlayer() {\n radioPlayer = new MediaPlayer();\n\n isPaused = true;\n\n radioPlayer.setWakeMode(owner.getApplicationContext(), PowerManager.PARTIAL_WAKE_LOCK);\n radioPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);\n radioPlayer.setOnErrorListener(this);\n radioPlayer.setOnCompletionListener(this);\n radioPlayer.setOnInfoListener(this);\n }",
"public void initGame() {\r\n\t\tConsolaText consola = new ConsolaText();\r\n\t\tconsola.displayRules();\r\n\t\t// System.out.println(\"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\r\n\r\n\t}",
"protected void initialize() {\n\t\tstate = 0;\n\t\t\n\t\tString gameData = DriverStation.getInstance().getGameSpecificMessage();\n\t\tscaleSide = gameData.substring(1, 2).contentEquals(\"R\");\n\t\tswitchSide = gameData.substring(0, 1).contentEquals(\"R\");\n\t\t\n\t\tdelay.start();\n\t\t\n\t\tif(delay.get() < Variables.autoDelay) {\n\t\t\t\n\t\t}\n\t}",
"public LetsPlayGUI() {\n super(\"Let's Play!\");\n initComponents();\n setCardLayouts();\n showSplashPanel();\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 static void setupNewGamePlay() {\r\n\t\tSTATUS = Gamestatus.PREPARED;\r\n\t\tGameplay.getInstance().start();\r\n\t\tgui.setMenu(new GameplayMenu(), true);\r\n\t}",
"void togglePlay();",
"private void initializeDisplayText() {\n // Title and field labels\n Stage stage = (Stage) titleLabel.getScene().getWindow();\n stage.setTitle(rb.getString(\"windowTitle\"));\n if (action.equals(Constants.ADD)) {\n titleLabel.setText(rb.getString(\"addTitleLabel\"));\n } else if (action.equals(Constants.UPDATE)) {\n titleLabel.setText(rb.getString(\"updateTitleLabel\"));\n }\n idLabel.setText(rb.getString(\"idLabel\"));\n nameLabel.setText(rb.getString(\"nameLabel\"));\n addressLabel.setText(rb.getString(\"addressLabel\"));\n cityLabel.setText(rb.getString(\"cityLabel\"));\n countryLabel.setText(rb.getString(\"countryLabel\"));\n divisionLabel.setText(rb.getString(\"divisionLabel\"));\n postalLabel.setText(rb.getString(\"postalLabel\"));\n phoneLabel.setText(rb.getString(\"phoneLabel\"));\n\n // Prompt text\n idField.setPromptText(rb.getString(\"idPrompt\"));\n nameField.setPromptText(rb.getString(\"namePrompt\"));\n addressField.setPromptText(rb.getString(\"addressPrompt\"));\n cityField.setPromptText(rb.getString(\"cityPrompt\"));\n countryComboBox.setPromptText(rb.getString(\"countryPrompt\"));\n divisionComboBox.setPromptText(rb.getString(\"divisionPrompt\"));\n postalField.setPromptText(rb.getString(\"postalPrompt\"));\n phoneField.setPromptText(rb.getString(\"phonePrompt\"));\n\n // Button labels\n Common.scaleButton(saveBtn, rb.getString(\"saveBtn\"));\n Common.scaleButton(cancelBtn, rb.getString(\"cancelBtn\"));\n\n // Error label; initially blank\n errorLabel.setText(\"\");\n }",
"public abstract void initMode();",
"public void initialize() {\r\n\t\t\tsetTextValue(!updateNoteEnabled);\r\n\t\t}",
"protected void initialize() {\n\t\tif (type == switchType.True) {\n\t\t\tVariables.platformStatus = true;\n\t\t}\n\t\telse if (type == switchType.False) {\n\t\t\tVariables.platformStatus = false;\n\t\t}\n\t\telse {\n\t\t\tVariables.platformStatus = !Variables.platformStatus;\n\t\t}\n\t\tgo.start();\n\t}",
"@Override\r\n\tprotected String play() \r\n\t{\r\n\t\treturn \"The \" + this.getClass().getSimpleName() + \" Class.\" + \"\\n\" + this.getName() + \" is up!\";\r\n//\t\tSystem.out.println( \"The \" + this.getClass().getSimpleName() + \" Class.\");\r\n//\t\tSystem.out.println( this.getName() + \" is up!\" );\t\r\n\t}",
"public void initPlayer();",
"private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.getContentPane().setBackground(Color.BLACK);\n\t\tframe.setBounds(100, 100, 450, 300);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(null);\n\t\t\n\t\tJButton btnNewButton = new JButton(\"Play\");\n\t\tbtnNewButton.setFont(new Font(\"Bodoni 72\", Font.BOLD, 13));\n\t\tbtnNewButton.setBounds(frame.getWidth() / 2 - 60, 195, 120, 30);\n\t\tframe.getContentPane().add(btnNewButton);\n\t\t\n\t\tJLabel lblNewLabel = new JLabel(\"Space Escape\");\n\t\tlblNewLabel.setForeground(Color.WHITE);\n\t\tlblNewLabel.setFont(new Font(\"Bodoni 72\", Font.BOLD, 24));\n\t\tlblNewLabel.setBounds(frame.getWidth() / 2 - 60, 30, 135, 25);\n\t\tframe.getContentPane().add(lblNewLabel);\n\t\t\n\t\tJLabel lblNewLabel_1 = new JLabel(\"New label\");\n\t\tlblNewLabel_1.setBounds(0, 0, frame.getWidth(), frame.getHeight());\n\t\tframe.getContentPane().add(lblNewLabel_1);\n\t}",
"private void initialize() {\r\n label = new JLabel();\r\n panel = new JPanel();\r\n }",
"public void init(){\n\t\tsetBackground(Color.green);\n\t\tmsg = \"Let's Play\";\n//\t\tmsg1 = \"Your Frinds Choice\";\n\t\tSystem.out.println(cpu);\n\t\tb1 = new Button(\"Stone\");\n\t\tb2 = new Button(\"Paper\");\n\t\tb3 = new Button(\"Seaser\");\n\t\tb1.addActionListener(this);\n\t\tb2.addActionListener(this);\n\t\tb3.addActionListener(this);\n\t\tadd(b1);\n\t\tadd(b2);\n\t\tadd(b3);\n\t}",
"@Override\n public void init() {\n super.init();\n prev1 = new Gamepad();\n prev2 = new Gamepad();\n armExtended = false;\n\n glyphLiftState = GlyphLiftState.ASCENDING;\n }",
"private void setPlayButtonToPause() {\n NowPlayingInformation.setPlayButtonStatus(1);\n MainActivity.displayPlayButton();\n }",
"private void transport_play() {\n timerReset();\n playing = true;\n now_playing_play_button.setForeground(getDrawable(R.drawable.ic_pause_50dp));\n }",
"private void initialize() {\n\t\tString teamNumber = Integer.toString(WPILibCore.getDefault().getTeamNumber(null));\n\t\tteamNumberText.setText(teamNumber);\n\t}",
"private void setLabelText() {\n\t\tthis.addSpelers();\n\n\t\tfor (int i = 0; i < 3; i++) {\n\n\t\t\tString spelerid = Integer.toString(spelerids.get(i));\n\t\t\tString[] params1 = { spelerid };\n\t\t\tString query = \"SELECT COUNT(idontwikkelingskaart) FROM spelerontwikkelingskaart WHERE idspeler = ?\";\n\t\t\tResultSet result = dc.select(query, params1);\n\t\t\ttry {\n\t\t\t\tif (result.next()) {\n\t\t\t\t\tamountOfCards = result.getInt(1);\n\t\t\t\t\tcards.add(amountOfCards);\n\t\t\t\t}\n\t\t\t} catch (SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\t// Second part, getting playername and filling in their amount of cards\n\n\t\tfor (int i = 0; i < 3; i++) {\n\t\t\ttry {\n\n\t\t\t\tString query = \"SELECT username FROM speler WHERE idspel = ? AND idspeler = ?\";\n\t\t\t\tString idspelString = Integer.toString(idspel);\n\t\t\t\tString spelerid = Integer.toString(spelerids.get(i));\n\t\t\t\tString[] params2 = { idspelString, spelerid };\n\t\t\t\tResultSet result2;\n\t\t\t\tresult2 = dc.select(query, params2);\n\t\t\t\twhile (result2.next()) {\n\t\t\t\t\tif (amountOfCards == 1) {\n\t\t\t\t\t\ttext = result2.getString(1) + \" has \" + Integer.toString(cards.get(i)) + \" card.\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttext = result2.getString(1) + \" has \" + Integer.toString(cards.get(i)) + \" cards.\";\n\t\t\t\t\t}\n\t\t\t\t\tlabels.get(i).setText(text);\n\t\t\t\t}\n\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"public void play() {\n\t\tSystem.out.println(\"ting.. ting...\");\n\t}",
"private void initializeUI() {\n MedUtils.displayMedInfo(coverArt, playBinding.thumbIv, playBinding.titleTv,\n playBinding.subtitleTv, selectedMed);\n\n playBinding.playPauseBt.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n switch (MediaPlayerService.getState()) {\n case Constants.STATE_PLAY:\n mediaPlayerService.pauseAction();\n break;\n case Constants.STATE_PAUSE:\n mediaPlayerService.playAction();\n break;\n case Constants.STATE_NOT_INIT:\n startMediaPlayerService();\n break;\n }\n }\n });\n\n playBinding.stopBt.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n mediaPlayerService.stopAction();\n }\n });\n }",
"public static play() {\n\t\t\n\t}",
"void playRadio();",
"private void initializeMixerLocalization() {\n\t\ttry {\n\t\t\tmixerTab.setText(bundle.getString(\"mixerTab\"));\n\n\t\t\tlabelSelectFile.setText(bundle.getString(\"mixerSelectFileText\"));\n\t\t\tlabelOr.setText(bundle.getString(\"mixerOrText\"));\n\t\t\tlabelRecordFile.setText(bundle.getString(\"mixerRecordFileText\"));\n\n\t\t\tif (mixerSelectedFile != null) {\n\t\t\t\tif (mixerSelectedFile.getName().equals(\"mixer_default.wav\")) {\n\t\t\t\t\tlabelSelectedFile.setText(bundle.getString(\"mixerFileSelectedText\") + \" \"\n\t\t\t\t\t\t\t+ bundle.getString(\"mixerSelectedRecordingText\"));\n\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tlabelSelectedFile\n\t\t\t\t\t\t\t.setText(bundle.getString(\"mixerFileSelectedText\") + \" \" + mixerSelectedFile.getName());\n\t\t\t\t\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlabelSelectedFile.setText(bundle.getString(\"mixerFileNotSelectedText\"));\n\t\t\t}\n\n\t\t\tlabelTryMixer.setText(bundle.getString(\"mixerTryMixerText\"));\n\n\t\t\tlabelPitch.setText(bundle.getString(\"mixerPitchText\"));\n\t\t\tlabelEcho.setText(bundle.getString(\"mixerEchoText\"));\n\t\t\tlabelDecay.setText(bundle.getString(\"mixerDecayText\"));\n\t\t\tlabelEchoLength.setText(bundle.getString(\"mixerEchoLengthText\"));\n\t\t\tlabelLowPass.setText(bundle.getString(\"mixerLowPassText\"));\n\t\t\tlabelFlanger.setText(bundle.getString(\"mixerFlangerText\"));\n\t\t\tlabelWetness.setText(bundle.getString(\"mixerWetnessText\"));\n\t\t\tlabelFlangerLength.setText(bundle.getString(\"mixerFlangerLengthText\"));\n\t\t\tlabelLfo.setText(bundle.getString(\"mixerLfoText\"));\n\t\t\tlabelGain.setText(bundle.getString(\"mixerGainText\"));\n\n\t\t\tbuttonMixerFileOpener.setText(bundle.getString(\"mixerFileButton\"));\n\t\t\tif (toggleButtonMixerStartRecording.isSelected()) {\n\t\t\t\ttoggleButtonMixerStartRecording.setText(bundle.getString(\"mixerStopRecordButton\"));\n\t\t\t} else {\n\t\t\t\ttoggleButtonMixerStartRecording.setText(bundle.getString(\"mixerStartRecordButton\"));\n\t\t\t}\n\n\t\t\tif (toggleButtonTestFilter.isSelected()) {\n\t\t\t\ttoggleButtonTestFilter.setText(bundle.getString(\"mixerButtonTryMixerStopText\"));\n\t\t\t} else {\n\t\t\t\ttoggleButtonTestFilter.setText(bundle.getString(\"mixerButtonTryMixerStartText\"));\n\t\t\t}\n\n\t\t\tbuttonMixerResetSliders.setText(bundle.getString(\"mixerResetSlidersButton\"));\n\t\t\tbuttonSaveSettings.setText(bundle.getString(\"mixerSaveSettingsButton\"));\n\t\t\tbuttonLoadSettings.setText(bundle.getString(\"mixerLoadSettingsButton\"));\n\t\t\tbuttonSaveMixedFile.setText(bundle.getString(\"mixerSaveFileButton\"));\n\n\t\t\ttooltipPitch.setText(bundle.getString(\"mixerPitchTooltip\"));\n\t\t\ttooltipGain.setText(bundle.getString(\"mixerGainTooltip\"));\n\t\t\ttooltipEcho.setText(bundle.getString(\"mixerEchoTooltip\"));\n\t\t\ttooltipFlanger.setText(bundle.getString(\"mixerFlangerTooltip\"));\n\t\t\ttooltipLowPass.setText(bundle.getString(\"mixerLowPassTooltip\"));\n\n\t\t\tsymbols = new DecimalFormatSymbols(bundle.getLocale());\n\t\t\tdecimalFormat = new DecimalFormat(\"#0.00\", symbols);\n\n\t\t\ttextFieldPitch\n\t\t\t\t\t.setText(decimalFormat.format(Double.parseDouble(textFieldPitch.getText().replace(',', '.'))));\n\t\t\ttextFieldEchoLength\n\t\t\t\t\t.setText(decimalFormat.format(Double.parseDouble(textFieldEchoLength.getText().replace(',', '.'))));\n\t\t\ttextFieldDecay\n\t\t\t\t\t.setText(decimalFormat.format(Double.parseDouble(textFieldDecay.getText().replace(',', '.'))));\n\t\t\ttextFieldLowPass\n\t\t\t\t\t.setText(decimalFormat.format(Double.parseDouble(textFieldLowPass.getText().replace(',', '.'))));\n\t\t\ttextFieldWetness\n\t\t\t\t\t.setText(decimalFormat.format(Double.parseDouble(textFieldWetness.getText().replace(',', '.'))));\n\t\t\ttextFieldFlangerLength.setText(\n\t\t\t\t\tdecimalFormat.format(Double.parseDouble(textFieldFlangerLength.getText().replace(',', '.'))));\n\t\t\ttextFieldLfo.setText(decimalFormat.format(Double.parseDouble(textFieldLfo.getText().replace(',', '.'))));\n\t\t\ttextFieldGain.setText(decimalFormat.format(Double.parseDouble(textFieldGain.getText().replace(',', '.'))));\n\n\t\t\tif (bundle.getLocale().toString().equals(\"fi_FI\")) {\n\t\t\t\tcheckmarkFinnish.setVisible(true);\n\t\t\t\tcheckmarkEnglish.setVisible(false);\n\t\t\t} else if (bundle.getLocale().toString().equals(\"en_US\")) {\n\t\t\t\tcheckmarkEnglish.setVisible(true);\n\t\t\t\tcheckmarkFinnish.setVisible(false);\n\t\t\t}\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}",
"private void initPlayerUI() {\n if (playableMediaItem instanceof Podcast) {\n tvPlayerTitle.setText(((Podcast) playableMediaItem).getSelectedTrack().getTitle().trim());\n } else {\n tvPlayerTitle.setText(playableMediaItem.getName().trim());\n }\n tvPlayserSubtitle.setText(playableMediaItem.getSubHeader().trim());\n if (playableMediaItem.getCoverImageUrl() == null) {\n final LetterBitmap letterBitmap = new LetterBitmap(getActivity());\n Bitmap letterTile = letterBitmap.getLetterTile(playableMediaItem.getName(), playableMediaItem.getName(), COVER_IMAGE_SIZE, COVER_IMAGE_SIZE);\n imgPlayerCover.setImageBitmap(letterTile);\n int dominantColor = UIHelper.getDominantColor(letterTile);\n rlTopSectionBckg.setBackgroundColor(dominantColor);\n } else {\n Glide.with(getActivity()).load(playableMediaItem.getCoverImageUrl()).crossFade().into(new GlideDrawableImageViewTarget(imgPlayerCover) {\n @Override\n public void onResourceReady(GlideDrawable drawable, GlideAnimation anim) {\n super.onResourceReady(drawable, anim);\n Bitmap bitmap = ((GlideBitmapDrawable) drawable).getBitmap();\n int dominantColor = UIHelper.getDominantColor(bitmap);\n rlTopSectionBckg.setBackgroundColor(dominantColor);\n }\n });\n }\n if (playableMediaItem instanceof Podcast) {\n Track selectedTrack = ((Podcast) playableMediaItem).getSelectedTrack();\n tvTrackDuration.setText(selectedTrack.getDuration());\n sbPlayerProgress.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {\n @Override\n public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {\n\n }\n\n @Override\n public void onStartTrackingTouch(SeekBar seekBar) {\n isChangingProgress = true;\n }\n\n @Override\n public void onStopTrackingTouch(SeekBar seekBar) {\n isChangingProgress = false;\n int progress = seekBar.getProgress();\n int position = (int) ((maxDuration * progress) / 100);\n seekBar.setProgress(progress);\n universalPlayer.seekTo(position);\n }\n });\n }\n if (playableMediaItem instanceof RadioItem) {\n sbPlayerProgress.setOnTouchListener(new View.OnTouchListener() {\n @Override\n public boolean onTouch(View v, MotionEvent event) {\n return true;\n }\n });\n }\n\n //playableMediaItem.syncWithDB();\n if (playableMediaItem.isSubscribed) {\n itemFavorites.setIcon(getResources().getDrawable(R.drawable.ic_heart_black_24dp));\n } else {\n itemFavorites.setIcon(getResources().getDrawable(R.drawable.ic_heart_white_24dp));\n }\n }",
"public void startPlaying() {\n\t\tpbrLoading.setVisibility(View.GONE);\n\t\tisPlaying = true;\n\t\tif (IjoomerApplicationConfiguration.isEnableVoiceReport && reportVoice) {\n\t\t\tlnrReportVoice.setVisibility(View.VISIBLE);\n\t\t\timgReport.setImageResource(reportImage);\n\n\t\t\tif (reportCaption != 0) {\n\t\t\t\ttxtReportCaption.setText(reportCaption);\n\t\t\t} else if (strReportCaption != null && strReportCaption.length() > 0) {\n\t\t\t\ttxtReportCaption.setText(strReportCaption);\n\t\t\t}\n\t\t} else {\n\t\t\tlnrReportVoice.setVisibility(View.GONE);\n\t\t}\n\t\tupdateView();\n\t}",
"public void play() {\n\t\t\r\n\t}",
"public PlayerAsker(int player) {\r\n initComponents();\r\n choice=0;\r\n text.setText(\"What do you want player \" + (player+1) + \" to be ?:\");\r\n \r\n }",
"private void initView() {\n\t\t//buttonPlayPause = (ImageButton)getView().findViewById(R.id.ButtonTestPlayPause);\n\t\t//buttonPlayPause.setOnClickListener(this);\n\t\t\n\t\t//seekBarProgress = (SeekBar)getView().findViewById(R.id.SeekBarTestPlay);\t\n\t\t//seekBarProgress.setMax(99); // It means 100% .0-99\n\t\t//seekBarProgress.setOnTouchListener(this);\n\t\t//editTextSongURL = (EditText)findViewById(R.id.EditTextSongURL);\n\t\t//editTextSongURL.setText(R.string.testsong_20_sec);\n\t\t\n\t\t//mediaPlayer = new MediaPlayer();\n\t\t//mediaPlayer.setOnBufferingUpdateListener(this);\n\t\t//mediaPlayer.setOnCompletionListener(this);\n\t}",
"void initializePlayer();",
"private void initPlayerNames() {\n\t\tlb_player1.setText(playerNames[0]);\n\t\tlb_player2.setText(playerNames[1]);\n\t\tlb_player3.setText(playerNames[2]);\n\t\tlb_player4.setText(playerNames[3]);\n\t}",
"public void startCommand() {\r\n _playing = true;\r\n }",
"private void setUIStatePlaying(){\n play.setEnabled(false);\n pause.setEnabled(true);\n stop.setEnabled(true);\n }",
"public JTimerLabel()\n\t{\n\t\tthis(LOOP_ICON);\n\t}",
"public void setLabel( String label )\n { \n this.label = label;\n show_text();\n }",
"public void play() { \r\n\t System.out.printf(\"Playing Song: artist=%-20s title=%s\\n\", artist, title);\r\n\t}",
"public void initializePointScore() {\n scoreSound = MediaPlayer.create(context, R.raw.pointscored);\n }",
"private void init() {\n chalkTypeFace = Typeface.createFromAsset(getAssets(), \"fonts/kg.ttf\");\n\n play = (Button) findViewById(R.id.main_play);\n play.setTypeface(chalkTypeFace);\n play.setOnClickListener(new View.OnClickListener() {\n public void onClick(View v) {\n gotoPlay();\n }\n });\n\n preferences = (Button) findViewById(R.id.main_options);\n preferences.setTypeface(chalkTypeFace);\n preferences.setOnClickListener(new View.OnClickListener() {\n public void onClick(View v) {\n gotoOptions();\n }\n });\n\n profile = (Button) findViewById(R.id.main_profile);\n profile.setTypeface(chalkTypeFace);\n profile.setOnClickListener(new View.OnClickListener() {\n public void onClick(View v) {\n gotoUserProfile();\n }\n });\n\n info = (ImageButton) findViewById(R.id.main_info);\n info.setOnClickListener(new View.OnClickListener() {\n public void onClick(View v) {\n gotoInfo();\n }\n });\n }",
"private void setPlayList() {\n int[] rawValues = {\n R.raw.bensoundbrazilsamba,\n R.raw.bensoundcountryboy,\n R.raw.bensoundindia,\n R.raw.bensoundlittleplanet,\n R.raw.bensoundpsychedelic,\n R.raw.bensoundrelaxing,\n R.raw.bensoundtheelevatorbossanova\n };\n String[] countryList = {\n \"Brazil\",\n \"USA\",\n \"India\",\n \"Iceland\",\n \"South Korea\",\n \"Indonesia\",\n \"Brazil\"\n };\n String [] descriptions = {\n \"Samba is a Brazilian musical genre and dance style, with its roots in Africa via the West African slave trade religious particularly of Angola and African traditions.\",\n \"Country music is a genre of American popular originated Southern States in the 1920s music that in the United\",\n \"The music of India includes multiple varieties of folk music, pop, and Indian classical music. India's classical music tradition, including Hindustani music and Carnatic, has a history spanning millennia and developed over several eras\",\n \"The music of Iceland includes vibrant folk and pop traditions. Well-known artists from Iceland include medieval music group Voces Thules, alternative rock band The Sugarcubes, singers Björk and Emiliana Torrini, post- rock band Sigur Rós and indie folk/indie pop band Of Monsters and Men\",\n \"The Music of South Korea has evolved over the course of the decades since the end of the Korean War, and has its roots in the music of the Korean people, who have inhabited the Korean peninsula for over a millennium. Contemporary South Korean music can be divided into three different categories: Traditional Korean folk music, popular music, or K- pop, and Western- influenced non-popular music\",\n \"The music of Indonesia demonstrates its cultural diversity, the local musical creativity, as well as subsequent foreign musical influences that shaped contemporary music scenes of Indonesia. Nearly thousands Indonesian having its own cultural and artistic history and character Nearly of islands\",\n \"Samba is a Brazilian musical genre and dance style, with its roots in Africa via the West African slave trade religious particularly of Angola\"\n };\n\n for (int i = 0; i < rawValues.length; i++) {\n this.mPlayList.add(rawValues[i]);\n this.mTrackList.add(new Track(this.getResources().getResourceEntryName(rawValues[i]),\n countryList[i],descriptions[i],rawValues[i]));\n }\n }",
"private void pauseAndPlay(Label textId) {\n textId.setVisible(false);\n textId.setText(\"O\");\n PauseTransition pause = new PauseTransition(Duration.seconds(1));\n pause.setOnFinished(event -> enableAll(textId));\n pause.play();\n\n }",
"public void newGame() {\n gameString = playerPlays = computerPlays = \"\";\n pScore = cScore = 0;\n setLabels();\n }",
"public void setLabel(boolean isLabel) {\n\t\tthis.roomLabel = isLabel; \n\t}",
"public void play() { \r\n if (midi) \r\n sequencer.start(); \r\n else \r\n clip.start(); \r\n timer.start(); \r\n play.setText(\"Stop\"); \r\n playing = true; \r\n }",
"private void displayReplay() {\n if (isEnglish)\n Toast.makeText(this, REPLAY, Toast.LENGTH_LONG).show();\n else\n Toast.makeText(this, REPLAY_CHINESE, Toast.LENGTH_LONG).show();\n }",
"public void initGameModeChoice() {\n\t\tWorld.clear();\n\t\tstate = STATE.MENU;\n\t\tinitBackground();\n\t\tWorld.add(new Logo(Screen.getCenterX() - Logo.WIDTH / 2, Screen\n\t\t\t\t.getHeight() * 3 / 4 - Logo.HEIGHT / 2));\n\t\tWorld.add(new SinglePlayerButton(Screen.getCenterX()\n\t\t\t\t- StartButton.WIDTH / 2, Screen.getHeight() * 3 / 8\n\t\t\t\t- StartButton.HEIGHT / 2, this));\n\t\tWorld.add(new MultiPlayerButton(Screen.getCenterX() - StartButton.WIDTH\n\t\t\t\t/ 2, Screen.getHeight() * 2 / 8 - StartButton.HEIGHT / 2, this));\n\t\tWorld.add(new TextStatic(footerText, Screen.getCenterX()\n\t\t\t\t- footerText.length() * Sprite.CHAR_WIDTH / 2,\n\t\t\t\tSprite.CHAR_HEIGHT, Color.yellow));\n\n\t}",
"public void play() {\n\t\tSystem.out.println(\"playing \"+title+\" by \" +artist);\n\t}",
"@Override\n\tpublic void nowPlaying() {\n\t}",
"public static void startTimerLabel()\n {\n {\n if (timeline != null) {\n timeline.stop();\n }\n timeSeconds.set(STARTTIME);\n //timeLabel.setText(timeSeconds.toString());\n timeline = new Timeline();\n //timeline.setCycleCount(timeline.INDEFINITE); // need this?\n\n timeline.getKeyFrames().add(\n new KeyFrame(Duration.seconds(STARTTIME+1),\n new EventHandler<ActionEvent>() {\n public void handle(ActionEvent event) {\n //System.out.println(\"Got Timer timeout.\");\n if (cancel == false) {\n SceneResultsTimed.updatePlayerScore();\n localStage.setScene(SceneMgr.getScene(SceneMgr.IDX_RESULTSTIMED));\n }\n }\n },\n new KeyValue(timeSeconds, 0)));\n timeline.playFromStart();\n }\n }",
"@Override\n\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\tgameType = \"Quick Play\"; \n\t\t\t\t\t\n\t\t\t\t}",
"public howToPlayButton()\r\n {\r\n GreenfootImage howToGuide = new GreenfootImage(\"how to play.png\");\r\n setImage(howToGuide);\r\n }",
"public void init() {\r\n bundle = ResourceBundle.getBundle(\"gong/i18n/NanoGong\");\r\n\r\n try {\r\n java.awt.EventQueue.invokeAndWait(new Runnable() {\r\n public void run() {\r\n initComponents();\r\n\r\n // Initialize the button UIs\r\n btnPlay.setUI(new NanoButtonUI(NanoButtonUI.PLAY));\r\n btnRecord.setUI(new NanoButtonUI(NanoButtonUI.RECORD));\r\n btnStop.setUI(new NanoButtonUI(NanoButtonUI.STOP));\r\n btnSave.setUI(new NanoButtonUI(NanoButtonUI.SAVE));\r\n slrAmplitude.setUI(new NanoAmplitudeUI(slrAmplitude));\r\n btnSlow.setUI(new NanoSpeedButtonUI(NanoSpeedButtonUI.SLOW));\r\n btnFast.setUI(new NanoSpeedButtonUI(NanoSpeedButtonUI.FAST));\r\n slrTime.setUI(new NanoTimeUI(slrTime, NanoGong.this));\r\n panWait.setVisible(false);\r\n/*\r\n // Create the JLabel for time display\r\n lblTime = new javax.swing.JLabel();\r\n lblTime.setText(\"\");\r\n lblTime.setBackground(new java.awt.Color(1.0f, 1.0f, 1.0f, 0.8f));\r\n lblTime.setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.Color.WHITE));\r\n lblTime.setBounds((getWidth() - 100) / 2, 20, 100, 12);\r\n lblTime.setFont(new java.awt.Font(\"Dialog\", java.awt.Font.BOLD, 10));\r\n lblTime.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\r\n lblTime.setOpaque(true);\r\n lblTime.setPreferredSize(lblTime.getSize());\r\n\r\n // Add the time label to the glass pane*/\r\n panGlassPane = (javax.swing.JPanel) getGlassPane();\r\n panGlassPane.setLayout(null);\r\n// panGlassPane.add(lblTime);*/\r\n }\r\n });\r\n } catch (Exception e) {}\r\n \r\n handler.addListener(this);\r\n \r\n String value;\r\n \r\n // Read various parameters from the applet\r\n value = getParameter(\"ShowAudioLevel\");\r\n if (value != null && value.equalsIgnoreCase(\"false\")) slrAmplitude.setVisible(false);\r\n value = getParameter(\"ShowRecordButton\");\r\n if (value != null && value.equalsIgnoreCase(\"false\")) btnRecord.setVisible(false);\r\n value = getParameter(\"ShowSpeedButton\");\r\n if (value != null && value.equalsIgnoreCase(\"false\")) panSpeed.setVisible(false);\r\n value = getParameter(\"ShowSaveButton\");\r\n if (value != null && value.equalsIgnoreCase(\"false\")) btnSave.setVisible(false);\r\n value = getParameter(\"ShowTime\");\r\n if (value != null && value.equalsIgnoreCase(\"true\")) showTime = true;\r\n value = getParameter(\"AudioFormat\");\r\n if (value != null && value.equals(IMA_ADPCM)) audioFormat = IMA_ADPCM;\r\n if (value != null && value.equals(PCM)) audioFormat = PCM;\r\n value = getParameter(\"SamplingRate\");\r\n if (value != null) {\r\n try {\r\n int rate = Integer.parseInt(value);\r\n if (audioFormat.equals(IMA_ADPCM)) {\r\n if (rate == 8000 || rate == 11025 || rate == 22050 || rate == 44100) samplingRate = rate;\r\n } else {\r\n if (rate == 8000 || rate == 16000 || rate == 32000 || rate == 44100) samplingRate = rate;\r\n }\r\n } catch (NumberFormatException nfe) {}\r\n }\r\n value = getParameter(\"SpeexQuality\");\r\n if (value != null) {\r\n try {\r\n int quality = Integer.parseInt(value);\r\n if (quality >= 0 && quality <= 10) speexQuality = quality;\r\n } catch (NumberFormatException nfe) {}\r\n }\r\n value = getParameter(\"Color\");\r\n if (value != null && value.length() > 1) {\r\n try {\r\n java.awt.Color c = new java.awt.Color(Integer.parseInt(value.substring(1), 16));\r\n \r\n // Change the color of all components\r\n panPanel.setBackground(c);\r\n btnPlay.setBackground(c);\r\n btnRecord.setBackground(c);\r\n btnStop.setBackground(c);\r\n slrAmplitude.setBackground(c);\r\n panSpeed.setBackground(c);\r\n btnSlow.setBackground(c);\r\n btnFast.setBackground(c);\r\n lblSpeed.setBackground(c);\r\n btnSave.setBackground(c);\r\n slrTime.setBackground(c);\r\n panWait.setBackground(c);\r\n lblMessage.setBackground(c);\r\n pbrWait.setBackground(c);\r\n } catch (NumberFormatException nfe) {\r\n speexQuality = 0;\r\n }\r\n }\r\n value = getParameter(\"MaxDuration\");\r\n if (value != null) {\r\n try {\r\n long duration = Long.parseLong(value);\r\n if (duration > 0 && duration <= 1200) maxDuration = duration * 1000;\r\n } catch (NumberFormatException nfe) {}\r\n }\r\n value = getParameter(\"StartTime\");\r\n if (value != null) {\r\n try {\r\n double dvalue = Double.parseDouble(value);\r\n if (dvalue > 0) startTime = (long) (dvalue * 1000.0);\r\n } catch (NumberFormatException nfe) {}\r\n }\r\n value = getParameter(\"EndTime\");\r\n if (value != null) {\r\n try {\r\n double dvalue = Double.parseDouble(value);\r\n if (dvalue > 0) endTime = (long) (dvalue * 1000.0);\r\n } catch (NumberFormatException nfe) {}\r\n }\r\n if (startTime > 0 && endTime > 0 && endTime <= startTime) {\r\n endTime = -1;\r\n }\r\n \r\n // Preload the sound file from the parameter\r\n String url = getParameter(\"SoundFileURL\");\r\n try {\r\n url = resolveURL(url);\r\n handler.setURL(url);\r\n } catch (MalformedURLException ex) {\r\n handler.setURL(null);\r\n }\r\n \r\n String jsListenerName = getParameter(\"AudioHandlerListener\");\r\n if(jsListenerName != null) {\r\n \tJSObject window = JSObject.getWindow(this);\r\n \ttry {\r\n\t \tJSObject jsListener = (JSObject)window.getMember(jsListenerName);\r\n\t\t handler.addListener(new JsAudioHandlerListener(jsListener));\r\n \t} catch(JSException e) {\r\n \t\t// specified object not found\r\n \t\t\r\n \t}\r\n }\r\n if (url != null) {\r\n URLLoader loader = getURLLoader(url, startTime, endTime);\r\n if (loader == null)\r\n JOptionPane.showMessageDialog(this, \"NanoGong is busy at the moment.\", \"Error\", JOptionPane.ERROR_MESSAGE);\r\n else\r\n loader.start();\r\n }\r\n }",
"public void updateLabels() {\n\t\tfinal PlayerInfo player = ControllerImpl.getController().getCurrentPlayer();\n\t\tplayerLabel.setText(\"Player:\\n\" + player.getName());\n\t\tcashLabel.setText(\"Cash:\\n\" + player.getMoney());\n\t\tnetWorthLabel.setText(\"Net Worth:\\n\" + player.totalAssets());\n\t\tprisonLabel.setText(player.isInJail() ? \"In jail\" : \"Free\");\n\t}",
"public void setPlayMode(PlayMode playMode) {\n // there can be a race condition where user tries to open file, this sets\n // playMode to PLAYBACK but run() method in ViewLoop sets it back to WAITING\n this.playMode = playMode;\n// log.info(\"set playMode=\"+playMode);\n }",
"public void start()\n {\n text = \"Game will start in: 3\";\n text2 = \"Total Score: \";\n text3 = \"Dots Collected: \";\n if(!modeT)\n text4 = \"Time Elapsed: \";\n else\n text4 = \"Time Remaining: 5.0 seconds \";\n text5 = \"Press the spacebar to pause\";\n text8 = \"Press h to see high scores\";\n text9 = \"Press m to mute\";\n text6 = \"Power Up: \" + \" Time Remaining: \";\n \n //text8 = hsdisplay();\n running = true;\n thread = new Thread(this, \"Game Loop\");\n thread.start();\n }",
"public GUI() {\n initComponents();\n model = new Model();\n playerTurn = 1;\n JTurnMessage.setText(\"Player X Turn\");\n }",
"void setLabel(String label);",
"@FXML\n\tprivate void initialize() {\n\n\t\t\n\n\t\tchooseLangCombo.getItems().setAll(\"English\", \"Vietnamese\");\n\t\tchooseLangCombo.setValue(\"English\");\n\t\t;\n\n\t\tspeechCalculator.setInfoArea(infoArea);\n\n\t\t// start\n\t\tstart.setOnAction(a -> {\n\t\t\tSystem.out.println(\"choose:\" + chooseLangCombo.getSelectionModel().getSelectedItem());\n\t\t\tspeechCalculator.setChooseLang(chooseLangCombo.getSelectionModel().getSelectedItem());\n\t\t\tstatusLabel.setText(\"Status : [Running]\");\n\t\t\tinfoArea.appendText(\"Starting Speech Recognizer\\n\");\n\t\t\tspeechCalculator.startSpeechThread();\n\t\t});\n\n\t\t// stop\n\t\tstop.setOnAction(a -> {\n\t\t\tstatusLabel.setText(\"Status : [Stopped]\");\n\t\t\tinfoArea.appendText(\"Stopping Speech Recognizer\\n\");\n\t\t\tspeechCalculator.stopSpeechThread();\n\t\t\tchooseLangCombo.setValue(\"English\");\n\t\t\t;\n\t\t});\n\n\t\t// restart\n\t\trestart.setDisable(true);\n\n\t\treportBtn.setOnAction((ActionEvent event) -> {\n System.out.println(\"report button\");\n infoArea.appendText(\"You've just export report to excel. Please check file path:\" + ReportResult.REPORT_FILE_PATH + \"\\n\");\n ReportResult.createExcelFile();\n });\n\t\tcreateRadioGroup();\n\t}",
"private void __selectMode(Gamemode mode) throws IOException {\n Game game = new Game(mode);\n MainApp.setGameState(game);\n MainApp.setRoot(Views.TOPIC);\n }",
"public void playCurrent() {\n owner.setMode(MyFlag.RADIO_MODE);\n\n // Case PAUSE\n if(radioPlayer.isPlaying()){\n radioPlayer.pause();\n this.isPaused = true;\n currentStationStatus = \"stop\";\n notifyUser(MyFlag.PLAY, currentStationName, currentStationGenre);\n return;\n }\n\n // Otherwise, case PLAY\n // Check for internet connection and update UI before streaming\n resetAllInfo();\n if(isOnline()) {\n currentStationStatus = \"Loading Stream...\";\n notifyUser(MyFlag.PAUSE, currentStationName, currentStationStatus);\n } else {\n currentStationStatus = \"No Internet Connection\";\n notifyUser(MyFlag.PAUSE, currentStationName, currentStationStatus);\n return;\n }\n\n radioPlayer.reset();\n isPaused = false;\n\n try {\n radioPlayer.setDataSource(radioList.get(currentStation).getUrl());\n radioPlayer.prepareAsync();\n radioPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {\n public void onPrepared(MediaPlayer mp) {\n radioPlayer.start(); //start streaming\n }\n });\n // fetch data from server to update notification bar\n fetch(radioList.get(currentStation).getUrl());\n } catch (Exception e) {\n // IllegalArgumentException , IOException, IllegalStateException\n // Are all because of Error setting data source (bad url)\n //e.printStackTrace();\n resetAllInfoExceptBitrate();\n currentStationStatus = \"Url not accessible\";\n notifyUser(MyFlag.PAUSE, currentStationName, currentStationStatus);\n }\n }",
"public void play(){\n\t\t\n\t}",
"public final void play() {\n\t\tinitialize();\n\t\tstartPlay();\n\t\tendPlay();\n\t}",
"public void initGame() {\n // clear the board contents\n board.init();\n // CROSS speelt eerst\n currentPlayer = Mark.CROSS;\n currentState = GameState.PLAYING;\n // ready for start\n }",
"private void startGame() {\n gameCountDownTimer = getGameTimer();\n gameCountDownTimer.start();\n animateBalloonView(balloon1, true);\n animateBalloonView(balloon2, true);\n animateBalloonView(balloon3, true);\n animateBalloonView(balloon4, true);\n animateBalloonView(balloon5, true);\n currentScreenGameState = GameState.PLAYING;\n String controlButtonTitle = getResources().getString(R.string.pause_btn);\n conttroler.setText(controlButtonTitle);\n setCurrentScreenCover();\n invalidateOptionsMenu();\n }",
"private void init() {\r\n\t\tint linePos = this.playBoard.length / 2;\r\n\t\tint columnPos = this.playBoard[0].length / 2;\r\n\t\tfor (int i = 0; i < playBoard.length; i++) {\r\n\t\t\tfor (int j = 0; j < playBoard[0].length; j++) {\r\n\t\t\t\tplayBoard[i][j] = '-';\r\n\t\t\t}\r\n\t\t}\r\n\t\tplayBoard[linePos - 1][columnPos - 1] = 'W';\r\n\t\tplayBoard[linePos - 1][columnPos] = 'B';\r\n\t\tplayBoard[linePos][columnPos] = 'W';\r\n\t\tplayBoard[linePos][columnPos - 1] = 'B';\r\n\t}",
"private void initialize() {\n\t\tsetModal(true);\n\t\tsetTitle(\"Mode Selector\");\n\t\tsetBounds(100, 100, 550, 343);\n\t\tsetDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);\n\t\tToolkit toolkit = Toolkit.getDefaultToolkit();\n\t\tImage image = toolkit.getImage(ConfigFilePath.SWING_PATH);\n\t\tsetIconImage(image);\n\t\tgetContentPane().setLayout(null);\n\t\tsetLocationRelativeTo(null);\n\t\tsetResizable(false);\n\t\tJPanel panel = new JPanel();\n\t\tpanel.setBounds(0, 0, 534, 304);\n\t\tgetContentPane().add(panel);\n\t\tpanel.setLayout(null);\n\t\tbtnMes.setFont(new Font(\"宋体\", Font.PLAIN, 27));\n\t\tbtnMes.setBounds(280, 104, 163, 75);\n\t\tpanel.add(btnMes);\n\t\tbtnOperator.setFont(new Font(\"宋体\", Font.PLAIN, 25));\n\t\tbtnOperator.setBounds(80, 104, 163, 75);\n\t\tpanel.add(btnOperator);\n\n\t\t// mes监听\n\t\tbtnMes.addActionListener(new ModeMesAction(this));\n\t\t// op监听\n\t\tbtnOperator.addActionListener(new ModeOpAction(this));\n\t}",
"public static void startGame()\r\n\t{\r\n\t\tnew ModeFrame();\r\n\t}",
"public void setLabel( String label ) {\r\n lbl = label;\r\n }",
"public void play() {\n\t\tplay(true, true);\n\t}",
"public void setup() {\n \n populating_variables();\n frameRate(120);\n background(white);\n load_songs();\n instructions();\n music_player_setup();\n scrollable_list();\n}",
"@Override\n public void simpleInitApp()\n {\n makeInitialWorld();\n \tAudio audio = new Audio(assetManager, rootNode);\n inputManager.setCursorVisible(false);\n \trootNode.attachChild(overlayNode);\n\n \tflyCam.setEnabled(true);\n flyCam.setMoveSpeed(25);\n\n setDisplayFps(true);\n setDisplayStatView(true);\n\n GUIInfo guiInfo = new GUIInfo(guiNode, assetManager.loadFont(\"Interface/Fonts/Console.fnt\"));\n guiNode.addControl(guiInfo);\n }",
"@Override\r\n\tpublic void playerInit(GameEngine engine, int playerID) {\r\n\t\towner = engine.getOwner();\r\n\t\treceiver = engine.getOwner().receiver;\r\n\t\tnumColors[playerID] = 4;\r\n\t\tojamaHard[playerID] = 4;\r\n\t\tcountdownDecremented[playerID] = true;\r\n\t\tojamaChecked[playerID] = false;\r\n\r\n\t\tif(engine.getOwner().replayMode == false) {\r\n\t\t\tloadOtherSetting(engine, engine.getOwner().modeConfig);\r\n\t\t\tloadPreset(engine, engine.getOwner().modeConfig, -1 - playerID, \"spf\");\r\n\t\t\tversion = CURRENT_VERSION;\r\n\t\t} else {\r\n\t\t\tloadOtherSetting(engine, engine.getOwner().replayProp);\r\n\t\t\tloadPreset(engine, engine.getOwner().replayProp, -1 - playerID, \"spf\");\r\n\t\t\tversion = owner.replayProp.getProperty(\"avalanchevs.version\", 0);\r\n\t\t}\r\n\t}",
"public Pong()\n { \n super(\"gameplay.wav\", 1000, 625, 1);\n lastFrameTimeMS = System.currentTimeMillis();\n prepare();\n }",
"@Override\r\n public void loadPianoAudioStart() {\n }",
"private void initializeLabels() {\n labelVertexA = new Label(\"Vertex A\");\n labelVertexB = new Label(\"Vertex B\");\n labelVertexA.setTextFill(Color.web(\"#ffffff\"));\n labelVertexB.setTextFill(Color.web(\"#ffffff\"));\n }",
"@Override\n public void playStart(long epoch) {\n }",
"public void btnPlaySong() {\n\t\tMusicApp.getAudioPlayer().playSong(track);\n\t}",
"public void setPlayAll() {\n shuffle = false;\n // set AUTO so when the song ends - it will start the next song automatically\n action = PLAY_TRACK;\n if (shuffleIndexes != null) shuffleIndexes.clear();\n songPosn = 0;\n playSong();\n }",
"private void createStartingLabel() {\n \tcreateLabel(myResources.getString(\"title\"), 1, 0, TITLE_FONT);\n }"
] | [
"0.80073893",
"0.6759003",
"0.64353144",
"0.6383611",
"0.62622774",
"0.62546176",
"0.62437844",
"0.620396",
"0.62037206",
"0.6161553",
"0.6110683",
"0.6101333",
"0.60592186",
"0.6036314",
"0.60337687",
"0.60172963",
"0.59983975",
"0.5998277",
"0.59980386",
"0.5978218",
"0.59687936",
"0.59602934",
"0.5949171",
"0.5938335",
"0.5912428",
"0.589617",
"0.588564",
"0.5867108",
"0.5838578",
"0.5831542",
"0.5804237",
"0.57933694",
"0.57911503",
"0.5788205",
"0.57769775",
"0.5774792",
"0.5767263",
"0.5752434",
"0.5741056",
"0.57344145",
"0.572584",
"0.5725822",
"0.5723943",
"0.57174146",
"0.56994385",
"0.56974703",
"0.56771916",
"0.567425",
"0.5663077",
"0.566281",
"0.5649778",
"0.5642501",
"0.5642231",
"0.56315166",
"0.56287867",
"0.5623669",
"0.56194985",
"0.5607303",
"0.5606008",
"0.56050664",
"0.5600556",
"0.5596096",
"0.5593604",
"0.55925316",
"0.55901474",
"0.55883443",
"0.5584323",
"0.5580742",
"0.55757177",
"0.55738825",
"0.55622745",
"0.55545986",
"0.5549898",
"0.55401325",
"0.55343467",
"0.55292845",
"0.55266887",
"0.552224",
"0.5521672",
"0.55124384",
"0.55070585",
"0.55070126",
"0.5497795",
"0.54966784",
"0.5490555",
"0.5486353",
"0.5481431",
"0.5480486",
"0.5477915",
"0.54759425",
"0.54715353",
"0.5469199",
"0.5467826",
"0.5464739",
"0.54642713",
"0.5464202",
"0.5458839",
"0.5458311",
"0.545825",
"0.5455449"
] | 0.7039765 | 1 |
add the action to the play mode label | private void initPlayModeController() {
playMode.setOnMouseClicked(event -> {
MasterMindMain mm = null;
try { mm = new MasterMindMain(); }
catch (Exception e) { e.printStackTrace(); }
mm.start(SimulatorMain.stage);
});
playMode.setOnMouseEntered(event -> { playMode.setGraphic(new Circle(5)); });
playMode.setOnMouseExited(event -> { playMode.setGraphic(null); });
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\tgameType = \"Quick Play\"; \n\t\t\t\t\t\n\t\t\t\t}",
"public static void setEventLabel(String action){\n static_label.setText(action + \" \");\n }",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tmainFrame.mainToolBar.jtb_play.doClick();\n\t\t\t}",
"public boolean action(Event e, Object o){\r\n\tif (e.target == playButton){ \r\n\t screenName = \"CharSelect\";\r\n\t}\r\n\telse{\r\n\t screenName = \"Instruction\";\r\n\t}\r\n\treturn super.action(e,o);\r\n }",
"default public void clickPlay() {\n\t\tremoteControlAction(RemoteControlKeyword.PLAY);\n\t}",
"public String action() { \n return \"Player capped.\";\n }",
"public void togglePlay() { }",
"public void addScAction() {\n\t\taddPairItem(labels.get(Labels.PROP_INFO_SC), true);\n\t}",
"void togglePlay();",
"public void actionPerformed(ActionEvent arg0) {\r\n\t\tif (play == arg0.getSource())\r\n\t\t\tm.changePanel(\"2\");\r\n\t\tif(instructions == arg0.getSource()) {\r\n\t\t\tm.changePanel(\"3\");\r\n\t\t}\r\n\t}",
"void play(){\n\n\t\tnew X.PlayXicon().root.setOnClickListener(Play_TestsPresenter::cc);\n\t}",
"public void btnPlaySong() {\n\t\tMusicApp.getAudioPlayer().playSong(track);\n\t}",
"@Override\n public void onClick(View v) {\n if (playMode < MusicPlayer.PLAY_WITH_SONG_LIST_LOOPING) {\n playMode++;\n } else {\n playMode = MusicPlayer.PLAY_WITH_SIGNAL;\n }\n playerService.setPlayMode(playMode);\n }",
"public void play() {\n\t\tSystem.out.println(\"playing \"+title);\r\n\t}",
"private void playAction(){\n\n if (stopBeforeCall.isSelected()) { execEndAction(execOnEnd.getText()); }\n execStartAction(execOnStart.getText());\n\n //if timer was inicializated\n if (timer != null) {\n if (pto == null) {\n pto = new PlayerTimerOnly(displayTimer);\n pto.play();\n } else {\n pto.stop();\n pto.play();\n }\n }\n //check if play is needed\n SolverProcess sp = solverChoices.getSelectionModel().getSelectedItem();\n if (sp == null || sp.isDummyProcess()){\n return;\n }\n\n Solution s = sp.getSolution();\n\n s = mfd.transofrmSolutionTimeIfChecked(s);\n\n List<List<AgentActionPair>> aapList = Simulator.getAAPfromSolution(s);\n rmp = new RealMapPlayer(aapList,smFront);\n rmp.play();\n\n\n }",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tString input = e.getActionCommand();\n\t\t\t\tif(start) {\n\t\t\t\t\tdisplay.setText(\"\");\n\t\t\t\t\tstart = false;\n\t\t\t\t}\n\t\t\t\tdisplay.setText(display.getText() + input);\n\t\t\t}",
"private void initPlayModeView() {\n playMode = new Label(\"PLAY\");\n playMode.setPrefSize(200,100);\n playMode.setFont(Font.font(null, FontWeight.BOLD, 30));\n playMode.setTextFill(Color.BLUE);\n playMode.setEffect(getDropShadow());\n }",
"public void audioAction() {\n getSelectedCell().toggleAudio();\n }",
"public void setTextOfStartPause() {\n if (play) {\n startButton.setText(\"Start\");\n } else {\n startButton.setText(\"Pause\");\n }\n }",
"public void actionPerformed(ActionEvent arg0) {\n\t\t\t\tlblMode.setText(\"Leap Motion\");\r\n\t\t\t}",
"@Override\n public void onClick(View v) {\n play(v);\n }",
"public void actionPerformed(ActionEvent e) {\r\n\t\t//enable buttons \r\n\t\tif(e.getActionCommand().equals(\"Play Again\")) {\r\n\t\t\tplayAgain = true;\r\n\t\t}\r\n\t\telse if(e.getActionCommand().equals(\"Main Menu\")) {\r\n\t\t\tmainMenu = true;\r\n\t\t}\r\n\t\t\r\n\t}",
"@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tplay();\n\t\t\t}",
"public void showNextMovePrompt() {\n\n if(model.isXTurn()){\n resultLabel.setText(\"X's Turn\");\n }\n else{\n resultLabel.setText(\"O's Turn\");\n }\n }",
"public void actionPerformed(ActionEvent e)\n\t{\n\t\tif(e.getSource() == play)\n\t\t{\n\t\t\tcl.show(this, \"Info\");\n\t\t}\n\t\telse if(e.getSource() == inst)\n\t\t{\n\t\t\tcl.show(this, \"Instructions\");\n\t\t}\n\t\telse if(e.getSource() == hs)\n\t\t{\n\t\t\thsp = new HigScoPanel();\n\t\t\tadd(\"High Scores\", hsp);\n\t\t\tcl.show(this, \"High Scores\");\n\t\t}\n\t\telse if(e.getSource() == tePan)\n\t\t{\n\t\t\tcl.show(this, \"Terms\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tcl.show(this, \"Base\");\n\t\t}\n\n\t}",
"public void act() \r\n {\r\n if (Greenfoot.mouseClicked(this)) {\r\n Greenfoot.setWorld(new howToPlayGuide());\r\n }\r\n }",
"public void actionPerformed(ActionEvent actionEvent) {\n\t\t\taddPlayer.setEnabled(false);\n\t\t\tnameField.setEnabled(false);\n\t\t\tplayGame.setEnabled(false);\n\t\t\ttakeTurn.setEnabled(true);\n\t\t\t\n\t\t\tgameText.append(\"\\n\\n\");\n\t\t}",
"String getAction();",
"String getAction();",
"@Override\n\t\tpublic void actionPerformed(ActionEvent e)\n\t\t{\n\t\t\tswitch( FinalJeopardyScreen.this.stage )\n\t\t\t{\n\t\t\t\tcase TITLE:\n\t\t\t\t\tFinalJeopardyScreen.this.stage = FinalJeopardyStage.CATEGORY;\n\t\t\t\t\tFinalJeopardyScreen.this.mainScreen.label = FinalJeopardyScreen.this.category.name;\n\t\t\t\t\tbreak;\n\t\t\t\tcase CATEGORY:\n\t\t\t\t\tFinalJeopardyScreen.this.stage = FinalJeopardyStage.CLUE;\n\t\t\t\t\tFinalJeopardyScreen.this.mainScreen.label = FinalJeopardyScreen.this.clue.text;\n\t\t\t\t\tbreak;\n\t\t\t\tcase CLUE:\n\t\t\t\t\tFinalJeopardyScreen.this.stage = FinalJeopardyStage.ANSWER;\n\t\t\t\t\tFinalJeopardyScreen.this.mainScreen.label = FinalJeopardyScreen.this.clue.answer;\n\t\t\t\t\tbreak;\n\t\t\t\tcase ANSWER:\n\t\t\t\t\tLogger.log( \"Final Jeopardy is complete!\");\n\t\t\t\t\tFinalJeopardyScreen.this.controller.startNextRound();\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t}",
"@Override\n\tpublic void play() {\n\t\tSystem.out.println(\"We played Snokker today\");\n\t\t\n\t\t\n\t}",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tsp10.play(sound_id10 , 1.0F, 1.0F, 0, 0, 1.0F);\n\t\t\t}",
"@Override\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\tif (button_SFX.getText().equals(\"효과음 : On\")){\n\t\t\t\tsfx=false;\n\t\t\t\tbutton_SFX.setText(\"효과음 : off\");\n\t\t\t}\n\t\t\telse{\n\t\t\t\tsfx=true;\n\t\t\t\tbutton_SFX.setText(\"효과음 : On\");\n\t\t\t}\n\t\t}",
"public void play() {\n\t\tSystem.out.println(\"playing \"+title+\" by \" +artist);\n\t}",
"private void buttonPlayerAction() {\n play.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View arg0) {\n // check for already playing\n if (mp.isPlaying()) {\n mp.pause();\n // Changing button image to play button\n play.setImageResource(R.drawable.ic_play_arrow);\n } else {\n // Resume song\n mp.start();\n // Changing button image to pause button\n play.setImageResource(R.drawable.ic_pause);\n mHandler.post(mUpdateTimeTask);\n }\n\n }\n });\n }",
"public void actionPerformed(ActionEvent e) {\r\n if (_blnPlaying) {\r\n stop();\r\n } else {\r\n play();\r\n }\r\n }",
"public void play() {\n\t\tSystem.out.println(\"ting.. ting...\");\n\t}",
"public void play() \n{\n s = !s; \n if (s == false)\n {\n //pausets = millis()/4;\n controlP5.getController(\"play\").setLabel(\"Play\");\n } else if (s == true)\n {\n //origint = origint + millis()/4 - pausets;\n controlP5.getController(\"play\").setLabel(\"Pause\");\n }\n}",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tsp11.play(sound_id11 , 1.0F, 1.0F, 0, 0, 1.0F);\n\t\t\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t// show level instructions\n\t\taddPopup(instructionsPopup);\n\t\tsetAlpha(1 * 60 * 5);\n\t\tsetFadeRate(1);\n\t}",
"private void pauseAndPlay(Label textId) {\n textId.setVisible(false);\n textId.setText(\"O\");\n PauseTransition pause = new PauseTransition(Duration.seconds(1));\n pause.setOnFinished(event -> enableAll(textId));\n pause.play();\n\n }",
"@Override\r\n public boolean onPrepareActionMode(ActionMode mode, Menu menu) {\n\r\n mode.setTitle(getString(R.string.tasks_selected, selectedCount));\r\n return false;\r\n }",
"private void startButtonAction(){\n scoreboard.setStartAction(event->initControl());\n }",
"@Override\n\tpublic void play() {\n\t\tSystem.out.println(\"打击乐器奏乐~~!\");\n\t}",
"public void updateAction(Player player)\n {\n Action action = player.getLastAction();\n if (action != null) \n {\n actionLabel.setText(action.getName());\n } \n else \n {\n actionLabel.setText(\"\");\n } \n int bet = player.getCurrentBet();\n if (bet == 0) \n {\n betLabel.setText(\"\");\n } \n else \n {\n betLabel.setText(\"€ \" + bet);\n }\n }",
"@Override\r\n public void actionPerformed(final ActionEvent e)\r\n {\n if (e.getSource() == quit)\r\n {\r\n // num--;\r\n Player.exit();\r\n dispose();\r\n }\r\n if (e.getSource() == suspend)\r\n {\r\n if (suspend.getText() == \"²¥·Å\")\r\n {\r\n Player.pause();\r\n suspend.setText(\"ÔÝÍ£\");\r\n }\r\n else\r\n {\r\n Player.pause();\r\n suspend.setText(\"²¥·Å\");\r\n }\r\n }\r\n if (e.getSource() == volumeMinus)\r\n {\r\n if (volume >= 5)\r\n {\r\n volume = volume - 5;\r\n Player.setVolume(volume);\r\n }\r\n }\r\n if (e.getSource() == volumePlus)\r\n {\r\n if (volume <= 95)\r\n {\r\n volume = volume + 5;\r\n Player.setVolume(volume);\r\n }\r\n }\r\n if (e.getSource() == playAgain)\r\n {\r\n Player.setTime(0);\r\n }\r\n if (e.getSource() == accompany)\r\n {\r\n if (accompany.getText() == \"°é³ª\")\r\n {\r\n Player.setAccompany();\r\n accompany.setText(\"Ô³ª\");\r\n }\r\n else\r\n {\r\n Player.setOriginal();\r\n accompany.setText(\"°é³ª\");\r\n }\r\n }\r\n if (e.getSource() == stop)\r\n {\r\n Player.stop();\r\n }\r\n if (e.getSource() == changeSong)\r\n {\r\n final String res = Player.nextSong();\r\n if (res.compareTo(\"ERROR\") != 0)\r\n {\r\n Player.play(res);\r\n }\r\n }\r\n }",
"@Override\n\tpublic void nowPlaying() {\n\t}",
"@Override\n public boolean play(String btn)\n {\n return btn.isEmpty();\n }",
"public void setTitleAccordingToState(){\n String ts=null;\n switch(getPlayMode()){\n case LIVE:\n ts=\" LIVE\";\n break;\n case PLAYBACK:\n ts=currentFile.getName()+\" PLAYING\";\n break;\n case WAITING:\n ts=\"MotionViewer - WAITING\";\n break;\n }\n setTitle(ts);\n }",
"@Override\n public void onAction(RPObject player, RPAction action) {\n }",
"public void play() { \r\n\t System.out.printf(\"Playing Song: artist=%-20s title=%s\\n\", artist, title);\r\n\t}",
"@Override\r\n\tpublic void play() {\n\t\tSystem.out.println(\"Play Movie\");\r\n\t\t\r\n\t}",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tsp12.play(sound_id12 , 1.0F, 1.0F, 0, 0, 1.0F);\n\t\t\t}",
"@Override\n public void onClick(View arg0) {\n if (mp.isPlaying()) {\n mp.pause();\n // Changing button image to play button\n play.setImageResource(R.drawable.ic_play_arrow);\n } else {\n // Resume song\n mp.start();\n // Changing button image to pause button\n play.setImageResource(R.drawable.ic_pause);\n mHandler.post(mUpdateTimeTask);\n }\n\n }",
"public void addSAction() {\n\t\taddPairItem(labels.get(Labels.PROP_INFO_S), false);\n\t}",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tsp6.play(sound_id6, 1.0F, 1.0F, 0, 0, 1.0F);\n\t\t\t}",
"private void playButton(ActionEvent e) {\n if (paused) {\n timer.start();\n paused = false;\n } else {\n paused = true;\n timer.stop();\n }\n }",
"@Override\n\t public void onClick(View v) {\n\t \teditor.putInt(\"buttonLabel\", 4);\n\t \t\teditor.commit();\n\t \tif(powerSwitch.isChecked() && nCurrentSpeed > drivingSpeed){\n\t \t\twarning();\n\t \t}\n\t \telse\n\t \t\tlaunchContact();\n\t }",
"public void actionPerformed(ActionEvent e) {\r\n mode = InputMode.CHG_TEXT;\r\n instr.setText(\"Click one node to change the text on the node.\");\r\n }",
"@Override\n\tpublic void doAction(String action) {\n\t\tthis.action = action;\n\t\t\n\t\tthis.gameController.pause();\n\t}",
"public howToPlayButton()\r\n {\r\n GreenfootImage howToGuide = new GreenfootImage(\"how to play.png\");\r\n setImage(howToGuide);\r\n }",
"protected void PlayActionPerformed(ActionEvent e) {\n\t\tif(rdbtnNormal.isSelected())\n\t\t\tthis.difficulty=5;\n\t\telse if(rdbtnHard.isSelected())\n\t\t\tthis.difficulty=10;\n\t\telse if(rdbtnHell.isSelected())\n\t\t\tthis.difficulty=15;\n\t\telse\n\t\t\tthis.difficulty=1;\n\t\tthis.setVisible(false);\n\t\t\n\t\tTankClient tc = new TankClient();\n\t\tTankClient.difficulty=this.difficulty;\n\t\ttc.launchFrame();\n\t}",
"public void setButton() {\n pan.add(playButton);\n }",
"@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\tif(e.getButton()==MouseEvent.BUTTON1)\n\t\t\t\t{\n\t\t\t\t\tif(Conf.isbegin==1)\n\t\t\t\t\t{\n\t\t\t\t\t\tConf.isbegin=0;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tConf.isbegin=1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(e.getButton()==MouseEvent.BUTTON3)\n\t\t\t\t{\n\t\t\t\t\tif(Conf.isreplay==1)\t\n\t\t\t\t\t{\n\t\t\t\t\t\tConf.isreplay=0;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tConf.isreplay=1;\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}",
"public void play() {\n\t\t\r\n\t}",
"public void display_game_start_text() {\n\n fill(150, 100);\n rect(0, 0, displayW, displayH);\n\n textFont(myFont);\n textAlign(CENTER);\n textSize(displayH/30);\n fill(255);\n text(\"Get Ready!\", displayW/2, displayH/2);\n\n mySound.play_opening_song();\n\n isKeyInputAllowed = false;\n }",
"@Override\r\n\tprotected String play() \r\n\t{\r\n\t\treturn \"The \" + this.getClass().getSimpleName() + \" Class.\" + \"\\n\" + this.getName() + \" is up!\";\r\n//\t\tSystem.out.println( \"The \" + this.getClass().getSimpleName() + \" Class.\");\r\n//\t\tSystem.out.println( this.getName() + \" is up!\" );\t\r\n\t}",
"public void play() {\r\n\t\tSystem.out.println(\"Playing Cricket with ball and bat\");\r\n\t}",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tsp8.play(sound_id8, 1.0F, 1.0F, 0, 0, 1.0F);\n\t\t\t}",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tsp9.play(sound_id9 , 1.0F, 1.0F, 0, 0, 1.0F);\n\t\t\t}",
"void playRadio();",
"public void onClick(View v) {\n if(DataHolder.theSoundSetting == 1){\n DataHolder.theSoundSetting = 2;\n modeButton.setText(\"Vibrate Only Mode\");\n }\n else if(DataHolder.theSoundSetting == 2){\n DataHolder.theSoundSetting = 3;\n modeButton.setText(\"Normal Mode\");\n }\n else if(DataHolder.theSoundSetting == 3){\n DataHolder.theSoundSetting = 4;\n modeButton.setText(\"Silent Mode\");\n }\n else if(DataHolder.theSoundSetting == 4){\n DataHolder.theSoundSetting = 1;\n modeButton.setText(\"Sound Only Mode\");\n }\n\n }",
"public void act()\n {\n if (Greenfoot.mouseClicked(this))\n Greenfoot.playSound(\"fanfare.wav\");\n }",
"private void setPlayButtonToPause() {\n NowPlayingInformation.setPlayButtonStatus(1);\n MainActivity.displayPlayButton();\n }",
"public void playClickSound() {\n\t\tAudioPlayer audio = AudioPlayer.getInstance();\n\t\taudio.playSound(MUSIC_FOLDER, CLICK);\n\t}",
"@Override\n\tpublic void showAction(int id) {\n\t\t\n\t}",
"ActionOpen()\n {\n super(\"Open\");\n this.setShortcut(UtilGUI.createKeyStroke('O', true));\n }",
"@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tbutton_press.playSound(BUTTON_PRESS);\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tbutton_press.playSound(BUTTON_PRESS);\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tbutton_press.playSound(BUTTON_PRESS);\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tbutton_press.playSound(BUTTON_PRESS);\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tbutton_press.playSound(BUTTON_PRESS);\r\n\t\t\t}",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tsp5.play(sound_id5, 1.0F, 1.0F, 0, 0, 1.0F);\n\t\t\t}",
"public void gameInstructions(){\n System.out.println(ANSI_GREEN + \"/**\\n\" +\n \" * @controls\\n\" +\n \" * \\\"play [sum]\\\" - spends 50 credits (\\\"play 50\\\") \\n\" +\n \" * \\\"add [sum]\\\" increases wallet (\\\"add 100\\\")\\n\" +\n \" * \\\"exit\\\" ends player session \\n\" +\n \" */\");\n }",
"public void play(){\n\t\t\n\t}",
"private void transport_play() {\n timerReset();\n playing = true;\n now_playing_play_button.setForeground(getDrawable(R.drawable.ic_pause_50dp));\n }",
"private void appendAction(String action) {\n \t\tif (board.isSetupPhase())\n \t\t\treturn;\n \n \t\tif (actionLog == \"\")\n \t\t\tactionLog += \"→ \" + action;\n \t\telse\n \t\t\tactionLog += \"\\n\" + \"→ \" + action;\n \n \t}",
"public void play(MouseEvent e) {\n\t\tLogic.curComp = (JLabel) e.getComponent();\n\t\tString name = Logic.curComp.getName();\n\t\tSystem.out.println(name);\n\t\tint posx = (int) name.charAt(0) - 48;\n\t\tint posy = (int) name.charAt(1) - 48;\n\t\tint piece = Logic.arr[posx][posy]; \n\t\t\n\t\tif (moveRed(piece)) { // Checks turn && target piece is pawn or king\n\t\t\tjumping = false;\n\t\t\tprepare(posx, posy, piece, null);\n\t\t} else if (moveBlack(piece)) { // Checks turn && target piece is pawn or king\n\t\t\tjumping = false;\n\t\t\tprepare(posx, posy, piece, \"black\");\n\t\t} else if (validate(posx, posy, Playboard.red, Playboard.rKing , Playboard.redSanta, Playboard.redSKing) && finishRedMoves(piece)){ // Checks that previous component was pawn or king and that it's a legal move\n\t\t\tapplyMove(name, posx, posy, piece);\n\t\t\tnext();\n\t\t} else if (validate(posx, posy, Playboard.black, Playboard.bKing, Playboard.blackSanta, Playboard.blackSKing) && finishBlackMoves(piece)){ // Checks that previous component was pawn or king and that it's a legal move\n\t\t\tapplyMove(name, posx, posy, piece);\n\t\t\tnext();\n\t\t} else {\n\t\t\tSystem.out.println(\"Invalid move\");\n\t\t}\n\t}",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tsp2.play(sound_id2, 1.0F, 1.0F, 0, 0, 1.0F);\n\t\t\t}",
"@Override\n public void onClick(View view) {\n handlePlaybackButtonClick();\n }",
"public void act() \n {\n if (Greenfoot.mouseClicked(this))\n {\n Peter.lb=2; \n Greenfoot.playSound(\"click.mp3\");\n Greenfoot.setWorld(new StartEngleza());\n };\n }",
"@Override\n public void onCompletion(MediaPlayer mp) {\n buttonPlayPause.setImageResource(R.mipmap.play);\n }",
"String getActionName();",
"@Override\n public boolean onPrepareActionMode(final ActionMode mode, Menu menu) {\n isEnable = true;\n //create method\n clickItem(holder);\n //set observer on to get text method\n mainViewModel.getSelectedLiveData().observe((LifecycleOwner) activity,\n new Observer<String>() {\n @Override\n public void onChanged(String s) {\n //when text change\n //set text on action mode title\n mode.setTitle(String.format(\"%s %s %s\",context.getResources()\n .getString(R.string.selected),s ,\n context.getResources().getString(R.string.item) ));\n }\n });\n return true;\n }",
"@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tplayer.start();\r\n\t\t\t}",
"public void start(){\n\t\tif (host.getGameSettings().isMusicOn()) {\r\n\t\t\tspr_btnMute.setFrame(0);\r\n\t\t}else{\r\n\t\t\tspr_btnMute.setFrame(1);\r\n\t\t}\r\n\t}",
"@Override\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\tfinal ImageView imgvw = (ImageView) v;\n\t\t\t\t\t\tif (imgvw.getTag(R.string.PlayPauseKey).equals(\n\t\t\t\t\t\t\t\t\"Stopped\")) {\n\t\t\t\t\t\t\timgvw.setTag(R.string.PlayPauseKey, \"Playing\");\n\t\t\t\t\t\t\timgvw.setImageResource(View.INVISIBLE);\n\t\t\t\t\t\t\t((VideoView) imgvw.getTag(R.string.PlayPauseVideo))\n\t\t\t\t\t\t\t\t\t.start();\n\t\t\t\t\t\t} else if (imgvw.getTag(R.string.PlayPauseKey).equals(\n\t\t\t\t\t\t\t\t\"Playing\")) {\n\t\t\t\t\t\t\timgvw.setTag(R.string.PlayPauseKey, \"Stopped\");\n\t\t\t\t\t\t\timgvw.setImageResource(R.drawable.ic_menu_play_clip);\n\t\t\t\t\t\t\t// seekRun.player.pause();\n\t\t\t\t\t\t\t((VideoView) imgvw.getTag(R.string.PlayPauseVideo))\n\t\t\t\t\t\t\t\t\t.pause();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t((VideoView) imgvw.getTag(R.string.PlayPauseVideo))\n\t\t\t\t\t\t\t\t.setOnCompletionListener(new OnCompletionListener() {\n\n\t\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\t\tpublic void onCompletion(MediaPlayer mp) {\n\t\t\t\t\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\t\t\t\t\timgvw.setImageResource(R.drawable.ic_menu_play_clip);\n\t\t\t\t\t\t\t\t\t\timgvw.setTag(R.string.PlayPauseKey,\n\t\t\t\t\t\t\t\t\t\t\t\t\"Stopped\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t}",
"public void pressMovieButton() {\n System.out.println(\"Home: You must pick an app to show movies.\\n\");\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tsp7.play(sound_id7, 1.0F, 1.0F, 0, 0, 1.0F);\n\t\t\t}",
"public void onAction(Player player) {\n }",
"public void actionPerformed(ActionEvent e) {\n\t\t\t\t\t\t// TODO Think about how to use the key in robots hashtable\n\t \t \tSystem.out.println(x.getName() + \" \" + Robot.getRobotInUse());\n\t \t \tRobot.setRobotInUse(x.getRobotKey());\n\t \t \tSystem.out.println(x.getName() + \" \" + Robot.getRobotInUse());\n\t \t \tjl.setText(x.getName());\n\t \t \t\n\t \t \tvi.showVideo(x);\n\t \t \t\n\t \t \t\n\t\t\t\t\t}"
] | [
"0.7463089",
"0.67957807",
"0.672024",
"0.6699686",
"0.6597586",
"0.63697314",
"0.6338634",
"0.62653685",
"0.6250427",
"0.61781585",
"0.61440676",
"0.6114482",
"0.6077879",
"0.6064084",
"0.6036411",
"0.60276604",
"0.6016883",
"0.60013396",
"0.5999286",
"0.5983485",
"0.5958105",
"0.5924834",
"0.59245574",
"0.59127796",
"0.590903",
"0.59056187",
"0.5901978",
"0.5900785",
"0.5900785",
"0.5851311",
"0.5841842",
"0.58402",
"0.5813531",
"0.5806466",
"0.5805784",
"0.58007187",
"0.5797549",
"0.5796334",
"0.5794758",
"0.57860416",
"0.5763432",
"0.5757383",
"0.5756563",
"0.5752982",
"0.5746763",
"0.57466155",
"0.5741219",
"0.5733159",
"0.57281065",
"0.5722707",
"0.5718125",
"0.5718053",
"0.57111216",
"0.5709304",
"0.56990284",
"0.56958944",
"0.56906086",
"0.5683974",
"0.5681886",
"0.5676478",
"0.5673145",
"0.56703067",
"0.56687635",
"0.56500053",
"0.5646715",
"0.56460327",
"0.5644683",
"0.56435144",
"0.5643411",
"0.5635568",
"0.5625273",
"0.56157565",
"0.5614991",
"0.5611696",
"0.5610328",
"0.5600649",
"0.55990195",
"0.5598569",
"0.5598569",
"0.5598569",
"0.5598569",
"0.5598569",
"0.5596266",
"0.5589146",
"0.5584425",
"0.55806977",
"0.5580649",
"0.5579381",
"0.55791",
"0.5568706",
"0.55653906",
"0.55557245",
"0.5553543",
"0.5548389",
"0.5545536",
"0.55397815",
"0.5538986",
"0.55334157",
"0.55277175",
"0.5520454",
"0.5520014"
] | 0.0 | -1 |
initialize the play mode view | private void initPlayModeView() {
playMode = new Label("PLAY");
playMode.setPrefSize(200,100);
playMode.setFont(Font.font(null, FontWeight.BOLD, 30));
playMode.setTextFill(Color.BLUE);
playMode.setEffect(getDropShadow());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void initPlayMode() {\n initPlayModeView();\n initPlayModeController();\n }",
"private void initView() {\n\t\t//buttonPlayPause = (ImageButton)getView().findViewById(R.id.ButtonTestPlayPause);\n\t\t//buttonPlayPause.setOnClickListener(this);\n\t\t\n\t\t//seekBarProgress = (SeekBar)getView().findViewById(R.id.SeekBarTestPlay);\t\n\t\t//seekBarProgress.setMax(99); // It means 100% .0-99\n\t\t//seekBarProgress.setOnTouchListener(this);\n\t\t//editTextSongURL = (EditText)findViewById(R.id.EditTextSongURL);\n\t\t//editTextSongURL.setText(R.string.testsong_20_sec);\n\t\t\n\t\t//mediaPlayer = new MediaPlayer();\n\t\t//mediaPlayer.setOnBufferingUpdateListener(this);\n\t\t//mediaPlayer.setOnCompletionListener(this);\n\t}",
"@Override\n protected void initView() {\n view.setVideoThumbnail(model.getThumbnail());\n\n if (isInFocus) {\n playOrPauseVideoIfMomentIsInFocus();\n }\n\n view.setMomentTitle(model.getTitle());\n view.setCounterTimeText(\"\" + Math.round((model.getEndTimeMs() - model.getStartTimeMs())/ TimeUtil.MS_IN_SECOND));\n\n view.setState(isInFocus);\n }",
"private void initPlayModeController() {\n playMode.setOnMouseClicked(event -> {\n MasterMindMain mm = null;\n try { mm = new MasterMindMain(); }\n catch (Exception e) { e.printStackTrace(); }\n mm.start(SimulatorMain.stage);\n });\n playMode.setOnMouseEntered(event -> { playMode.setGraphic(new Circle(5)); });\n playMode.setOnMouseExited(event -> { playMode.setGraphic(null); });\n }",
"private void initializeUI() {\n MedUtils.displayMedInfo(coverArt, playBinding.thumbIv, playBinding.titleTv,\n playBinding.subtitleTv, selectedMed);\n\n playBinding.playPauseBt.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n switch (MediaPlayerService.getState()) {\n case Constants.STATE_PLAY:\n mediaPlayerService.pauseAction();\n break;\n case Constants.STATE_PAUSE:\n mediaPlayerService.playAction();\n break;\n case Constants.STATE_NOT_INIT:\n startMediaPlayerService();\n break;\n }\n }\n });\n\n playBinding.stopBt.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n mediaPlayerService.stopAction();\n }\n });\n }",
"private void initializeView() {\n @SuppressLint(\"ResourceType\") InputStream is = getContext().getResources().openRawResource(this.gifId);\n mMovie = Movie.decodeStream(is);\n }",
"@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n setContentView(R.layout.activity_live);\n\n initView();\n initPlayer();\n\n }",
"@Override\n public void initialize() {\n //talonOrchestra.playMusic();\n }",
"public GameView() {\n initComponents();\n gameView(30, 30);\n }",
"public void initPlayerStateUI() {\n if (!playableMediaItem.getBitrate().isEmpty()) {\n tvTrackInfo.setText(playableMediaItem.getBitrate() + getString(R.string.kbps));\n } else {\n tvTrackInfo.setText(\"\");\n }\n\n if (universalPlayer.isPrepaired) {\n ((IToolbarHolder) getActivity()).getToolbar().setTitle(R.string.now_paying);\n if (btnPlay.isPlay() && universalPlayer.isPlaying()) {\n btnPlay.toggle();\n } else if (!btnPlay.isPlay() && !universalPlayer.isPlaying()) {\n btnPlay.toggle();\n }\n\n } else {\n ((IToolbarHolder) getActivity()).getToolbar().setTitle(R.string.buffering);\n if (!btnPlay.isPlay()) {\n btnPlay.toggle();\n }\n }\n }",
"private void initView() {\n\t\tmSeekButton = (Button) findViewById(R.id.seekButton);\r\n\t\tmViewPager = (ViewPager) findViewById(R.id.viewPager);\r\n\t}",
"private void initializeView() {\n InputStream is1 = getContext().getResources().openRawResource(+R.drawable.congratulations);\n mMovie1 = Movie.decodeStream(is1);\n InputStream is2 = getContext().getResources().openRawResource(+R.drawable.giffy3);\n mMovie2 = Movie.decodeStream(is2);\n InputStream is3 = getContext().getResources().openRawResource(+R.drawable.giffy4);\n mMovie3 = Movie.decodeStream(is1);\n InputStream is4 = getContext().getResources().openRawResource(+R.drawable.giphy1);\n mMovie4 = Movie.decodeStream(is4);\n }",
"@Override\r\n\tpublic void initView() {\n\t\tsuper.initView();\r\n\t\tdialog = new BufferDialog(this);\r\n\t\tswitchAntiLost = (Switch) findViewById(R.id.switch_antilost);\r\n\t}",
"public PlayerView2() {\n initComponents();\n }",
"void initView();",
"public abstract void initMode();",
"private void initView() {\n\n }",
"private void initialize() {\n handler = new Handler();\n recyclerView();\n swapRefresh.setColorSchemeResources(R.color.colorAccent);\n swapRefresh.setOnRefreshListener(this);\n btnPlayTop.setOnClickListener(btnClickListener);\n btnClose.setOnClickListener(btnClickListener);\n\n // bottom sheet {media player}\n bottomSheetBehavior = BottomSheetBehavior.from(rlBottomsheet);\n bottomSheetBehavior.setState(3);// 3: full bottom sheet\n bottomSheetBehavior.setPeekHeight(100);\n bottomSheetBehavior.setHideable(false);\n\n mediaPlayer = new MediaPlayer();\n mediaPlayer.setOnCompletionListener(this);\n\n Tools.setSystemBarColor(this, R.color.colorPrimary);\n\n actionModeCallback = new ActionModeCallback();\n }",
"private void initView() {\n TIMManager.getInstance().addMessageListener(this);\n initAdapter();\n initRefresh();\n }",
"private void initview() {\n\t\tbtn_connect = (Button) findViewById(R.id.btn_connect);\n\t\tbtn_disconnect = (Button) findViewById(R.id.btn_disconnect);\n\t\tbtn_send = (Button) findViewById(R.id.pinpad_controller_btn_send);\n\t\tbtn_recv = (Button) findViewById(R.id.pinpad_controller_btn_recv);\n\t\tbtn_clear = (Button) findViewById(R.id.btn_clear);\n\t\tbtn_random = (Button) findViewById(R.id.btn_random);\n\t\tbtn_connect.setOnClickListener(this);\n\t\tbtn_recv.setOnClickListener(this);\n\t\tbtn_send.setOnClickListener(this);\n\t\tbtn_disconnect.setOnClickListener(this);\n\t\tbtn_clear.setOnClickListener(this);\n\t\tbtn_random.setOnClickListener(this);\n\t\ttv_read = (TextView) findViewById(R.id.pinpad_controller_tv_recv);\n\t\tet_send = (EditText) findViewById(R.id.pinpad_controller_et_send);\n\t\ttv_version = (TextView) findViewById(R.id.pinpad_controller_tv_version);\n\t\ttv_version.setText(\"\");\n\t\tsetViewEnabledFalse();\n\t}",
"@FXML\n public void initialize() throws Exception {\n trigger = true; // Indicate the screen welcome had been opened once\n season = GameEngine.getInstance().getSeason();\n\n Team playerTeam = season.getPlayerControlledTeam();\n teamName.setText(playerTeam.getName());\n engineName.setText(playerTeam.getEngine().getName());\n firstDriverName.setText(playerTeam.getFirstDriver().getName());\n secondDriverName.setText(playerTeam.getSecondDriver().getName());\n strategistName.setText(playerTeam.getStrategist().getName());\n aerodynamicistName.setText(playerTeam.getAerodynamicist().getName());\n mechanicName.setText(playerTeam.getMechanic().getName());\n nextCircuit.setText(season.getCurrentRound().getTrackName());\n currentBudget.setText(playerTeam.getBudgetString());\n\n int roundNum = season.getRoundInt() + 1;\n round.setText(\"Round \" + roundNum);\n\n Media media = new Media(getClass().getResource(\"/media/video/australia.mp4\").toURI().toString());\n MediaPlayer mediaPlayer = new MediaPlayer(media);\n mediaPlayer.setMute(true);\n mediaPlayer.setCycleCount(MediaPlayer.INDEFINITE);\n mediaPlayer.play();\n\n mediaView.setMediaPlayer(mediaPlayer);\n mediaView.setFitHeight(1080);\n mediaView.setFitWidth(1920);\n\n }",
"protected abstract void initView();",
"private void viewInit() {\n }",
"public Controller() {\n\t\tplaylist = new ArrayList<>();\n\t\tshowingMore = false;\n\t\tstage = Main.getStage();\n\t}",
"private void initView() {\r\n\t\tviewerGraz.refresh(true);\r\n\t\tviewerGraz.refresh(true);\r\n\t\tviewerKapfenberg.refresh(true);\r\n\t\tviewerLeoben.refresh(true);\r\n\t\tviewerMariazell.refresh(true);\r\n\t\tviewerWien.refresh(true);\r\n\t}",
"@Override\r\n\tpublic void initView() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void initView() {\n\t\t\r\n\t}",
"private void initializeViews() {\n VideoView mainVideoView = (VideoView) findViewById(R.id.mainPageVideoView);\n mainVideoView.setVideoURI(Uri.parse(\"android.resource://\" + getPackageName() + \"/\" + R.raw.documentariesandyou));\n // mainVideoView.setZOrderOnTop(true);\n mainVideoView.start();\n\n // set the font.\n Typeface type = Typeface.createFromAsset(getAssets(), \"fonts/CostaRica.ttf\");\n TextView nameTitleScreen = (TextView) findViewById(R.id.nameTitleScreen);\n TextView oneTextView = (TextView) findViewById(R.id.oneTextView);\n TextView twoTextView = (TextView) findViewById(R.id.twoTextView);\n TextView optionsTextView = (TextView) findViewById(R.id.optionsTextView);\n\n nameTitleScreen.setOnClickListener(titleHandler);\n oneTextView.setOnClickListener(oneHandler);\n twoTextView.setOnClickListener(twoHandler);\n optionsTextView.setOnClickListener(optionsHandler);\n\n nameTitleScreen.setTypeface(type);\n oneTextView.setTypeface(type);\n twoTextView.setTypeface(type);\n optionsTextView.setTypeface(type);\n }",
"public abstract void initView();",
"@Override\r\n\tprotected void initView() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initView() {\n\t\t\r\n\t}",
"private void init() {\n chalkTypeFace = Typeface.createFromAsset(getAssets(), \"fonts/kg.ttf\");\n\n play = (Button) findViewById(R.id.main_play);\n play.setTypeface(chalkTypeFace);\n play.setOnClickListener(new View.OnClickListener() {\n public void onClick(View v) {\n gotoPlay();\n }\n });\n\n preferences = (Button) findViewById(R.id.main_options);\n preferences.setTypeface(chalkTypeFace);\n preferences.setOnClickListener(new View.OnClickListener() {\n public void onClick(View v) {\n gotoOptions();\n }\n });\n\n profile = (Button) findViewById(R.id.main_profile);\n profile.setTypeface(chalkTypeFace);\n profile.setOnClickListener(new View.OnClickListener() {\n public void onClick(View v) {\n gotoUserProfile();\n }\n });\n\n info = (ImageButton) findViewById(R.id.main_info);\n info.setOnClickListener(new View.OnClickListener() {\n public void onClick(View v) {\n gotoInfo();\n }\n });\n }",
"public void initializePlayer() {\n radioPlayer = new MediaPlayer();\n\n isPaused = true;\n\n radioPlayer.setWakeMode(owner.getApplicationContext(), PowerManager.PARTIAL_WAKE_LOCK);\n radioPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);\n radioPlayer.setOnErrorListener(this);\n radioPlayer.setOnCompletionListener(this);\n radioPlayer.setOnInfoListener(this);\n }",
"@Override\n\tprotected void initView() {\n\t\tiv_content = (ImageView) findViewById(R.id.music_content);\n\t\tiv_music = (ImageView) findViewById(R.id.music_me_iv);\n\t\tiv_queen = (ImageView) findViewById(R.id.music_queen_iv);\n\t\ttv_music = (TextView) findViewById(R.id.music_me_tv);\n\t\ttv_queen = (TextView) findViewById(R.id.music_queen_tv);\n\t\tiv_music.setOnClickListener(this);\n\t\tiv_queen.setOnClickListener(this);\n\t\t\n\t\tbitmap=DisplayUtil.readBitMap(getApplicationContext(), R.drawable.music_part1);\n\t\tiv_content.setImageBitmap(bitmap);\n\n\t}",
"private void initView() {\n mRetrofit = new Retrofit.Builder()\n .baseUrl(Challenge1Activity.MY_BASE_URL)\n .addConverterFactory(GsonConverterFactory.create())\n .build();\n\n mTextViewDisplayTopRated = findViewById(R.id.text_view_display_toprated_movies);\n\n mTextViewPrev = findViewById(R.id.text_view_prev);\n mTextViewCurrentAndMaxPage = findViewById(R.id.text_view_current_and_max_page);\n mTextViewNext = findViewById(R.id.text_view_next);\n }",
"private void initiatePlayer() {\n ExoPlayerVideoHandler.getInstance().initiateLoaderController(\n this,\n loadingImage,\n exoPlayerView,\n ExoPlayerVideoHandler.getInstance().getVideoResolution()!=null?ExoPlayerVideoHandler.getInstance().getVideoResolution():getString(R.string.default_resolution),\n this\n );\n ExoPlayerVideoHandler.getInstance().playVideo();\n content = ExoPlayerVideoHandler.getInstance().getCurrentVideoInfo();\n //ExoPlayerVideoHandler.getInstance().goToForeground();\n setSpinnerValue();\n }",
"private void initializePresentation() {\r\n viewRankingAttemptFX = new ViewRankingAttemptFX(this);\r\n viewRankingPlayerFX = new ViewRankingPlayerFX(this);\r\n viewLoginFX = new ViewLoginFX(this);\r\n viewRegisterFX = new ViewRegisterFX(this);\r\n viewProblemListFX = new ViewProblemListFX(this);\r\n viewLoginFX = new ViewLoginFX(this);\r\n viewRegisterFX = new ViewRegisterFX(this);\r\n viewMenuFX = new ViewMenuFX(this);\r\n viewSettingsFX = new ViewSettingsFX(this);\r\n viewGenerateFX = new ViewGenerateFX(this);\r\n viewAttemptFX = new ViewAttemptFX(this);\r\n viewAttemptListFX = new ViewAttemptListFX(this);\r\n\r\n viewsFX.add(viewLoginFX);\r\n viewsFX.add(viewRankingAttemptFX);\r\n viewsFX.add(viewRankingPlayerFX);\r\n viewsFX.add(viewRegisterFX);\r\n viewsFX.add(viewProblemListFX);\r\n viewsFX.add(viewMenuFX);\r\n viewsFX.add(viewSettingsFX);\r\n viewsFX.add(viewGenerateFX);\r\n viewsFX.add(viewAttemptFX);\r\n viewsFX.add(viewAttemptListFX);\r\n\r\n }",
"protected abstract void initializeView();",
"public void initView(){}",
"private void mediaSessionInitializer() {\n mMediaSessionCompat = new MediaSessionCompat(getContext(), TAG);\n\n // Set flags for external clients in a car and media buttons\n mMediaSessionCompat.setFlags(MediaSessionCompat.FLAG_HANDLES_MEDIA_BUTTONS\n | MediaSessionCompat.FLAG_HANDLES_TRANSPORT_CONTROLS);\n\n // Don't let external client restart the player when not in UI\n mMediaSessionCompat.setMediaButtonReceiver(null);\n\n // Set available actions to support outside UI\n mStateBuilder = new PlaybackStateCompat.Builder()\n .setActions(PlaybackStateCompat.ACTION_PLAY |\n PlaybackStateCompat.ACTION_PLAY_PAUSE |\n PlaybackStateCompat.ACTION_SKIP_TO_PREVIOUS |\n PlaybackStateCompat.ACTION_PLAY_PAUSE);\n\n // Set the playback state for compat\n mMediaSessionCompat.setPlaybackState(mStateBuilder.build());\n\n // Handle callbacks from media controller\n mMediaSessionCompat.setCallback(new SessionCallbacks());\n\n // Start the Media Session since the activity is active\n mMediaSessionCompat.setActive(true);\n }",
"public LetsPlayGUI() {\n super(\"Let's Play!\");\n initComponents();\n setCardLayouts();\n showSplashPanel();\n }",
"public abstract void init(int myIndex, GameView view);",
"@Override\r\n\tprotected void initViews() {\n\t\t\r\n\t}",
"private void init() {\n initView();\n setListener();\n }",
"private void initSimulateModeView() {\n simulateMode = new Label(\"SIMULATE\");\n simulateMode.setPrefSize(200, 100);\n simulateMode.setFont(Font.font(null, FontWeight.BOLD, 30));\n simulateMode.setTextFill(Color.ORANGE);\n simulateMode.setEffect(getDropShadow());\n }",
"private void initView(Context context) {\n\t\tthis.context = context;\t\t\n\t\tCreateTimer();\n\t\t//nameButton = getResources().getString(R.string.lyric_0);\n\t\tdrawable = getResources().getDrawable(R.drawable.pbstatus_next_ipad);\n\t\tdrawablePlaylist= getResources().getDrawable(\n\t\t\t\tR.drawable.touch_tab_playlist_hover_144x144);\n\t\tdrawableStatusPlay = getResources().getDrawable(\n\t\t\t\tR.drawable.touch_pbstatus_play_48x48);\n\t\tdrawableStatusPause = getResources().getDrawable(\n\t\t\t\tR.drawable.touch_pbstatus_pause_48x48);\n\t\t\n\t\tdrawablePlaylist_Off = getResources().getDrawable(\n\t\t\t\tR.drawable.touch_tab_playlist_inactive_65x65);\n\t\t\n\t\tzlightdrawable = getResources().getDrawable(R.drawable.zlight_pbstatus_next);\n\t\tzlightdrawablePlaylist= getResources().getDrawable(\n\t\t\t\tR.drawable.zlight_tab_playlist_inactive_144x144);\n\t\tzlightdrawableStatusPlay = getResources().getDrawable(\n\t\t\t\tR.drawable.zlight_pbstatus_play_48x48);\n\t\tzlightdrawableStatusPause = getResources().getDrawable(\n\t\t\t\tR.drawable.zlight_pbstatus_pause_48x48);\n\t\t\n\t\tzlight_drawablePlaylist_Off = getResources().getDrawable(\n\t\t\t\tR.drawable.zlight_tab_playlist_inactive_144x144);\n\t\t\n\t\tdrawStatusNext = getResources().getDrawable(\n\t\t\t\tR.drawable.pbstatus_next_ipad);\n\t\tdrawMidi = getResources().getDrawable(\n\t\t\t\tR.drawable.tomau_midi);\n\t\tdrawKTVMid = getResources().getDrawable(R.drawable.tomau_ktv_midi);\n\t\tdrawKTVVid = getResources().getDrawable(R.drawable.tomau_ktv_video);\n\t\t\t\t\t\n\t\tzlightdrawStatusNext = getResources().getDrawable(\n\t\t\t\tR.drawable.zlight_pbstatus_next);\n\t\tzlightdrawMidi = getResources().getDrawable(\n\t\t\t\tR.drawable.zlight_image_midi_50x35);\n\t\tzlightdrawKTV = getResources().getDrawable(\n\t\t\t\tR.drawable.zlight_ktv_50x30);\n\t\t\n\t\tzlight_drawablePlaylist_Off = getResources().getDrawable(\n\t\t\t\tR.drawable.zlight_tab_playlist_inactive_144x144);\n\t\t\n\t\tdrawDevice = getResources().getDrawable(R.drawable.touch_daumay_chuaketnoi_56x50);\n\t\t\n\t\tdrawWifi0 = getResources().getDrawable(R.drawable.wifi_0);\n\t\tdrawWifi1 = getResources().getDrawable(R.drawable.wifi_1);\n\t\tdrawWifi2 = getResources().getDrawable(R.drawable.wifi_2);\n\t\tdrawWifi3 = getResources().getDrawable(R.drawable.wifi_3);\n\t\tdrawWifi4 = getResources().getDrawable(R.drawable.wifi_4);\n\t\t\n\t\tdrawWifi0_hiw = getResources().getDrawable(R.drawable.ktvwifi_0);\n\t\tdrawWifi1_hiw = getResources().getDrawable(R.drawable.ktvwifi_1);\n\t\tdrawWifi2_hiw = getResources().getDrawable(R.drawable.ktvwifi_2);\n\t\tdrawWifi3_hiw = getResources().getDrawable(R.drawable.ktvwifi_3);\n\t\tdrawWifi4_hiw = getResources().getDrawable(R.drawable.ktvwifi_4);\n\t\t\n\t\tdrawWifi0_smartk = getResources().getDrawable(R.drawable.wifi_9108_0);\n\t\tdrawWifi1_smartk = getResources().getDrawable(R.drawable.wifi_9108_1);\n\t\tdrawWifi2_smartk = getResources().getDrawable(R.drawable.wifi_9108_2);\n\t\tdrawWifi3_smartk = getResources().getDrawable(R.drawable.wifi_9108_3);\n\t\tdrawWifi4_smartk = getResources().getDrawable(R.drawable.wifi_9108_4);\t\n\t\t\t\t\n\t\tzlight_drawWifi0 = getResources().getDrawable(R.drawable.zlight_wifi_0);\n\t\tzlight_drawWifi1 = getResources().getDrawable(R.drawable.zlight_wifi_1);\n\t\tzlight_drawWifi2 = getResources().getDrawable(R.drawable.zlight_wifi_2);\n\t\tzlight_drawWifi3 = getResources().getDrawable(R.drawable.zlight_wifi_3);\n\t\tzlight_drawWifi4 = getResources().getDrawable(R.drawable.zlight_wifi_4);\n\t\t\n\t\tzlight_drawWifi0_hiw = getResources().getDrawable(R.drawable.zlight_ktvwifi_0);\n\t\tzlight_drawWifi1_hiw = getResources().getDrawable(R.drawable.zlight_ktvwifi_1);\n\t\tzlight_drawWifi2_hiw = getResources().getDrawable(R.drawable.zlight_ktvwifi_2);\n\t\tzlight_drawWifi3_hiw = getResources().getDrawable(R.drawable.zlight_ktvwifi_3);\n\t\tzlight_drawWifi4_hiw = getResources().getDrawable(R.drawable.zlight_ktvwifi_4);\n\t\t\n\t\tzlight_drawWifi0_smartk = getResources().getDrawable(R.drawable.zlight_wifi_9108_0);\n\t\tzlight_drawWifi1_smartk = getResources().getDrawable(R.drawable.zlight_wifi_9108_1);\n\t\tzlight_drawWifi2_smartk = getResources().getDrawable(R.drawable.zlight_wifi_9108_2);\n\t\tzlight_drawWifi3_smartk = getResources().getDrawable(R.drawable.zlight_wifi_9108_3);\n\t\tzlight_drawWifi4_smartk = getResources().getDrawable(R.drawable.zlight_wifi_9108_4);\n\t\t\t\n\t}",
"@Override\n\tpublic void initView() {\n\t\t\n\t}",
"public GameController() {\r\n\t\tsuper();\r\n\t\tthis.model = Main.getModel();\r\n\t\tthis.player = this.model.getPlayer();\r\n\t\tthis.timeline = this.model.getIndefiniteTimeline();\r\n\t}",
"public void init(){\n\t\t//Makes the view\n\t\tsetUpView();\n\n\t\t//Make the controller. Links the action listeners to the view\n\t\tnew Controller(this);\n\t\t\n\t\t//Initilize the array list\n\t\tgameInput = new ArrayList<Integer>();\n\t\tuserInput = new ArrayList<Integer>();\n\t\thighScore = new HighScoreArrayList();\n\t}",
"public void initView() {\n ArrayAdapter<String> arrayAdapter=new ArrayAdapter<String>(getView().getContext(),android.R.layout.simple_list_item_1,tracks);\n list.setAdapter(arrayAdapter);\n }",
"public void initView() {\n\t\t view.initView(model);\t \n\t }",
"private void initView(){\n\t\tinitSize();\n\t\tinitText();\n\t\tinitBackground();\n\t\tthis.setOnClickListener(this);\n\t\tthis.setOnLongClickListener(this);\n\t}",
"public void onPlayGame(View view)\n {\n boolean newMode = !tttGame.getAIMode();\n\n tttGame = new TicTacToeGameState(newMode);\n resetBoard();\n setDescriptionPlay();\n\n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.player_simple_layout);\n completePlayerSetup(asked);\n }",
"private void initializeVariable() {\n\n\t\tlearn = (Button) findViewById(R.id.learnButton);\n\t\tlearn.setOnClickListener(this);\n\t\tplay = (Button) findViewById(R.id.playButton);\n\t\tplay.setOnClickListener(this);\n\t\tmode = (Button) findViewById(R.id.b_mode);\n\t\tmode.setOnClickListener(this);\n\t\tmode.setText(Global.currentMode + \" MODE\");\n\t\tclassID_SD = \"com.example.northamericanwildlifesounds.SOUNDDISPLAY\";\n\t\tsetUpAnimalData();\n\t}",
"@Override\n\tprotected void initView() {\n\t\t\n\t}",
"@Override\n\tprotected void initView() {\n\t\t\n\t}",
"@Override\r\n\tpublic void initViews() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void initViews() {\n\t\t\r\n\t}",
"public StreamRecorderDisplay() {\n initialize();\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 }",
"private void initVideoView(Context context) {\n IjkMediaPlayer.loadLibrariesOnce(null);\n IjkMediaPlayer.native_profileBegin(\"libijkplayer.so\");\n\n mAppContext = context.getApplicationContext();\n mActivity = (Activity) context;\n if (mActivity != null) {\n this.mBrightness = mActivity.getWindow().getAttributes().screenBrightness;\n }\n this.mAudioManager = (AudioManager) mAppContext.getSystemService(Context.AUDIO_SERVICE);\n this.mVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);\n if (mMediaController != null) {\n mMediaController.setVideoView(this);\n }\n screenWidthPixels = getScreenWidth(context);\n\n setRender(mCurrentRender);\n\n mVideoWidth = 0;\n mVideoHeight = 0;\n // REMOVED: getHolder().addCallback(mSHCallback);\n // REMOVED: getHolder().setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);\n setFocusable(true);\n setFocusableInTouchMode(true);\n requestFocus();\n // REMOVED: mPendingSubtitleTracks = new Vector<Pair<InputStream, MediaFormat>>();\n setCurrentState(STATE_IDLE);\n mTargetState = STATE_IDLE;\n\n subtitleDisplay = new TextView(context);\n subtitleDisplay.setTextSize(16);\n subtitleDisplay.setShadowLayer(3, 5, 5, getResources().getColor(R.color.black));\n subtitleDisplay.setGravity(Gravity.CENTER);\n subtitleDisplay.setTextColor(getResources().getColor(R.color.white));\n// subtitleDisplay.setBackgroundResource(R.color.red);\n LayoutParams layoutParams_txt = new LayoutParams(\n LayoutParams.MATCH_PARENT,\n LayoutParams.WRAP_CONTENT,\n Gravity.BOTTOM);\n addView(subtitleDisplay, layoutParams_txt);\n }",
"@Override\n\tpublic void setContentView() {\n\t\tsetContentView(R.layout.mode_screen);\n\t\ttitle = (TextView) findViewById(R.id.title);\n\t\tmoShiTxt = (TextView) findViewById(R.id.moShiTxt);\n\t\tdangWeiSeekBar = (SeekBar) findViewById(R.id.moShiSeekBar);\n\t}",
"private void initView() {\n\t\tsetContentView(R.layout.activity_main);\n\t\tlv_showdatas = (ListView) findViewById(R.id.lv_datas);\n\t\t\n\t\tmyAdapter = new MyAdapter();\n\t\tlv_showdatas.setAdapter(myAdapter);\n\t\tbt_speak = (Button) findViewById(R.id.bt_speak);\n\t}",
"@Override\n\tpublic void InitView() {\n\t\t\n\t}",
"private void initViews() {\n\n\t}",
"@Override\n public void onPrepared(OrionVideoView view) {\n Toast.makeText(DirectorsCut.this, \"Initial orientation\",\n Toast.LENGTH_SHORT).show();\n setYaw(180.0f);\n\n // Start playback when the player has initialized itself and buffered\n // enough video frames.\n mOrionVideoView.start();\n }",
"@Override\n public void initView() {\n }",
"private void setController() {\n if (controller == null) {\n controller = new MusicController(this);\n }\n controller.setPrevNextListeners(\n new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n playNext();\n }\n }, new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n playPrev();\n }\n }\n );\n\n controller.setMediaPlayer(this);\n controller.setAnchorView(findViewById(R.id.song_list));\n controller.setEnabled(true);\n }",
"void setPlayerView(View v);",
"private void initialiseViews() {\n\n layoutGameOver = findViewById(R.id.layout_gameover);\n layoutGame = findViewById(R.id.layout_game);\n\n layoutGame.setVisibility(View.VISIBLE);\n layoutGameOver.setVisibility(View.GONE);\n\n tvHighScore = findViewById(R.id.tv_highscore);\n tvCurrentScore = findViewById(R.id.tv_current_score);\n tvGameoverScore = findViewById(R.id.tv_gameover_score);\n\n\n gvBoard = findViewById(R.id.gl_board);\n btNewGame =findViewById(R.id.bt_newgame);\n btRestart =findViewById(R.id.bt_restart);\n\n btNewGame.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n startNewGame();\n }\n });\n btRestart.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n startNewGame();\n }\n });\n }",
"public abstract void initViews();",
"private void initUI() {\n mLocalContainer = findViewById(R.id.local_video_view_container);\n mRemoteContainer = findViewById(R.id.remote_video_view_container);\n\n mCallBtn = findViewById(R.id.btn_call);\n mMuteBtn = findViewById(R.id.btn_mute);\n mSwitchCameraBtn = findViewById(R.id.btn_switch_camera);\n }",
"private void initViews() {\n\n }",
"@Override\n\tprotected void initView()\n\t{\n\n\t}",
"@FXML\n private void initialize() {\n\n setUpPlayerTable();\n }",
"@Override\n public void initialize(URL location, ResourceBundle resources) {\n reinforceViewInit(Main.curRoundPlayerIndex);\n }",
"private void initializePlayer() {\n mBufferingTextView.setVisibility(VideoView.VISIBLE);\n\n // Buffer and decode the video sample.\n Uri videoUri = getMedia(VIDEO_URL);\n mVideoView.setVideoURI(videoUri);\n\n // Listener for onPrepared() event (runs after the media is prepared).\n mVideoView.setOnPreparedListener(\n new MediaPlayer.OnPreparedListener() {\n @Override\n public void onPrepared(MediaPlayer mediaPlayer) {\n\n // Hide buffering message.\n mBufferingTextView.setVisibility(VideoView.INVISIBLE);\n previewImageview.setVisibility(View.GONE);\n // Restore saved position, if available.\n if (mCurrentPosition > 0) {\n mVideoView.seekTo(mCurrentPosition);\n } else {\n // Skipping to 1 shows the first frame of the video.\n mVideoView.seekTo(1);\n }\n\n // Start playing!\n mVideoView.start();\n }\n });\n\n // Listener for onCompletion() event (runs after media has finished\n // playing).\n mVideoView.setOnCompletionListener(\n new MediaPlayer.OnCompletionListener() {\n @Override\n public void onCompletion(MediaPlayer mediaPlayer) {\n// TODO Restart video\n\n // Return the video position to the start.\n mVideoView.seekTo(0);\n mVideoView.start();\n }\n });\n }",
"protected abstract void initViews();",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.player_simple_layout);\n completePlayerSetup(asked);\n }",
"@Override protected void startup() {\n show(new FFTView(this));\n }",
"private void setupView() {\n //TODO Enter animation\n\n //setup button\n recordButtonToggle(true);\n resetButtonToggle(false);\n playButtonToggle(false);\n submitButtonToggle(false);\n\n tvChronometer.setText(getString(R.string.dummy_00_00));\n\n tvEmptyHistory.setVisibility(View.VISIBLE);\n item_one.setVisibility(View.INVISIBLE);\n item_two.setVisibility(View.INVISIBLE);\n\n pbCircle.setSmoothPercent(0.0f);\n\n //setup TextView\n Bundle bundle = this.getArguments();\n if (bundle != null) {\n\n String surahName = bundle.getString(Constants.AYAT_SURAHNAME);\n String subAyat = bundle.getString(Constants.AYAT_SUBAYAT);\n String ayatId = bundle.getString(Constants.AYAT_ID);\n\n if (!TextUtils.isEmpty(surahName) && !TextUtils.isEmpty(subAyat) &&!TextUtils.isEmpty(ayatId)) {\n //Set surah name\n tvSurahName.setText(surahName);\n\n //Set surah ayat\n tvVerse.setText(subAyat);\n\n //Save id in model\n presenter.setSurahId(ayatId);\n\n //Save sub ayat in model\n presenter.setAyat(subAyat);\n } else {\n activity.onBackPressed();\n }\n\n //Save surahName for output recording location\n String outputFileName = utils.trimSurahNameToFileName(tvSurahName.getText().toString());\n presenter.setAudioFileName(outputFileName);\n presenter.setSurahName(tvSurahName.getText().toString());\n\n presenter.initializedRecorder();\n\n //Get recite time from server\n presenter.processGetReciteTime(ayatId);\n } else {\n activity.onBackPressed();\n }\n\n //Setup folder for recording\n //TODO Ask for permission!\n boolean folder = new FileManager().createdReciteFolder();\n if (!folder) {\n //Unsuccessful create folder\n utils.getToast(activity, getString(R.string.error_create_folder));\n //disable record button\n recordButtonToggle(false);\n }\n }",
"private void initPlayerUI() {\n if (playableMediaItem instanceof Podcast) {\n tvPlayerTitle.setText(((Podcast) playableMediaItem).getSelectedTrack().getTitle().trim());\n } else {\n tvPlayerTitle.setText(playableMediaItem.getName().trim());\n }\n tvPlayserSubtitle.setText(playableMediaItem.getSubHeader().trim());\n if (playableMediaItem.getCoverImageUrl() == null) {\n final LetterBitmap letterBitmap = new LetterBitmap(getActivity());\n Bitmap letterTile = letterBitmap.getLetterTile(playableMediaItem.getName(), playableMediaItem.getName(), COVER_IMAGE_SIZE, COVER_IMAGE_SIZE);\n imgPlayerCover.setImageBitmap(letterTile);\n int dominantColor = UIHelper.getDominantColor(letterTile);\n rlTopSectionBckg.setBackgroundColor(dominantColor);\n } else {\n Glide.with(getActivity()).load(playableMediaItem.getCoverImageUrl()).crossFade().into(new GlideDrawableImageViewTarget(imgPlayerCover) {\n @Override\n public void onResourceReady(GlideDrawable drawable, GlideAnimation anim) {\n super.onResourceReady(drawable, anim);\n Bitmap bitmap = ((GlideBitmapDrawable) drawable).getBitmap();\n int dominantColor = UIHelper.getDominantColor(bitmap);\n rlTopSectionBckg.setBackgroundColor(dominantColor);\n }\n });\n }\n if (playableMediaItem instanceof Podcast) {\n Track selectedTrack = ((Podcast) playableMediaItem).getSelectedTrack();\n tvTrackDuration.setText(selectedTrack.getDuration());\n sbPlayerProgress.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {\n @Override\n public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {\n\n }\n\n @Override\n public void onStartTrackingTouch(SeekBar seekBar) {\n isChangingProgress = true;\n }\n\n @Override\n public void onStopTrackingTouch(SeekBar seekBar) {\n isChangingProgress = false;\n int progress = seekBar.getProgress();\n int position = (int) ((maxDuration * progress) / 100);\n seekBar.setProgress(progress);\n universalPlayer.seekTo(position);\n }\n });\n }\n if (playableMediaItem instanceof RadioItem) {\n sbPlayerProgress.setOnTouchListener(new View.OnTouchListener() {\n @Override\n public boolean onTouch(View v, MotionEvent event) {\n return true;\n }\n });\n }\n\n //playableMediaItem.syncWithDB();\n if (playableMediaItem.isSubscribed) {\n itemFavorites.setIcon(getResources().getDrawable(R.drawable.ic_heart_black_24dp));\n } else {\n itemFavorites.setIcon(getResources().getDrawable(R.drawable.ic_heart_white_24dp));\n }\n }",
"public MainView() {\r\n\t\tinitialize();\r\n\t}",
"@Override\n protected void initView() {\n }",
"@Override\n protected void initView() {\n }",
"public void onFinishInflate() {\n super.onFinishInflate();\n this.o = getResources().getDimensionPixelSize(R.dimen.view_dimen_1000);\n this.p = getResources().getDimensionPixelSize(R.dimen.view_dimen_561);\n this.f5336c = (TextView) findViewById(R.id.title);\n this.f5337d = (TextView) findViewById(R.id.video_repeat);\n this.e = (RelativeLayout) findViewById(R.id.video_container);\n this.f = (ImageView) findViewById(R.id.banner);\n this.i = (ShowTextCountTextView) findViewById(R.id.content);\n this.m = (ImageView) findViewById(R.id.sounds_btn);\n this.i.setTexColor(getResources().getColor(R.color.color_black_trans_40));\n this.j = (DataNetVideoPlayBtn) findViewById(R.id.video_play_btn);\n this.n = (RelativeLayout) findViewById(R.id.jump_view);\n this.r = (PlayerView) findViewById(R.id.player_view);\n this.r.setControllerVisibilityListener(this);\n this.r.requestFocus();\n if (Build.VERSION.SDK_INT < 26) {\n ((SurfaceView) this.r.getVideoSurfaceView()).getHolder().setFormat(-3);\n }\n this.j.setOnClickListener(this);\n this.m.setOnClickListener(this);\n this.i.setOnClickListener(this);\n this.n.setOnClickListener(this);\n this.f5337d.setOnClickListener(this);\n this.s = a(true);\n this.v = new DefaultTrackSelector.ParametersBuilder().build();\n this.l = (ImageView) findViewById(R.id.loading);\n this.k = ObjectAnimator.ofFloat(this.l, AnimatedProperty.PROPERTY_NAME_ROTATION, new float[]{0.0f, 719.0f});\n this.k.setDuration(3000);\n this.k.setRepeatCount(-1);\n this.k.setInterpolator(new LinearInterpolator());\n }",
"public void initialize() {\n sceneSwitch = SceneSwitch.getInstance();\n addTypes();\n }",
"public static void setupNewGamePlay() {\r\n\t\tSTATUS = Gamestatus.PREPARED;\r\n\t\tGameplay.getInstance().start();\r\n\t\tgui.setMenu(new GameplayMenu(), true);\r\n\t}",
"public void initView() {\n this.f4854a = (ValueSettingItemView) findViewById(R.id.performanceEnhanceSettingItem);\n this.f4854a.setOnClickListener(this);\n this.f4855b = (CheckBoxSettingItemView) findViewById(R.id.performanceOptimizationSettingItem);\n this.f4855b.setOnCheckedChangeListener(this);\n this.f4856c = (CheckBoxSettingItemView) findViewById(R.id.networkSettingItem);\n this.f4856c.setOnCheckedChangeListener(this);\n this.f4857d = (ValueSettingItemView) findViewById(R.id.memorySettingItem);\n this.f4857d.setOnClickListener(this);\n this.e = findViewById(R.id.xunyouSettingCategory);\n this.f = (CheckBoxSettingItemView) findViewById(R.id.xunyouSettingItem);\n this.f.setOnCheckedChangeListener(this);\n this.g = (CheckBoxSettingItemView) findViewById(R.id.xyWifiSettingItem);\n this.g.setOnCheckedChangeListener(this);\n com.miui.gamebooster.c.a.a((Context) this.mActivity);\n this.h = ((SettingsActivity) this.mActivity).n();\n if (this.h == 0) {\n this.f4855b.setVisibility(8);\n }\n (C0388t.n() ? this.f4856c : this.f4854a).setVisibility(8);\n g();\n }",
"private void initializeMediaSession() {\n\n // Create a MediaSessionCompat.\n mMediaSession = new MediaSessionCompat(getActivity(), TAG);\n\n // Enable callbacks from MediaButtons and TransportControls.\n mMediaSession.setFlags(\n MediaSessionCompat.FLAG_HANDLES_MEDIA_BUTTONS |\n MediaSessionCompat.FLAG_HANDLES_TRANSPORT_CONTROLS);\n\n // Do not let MediaButtons restart the player when the app is not visible.\n mMediaSession.setMediaButtonReceiver(null);\n\n // Set an initial PlaybackState with ACTION_PLAY, so media buttons can start the player.\n mStateBuilder = new PlaybackStateCompat.Builder()\n .setActions(\n PlaybackStateCompat.ACTION_PLAY |\n PlaybackStateCompat.ACTION_PAUSE |\n PlaybackStateCompat.ACTION_SKIP_TO_PREVIOUS |\n PlaybackStateCompat.ACTION_PLAY_PAUSE);\n\n mMediaSession.setPlaybackState(mStateBuilder.build());\n\n\n // MySessionCallback has methods that handle callbacks from a media controller.\n mMediaSession.setCallback(new MySessionCallback());\n\n // Start the Media Session since the activity is active.\n mMediaSession.setActive(true);\n\n }",
"public void initViews(){\n }",
"@Override \n protected void startup() {\n GretellaView view = new GretellaView(this);\n show( view );\n view.initView(); \n }",
"private void initializeGUIComponents() {\n\t\tmyScene = new Scene(myRoot);\n ButtonConditionManager.getInstance().beginListeningToScene(myScene);\n\t\tmyStage.setTitle(\"MY PLAYER VIEW\");\n\t\tmyStage.setScene(myScene);\n\t\tmyStage.show();\n\t\tmyCanvas = new GameCanvas();\n\t\tmyRoot.getChildren().add(myCanvas.getNode());\n\t\tmyCanvas.getNode().toBack();\n\t}",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_play, container, false);\n ButterKnife.bind(this, view);\n getReferences();\n setupUI();\n beginPlay();\n return view;\n }",
"private void initializePhaseConfigView() {\n resetViews();\n phaseConfigView.initialize(phasesUI, skin);\n }",
"@Override\n public void simpleInitApp() {\n this.viewPort.setBackgroundColor(ColorRGBA.LightGray);\n im = new InteractionManager();\n setEdgeFilter();\n initEnemies();\n initCamera();\n initScene();\n initPlayer();\n initCrossHairs();\n }",
"private void initializeViews() {\n avatarView = (AvatarView) findViewById(R.id.avatarImage);\n userNameText = (TextView) findViewById(R.id.user_profile_name);\n userJoinedText = (TextView) findViewById(R.id.user_date_joined);\n followingButton = (Button) findViewById(R.id.following_btn);\n backButton = (ImageButton) findViewById(R.id.back_button);\n settingButton = (ImageButton) findViewById(R.id.settings_button);\n cameraButton = (ImageButton) findViewById(R.id.camera_button);\n\n cameraButton.setVisibility(View.GONE);\n settingButton.setVisibility(View.GONE);\n\n viewPager = (ViewPager) findViewById(R.id.viewpager);\n setupViewPager(viewPager);\n\n tabLayout = (TabLayout) findViewById(R.id.tabs);\n tabLayout.setupWithViewPager(viewPager);\n }",
"@Override\n protected void initViewSetup() {\n }",
"private void initial() {\n\t\tsetTitleTxt(getString(R.string.choose_game));\n\t\tLinearLayout contentView = (LinearLayout) findViewById(R.id.contentView);\n\t\tLinearLayout.LayoutParams params = new LinearLayout.LayoutParams(\n\t\t\t\tLayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);\n\t\tview = View.inflate(this, R.layout.user_choose_game, null);\n\t\tcontentView.addView(view, params);\n\t\tgameGrid = (GridView) view.findViewById(R.id.game_list);\n\t\tgameContent = (LinearLayout) view.findViewById(R.id.game_list_info);\n\t\tview.setVisibility(View.GONE);\n\t}"
] | [
"0.8527113",
"0.7549778",
"0.74161005",
"0.7236023",
"0.68821657",
"0.6680504",
"0.65717816",
"0.65504694",
"0.65489537",
"0.6497012",
"0.6486736",
"0.64773774",
"0.6466374",
"0.64571846",
"0.6447194",
"0.64427996",
"0.6440443",
"0.6440357",
"0.6424275",
"0.64008456",
"0.6390507",
"0.6363305",
"0.6359549",
"0.63509613",
"0.63387364",
"0.6333669",
"0.6333669",
"0.63309425",
"0.6325042",
"0.6324299",
"0.6324299",
"0.6320892",
"0.6312633",
"0.6309363",
"0.63046086",
"0.6303206",
"0.63008976",
"0.62898296",
"0.6285577",
"0.62803066",
"0.62796414",
"0.6271742",
"0.6249721",
"0.6248741",
"0.6246471",
"0.624586",
"0.6239494",
"0.62223923",
"0.62208974",
"0.6219266",
"0.6219019",
"0.621277",
"0.6209032",
"0.6205515",
"0.61996555",
"0.61989266",
"0.61989266",
"0.6188729",
"0.6188729",
"0.6183104",
"0.61744845",
"0.6171281",
"0.61669785",
"0.61641985",
"0.6163594",
"0.61635035",
"0.61557204",
"0.61537814",
"0.6151502",
"0.6147553",
"0.6146001",
"0.61454374",
"0.613366",
"0.61334836",
"0.6128476",
"0.61230433",
"0.61219805",
"0.61213213",
"0.61204535",
"0.61139846",
"0.6104991",
"0.61046755",
"0.6104573",
"0.60971785",
"0.60909826",
"0.60909826",
"0.6077422",
"0.6072242",
"0.60708874",
"0.60674644",
"0.60615486",
"0.60606056",
"0.6057924",
"0.6044743",
"0.60396683",
"0.6038929",
"0.6035136",
"0.6034923",
"0.60318047",
"0.60315734"
] | 0.85780746 | 0 |
TODO Autogenerated method stub | public static void main(String[] args) {
Scanner obj = new Scanner(System.in);
int[] id = new int[3];
int[] salary = new int[3];
String[] name = new String[3];
for (int i = 0; i < 3 ; i++) {
System.out.println("Enter employee id: ");
int empId = obj.nextInt();
id[i] = empId;
System.out.println("Enter employee salary: ");
int empSalary = obj.nextInt();
salary[i] = empSalary;
System.out.println("Enter employee name: ");
obj.nextLine();
String empName = obj.nextLine();
name[i] = empName;
}
for (int i=0;i<
id.length;i++) {
System.out.println(id[i]);
System.out.println(salary[i]);
System.out.println(name[i]);
}
int max = salary[0];
int index = 0;
for (int i = 1; i < salary.length; i++) {
if (salary[i]>max) {
max = salary[i];
index = i;
}
}
System.out.println(id[index]);
System.out.println(name[index]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
String[] languages = getResources().getStringArray(R.array.languages); | @Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void loadCompliments(){\n compliments = getResources().getStringArray(R.array.compliments_array);\n }",
"public String[] getLanguages() {\n/* 238 */ return getStringArray(\"language\");\n/* */ }",
"public String[] getLanguages()\n {\n return languages;\n }",
"String getLocalization();",
"public String[] getLanguage() {\n return mSelf.getLanguage();\n }",
"public String getLocalizedString( String name ) {\n\t\tString outString = \"\";\r\n\t\tint id = getResources().getIdentifier( name, \"string\", getPackageName() );\r\n\t\tif ( id == 0 )\r\n\t\t{\r\n\t\t\t// 0 is not a valid resource id\r\n\t\t\tLog.v(\"VrLocale\", name + \" is not a valid resource id!!\" );\r\n\t\t\treturn outString;\r\n\t\t} \r\n\t\tif ( id != 0 ) \r\n\t\t{\r\n\t\t\toutString = getResources().getText( id ).toString();\r\n\t\t\t//Log.v(\"VrLocale\", \"getLocalizedString resolved \" + name + \" to \" + outString);\r\n\t\t}\r\n\t\treturn outString;\r\n\t}",
"public static String[] getAvailableLocaleStrings() {\n\t\tLocale[] availableLocales = getAvailableLocales();\n\t\tString[] result = new String[availableLocales.length];\n\t\tfor (int i = 0; i < availableLocales.length; i++) {\n\t\t\tresult[i] = availableLocales[i].toString();\n\t\t}\n\t\treturn result;\n\t}",
"private List<String> loadLanguages() {\n\t\tFile directory = new File(\"./src/resources/languages\");\t// load current directory\n\t\t\n\t\tFilenameFilter textFilter = new FilenameFilter() {\n\t\t\tpublic boolean accept(File dir, String name) {\n\t\t\t\tif(!name.startsWith(\"Syntax\") && !name.startsWith(\"LanguageCodes\")) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t};\n\t\t\n\t\tResourceFilter filter = new ResourceFilter(directory, textFilter);\n\t\t\n\t\tList<String> languages = (List<String>) filter.getFilteredList();\n\t\t\n\t\tlanguages = languages.stream()\n\t\t\t\t\t\t\t .map(m -> m.replace(UNWANTED_EXTENSION, \"\"))\n\t\t\t\t \t\t\t .collect(Collectors.toList());\n\t\t\n\t\treturn languages;\n\t}",
"protected String[] getDrawerChoices() {\n return getResources().getStringArray(R.array.nav_drawer_array);\n }",
"public void onClick(DialogInterface dialog, int which) {\n String[] myResArray = getResources().getStringArray(R.array.themes);\n List<String> myResArrayList = Arrays.asList(myResArray);\n Intent intent = new Intent(getActivity(), LivestreamBroadcastActivity.class);\n startActivity(intent);\n Toast.makeText(mContext, myResArrayList.get(which) , Toast.LENGTH_LONG).show();\n dialog.dismiss();\n }",
"public String[] getString();",
"List<String> externalResources();",
"protected String getLang(SharedPreferences prefs, Resources res) {\n Intent intent = getIntent();\n if (intent != null) {\n String lang = intent.getStringExtra(RecognizerIntent.EXTRA_LANGUAGE);\n if (lang != null) {\n return lang;\n }\n }\n return PreferenceUtils.getPrefString(prefs, res, R.string.keyLanguage, R.string.defaultLanguage);\n }",
"@Override\n protected String[] onGetLanguage() {\n return mCurrentLanguage;\n }",
"public static String[] getISOLanguages() {\n/* 229 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"public String[] _sArray(int res_id) {\n\t\treturn mContext.getResources().getStringArray(res_id);\n\t}",
"public static String[] localizeCountries(Context context, String[] toLocalize){\n String language = Locale.getDefault().getLanguage();\n if(!language.equals(lastLanguage)){\n lastLanguage = language;\n resetArrayMaps();\n }\n if(countriesTranslations.isEmpty()){\n //Mapping english names and android ids allows to translate\n //int[] countriesIds = Values.COUNTRIES_IDS;\n String[] localizedCountries = context.getResources().getStringArray(R.array.supported_countries);\n String[] countries = Values.COUNTRIES_DEFAULT_NAMES;\n for(int i = 0; i < countries.length; i++)\n countriesTranslations.put(countries[i], localizedCountries[i]);\n }\n String[] localized = new String[toLocalize.length];\n for(int i = 0; i < toLocalize.length; i++)\n localized[i] = countriesTranslations.get(toLocalize[i]);\n\n return localized;\n }",
"public String[] getStringArray();",
"public static ULocale[] getAvailableLocales() {\n/* 212 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"String getLanguage();",
"String getLanguage();",
"String getLanguage();",
"String getLang();",
"public String[] getAllThemeNames() {\n\tjava.util.List names = resources.getStringList(\"themelist\");\n\treturn (String[]) names.toArray(new String[names.size()]);\n }",
"public void loadSifMessages(){\n String[] sifMessagesArray = getResources().getStringArray(R.array.seek_medical_care_messages);\n if(sifEncouragingMessagesTv == null){\n Log.e(TAG, \"sifEncouragingMessagesTv is null\");\n }else{\n sifEncouragingMessagesTv.setText(sifMessagesArray[randMessageIndex(0, sifMessagesArray.length)].toString());\n }\n\n }",
"public static I18NBundle getStrings() {\n\t\treturn strings;\n\t}",
"String getString(String bundleKey, Locale locale);",
"final String[] getResourceStringArray(final int id) {\n String[] retArray = getArrayStringResource(id);\n return retArray;\n }",
"void fillProblemsText() {\n problemsText = new ArrayList();\n String[] problems = getResources().getStringArray(R.array.medicalProblems);\n\n for(int i=0; i<problems.length; i++)\n problemsText.add(problems[i]);\n }",
"private void initData() {\n Resources resources = context.getResources();\n settingTitles = resources.getStringArray(R.array.setting_array);\n selectAccent = resources.getStringArray(R.array.accent_array);\n selectAccentDisplay = resources.getStringArray(R.array.accent_display_array);\n selectSpeaker = resources.getStringArray(R.array.speaker_array);\n selectSpeakerDisplay = resources.getStringArray(R.array.speaker_display_array);\n\n positive = resources.getString(R.string.positive);\n negative = resources.getString(R.string.negative);\n answerUnKnown = resources.getString(R.string.unknown);\n answerCalling = resources.getString(R.string.calling);\n answerOpen = resources.getString(R.string.opening);\n answerFound = resources.getString(R.string.founded);\n answerNotFound = resources.getString(R.string.not_found);\n\n String systemLanguage = Util.getSystemLanguage(context).toLowerCase();\n if (systemLanguage.equalsIgnoreCase(\"zh_cn\")) {\n isEnglishEnvironment = false;\n }\n }",
"public String getLanguages() {\n return languages;\n }",
"public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_fs_lang);\n this.mStrLang = getResources().getStringArray(R.array.fs_languages);\n topBtnInit(R.string.str_fsmain_lang);\n this.mManager = new RelativeLayoutManager(this, R.id.fs_lang_layout);\n this.mBtnLang = new ParamButton[this.mStrLang.length];\n int numPerRow = getResources().getInteger(R.integer.fs_lang_num_per_row);\n for (int i = 0; i < this.mBtnLang.length; i++) {\n this.mBtnLang[i] = this.mManager.AddButton(((i % numPerRow) * Can.CAN_ZH_WC) + 50, ((i / numPerRow) * 100) + 86);\n this.mBtnLang[i].setTag(Integer.valueOf(i));\n this.mBtnLang[i].setOnClickListener(this);\n SetCommBtn(this.mBtnLang[i], this.mStrLang[i]);\n }\n }",
"public static void loadStrings(Locale locale) {\n\t\tFileHandle baseFileHandle = Gdx.files.internal(\"i18n/Strings\");\n\t\tstrings = I18NBundle.createBundle(baseFileHandle, locale);\n\t}",
"public java.lang.String getResources(int index) {\n return resources_.get(index);\n }",
"private void setStrings(){\n ip = context.getResources().getString(R.string.ip);\n port = context.getResources().getString(R.string.port);\n dbName = context.getResources().getString(R.string.db_name);\n user = context.getResources().getString(R.string.masterUser);\n pass = context.getResources().getString(R.string.masterPass);\n }",
"private void setAnswers()\n {\n StringBuilder answers = new StringBuilder(256);\n String[] correctAnswers = getResources().getStringArray(R.array.correct_answers);\n TextView answer_view = (TextView) findViewById(R.id.answers);\n for(int i = 0 ; i < correctAnswers.length; i++)\n {\n answers.append(correctAnswers[i]);\n }\n answer_view.setText(answers.toString());\n }",
"String getString(String bundleKey, String bundleBaseName, Locale locale);",
"public String getLanguage();",
"String[] getLanguageList(InputStream inputStream) throws CaptionConverterException;",
"void setupSpinner() {\n\n Spinner spinner = (Spinner) findViewById(R.id.language_spinner);\n\n ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.language_array, android.R.layout.simple_spinner_item);\n adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n spinner.setAdapter(adapter);\n\n }",
"public static String[] getLangNames() {\r\n\t\tHashMap<String, String> ges = getLangs();\r\n\r\n\t\tString[] names = new String[ges.size()];\r\n\t\tint i = 0;\r\n\t\t// add all\r\n\t\tfor (String key : ges.keySet()) {\r\n\t\t\tnames[i] = ges.get(key);\r\n\t\t\ti++;\r\n\t\t}\r\n\r\n\t\treturn names;\r\n\t}",
"public SrvI18n() {\n try { //to fix Android Java\n messages = ResourceBundle.getBundle(\"MessagesBundle\");\n } catch (Exception e) {\n Locale locale = new Locale(\"en\", \"US\");\n messages = ResourceBundle.getBundle(\"MessagesBundle\", locale);\n }\n }",
"static WordList get(Language language) {\n return switch (language) {\n case ENGLISH -> readResource(\"bip39_english.txt\");\n };\n }",
"public java.lang.String getResources(int index) {\n return resources_.get(index);\n }",
"public static HashMap<String, String> getLangs() {\r\n\t\t// search for it\r\n\t\tHashMap<String, String> names = new HashMap<String, String>();\r\n\t\tnames.put(\"de\", \"Deutsch (integriert) - German (included)\");\r\n\r\n\t\t// load all files from this dir\r\n\t\tfor (File f : new File(YAamsCore.programPath, \"lang\").listFiles()) {\r\n\t\t\tif (f.isDirectory() && new File(f, \"info.xml\").canRead()) {\r\n\t\t\t\tHashMap<String, String> data = (HashMap<String, String>) FileHelper.loadXML(new File(f, \"info.xml\"));\r\n\t\t\t\tnames.put(f.getName(), data.get(\"title\"));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn names;\r\n\t}",
"public static void readFolder() {\n\t\t PluginManager.getPlugin(PluginManager.class).saveResource(\"language_en_US.yml\", true);\n\t\t PluginManager.getPlugin(PluginManager.class).saveResource(\"language_af_ZA.yml\", true);\n\t\t PluginManager.getPlugin(PluginManager.class).saveResource(\"language_ar_SA.yml\", true);\n\t\t PluginManager.getPlugin(PluginManager.class).saveResource(\"language_ca_ES.yml\", true);\n\t\t PluginManager.getPlugin(PluginManager.class).saveResource(\"language_cs_CZ.yml\", true);\n\t\t PluginManager.getPlugin(PluginManager.class).saveResource(\"language_da_DK.yml\", true);\n\t\t PluginManager.getPlugin(PluginManager.class).saveResource(\"language_de_DE.yml\", true);\n\t\t PluginManager.getPlugin(PluginManager.class).saveResource(\"language_el_GR.yml\", true);\n\t\t PluginManager.getPlugin(PluginManager.class).saveResource(\"language_es_ES.yml\", true);\n\t\t PluginManager.getPlugin(PluginManager.class).saveResource(\"language_fi_FI.yml\", true);\n\t\t PluginManager.getPlugin(PluginManager.class).saveResource(\"language_fr_FR.yml\", true);\n\t\t PluginManager.getPlugin(PluginManager.class).saveResource(\"language_he_IL.yml\", true);\n\t\t PluginManager.getPlugin(PluginManager.class).saveResource(\"language_hu_HU.yml\", true);\n\t\t PluginManager.getPlugin(PluginManager.class).saveResource(\"language_it_IT.yml\", true);\n\t\t PluginManager.getPlugin(PluginManager.class).saveResource(\"language_ja_JP.yml\", true);\n\t\t PluginManager.getPlugin(PluginManager.class).saveResource(\"language_ko_KR.yml\", true);\n\t\t PluginManager.getPlugin(PluginManager.class).saveResource(\"language_nl_NL.yml\", true);\n\t\t PluginManager.getPlugin(PluginManager.class).saveResource(\"language_no_NO.yml\", true);\n\t\t PluginManager.getPlugin(PluginManager.class).saveResource(\"language_pl_PL.yml\", true);\n\t\t PluginManager.getPlugin(PluginManager.class).saveResource(\"language_pt_BR.yml\", true);\n\t\t PluginManager.getPlugin(PluginManager.class).saveResource(\"language_pt_PT.yml\", true);\n\t\t PluginManager.getPlugin(PluginManager.class).saveResource(\"language_ro_RO.yml\", true);\n\t\t PluginManager.getPlugin(PluginManager.class).saveResource(\"language_ru_RU.yml\", true);\n\t\t PluginManager.getPlugin(PluginManager.class).saveResource(\"language_sr_SP.yml\", true);\n\t\t PluginManager.getPlugin(PluginManager.class).saveResource(\"language_sv_SE.yml\", true);\n\t\t PluginManager.getPlugin(PluginManager.class).saveResource(\"language_tr_TR.yml\", true);\n\t\t PluginManager.getPlugin(PluginManager.class).saveResource(\"language_uk_UA.yml\", true);\n\t\t PluginManager.getPlugin(PluginManager.class).saveResource(\"language_vi_VN.yml\", true);\n\t\t PluginManager.getPlugin(PluginManager.class).saveResource(\"language_zh_CN.yml\", true);\n\t\t PluginManager.getPlugin(PluginManager.class).saveResource(\"language_zh_TW.yml\", true);\n\t }",
"public List<String> getResources() {\n return resources;\n }",
"public int[] getResources() {\n \t\tint[] list = new int[resources.length];\n \t\tfor (int i = 0; i < resources.length; i++)\n \t\t\tlist[i] = resources[i];\n \n \t\treturn list;\n \t}",
"String getLocalizedString(Locale locale);",
"private static SparseArray<String> getStringsForLocale(Locale targetLocale, @StringRes int[] strings) {\n Configuration config = getCurrentConfiguration();\n Locale systemLocale = config.locale;\n config.locale = targetLocale;\n SparseArray<String> localizedStrings = getTargetStrings(strings, config);\n config.locale = systemLocale;\n resetConfiguration(config);\n return localizedStrings;\n }",
"public static String[] readStrings() {\n return readAllStrings();\n }",
"public static String[] getLangIDs() {\r\n\t\tHashMap<String, String> ges = getLangs();\r\n\r\n\t\tString[] names = new String[ges.size()];\r\n\t\tint i = 0;\r\n\t\t// add all\r\n\t\tfor (String key : ges.keySet()) {\r\n\t\t\tnames[i] = key;\r\n\t\t\ti++;\r\n\t\t}\r\n\r\n\t\treturn names;\r\n\t}",
"private static ResourceBundle getBundle(String language) {\r\n\t\tResourceBundle bundle;\r\n\r\n\t\tLocale locale = new Locale(language);\r\n\t\tbundle = ResourceBundle.getBundle(filename, locale);\r\n\r\n\t\treturn bundle;\r\n\t}",
"java.lang.String getLanguage();",
"java.lang.String getLanguage();",
"public List<String> getLanguages() {\n return languages;\n }",
"public String[] getStringList();",
"public String getStringResource(LocaleResource resource){\n\t\tContext c = ConnectedApp.getContextStatic();\n\t\tswitch(resource){\t\t\n\t\tcase support_contact:\n default:\n\t\t\tint resId= c.getResources().getIdentifier(resource.toString()+\"_\"+ getCountryCode().toLowerCase(Locale.US), \"string\",\n\t\t\t\t\tc.getPackageName());\n\t\t\treturn c.getString(resId);\n\t\t}\n\t\t//return null;\n\t}",
"private Resources getLocalizedResources(Context context) {\n Configuration conf = context.getResources().getConfiguration();\n conf = new Configuration(conf);\n conf.setLocale(new Locale(LocaleHelper.getLocaleCode(context)));\n Context localizedContext = context.createConfigurationContext(conf);\n return localizedContext.getResources();\n }",
"public List getLocaleLabels() {\n\n return (localeLabels);\n\n }",
"public static String getlanguage(Context ctx) {\n\t\treturn getSharedPreferences(ctx).getString(language, \"\");\n\t}",
"public CharSequence[] getResourceTextArray(int resId) {\n synchronized (this) {\n ensureValidLocked();\n int[] rawInfoArray = nativeGetResourceStringArrayInfo(this.mObject, resId);\n if (rawInfoArray == null) {\n return null;\n }\n int rawInfoArrayLen = rawInfoArray.length;\n CharSequence[] retArray = new CharSequence[(rawInfoArrayLen / 2)];\n int i = 0;\n int i2 = 0;\n int j = 0;\n while (i2 < rawInfoArrayLen) {\n int cookie = rawInfoArray[i2];\n int index = rawInfoArray[i2 + 1];\n retArray[j] = (index < 0 || cookie <= 0) ? null : this.mApkAssets[cookie - 1].getStringFromPool(index);\n i2 += 2;\n j++;\n }\n if (hasRes()) {\n while (true) {\n int i3 = i;\n if (i3 >= retArray.length) {\n break;\n }\n CharSequence rt = getTextForDBid(retArray[i3]);\n if (rt != null) {\n retArray[i3] = rt;\n }\n i = i3 + 1;\n }\n }\n }\n }",
"private static ResourceBundle getResourceBundleFor(String text) {\n ResourceBundle ret;\n\n String bundle = text.split(\"\\\\.\")[0];\n\n if (\"game\".equals(bundle)) {\n ret = AppText.gameText;\n } else if (\"menu\".equals(bundle)) {\n ret = AppText.menuText;\n } else {\n ret = AppText.globalText;\n }\n\n return ret;\n }",
"protected static String m94909a(Context context, int i) {\n return context.getResources().getString(i);\n }",
"String getString(String bundleKey);",
"public Language[] getLanguageList() {\n return languageList;\n }",
"@Override\r\n protected void onCreate(Bundle savedInstanceState) {\r\n super.onCreate(savedInstanceState);\r\n setContentView(R.layout.activity_translate);\r\n\r\n translatedPhrase = findViewById(R.id.translatedPhrase);//textview to display the translated phrase or word\r\n list3 = findViewById(R.id.list3);\r\n list3.setChoiceMode(ListView.CHOICE_MODE_SINGLE);//setting the choice mode of the list to single choice\r\n\r\n subscribedLanguage = findViewById(R.id.subscribedLanguage);\r\n languageArrayList = phrasesDatabase.languages();//storing the data from the database into the array\r\n //array to store the string values of the main array\r\n ArrayList<String> spinnerArray = new ArrayList<>();\r\n //loop to retrieve the values from the main array into the string array for displaying\r\n for(int i =0; i < languageArrayList.size(); i++) {\r\n spinnerArray.add(languageArrayList.get(i).getLanguage());\r\n }\r\n\r\n ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, spinnerArray);\r\n spinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\r\n subscribedLanguage.setAdapter(spinnerAdapter);\r\n\r\n translate = findViewById(R.id.translate);\r\n pronounce = findViewById(R.id.pronounce);\r\n\r\n translationService = initLanguageTranslatorService();\r\n textService = initTextToSpeechService();\r\n\r\n //calling methods\r\n translatePhrase();\r\n textToSpeech();\r\n }",
"public String[] getResourceStringArray(int resId) {\n String[] retArray;\n synchronized (this) {\n ensureValidLocked();\n retArray = nativeGetResourceStringArray(this.mObject, resId);\n if (hasRes()) {\n for (int i = 0; i < retArray.length; i++) {\n CharSequence rt = getTextForDBid(retArray[i]);\n if (rt != null) {\n retArray[i] = rt.toString();\n }\n }\n }\n }\n return retArray;\n }",
"int getLocalizedText();",
"public Future<List<String>> getAvailableLanguages() throws DynamicCallException, ExecutionException {\n return call(\"getAvailableLanguages\");\n }",
"@Override\n public Resources getResources() {\n //Set font size, language\n return super.getResources();\n }",
"public static void loadStrings() {\n\t\tloadStrings(Locale.getDefault());\n\t}",
"public static Set<String> getEnglishWords()\n{\n return english_words;\n}",
"public String[] getVariants_ru(int[] randIds){\n Cursor crs;\n String[] variants_ru = new String[4];\n for(int i = 0; i< 4; i++){\n String[] args = new String[1];\n args[0] = Integer.toString(randIds[i]+1);\n crs = aniDB.getReadableDatabase().rawQuery(\"SELECT name_ru FROM titles WHERE id = ?\",args);\n if(crs.moveToFirst()) {\n variants_ru[i] = crs.getString(crs.getColumnIndex(\"name_ru\"));\n }\n crs.close();\n }\n return variants_ru;\n }",
"final CharSequence[] getResourceTextArray(final int id) {\n int[] rawInfoArray = getArrayStringInfo(id);\n if (rawInfoArray == null) {\n throw new NullPointerException(\"AssetManager.getResourceTextArray rawInfoArray is null\");\n }\n int rawInfoArrayLen = rawInfoArray.length;\n final int infoArrayLen = rawInfoArrayLen / 2;\n int block;\n int index;\n CharSequence[] retArray = new CharSequence[infoArrayLen];\n for (int i = 0, j = 0; i < rawInfoArrayLen; i = i + 2, j++) {\n block = rawInfoArray[i];\n index = rawInfoArray[i + 1];\n retArray[j] = index >= 0 ? mStringBlocks[block].get(index) : null;\n }\n return retArray;\n }",
"public IPath[] getAdditionalResources();",
"public final native ApplicationFormItemTexts getItemTexts(String locale) /*-{\n\t\tif(!(locale in this.i18n)){\n\t\t\tthis.i18n[locale] = {locale: locale, errorMessage : \"\", help : \"\", label : \"\", options : \"\"};\n\t\t}\n\t\treturn this.i18n[locale];\n\t}-*/;",
"public String[] getDisplayedResources(){\n\t\tString resources =\n\t\t\tHub.localCfg.get(PreferenceConstants.AG_RESOURCESTOSHOW,\n\t\t\t\tStringTool.join(agenda.getResources(), \",\")); //$NON-NLS-1$\n\t\tif (resources == null) {\n\t\t\treturn new String[0];\n\t\t} else {\n\t\t\treturn resources.split(\",\"); //$NON-NLS-1$\n\t\t}\n\t}",
"ResourceBundle getResourceBundle(Locale locale);",
"public static final ULocale[] getAvailableULocales()\n/* */ {\n/* 440 */ return getAvailableULocales(\"com/ibm/icu/impl/data/icudt48b\", ICU_DATA_CLASS_LOADER);\n/* */ }",
"public List<ITranslationResource> getResources(){\n\t\treturn resources;\n\t}",
"public static final Locale[] getAvailableLocales()\n/* */ {\n/* 456 */ return getAvailEntry(\"com/ibm/icu/impl/data/icudt48b\", ICU_DATA_CLASS_LOADER).getLocaleList();\n/* */ }",
"public ArrayList<Book> getListBooklanguage(String laguage);",
"public TextView[] Weekdays(){\n Resources r = getResources();\n String name = getPackageName();\n String WeekDays[]={\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\",\"Sun\"};\n String DummyWeekDays[]={\"F1\",\"F2\",\"F3\",\"F4\",\"F5\",\"F6\",\"F7\"};\n TextView Weekdays[]=new TextView[7];\n DropDownCalendar.setCurrentDate(Calendar.getInstance());\n for(int i=0;i<WeekDays.length;++i) {\n TextView weekday,dummyWeekday;\n weekday = (TextView) findViewById(r.getIdentifier(WeekDays[i], \"id\", name));\n dummyWeekday=(TextView)findViewById(r.getIdentifier(DummyWeekDays[i],\"id\",name));\n Weekdays[i]=weekday;\n dummyWeekday.setTextColor(Color.TRANSPARENT);\n dummyWeekday.setHintTextColor(Color.TRANSPARENT);\n MaskWeekdays[i]=dummyWeekday;;\n\n }\n return Weekdays;\n }",
"public static String[] localizeSymptoms(Context context, String[] toLocalize){\n String language = Locale.getDefault().getLanguage();\n if(!language.equals(lastLanguage)) {\n lastLanguage = language;\n resetArrayMaps();\n }\n if(symptomsTranslations.isEmpty()){\n String[] localizedSymptoms = context.getResources().getStringArray(R.array.symptoms);\n String[] symptoms = Values.SYMPTOMS_DEFAULT_NAMES;\n for(int i = 0; i < symptoms.length; i++)\n symptomsTranslations.put(symptoms[i], localizedSymptoms[i]);\n }\n String[] localizedSymptoms;\n if(toLocalize == null) {\n localizedSymptoms = new String[symptomsTranslations.size()];\n String[] allSymptoms = Values.SYMPTOMS_DEFAULT_NAMES;\n for(int i = 0; i < localizedSymptoms.length; i++)\n localizedSymptoms[i] = symptomsTranslations.get(allSymptoms[i]);\n }\n else {\n localizedSymptoms = new String[toLocalize.length];\n for(int i = 0; i < toLocalize.length; i++)\n localizedSymptoms[i] = symptomsTranslations.get(toLocalize[i]);\n }\n return localizedSymptoms;\n }",
"public void changeLanguage(View view) {\n\n // Create Dialog\n final Dialog dialog = new Dialog(this);\n\n dialog.setTitle(R.string.language);// Doesn't work\n dialog.setContentView(R.layout.fragment_language_fragment);\n\n // Gets RadioGroup ID from dialog which contains the layout that hold the RadioGroup\n RadioGroup rg = dialog.findViewById(R.id.radiogroup);\n rg.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {\n @Override\n public void onCheckedChanged(RadioGroup group, int checkedId) {\n\n switch (checkedId){\n case R.id.en: {// English\n String languageToLoad = \"en\"; // your language\n Locale locale = new Locale(languageToLoad);\n Locale.setDefault(locale);\n Configuration config = new Configuration();\n config.setLocale(locale); //= locale;\n getBaseContext().getResources().updateConfiguration(config,\n getBaseContext().getResources().getDisplayMetrics());\n }\n break;\n case R.id.es: { // Spanish\n String languageToLoad = \"es\"; // your language\n Locale locale = new Locale(languageToLoad);\n Locale.setDefault(locale);\n Configuration config = new Configuration();\n config.setLocale(locale); //= locale;\n getBaseContext().getResources().updateConfiguration(config,\n getBaseContext().getResources().getDisplayMetrics());\n\n }\n break;\n case R.id.ja: {// Japanese\n String languageToLoad = \"ja\"; // your language\n Locale locale = new Locale(languageToLoad);\n Locale.setDefault(locale);\n Configuration config = new Configuration();\n config.setLocale(locale); //= locale;\n getBaseContext().getResources().updateConfiguration(config,\n getBaseContext().getResources().getDisplayMetrics());\n }\n break;\n default: {// In case check id gives weired int, set to English\n String languageToLoad = \"en\"; // your language\n Locale locale = new Locale(languageToLoad);\n Locale.setDefault(locale);\n Configuration config = new Configuration();\n config.setLocale(locale); //= locale;\n getBaseContext().getResources().updateConfiguration(config,\n getBaseContext().getResources().getDisplayMetrics());\n }\n break;\n }\n // Refreshes Activity\n Intent intent = new Intent(getBaseContext(),WelcomePage.class);\n finish();\n startActivity(intent);\n }\n });\n\n //Show the dialog\n dialog.show();\n }",
"public String getS(String name){\t\n\t\t\n\t\tString packageName = activity.getPackageName();\n\t\tint resId = activity.getResources().getIdentifier(name, \"string\", packageName);\n\t\treturn activity.getString(resId);\n\t\t \n\t}",
"com.google.ads.googleads.v6.resources.LanguageConstant getLanguageConstant();",
"public List<String> getAvailableLanguages() throws DynamicCallException, ExecutionException {\n return (List<String>)call(\"getAvailableLanguages\").get();\n }",
"protected String[] getAvailableLocaleNames() {\n return LocaleInfo.getAvailableLocaleNames();\n }",
"public JSONArray readFromJSON(){\n\n JSONArray jsonArray=null;\n\n try {\n InputStream inputStream =context.getResources().getAssets().open(FILE_NAME);\n int size = inputStream.available();\n byte[] data = new byte[size];\n inputStream.read(data);\n inputStream.close();\n String json = new String(data, \"UTF-8\");\n jsonArray = new JSONArray(json);\n } catch (IOException e) {\n e.printStackTrace();\n } catch (JSONException e) {\n e.printStackTrace();\n }\n return jsonArray;\n }",
"public ResourceBundle getResourceBundle()\n {\n return resources;\n }",
"public String getLanguageKey();",
"public static void display(){\r\n String baseName = \"res.Messages\";\r\n ResourceBundle messages = ResourceBundle.getBundle(baseName, Locale.getDefault());\r\n System.out.println(messages.getString(\"locales\"));\r\n\r\n Locale available[] = Locale.getAvailableLocales();\r\n for(Locale locale : available) {\r\n System.out.println(locale.getDisplayCountry() + \"\\t\" + locale.getDisplayLanguage(locale));\r\n }\r\n }",
"public static void syncLanguages(Context context) {\n StringRequest stringRequest = new StringRequest( Request.Method.GET, URL_SYNC_LANGUAGE,\n new Response.Listener<String>() {\n @Override\n public void onResponse(String response) {\n try {\n JSONArray jsonArray = new JSONArray( response );\n parseInsertData(\n jsonArray,\n LanguagesEntry.CONTENT_URI,\n LanguagesEntry.TABLE_NAME,\n LanguagesEntry.COLUMN_LANGUAGE_ID,\n LanguagesEntry.COLUMN_LANGUAGE_NAME_EN,\n LanguagesEntry.COLUMN_LANGUAGE_NAME_AR\n );\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n Log.e( TAG, \"message :\" + error );\n }\n } );\n Mysingletone.getInstance( context ).addRequestQueue( stringRequest );\n }",
"public List<Locale> getTranslationLocales(String edition);",
"public String getName(String name) {\n return myResources.getString(name);\n }",
"public List<IResource> getResources();",
"public static String[] getDownloadedCountries(Context context){\n SharedPreferences sharedPreferences = context.getSharedPreferences(Values.PREFERENCES_NAME, Context.MODE_PRIVATE);\n File downloadPath = null;\n //We can save resources either in external sd or internal shared storage, we scan the last known download location\n switch (sharedPreferences.getString(Values.DOWNLOAD_LOCATION, Values.LOCATION_INTERNAL)){\n case Values.LOCATION_INTERNAL:\n downloadPath = context.getExternalFilesDir(null);\n break;\n case Values.LOCATION_EXTERNAL:\n if(hasWritableSd(context))\n downloadPath = context.getExternalFilesDirs(null)[1];\n break;\n //If the user has yet to download a package, we return null. This branch is repetitive but added for clarity\n case Values.NOT_YET_DECIDED:\n downloadPath = null;\n break;\n }\n if(downloadPath != null){\n String[] downloadedCountries;\n //Get list of directories, each corresponding to a different country\n File[] resFolders = downloadPath.listFiles(new FileFilter() {\n @Override\n public boolean accept(File pathname) {\n return pathname.isDirectory();\n }\n });\n if(resFolders != null){\n if(resFolders.length == 0)\n return null;\n //countriesNames contains the english name of all supported countries\n //All resFolders will always use the english names of the countries\n String[] countriesNames = Values.COUNTRIES_DEFAULT_NAMES;\n downloadedCountries = new String[resFolders.length];\n //Get folder name and translate country name\n for(int i = 0; i < resFolders.length; i++) {\n String[] folderPath = resFolders[i].getAbsolutePath().split(\"/\");\n String folderName = folderPath[folderPath.length - 1];\n for (String countryName : countriesNames) {\n //If found folder with name matching one country, add it to the list\n if (folderName.equals(countryName)) {\n downloadedCountries[i] = folderName;\n break;\n }\n }\n }\n return downloadedCountries;\n }\n }\n\n return null;\n }",
"@ArrayRes\n protected abstract int getTabTitleArrayResources();",
"String getString(String bundleKey, String bundleBaseName);"
] | [
"0.71919304",
"0.7180608",
"0.6295264",
"0.62355006",
"0.6230085",
"0.61931944",
"0.60705423",
"0.60535014",
"0.5989425",
"0.598456",
"0.593683",
"0.5931349",
"0.59047097",
"0.5878472",
"0.58592093",
"0.58578837",
"0.58435345",
"0.5838076",
"0.58374727",
"0.5819309",
"0.5819309",
"0.5819309",
"0.57823914",
"0.57650787",
"0.5760494",
"0.5752342",
"0.5751774",
"0.5726693",
"0.57159084",
"0.56828624",
"0.5677123",
"0.5668401",
"0.5666182",
"0.564974",
"0.56467885",
"0.55974954",
"0.5582462",
"0.5579627",
"0.5578721",
"0.55762637",
"0.55709755",
"0.556386",
"0.55570656",
"0.55503637",
"0.55464715",
"0.5545212",
"0.5504425",
"0.5501588",
"0.5494192",
"0.54930687",
"0.5482814",
"0.5465594",
"0.5464818",
"0.5463447",
"0.5463447",
"0.546181",
"0.54593676",
"0.54550314",
"0.54461145",
"0.54260206",
"0.5424469",
"0.5409184",
"0.5403738",
"0.5403546",
"0.54003817",
"0.54001814",
"0.539197",
"0.5376066",
"0.537457",
"0.5370333",
"0.5351529",
"0.5346727",
"0.5337967",
"0.5336139",
"0.5335724",
"0.532532",
"0.5323453",
"0.53113395",
"0.53068477",
"0.53065425",
"0.530635",
"0.5304826",
"0.5284434",
"0.5277616",
"0.52562076",
"0.5242928",
"0.5234745",
"0.5232202",
"0.52299505",
"0.52292967",
"0.52292126",
"0.52234006",
"0.522218",
"0.52158433",
"0.520505",
"0.51993316",
"0.51959693",
"0.5193067",
"0.51930404",
"0.51901186",
"0.5181581"
] | 0.0 | -1 |
String[] countries = getResources().getStringArray(R.array.colors); | @Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void loadCompliments(){\n compliments = getResources().getStringArray(R.array.compliments_array);\n }",
"public static String[] localizeCountries(Context context, String[] toLocalize){\n String language = Locale.getDefault().getLanguage();\n if(!language.equals(lastLanguage)){\n lastLanguage = language;\n resetArrayMaps();\n }\n if(countriesTranslations.isEmpty()){\n //Mapping english names and android ids allows to translate\n //int[] countriesIds = Values.COUNTRIES_IDS;\n String[] localizedCountries = context.getResources().getStringArray(R.array.supported_countries);\n String[] countries = Values.COUNTRIES_DEFAULT_NAMES;\n for(int i = 0; i < countries.length; i++)\n countriesTranslations.put(countries[i], localizedCountries[i]);\n }\n String[] localized = new String[toLocalize.length];\n for(int i = 0; i < toLocalize.length; i++)\n localized[i] = countriesTranslations.get(toLocalize[i]);\n\n return localized;\n }",
"public void onClick(DialogInterface dialog, int which) {\n String[] myResArray = getResources().getStringArray(R.array.themes);\n List<String> myResArrayList = Arrays.asList(myResArray);\n Intent intent = new Intent(getActivity(), LivestreamBroadcastActivity.class);\n startActivity(intent);\n Toast.makeText(mContext, myResArrayList.get(which) , Toast.LENGTH_LONG).show();\n dialog.dismiss();\n }",
"protected String[] getDrawerChoices() {\n return getResources().getStringArray(R.array.nav_drawer_array);\n }",
"public String[] _sArray(int res_id) {\n\t\treturn mContext.getResources().getStringArray(res_id);\n\t}",
"public JSONArray getCountry(Activity act)\n\t{\n\t\tJSONArray json = null;\n\n\t\tprefManager = new SharedPrefManager(act);\n\t\tHashMap<String, String> init = prefManager.getCountry();\n\t\tString dataCountry = init.get(SharedPrefManager.COUNTRY);\n\t\tLog.e(\"dataCountry\",dataCountry);\n\n\t\ttry {\n\t\t\tjson = new JSONArray(dataCountry);\n\t\t\tLog.e(\"json\",Integer.toString(json.length()));\n\t\t}catch (JSONException e){\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn json;\n\n\t\t/*Locale[] locales = Locale.getAvailableLocales();\n\t\tArrayList<String> countries = new ArrayList<String>();\n\n\t\tfor (Locale locale : locales) {\n\t\t\tString country = locale.getDisplayCountry();\n\t\t\tString countryCode = locale.getCountry();\n\n\n\t\t\tif (country.trim().length()>0 && !countries.contains(country)) {\n\t\t\t\tcountries.add(country+\"-\"+countryCode);\n\t\t\t}\n\t\t}\n\n\t\tCollections.sort(countries);\n\t\treturn countries;*/\n\t}",
"public static String[] getDownloadedCountries(Context context){\n SharedPreferences sharedPreferences = context.getSharedPreferences(Values.PREFERENCES_NAME, Context.MODE_PRIVATE);\n File downloadPath = null;\n //We can save resources either in external sd or internal shared storage, we scan the last known download location\n switch (sharedPreferences.getString(Values.DOWNLOAD_LOCATION, Values.LOCATION_INTERNAL)){\n case Values.LOCATION_INTERNAL:\n downloadPath = context.getExternalFilesDir(null);\n break;\n case Values.LOCATION_EXTERNAL:\n if(hasWritableSd(context))\n downloadPath = context.getExternalFilesDirs(null)[1];\n break;\n //If the user has yet to download a package, we return null. This branch is repetitive but added for clarity\n case Values.NOT_YET_DECIDED:\n downloadPath = null;\n break;\n }\n if(downloadPath != null){\n String[] downloadedCountries;\n //Get list of directories, each corresponding to a different country\n File[] resFolders = downloadPath.listFiles(new FileFilter() {\n @Override\n public boolean accept(File pathname) {\n return pathname.isDirectory();\n }\n });\n if(resFolders != null){\n if(resFolders.length == 0)\n return null;\n //countriesNames contains the english name of all supported countries\n //All resFolders will always use the english names of the countries\n String[] countriesNames = Values.COUNTRIES_DEFAULT_NAMES;\n downloadedCountries = new String[resFolders.length];\n //Get folder name and translate country name\n for(int i = 0; i < resFolders.length; i++) {\n String[] folderPath = resFolders[i].getAbsolutePath().split(\"/\");\n String folderName = folderPath[folderPath.length - 1];\n for (String countryName : countriesNames) {\n //If found folder with name matching one country, add it to the list\n if (folderName.equals(countryName)) {\n downloadedCountries[i] = folderName;\n break;\n }\n }\n }\n return downloadedCountries;\n }\n }\n\n return null;\n }",
"public String[] getStringArray();",
"public String[] getString();",
"public String[] getAllThemeNames() {\n\tjava.util.List names = resources.getStringList(\"themelist\");\n\treturn (String[]) names.toArray(new String[names.size()]);\n }",
"public String[] getLanguages() {\n/* 238 */ return getStringArray(\"language\");\n/* */ }",
"@Override\n public void onItemSelected(AdapterView<?> arg1, View arg2, int position1, long id1) {\n\n crechCity = getResources().getStringArray(R.array.city_list)[position1];\n\n }",
"public int[] getResources() {\n \t\tint[] list = new int[resources.length];\n \t\tfor (int i = 0; i < resources.length; i++)\n \t\t\tlist[i] = resources[i];\n \n \t\treturn list;\n \t}",
"public List<String> getCountries() {\n\t\tif (countries == null) {\r\n\t\t\tcountries = new ArrayList<>();\r\n\t\t\tif (Files.exists(countriesPath)) {\r\n\t\t\t\ttry (BufferedReader in = new BufferedReader(\r\n\t\t\t\t\t\t new FileReader(countriesFile))) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t//read countries from file into array list\r\n\t\t\t\t\tString line = in.readLine();\r\n\t\t\t\t\twhile (line != null) {\r\n\t\t\t\t\t countries.add(line);\r\n\t\t\t\t\t line = in.readLine();\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tFiles.createFile(countriesPath);\r\n\t\t\t\t\tSystem.out.println(\"** countries file create!\");\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn countries;\r\n\t}",
"final String[] getResourceStringArray(final int id) {\n String[] retArray = getArrayStringResource(id);\n return retArray;\n }",
"List<String> externalResources();",
"public String[] getVariants_ru(int[] randIds){\n Cursor crs;\n String[] variants_ru = new String[4];\n for(int i = 0; i< 4; i++){\n String[] args = new String[1];\n args[0] = Integer.toString(randIds[i]+1);\n crs = aniDB.getReadableDatabase().rawQuery(\"SELECT name_ru FROM titles WHERE id = ?\",args);\n if(crs.moveToFirst()) {\n variants_ru[i] = crs.getString(crs.getColumnIndex(\"name_ru\"));\n }\n crs.close();\n }\n return variants_ru;\n }",
"public Color[] getColors();",
"public static String[] getAvailableLocaleStrings() {\n\t\tLocale[] availableLocales = getAvailableLocales();\n\t\tString[] result = new String[availableLocales.length];\n\t\tfor (int i = 0; i < availableLocales.length; i++) {\n\t\t\tresult[i] = availableLocales[i].toString();\n\t\t}\n\t\treturn result;\n\t}",
"public ArrayList<String> getCountries() {\n\n JSONArray jsonArray = readFromJSON();\n\n ArrayList<String> cList=new ArrayList<String>();\n\n if (jsonArray != null) {\n for (int i = 0; i < jsonArray.length(); i++) {\n try {\n cList.add(jsonArray.getJSONObject(i).getString(\"name\")); //getting the name of the country and adding it to an arraylist\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n }\n return cList;\n }",
"public String[] getCountryNames() {\r\n return countryNames;\r\n }",
"public static int getColorStringResource(Color color) {\n \t\tswitch (color) {\n \t\tcase RED:\n \t\t\treturn R.string.red;\n \t\tcase BLUE:\n \t\t\treturn R.string.blue;\n \t\tcase GREEN:\n \t\t\treturn R.string.green;\n \t\tcase ORANGE:\n \t\t\treturn R.string.orange;\n \t\tdefault:\n \t\t\treturn R.string.nostring;\n \t\t}\n \t}",
"public java.lang.String getResources(int index) {\n return resources_.get(index);\n }",
"public String[] colorLabelsArray() {\n List<String> list = Utils.jListGetValuesWrapper(entity_color_list);\n String strs[] = new String[list.size()]; for (int i=0;i<strs.length;i++) strs[i] = list.get(i);\n return strs;\n }",
"public static void getCountries() {\n\t\tJSONArray countries = (JSONArray) FileParser.dataSetter().get(\"countries\");\n\t\tfor(int i = 0, size = countries.size(); i < size; i++) {\n\t\t\tJSONObject objectInArray = (JSONObject) countries.get(i);\n\t\t\tSystem.out.println(objectInArray.get(\"name\"));\n\t\t}\n\t}",
"public TextView[] Weekdays(){\n Resources r = getResources();\n String name = getPackageName();\n String WeekDays[]={\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\",\"Sun\"};\n String DummyWeekDays[]={\"F1\",\"F2\",\"F3\",\"F4\",\"F5\",\"F6\",\"F7\"};\n TextView Weekdays[]=new TextView[7];\n DropDownCalendar.setCurrentDate(Calendar.getInstance());\n for(int i=0;i<WeekDays.length;++i) {\n TextView weekday,dummyWeekday;\n weekday = (TextView) findViewById(r.getIdentifier(WeekDays[i], \"id\", name));\n dummyWeekday=(TextView)findViewById(r.getIdentifier(DummyWeekDays[i],\"id\",name));\n Weekdays[i]=weekday;\n dummyWeekday.setTextColor(Color.TRANSPARENT);\n dummyWeekday.setHintTextColor(Color.TRANSPARENT);\n MaskWeekdays[i]=dummyWeekday;;\n\n }\n return Weekdays;\n }",
"private List<Map<String, String>> loadCredits() {\n\t\tfinal String[] creditsArray = this.getResources().getStringArray(\n\t\t\t\tR.array.credits);\n\t\tfinal Credits credits = new Credits(creditsArray);\n\t\treturn credits.getListCredits();\n\t}",
"public static ULocale[] getAvailableLocales() {\n/* 212 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"private void setStrings(){\n ip = context.getResources().getString(R.string.ip);\n port = context.getResources().getString(R.string.port);\n dbName = context.getResources().getString(R.string.db_name);\n user = context.getResources().getString(R.string.masterUser);\n pass = context.getResources().getString(R.string.masterPass);\n }",
"public String getLocalizedString( String name ) {\n\t\tString outString = \"\";\r\n\t\tint id = getResources().getIdentifier( name, \"string\", getPackageName() );\r\n\t\tif ( id == 0 )\r\n\t\t{\r\n\t\t\t// 0 is not a valid resource id\r\n\t\t\tLog.v(\"VrLocale\", name + \" is not a valid resource id!!\" );\r\n\t\t\treturn outString;\r\n\t\t} \r\n\t\tif ( id != 0 ) \r\n\t\t{\r\n\t\t\toutString = getResources().getText( id ).toString();\r\n\t\t\t//Log.v(\"VrLocale\", \"getLocalizedString resolved \" + name + \" to \" + outString);\r\n\t\t}\r\n\t\treturn outString;\r\n\t}",
"public java.lang.String getResources(int index) {\n return resources_.get(index);\n }",
"protected static String m94909a(Context context, int i) {\n return context.getResources().getString(i);\n }",
"public static String[] getIcons() {\n String[] res = new String[crossbows.length];\n for (int i = 0; i < crossbows.length; i++) {\n res[i] = (String)crossbows[i][1];\n }\n return res;\n }",
"public String[] getStringList();",
"public String[] getResourceStringArray(int resId) {\n String[] retArray;\n synchronized (this) {\n ensureValidLocked();\n retArray = nativeGetResourceStringArray(this.mObject, resId);\n if (hasRes()) {\n for (int i = 0; i < retArray.length; i++) {\n CharSequence rt = getTextForDBid(retArray[i]);\n if (rt != null) {\n retArray[i] = rt.toString();\n }\n }\n }\n }\n return retArray;\n }",
"public static String[] getISOCountries() {\n/* 219 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"private static SparseArray<String> getStringsForLocale(Locale targetLocale, @StringRes int[] strings) {\n Configuration config = getCurrentConfiguration();\n Locale systemLocale = config.locale;\n config.locale = targetLocale;\n SparseArray<String> localizedStrings = getTargetStrings(strings, config);\n config.locale = systemLocale;\n resetConfiguration(config);\n return localizedStrings;\n }",
"private void ActionChooseCountry() {\n final AlertDialog.Builder dialog = new AlertDialog.Builder(getContext());\n dialog.setTitle(getString(R.string.dialog_title_choose_country));\n\n final List<String> countryNames = Arrays.asList(getResources().getStringArray(R.array.countries_names));\n final List<String> countryArgs = Arrays.asList(getResources().getStringArray(R.array.countries_arg));\n\n final ArrayAdapter<String> arrayAdapter = new ArrayAdapter<>(getContext(), android.R.layout.simple_list_item_1);\n arrayAdapter.addAll(countryNames);\n\n dialog.setNegativeButton(getString(R.string.dialog_btn_cancel), new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n dialogInterface.dismiss();\n }\n });\n\n dialog.setAdapter(arrayAdapter, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n CoutryArg = countryArgs.get(i);\n\n tvChooseCountry.setText(countryNames.get(i));\n if (SourceId != null) {\n SourceId = null;\n tvChooseSource.setText(R.string.tv_pick_sourse);\n currentPage = 1;\n }\n }\n });\n dialog.show();\n }",
"@Override\n public void onItemSelected(AdapterView<?> arg0, View arg1, int position, long id) {\n Toast.makeText(getApplicationContext(),country[position] , Toast.LENGTH_LONG).show();\n }",
"public String getStringResource(LocaleResource resource){\n\t\tContext c = ConnectedApp.getContextStatic();\n\t\tswitch(resource){\t\t\n\t\tcase support_contact:\n default:\n\t\t\tint resId= c.getResources().getIdentifier(resource.toString()+\"_\"+ getCountryCode().toLowerCase(Locale.US), \"string\",\n\t\t\t\t\tc.getPackageName());\n\t\t\treturn c.getString(resId);\n\t\t}\n\t\t//return null;\n\t}",
"@ArrayRes\n protected abstract int getTabTitleArrayResources();",
"public String[] getDisplayedResources(){\n\t\tString resources =\n\t\t\tHub.localCfg.get(PreferenceConstants.AG_RESOURCESTOSHOW,\n\t\t\t\tStringTool.join(agenda.getResources(), \",\")); //$NON-NLS-1$\n\t\tif (resources == null) {\n\t\t\treturn new String[0];\n\t\t} else {\n\t\t\treturn resources.split(\",\"); //$NON-NLS-1$\n\t\t}\n\t}",
"public static java.lang.String[] getAvailableIDs(java.lang.String country) { throw new RuntimeException(\"Stub!\"); }",
"public IPath[] getAdditionalResources();",
"public static String[] readStrings() {\n return readAllStrings();\n }",
"public JSONArray readFromJSON(){\n\n JSONArray jsonArray=null;\n\n try {\n InputStream inputStream =context.getResources().getAssets().open(FILE_NAME);\n int size = inputStream.available();\n byte[] data = new byte[size];\n inputStream.read(data);\n inputStream.close();\n String json = new String(data, \"UTF-8\");\n jsonArray = new JSONArray(json);\n } catch (IOException e) {\n e.printStackTrace();\n } catch (JSONException e) {\n e.printStackTrace();\n }\n return jsonArray;\n }",
"String getLocalization();",
"public static List<String> getResourceList(Context context, String ingredientId){\n String[] ingredientList = null;\n int ingredientIdentifier = context.getResources().getIdentifier(ingredientId, \"array\", context.getPackageName());\n try {\n if(ingredientIdentifier != 0) {\n ingredientList = context.getResources().getStringArray(ingredientIdentifier);\n return Arrays.asList(ingredientList);\n }\n }catch(Exception e){\n }\n return null;\n }",
"public static String [] getCities(){\n\t\tString [] s = new String [cities.length]; \n\t\tfor (int i = 0; i < cities.length; i++)\n\t\t{\n\t\t\ts[i] = cities[i].getCity();\n\t\t}\n\t\treturn s;\n\t}",
"public String[] getDataArray(String name){\n String[] string = new String[5];\n SQLiteDatabase db = this.getReadableDatabase();\n Cursor cursor = db.rawQuery(\"SELECT * FROM gericht WHERE name='\"+name+\"';\", null);\n\n if(cursor.moveToFirst()){\n do{\n for(int i=0; i<5; i++){\n string[i]=cursor.getString(i);\n }\n }while(cursor.moveToNext());\n }\n\n cursor.close();\n db.close();\n\n return string;\n }",
"private IResource[] getSelectedResourcesArray() {\r\n List selection = getSelectedResources();\r\n IResource[] resources = new IResource[selection.size()];\r\n selection.toArray(resources);\r\n return resources;\r\n }",
"public void loadSifMessages(){\n String[] sifMessagesArray = getResources().getStringArray(R.array.seek_medical_care_messages);\n if(sifEncouragingMessagesTv == null){\n Log.e(TAG, \"sifEncouragingMessagesTv is null\");\n }else{\n sifEncouragingMessagesTv.setText(sifMessagesArray[randMessageIndex(0, sifMessagesArray.length)].toString());\n }\n\n }",
"public CharSequence[] getResourceTextArray(int resId) {\n synchronized (this) {\n ensureValidLocked();\n int[] rawInfoArray = nativeGetResourceStringArrayInfo(this.mObject, resId);\n if (rawInfoArray == null) {\n return null;\n }\n int rawInfoArrayLen = rawInfoArray.length;\n CharSequence[] retArray = new CharSequence[(rawInfoArrayLen / 2)];\n int i = 0;\n int i2 = 0;\n int j = 0;\n while (i2 < rawInfoArrayLen) {\n int cookie = rawInfoArray[i2];\n int index = rawInfoArray[i2 + 1];\n retArray[j] = (index < 0 || cookie <= 0) ? null : this.mApkAssets[cookie - 1].getStringFromPool(index);\n i2 += 2;\n j++;\n }\n if (hasRes()) {\n while (true) {\n int i3 = i;\n if (i3 >= retArray.length) {\n break;\n }\n CharSequence rt = getTextForDBid(retArray[i3]);\n if (rt != null) {\n retArray[i3] = rt;\n }\n i = i3 + 1;\n }\n }\n }\n }",
"public List<String> getResources() {\n return resources;\n }",
"public ComboItem[] getCountries() {\r\n\t\treturn countries;\r\n\t}",
"public String[] getArrayValue();",
"String[] getData();",
"public static ArrayList<Integer> getPrimaryColorArray(Context context) {\n\n ArrayList<Integer> arrylst_prmrycolor = new ArrayList<Integer>();\n try {\n arrylst_prmrycolor.add(ContextCompat.getColor(context, R.color.colorPrimaryTeal));\n arrylst_prmrycolor.add(ContextCompat.getColor(context, R.color.colorPrimaryBlue));\n arrylst_prmrycolor.add(ContextCompat.getColor(context, R.color.colorPrimaryRed));\n arrylst_prmrycolor.add(ContextCompat.getColor(context, R.color.colorPrimaryPink));\n arrylst_prmrycolor.add(ContextCompat.getColor(context, R.color.colorPrimaryPurple));\n arrylst_prmrycolor.add(ContextCompat.getColor(context, R.color.colorPrimaryIndigo));\n arrylst_prmrycolor.add(ContextCompat.getColor(context, R.color.colorPrimaryDarkAmber));\n arrylst_prmrycolor.add(ContextCompat.getColor(context, R.color.colorPrimaryBlueGrey));\n } catch (Resources.NotFoundException e) {\n e.printStackTrace();\n }\n\n return arrylst_prmrycolor;\n }",
"public static String[] getISOLanguages() {\n/* 229 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"public ArrayList<String> getFlags(){\n\n JSONArray jsonArray = readFromJSON();\n\n ArrayList<String> flagList=new ArrayList<String>();\n\n if (jsonArray != null) {\n for (int i = 0; i < jsonArray.length(); i++) {\n try {\n flagList.add(jsonArray.getJSONObject(i).getString(\"iso\")); //getting the iso code of the country and adding it to an arraylist\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n }\n\n return flagList;\n }",
"private void initData() {\n Resources resources = context.getResources();\n settingTitles = resources.getStringArray(R.array.setting_array);\n selectAccent = resources.getStringArray(R.array.accent_array);\n selectAccentDisplay = resources.getStringArray(R.array.accent_display_array);\n selectSpeaker = resources.getStringArray(R.array.speaker_array);\n selectSpeakerDisplay = resources.getStringArray(R.array.speaker_display_array);\n\n positive = resources.getString(R.string.positive);\n negative = resources.getString(R.string.negative);\n answerUnKnown = resources.getString(R.string.unknown);\n answerCalling = resources.getString(R.string.calling);\n answerOpen = resources.getString(R.string.opening);\n answerFound = resources.getString(R.string.founded);\n answerNotFound = resources.getString(R.string.not_found);\n\n String systemLanguage = Util.getSystemLanguage(context).toLowerCase();\n if (systemLanguage.equalsIgnoreCase(\"zh_cn\")) {\n isEnglishEnvironment = false;\n }\n }",
"public String getName(String name) {\n return myResources.getString(name);\n }",
"public java.lang.String getResourceNames(int index) {\n return resourceNames_.get(index);\n }",
"public RegTapResource[] getResources() {\n return resMap_.values().toArray( new RegTapResource[ 0 ] );\n }",
"void fillProblemsText() {\n problemsText = new ArrayList();\n String[] problems = getResources().getStringArray(R.array.medicalProblems);\n\n for(int i=0; i<problems.length; i++)\n problemsText.add(problems[i]);\n }",
"String getString(String bundleKey, Locale locale);",
"public ArrayList<String> spinnerOptions() {\n ArrayList<String> options = new ArrayList<>();\n\n try {\n JSONObject obj = (JSONObject) jsonParser.parse(new FileReader(file.getPath()));\n\n JSONArray listCounty = (JSONArray) obj.get(\"Counties\");\n\n JSONObject county;\n\n for (int i = 0; i < listCounty.size(); i++) {\n county = (JSONObject) listCounty.get(i);\n\n options.add(county.get(\"name\").toString());\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n } catch (ParseException e) {\n e.printStackTrace();\n }\n\n return options;\n }",
"public Color[] getColors()\n {\n return colors;\n }",
"private List<String> loadLabelList(Activity activity) throws IOException {\n List<String> labelList = new ArrayList<String>();\n BufferedReader reader =\n new BufferedReader(new InputStreamReader(activity.getAssets().open(LABEL_PATH)));\n String line;\n while ((line = reader.readLine()) != null) {\n labelList.add(line);\n }\n reader.close();\n return labelList;\n }",
"private void setAnswers()\n {\n StringBuilder answers = new StringBuilder(256);\n String[] correctAnswers = getResources().getStringArray(R.array.correct_answers);\n TextView answer_view = (TextView) findViewById(R.id.answers);\n for(int i = 0 ; i < correctAnswers.length; i++)\n {\n answers.append(correctAnswers[i]);\n }\n answer_view.setText(answers.toString());\n }",
"public abstract String[] getLabels();",
"public void getCountryCode(final Spinner country){\n\n StringRequest stringRequest = new StringRequest(Request.Method.POST, DatabaseInfo.GetCountrycodeURL,\n new Response.Listener<String>() {\n @Override\n public void onResponse(String response) {\n Log.d(\"Volleyresponse\",response.toString());\n try {\n JSONArray jArray;\n JSONObject Jobject = (JSONObject) new JSONTokener(response).nextValue();\n Log.e(\"volleyJson\", Jobject.toString());\n try {\n jArray = Jobject.getJSONArray(\"country\");\n Toast.makeText(getApplicationContext(),String.valueOf(jArray.length()+1),Toast.LENGTH_SHORT).show();\n int jarraylength=jArray.length()+1;\n\n String c1[] = new String[jarraylength];\n String c2[] = new String[jarraylength];\n String c3[] = new String[jarraylength];\n String sname,cid;\n for (int i = 0; i <jarraylength+1; i++) {\n JSONObject json_data = jArray.getJSONObject(i);\n\n\n cid = json_data.getString(\"id\");\n sname = json_data.getString(\"name\");\n Log.e(sname, \"got\");\n Log.e(\"got\",json_data.toString());\n Log.e(cid, \"got\");\n c1[i]=cid;\n c3[i]=sname;\n Log.e(\"list sizzeeeee\",String.valueOf(countrycodename.size()+1));\n countrycodename.add(i,sname);\n countrycodid.add(i ,cid);\n\n\n\n }\n\n\n } catch (Exception e) {\n }\n countrycodename.add(0,\"Select Country\");\n countrycodid.add(0,\"0\");\n\n ArrayAdapter<String> spinnerAdapter =new ArrayAdapter<String>(getApplicationContext(),R.layout.spinner_iltem,countrycodename);\n spinnerAdapter.setDropDownViewResource(R.layout.spinner_iltem);\n\n country.setAdapter(spinnerAdapter);\n country.setSelection(0);\n // Toast.makeText(getApplicationContext(),\" country code size \"+String.valueOf(Arrays.asList(countrycodid.size())),Toast.LENGTH_SHORT).show();\n\n // Toast.makeText(getApplicationContext(),\"country string array count \"+countrycodename.length,Toast.LENGTH_SHORT).show();\n\n } catch (Exception e) {\n }\n// pDialog.hide();\n // Toast.makeText(getActivity().getApplication(),response,Toast.LENGTH_LONG).show();\n }\n },\n\n new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n// pDialog.hide();\n Toast.makeText(MatrimonyRegistration.this,error.toString(), Toast.LENGTH_LONG).show();\n }\n }) {\n @Override\n protected Map<String, String> getParams() {\n Map<String, String> params = new HashMap<String, String>();\n return params;\n }\n\n };\n\n //Adding the string request to the queue\n RequestQueue requestQueue = Volley.newRequestQueue(this);\n requestQueue.add(stringRequest);\n\n stringRequest.setRetryPolicy(new DefaultRetryPolicy(10000,\n DefaultRetryPolicy.DEFAULT_MAX_RETRIES,\n DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));\n }",
"final CharSequence[] getResourceTextArray(final int id) {\n int[] rawInfoArray = getArrayStringInfo(id);\n if (rawInfoArray == null) {\n throw new NullPointerException(\"AssetManager.getResourceTextArray rawInfoArray is null\");\n }\n int rawInfoArrayLen = rawInfoArray.length;\n final int infoArrayLen = rawInfoArrayLen / 2;\n int block;\n int index;\n CharSequence[] retArray = new CharSequence[infoArrayLen];\n for (int i = 0, j = 0; i < rawInfoArrayLen; i = i + 2, j++) {\n block = rawInfoArray[i];\n index = rawInfoArray[i + 1];\n retArray[j] = index >= 0 ? mStringBlocks[block].get(index) : null;\n }\n return retArray;\n }",
"public static int getResourceByName(Context context, String resource_name) {\n\n String final_name = resource_name.toLowerCase().equals(\"bangalore\") ? \"bengaluru\" : resource_name.replace(\" \", \"_\").toLowerCase();\n\n return context.getResources().getIdentifier(final_name, \"drawable\", context.getPackageName());\n }",
"@Override\n\t\t\t\tpublic void onItemSelected( AdapterView< ? > parent,\n\t\t\t\t\t\t\t\t\t\t\tView view,\n\t\t\t\t\t\t\t\t\t\t\tint position,\n\t\t\t\t\t\t\t\t\t\t\tlong id )\n\t\t\t\t{\n\t\t\t\t\tString[] genders = Resources.getSystem().getStringArray( R.array.Genders );\n\t\t\t\t}",
"Set<String> getGameShortcodes();",
"String getString(String bundleKey);",
"@Source(\"gr/grnet/pithos/resources/translate.png\")\n ImageResource selectAll();",
"public static ArrayList<String> getArray(String jsonFile, String jsonName,String jsonNames, String jsonKey, Context context)\n {\n String jsonCategorias = Common.loadJSONFromAsset(context,jsonFile);\n JSONObject obj_categorias;\n JSONObject obj_categoria;\n\n\n ArrayList<String> lista = new ArrayList<String>();\n\n ///////////////\n try {\n\n obj_categorias = new JSONObject(jsonCategorias);\n JSONArray res = obj_categorias.getJSONArray(jsonName);\n\n for (int i = 0; i < res.length(); i++) {\n obj_categoria = res.getJSONObject(i).getJSONObject(jsonNames);\n\n String name = obj_categoria.getString(jsonKey);\n lista.add(name);\n\n }\n\n\n\n }\n\n catch (Exception e)\n {\n Log.d(\"Utils\",\"Can not read json file categories\");\n //return null;\n\n }\n\n ///////\n return lista;\n\n }",
"public static I18NBundle getStrings() {\n\t\treturn strings;\n\t}",
"private List<String> loadLabelList(Activity activity) throws IOException {\n List<String> labelList = new ArrayList<String>();\n BufferedReader reader =\n new BufferedReader(new InputStreamReader(activity.getAssets().open(LABEL_PATH)));\n String line;\n while ((line = reader.readLine()) != null) {\n labelList.add(line);\n }\n reader.close();\n return labelList;\n }",
"public String[] getColour()\n {\n return colour;\n }",
"@Override\n public void initialize(URL url, ResourceBundle rb)\n {\n String[] datos=Habitacion.getdatos();\n caracteristicas.setText(datos[0]); \n precio.setText(datos[1]);\n estado.setText(datos[2]);\n tipo_hab.setText(datos[3]);\n piso.setText(datos[4]);\n caracteristicas.setText(datos[5]);\n }",
"public String[] getNames(){\n File file = new File(getContext().getFilesDir(),\"currentUsers.txt\");\n List<String> names = null;\n try {\n //read names from file\n names = new ArrayList<>(FileUtils.readLines(file, Charset.defaultCharset()));\n Log.i(TAG,\"names from currentUsers.txt: \" + names.toString());\n usernames = new String[names.size()];\n //populate the array with the data form file\n for(int i = 0; i < usernames.length; i++){\n String user = names.get(i);\n usernames[i] = user;\n Log.i(TAG, \"added \" + usernames[i] + \" to usernames array\");\n }\n } catch (IOException e) {\n Log.i(TAG, \"error: \" + e.getLocalizedMessage());\n }\n return usernames;\n }",
"public String[] getVariants(int[] randIds){\n Cursor crs;\n String[] variants = new String[4];\n for(int i = 0; i< 4; i++){\n String[] args = new String[1];\n args[0] = Integer.toString(randIds[i]+1);\n crs = aniDB.getReadableDatabase().rawQuery(\"SELECT name FROM titles WHERE id = ?\",args);\n if(crs.moveToFirst()) {\n variants[i] = crs.getString(crs.getColumnIndex(\"name\"));\n }\n crs.close();\n }\n return variants;\n }",
"public List<IResource> getResources();",
"@Override\n public void initialize(URL url, ResourceBundle resourceBundle) {\n ObservableList<String> countryNames = FXCollections.observableArrayList();\n for (Countries c : DBCountries.getAllCountries()) {\n countryNames.add(c.getName());\n }\n countryCombo.setItems(countryNames);\n }",
"String getString(String bundleKey, String bundleBaseName, Locale locale);",
"public static final ULocale[] getAvailableULocales()\n/* */ {\n/* 440 */ return getAvailableULocales(\"com/ibm/icu/impl/data/icudt48b\", ICU_DATA_CLASS_LOADER);\n/* */ }",
"public void createCountries() {\n\t\t\n\t\tcountryArray = new Country[Constants.NUM_COUNTRIES];\n\t\t\n\t\tfor(int i=0; i<Constants.NUM_COUNTRIES; i++) {\n\t\t\tcountryArray[i] = (new Country(i));\n\t\t}\n\t}",
"private static VKApiCountry[] m147467a(int i) {\n return new VKApiCountry[i];\n }",
"public List<String> getList(String path) {\n return yml.getStringList(path).stream().map(s -> ChatColor.translateAlternateColorCodes('&', s)).collect(Collectors.toList());\n }",
"public java.lang.String getResourceNames(int index) {\n return resourceNames_.get(index);\n }",
"private void carregarDadosSpinner() {\n String[] categorias = getResources().getStringArray(R.array.categorias);\n //adicionar valores do spinner\n ArrayAdapter<String> adapterCategorias = new ArrayAdapter<String>(\n getApplicationContext(), android.R.layout.simple_spinner_item,\n categorias\n );\n adapterCategorias.setDropDownViewResource(android.R.layout\n .simple_spinner_dropdown_item);\n campoCategorias.setAdapter(adapterCategorias);\n\n }",
"private void loadResourcesData(){\n //showResourceListView();\n\n String [] resourceData = new String [20];\n\n for(int stringCount = 1; stringCount <= 20; stringCount++) {\n resourceData[stringCount - 1] = \"Title \" + stringCount;\n }\n\n mResourceListAdapter.setResourceData(resourceData);\n }",
"public ArrayList<String> getColorList()\n {\n \treturn colors;\n }",
"@DrawableRes\n public static int getFlagDrawableResId(String country) {\n switch (country) {\n\n case \"ly\": //libya\n return R.drawable.flag_libya;\n\n default:\n return R.drawable.flag_libya;\n }\n }",
"@Override\r\n public void initialize(URL url, ResourceBundle rb) {\n correctButtonName = buttonList[(int)(Math.random() * buttonList.length)];\r\n \r\n/* If you want to test out the program but hate guessing, this will give you the correct button name.\r\n This is a cheat code for \"X Marks The Spot!\".\r\n System.out.print(correctButtonName);\r\n*/\r\n }",
"public String getS(String name){\t\n\t\t\n\t\tString packageName = activity.getPackageName();\n\t\tint resId = activity.getResources().getIdentifier(name, \"string\", packageName);\n\t\treturn activity.getString(resId);\n\t\t \n\t}",
"public static String getString(Context context, String name)\n\t{\n\t\treturn context.getResources().getString(RR.getStringId(name));\n\t}",
"public String[] getLocalNames() {\r\n\t\treturn names.toArray(new String[0]);\r\n\t}"
] | [
"0.68345064",
"0.61329603",
"0.60308945",
"0.5996853",
"0.5916384",
"0.5717338",
"0.5702808",
"0.56982255",
"0.5691909",
"0.5628091",
"0.5625466",
"0.56045747",
"0.559297",
"0.55697215",
"0.5497698",
"0.54630256",
"0.54573375",
"0.5452863",
"0.54451555",
"0.5439726",
"0.5438609",
"0.54311156",
"0.5418859",
"0.5415927",
"0.5395695",
"0.53913766",
"0.53734946",
"0.53629476",
"0.5330297",
"0.5319441",
"0.5314779",
"0.53022915",
"0.52971315",
"0.5257282",
"0.5256161",
"0.5247263",
"0.52162343",
"0.5185286",
"0.5183893",
"0.5182469",
"0.51821005",
"0.51716757",
"0.5160316",
"0.51506627",
"0.5144689",
"0.5138619",
"0.5116375",
"0.51087576",
"0.50979054",
"0.509257",
"0.50891674",
"0.5080971",
"0.50769687",
"0.5076333",
"0.5074367",
"0.50610197",
"0.5057859",
"0.50525844",
"0.50483316",
"0.50438446",
"0.50312185",
"0.50291955",
"0.5019408",
"0.50146616",
"0.49955714",
"0.49934584",
"0.49795845",
"0.4976937",
"0.49735865",
"0.4961059",
"0.49607122",
"0.4960588",
"0.49581933",
"0.49580428",
"0.49551362",
"0.4946826",
"0.4938978",
"0.49377337",
"0.493602",
"0.49346587",
"0.49291718",
"0.49291414",
"0.49279556",
"0.49159026",
"0.49072897",
"0.49026704",
"0.4901412",
"0.48987883",
"0.48961523",
"0.48938203",
"0.48932227",
"0.48897177",
"0.48872155",
"0.4878287",
"0.4875053",
"0.48740792",
"0.4866085",
"0.48627466",
"0.4860335",
"0.48597822",
"0.48345727"
] | 0.0 | -1 |
Constructs a new DisorderException | public DisorderException() {
super("A process was run after its parent");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public DynamicDeckDynamoException() {\n }",
"public PropagationException() {\n }",
"public OperationException() {\n super();\n }",
"SpaceInvaderTest_test_UnNouveauVaisseauPositionneHorsEspaceJeu_DoitLeverUneException createSpaceInvaderTest_test_UnNouveauVaisseauPositionneHorsEspaceJeu_DoitLeverUneException();",
"public RedoException(){\r\n\t\tsuper();\r\n\t}",
"public Exception() {\n\t\t\tsuper();\n\t\t}",
"public DeferConsultationException() {\n }",
"public ShopingCartException() {\n\tsuper(); // call superclass constructor\n\tmistake = \"unknown\";\n }",
"public PreparationException() {\n\t\tsuper();\n\t}",
"public PropagationException(String msg) {\n super(msg);\n }",
"public DynamicDeckDynamoException(String message) {\n super(message);\n }",
"public GameBuyException() {\n }",
"public PizzaException() {\n super(\"That pizza has been eaten.\");\n }",
"public Exception() {\n\tsuper();\n }",
"public NotAnOrphanException()\n {\n super();\n }",
"public PriceModelException() {\n\n }",
"public NSException() {\n\t\tsuper();\n\t\tthis.exception = new Exception();\n\t}",
"public KillException() {}",
"public DataAccessLayerException() {\n }",
"public negativeNumberException() {\r\n\t \t \r\n\t }",
"public StockException() {\r\n\t\tsuper();\r\n\t}",
"public ShieldException() {\n }",
"public OfferingException() {\n }",
"public NetworkException() {\n\t\tsuper();\n\t}",
"InvalidDeletionException() {\n super();\n }",
"public SucheException() {\n }",
"public RDISException(String msg) {\n\t\tthis(msg, null);\n\t}",
"InvalidDeletionException(String message) {\n super(message);\n }",
"public RentalException(String reason){\n super(reason);\n }",
"public XDBBaseException() {\n }",
"public OperationException(String message) {\n super(message);\n }",
"public MyMoneyException() {\r\n\t\tsuper();\r\n\t}",
"public NegativeBalanceException(String message){\n super(message);\n }",
"public MRFException() {\n\t\tsuper();\n\t}",
"public ItemInvalidoException() {\r\n }",
"GitletException() {\n super();\n }",
"public AditoGitException(Exception pE)\n {\n super(pE);\n }",
"@SuppressWarnings(\"unused\")\r\n\tprivate TransporterException(){\r\n\t\t\r\n\t}",
"public CommunicationException() {\r\n\t\tsuper();\r\n\t}",
"public ScheduleException() {\r\n }",
"public DuplicateItemException() {\r\n super();\r\n }",
"public OLMSException() {\r\n super();\r\n }",
"public DaoException() {\r\n\t\tsuper();\r\n\t}",
"public TDLProException(String message)\n {\n super(message);\n }",
"public TwoDAReadException(String message) { super(message); }",
"public CacheException() {\r\n\t\tsuper();\r\n\t}",
"public TR069Exception(DmtException e) {\n\t\tsuper(e);\n\t\tthis.faultCode = getFaultCode(e);\n\t\tthis.dmtException = e;\n\t}",
"public QueryException() {\n\n }",
"public PriceModelException(Reason reason) {\n super(reason.toString());\n setMessageKey(getMessageKey() + \".\" + reason.toString());\n }",
"public YardException(String reason) {\n super(reason);\n }",
"public CryptoException(short reason) { super(reason); }",
"public BadDiceException() {\n }",
"public FullCarException() {\r\n super(\"\");\r\n }",
"public DSSEncodingException(MSG key) {\n init(key);\n }",
"public NegativeBalanceException(double balance){\n super();\n this.balance = balance;\n }",
"public MyException(String message)\n { super(message); }",
"public MyException() {\n super(\"This is my message. There are many like it but this one is mine.\");\n }",
"protected static ExceptionSignalingNode createExceptionNode(final SourceSection ss) {\n CompilerDirectives.transferToInterpreter();\n return ExceptionSignalingNode.createNode(Symbols.symbolFor(\"TypeError\"), ss);\n }",
"public DataControlException() {\r\n }",
"public PascalTriangleException()\r\n {\r\n }",
"public InvalidDeliveryException(String message) {\n super(message);\n }",
"public Exception(String s) {\n\tsuper(s);\n }",
"public BDException() {\n\t\tsuper();\n\t\t// TODO Auto-generated constructor stub\n\t}",
"public BusinessObjectException() {\r\n super();\r\n }",
"public PizzaException(String message) {\n super(message);\n }",
"public OrderServiceSecurityException() {\n\t}",
"public withdrawException(String msg) {\n super(msg);\n }",
"public Neo4jException(String message) {\n this(\"N/A\", message);\n }",
"protected ValidationException() {\r\n\t\t// hidden\r\n\t}",
"public ObjectDescriptionException() {\r\n super();\r\n }",
"public TechnicalException() {\r\n }",
"public ClustererFactoryException(String msg, String classname) {\n super(msg, classname);\n }",
"public EntityTransactionException() {\r\n\t\tsuper();\r\n\t}",
"public InvalidMarkException() { }",
"public CIMException() {\n\t\tthis((String) null, (Object[]) null);\n\t}",
"public EmptyDeckException() {\n\t}",
"public EmptyHeapException() {\n }",
"public UnmatchedException(){\r\n\r\n\t}",
"public PreparationException(final String message) {\n\t\tsuper(message);\n\t}",
"public TypeException() {\n }",
"public BusinessObjectException(Exception e) {\r\n super( \"\" + e );\r\n }",
"public RedoException(String message) {\r\n\t\tsuper(message);\r\n\t}",
"public CommandFailedByConfigException() {\n }",
"public InvalidMoveException() {\n super(\"Invalid move!\");\n }",
"public ToDoException() {\n super(\"OOPS!!! The description of a todo cannot be empty.\");\n }",
"public NEOLoggerException()\n {\n }",
"public DslException(String message, Exception e) {\n\t\tsuper(message, e);\n\t}",
"public EntidadNoBorradaException() {\n super();\n }",
"public AditoGitException(String pMessage, Exception pE)\n {\n super(pMessage, pE);\n }",
"public DslException(String message) {\n\t\tsuper(message);\n\t}",
"public IllegalArgumentException buildException() {\n return this.buildException(null);\n }",
"public HttpException() {\n }",
"WireframeException(String message){\r\n super(message);\r\n }",
"public OperationFailedException(String message, Exception causeOfException){\n super(message, causeOfException);\n }",
"public UnderflowException(String message) {\n super(message);\n }",
"public Exception(String message) {\n\t\t\tsuper(message);\n\t\t}",
"public PostFixException(){\n\t\tsuper();\n\t}",
"public SmppException() {\n\t\tsuper();\n\t}",
"public StackUnderflowException(String e) {\n\t\tsuper(e);\n\t}",
"public SMSLibException(String errorMessage, Throwable originalE)\n/* 22: */ {\n/* 23:50 */ super(errorMessage);\n/* 24:51 */ this.originalE = originalE;\n/* 25: */ }"
] | [
"0.67090505",
"0.6641601",
"0.6193778",
"0.608054",
"0.6040204",
"0.599005",
"0.5989253",
"0.5984042",
"0.5969757",
"0.5956021",
"0.59469587",
"0.5917267",
"0.59056705",
"0.59051865",
"0.58687735",
"0.58647823",
"0.58330643",
"0.5822153",
"0.58110255",
"0.58040935",
"0.5773773",
"0.5767674",
"0.57609016",
"0.5754038",
"0.57528657",
"0.5742046",
"0.5738933",
"0.5732308",
"0.57312053",
"0.5730356",
"0.5713277",
"0.5704256",
"0.56957805",
"0.56895727",
"0.5689406",
"0.5678595",
"0.56700885",
"0.56530255",
"0.5651666",
"0.5646444",
"0.56383836",
"0.5636485",
"0.5633654",
"0.56330955",
"0.5630896",
"0.5628282",
"0.5625829",
"0.56249845",
"0.56246257",
"0.56216055",
"0.56186616",
"0.56113064",
"0.55982816",
"0.55941784",
"0.5579365",
"0.55774957",
"0.55726355",
"0.5566048",
"0.5565996",
"0.5563483",
"0.5550501",
"0.55494714",
"0.5547889",
"0.5539103",
"0.55382144",
"0.5537598",
"0.55364746",
"0.5531237",
"0.55298287",
"0.5529212",
"0.55270827",
"0.5522153",
"0.5521213",
"0.5501707",
"0.54987425",
"0.5491264",
"0.54888827",
"0.5481838",
"0.54804033",
"0.54791635",
"0.5474823",
"0.54687285",
"0.5464815",
"0.5456834",
"0.5456501",
"0.54549646",
"0.5452432",
"0.54417676",
"0.54409885",
"0.54391044",
"0.5433377",
"0.54325634",
"0.54276997",
"0.54223126",
"0.5421323",
"0.5417854",
"0.54161984",
"0.5411401",
"0.5411019",
"0.5400166"
] | 0.62542164 | 2 |
Will override existing object instead of returning false. | @Override
public boolean add(Building object) {
if (contains(object)) {
super.remove(object);
}
super.add(object);
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic boolean isExisting() {\n\t\treturn false;\r\n\t}",
"@Override\n public boolean exists()\n {\n return orig.exists();\n }",
"@Override\n\tpublic boolean update(Dynamic object) {\n\t\treturn false;\n\t}",
"@Override\n\tpublic void updateFalse(MetodoPagamento object) {\n\t\t\n\t}",
"@Override\n\tpublic boolean update(Etape obj) {\n\t\treturn false;\n\t}",
"@Override\n public boolean update(Revue objet) {\n return false;\n }",
"@Override\r\n\t\tpublic boolean implementEquals(Object obj) {\n\t\t\treturn false;\r\n\t\t}",
"@Override\r\n\tpublic boolean update(Moteur obj) {\n\t\treturn false;\r\n\t}",
"@Override\n\tpublic boolean isNew() {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean isNew() {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean isNew() {\n\t\treturn false;\n\t}",
"@Override\n public boolean IsNewObject()\n {\n return _isNewObject;\n }",
"@Override\n\tpublic boolean update(Document obj) {\n\t\treturn false;\n\t}",
"@Override\n public boolean equals(Object other) {\n return false;\n }",
"@Override\n\tpublic boolean update() {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean update() {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean update() {\n\t\treturn false;\n\t}",
"@Override // com.google.common.base.Equivalence\n public boolean doEquivalent(Object a, Object b) {\n return false;\n }",
"@Override\r\n public boolean update(Person old, Person updated) {\n return false;\r\n }",
"@Override\n\tpublic boolean erTom() {\n\t\treturn (bak == null);\n\t}",
"boolean isReplaceable();",
"public boolean update(Etudiant obj) {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean equal() {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean equals(Object other)\n\t{\n\t\treturn false;\n\t}",
"@Override\n public boolean equals(Object o) {\n return false;\n }",
"@Override\n\tpublic boolean equals(Object obj) {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean equals(Object obj) {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean equals(Object obj) {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean equals(Object obj) {\n\t\treturn false;\n\t}",
"public void setNewObject(boolean newObject)\r\n\t{\r\n\t\tthis.newObject = newObject;\r\n\t}",
"@Override\n public boolean isObject() {\n return false;\n }",
"public boolean update(New object);",
"@Override\n\tpublic boolean update(Langues obj) {\n\t\treturn false;\n\t}",
"@Override\n public boolean getOrReplace() {\n return orReplace_;\n }",
"@Override\n public boolean getOrReplace() {\n return orReplace_;\n }",
"public static boolean allowOverwrite() {\n\t\tif ((xml != null) && (overwrite != null) && overwrite.equals(\"no\")) return false;\n\t\treturn true;\n\t}",
"public final boolean tryOwn() {\n return own(this) == this;\n }",
"@Override\n public boolean getOrReplace() {\n return orReplace_;\n }",
"@Override\n public boolean getOrReplace() {\n return orReplace_;\n }",
"boolean isOverride();",
"@Override\n public boolean create(Revue objet) {\n return false;\n }",
"boolean shouldModify();",
"@Override\r\n\tpublic boolean update(Amigo amigo) {\n\t\treturn false;\r\n\t}",
"public boolean is_overwrite() {\n\t\treturn _overwrite;\n\t}",
"@Override\n public boolean equals(Object obj) {\n return super.equals(obj);\n }",
"public boolean doModify() {\n return true;\n }",
"@Override\n public final boolean equals(Object obj) {\n return super.equals(obj);\n }",
"@Override\n\tprotected boolean itemExists() {\n\t\treturn false;\n\t}",
"@SuppressWarnings(\"unchecked\")\n public boolean stillExists(Object obj) {\n \treturn true;\n }",
"@Override\n\tpublic boolean paie() {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean update(NPC_tmpl obj) {\n\t\treturn false;\n\t}",
"@java.lang.Override\n public boolean hasObject() {\n return object_ != null;\n }",
"@Override\r\n\tpublic boolean validaObj() {\n\t\treturn false;\r\n\t}",
"@Override\n\tprotected boolean canBeRidden(Entity entityIn)\n\t{\n\t\treturn false;\n\t}",
"@Override\n public boolean isDirty()\n {\n return false;\n }",
"@Override\n public boolean isOutdated() {\n return false;\n }",
"@Override\n public boolean isDirty() {\n return false;\n }",
"@Override\n public final boolean equals( Object obj ) {\n return super.equals(obj);\n }",
"@Override\n\tpublic boolean equals(TestObject obj) {\n\t\treturn false;\n\t}",
"@Override\n public boolean save()\n {\n return false;\n }",
"@Override\n public boolean isExist(Object o) {\n return true;\n }",
"@Override\r\n\tpublic boolean create(Jeu obj) {\n\t\treturn false;\r\n\t}",
"@Override\n protected boolean doEquals(Object obj) {\n if (obj instanceof BsUserInfo) {\n BsUserInfo other = (BsUserInfo)obj;\n if (!xSV(_id, other._id)) { return false; }\n return true;\n } else {\n return false;\n }\n }",
"@Override\n public boolean isModified() {\n return true;\n }",
"@Override\r\n public boolean equals(Object obj) {\r\n return super.equals(obj);\r\n }",
"@Override\n\tpublic boolean update(Order bean) {\n\t\treturn false;\n\t}",
"public boolean isObject() {\n return false;\n }",
"@Override\n public boolean canUpdate() { return false; }",
"@Override\n public boolean equals(Object obj) {\n return super.equals(obj);\n }",
"@Override\n\tpublic boolean update(Dates obj) {\n\t\treturn false;\n\t}",
"boolean getOrReplace();",
"boolean getOrReplace();",
"public BooleanProperty getOverrideProperty() {\n return overrideProperty;\n }",
"@Override\n\t\tpublic boolean equals(Object obj) {\n\t\t\treturn super.equals(obj);\n\t\t}",
"public boolean shouldOverrideExistingValue(String seqName, Object existingValue) {\n if (shouldAcquireValueAfterInsert()) {\n return true;\n } else {\n // Check if the stored number is greater than zero (a valid sequence number)\n if (existingValue instanceof BigDecimal) {\n if (((BigDecimal)existingValue).signum() <= 0) {\n return true;\n }\n } else if (existingValue instanceof BigInteger) {\n if (((BigInteger)existingValue).signum() <= 0) {\n return true;\n }\n }\n //CR#2645: Fix for String ClassCastException. Now we don't assume\n //anything which is not a BigDecimal to be a Number.\n else if (existingValue instanceof Number && (((Number)existingValue).longValue() <= 0)) {\n return true;\n }\n\n return false;\n }\n }",
"@Override\n\tpublic boolean equals(Object o) {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean equals(Object o) {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean equals(Object o) {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean equals(Object o) {\n\t\treturn false;\n\t}",
"@Override\r\n\tpublic boolean updateUser() {\n\t\treturn false;\r\n\t}",
"public void override() {\n isOverridden = true;\n }",
"@Override\n public boolean equals(final Object obj) {\n return super.equals(obj);\n }",
"@Override\n public boolean equals(Object other) {\n return super.equals(other);\n }",
"@Override\n\tpublic boolean equals(Object arg0) {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean equals(Object arg0) {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean equals(Object arg0) {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean equals(Object arg0) {\n\t\treturn false;\n\t}",
"@Override\n public final boolean equals(final Object other) {\n return super.equals(other);\n }",
"@Override\n public boolean updateBaseIncludeNull(TFollowPersonVo source, TFollowPersonVo target) {\n\n return dao.updateBaseIncludeNull(source, target) > 0 ? true : false;\n\n }",
"@Override\n public boolean updateBase(TFollowPersonVo source, TFollowPersonVo target) {\n\n return dao.updateBase(source, target) > 0 ? true : false;\n\n }",
"@Override\n public boolean isMutable()\n {\n return true;\n }",
"public void setOverwrite(boolean overwrite)\n {\n this.overwrite = overwrite;\n }",
"@Override\r\n\tpublic boolean gbAttachUpdate(GbAttachDto dto) {\n\t\treturn false;\r\n\t}",
"@Override\n\tpublic boolean delete(Dynamic object) {\n\t\treturn false;\n\t}",
"public boolean isNew(){\n return isNew;\n }",
"@Override\r\n\tpublic boolean isExist() {\n\t\treturn false;\r\n\t}",
"@Override\n\tpublic boolean isRented() {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean remove(Object o) {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean remove(Object o) {\n\t\treturn false;\n\t}",
"boolean isModified();",
"boolean isModified();"
] | [
"0.70096207",
"0.6966421",
"0.68306017",
"0.6686205",
"0.6600052",
"0.65641814",
"0.6524878",
"0.650761",
"0.64159065",
"0.64159065",
"0.64159065",
"0.6375276",
"0.63592815",
"0.62068206",
"0.61422646",
"0.61422646",
"0.61422646",
"0.61377287",
"0.61320215",
"0.61043656",
"0.60729915",
"0.6058556",
"0.605494",
"0.6048213",
"0.6043947",
"0.59919125",
"0.59919125",
"0.59919125",
"0.59919125",
"0.5987727",
"0.59757483",
"0.597052",
"0.5968459",
"0.595414",
"0.595414",
"0.5948851",
"0.59269005",
"0.5913189",
"0.5913189",
"0.591286",
"0.59114",
"0.5902961",
"0.59024364",
"0.5901049",
"0.5889006",
"0.58759886",
"0.5871645",
"0.58617234",
"0.5860326",
"0.58569014",
"0.58469963",
"0.5828954",
"0.5822685",
"0.5807659",
"0.58014774",
"0.5796619",
"0.5795582",
"0.5792578",
"0.57888764",
"0.5785379",
"0.5772903",
"0.5769026",
"0.57595825",
"0.57525355",
"0.574999",
"0.574873",
"0.57477355",
"0.5742816",
"0.57386434",
"0.5720519",
"0.571547",
"0.571547",
"0.56825036",
"0.5680806",
"0.56755465",
"0.56753385",
"0.56753385",
"0.56753385",
"0.56753385",
"0.566935",
"0.5660852",
"0.56553465",
"0.56539047",
"0.56534934",
"0.56534934",
"0.56534934",
"0.56534934",
"0.5649826",
"0.5641856",
"0.56354433",
"0.5627378",
"0.5624086",
"0.5623371",
"0.56210005",
"0.5620566",
"0.5620097",
"0.5619938",
"0.5617704",
"0.5617704",
"0.5617338",
"0.5617338"
] | 0.0 | -1 |
TODO Autogenerated method stub | @SuppressLint("SetJavaScriptEnabled")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mReciveOneMailDB = (ReciveOneMailDB) (savedInstanceState != null ? savedInstanceState
.getSerializable("mReciveOneMail") : getIntent()
.getSerializableExtra("mReciveOneMail"));
emailUsername = (savedInstanceState != null ? savedInstanceState
.getString("emailUsername") : getIntent().getStringExtra(
"emailUsername"));
if (mReciveOneMailDB == null) {
finish();
}
dialog = DialogUtils.showLoading(mContext,
mContext.getString(R.string.dialog_loading), true);
dialog.setCanceledOnTouchOutside(false);
dialog.show();
emailUid = mReciveOneMailDB.getUserid();
sjx_layout_006.setVisibility(View.GONE);
String mSubject = TextUtils.isEmpty(mReciveOneMailDB.getSubject()) ? "无标题文档"
: mReciveOneMailDB.getSubject();
// String mFrom = TextUtils.isEmpty(mReciveOneMailDB.getForm()) ? ""
// : mReciveOneMailDB.getForm();
// String mTo = TextUtils.isEmpty(mReciveOneMailDB.getTopeople()) ? ""
// : mReciveOneMailDB.getTopeople();
// String mCC = TextUtils.isEmpty(mReciveOneMailDB.getCcpeople()) ? ""
// : mReciveOneMailDB.getCcpeople();
// String mTime = TextUtils.isEmpty(mReciveOneMailDB.getSentDate()) ? ""
// : mReciveOneMailDB.getSentDate();
tv_title.setText(mSubject);
// sjx_yj_fjr.setText(mFrom);
// sjx_yj_sjr.setText(mTo);
// if (TextUtils.isEmpty(mCC)) {
// findViewById(R.id.lyout_caosong).setVisibility(View.GONE);
// } else
// sjx_yj_cs.setText(mCC);
// sjx_yj_fssj.setText(mTime);
path = StorageUtils.getStorageFile().toString()
+ Constants.ROOT_DIRECTION + "/tmp";
new Thread(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
// String AppfileName = mReciveOneMailDB.getAppfileName();
List<ATTACH> mAttachs = SQLiteUtils.getInstance(mContext)
.getEmailAttachsFromDb(emailUsername, emailUid);
// feed = readFile(path + "/" + AppfileName);
mDetails = SQLiteUtils.getInstance(mContext)
.getEmailDetailFromDb(emailUsername, emailUid);
android.os.Message msg = mHandler.obtainMessage();
msg.what = 1;
msg.obj = mAttachs;
mHandler.sendMessage(msg);
}
}).start();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub String AppfileName = mReciveOneMailDB.getAppfileName(); | @Override
public void run() {
List<ATTACH> mAttachs = SQLiteUtils.getInstance(mContext)
.getEmailAttachsFromDb(emailUsername, emailUid);
// feed = readFile(path + "/" + AppfileName);
mDetails = SQLiteUtils.getInstance(mContext)
.getEmailDetailFromDb(emailUsername, emailUid);
android.os.Message msg = mHandler.obtainMessage();
msg.what = 1;
msg.obj = mAttachs;
mHandler.sendMessage(msg);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getFileName()\n {\n return getString(\"FileName\");\n }",
"@Column(length = 500, name = \"FILE_NAME\")\r\n public String getFileName() {\r\n return this.fileName == null ? null : this.fileName.substring(this.fileName.lastIndexOf(File.separator) + 1);\r\n }",
"public String GetFileName() {\r\n\treturn fileName;\r\n }",
"public String getFileName(){\n\t\treturn _fileName;\n\t}",
"public String getFileName(){\r\n\t\treturn linfo != null ? linfo.getFileName() : \"\";\r\n\t}",
"public String filename (){\r\n\t\t\treturn _filename;\r\n\t\t}",
"protected String getFileName() {\n\t\treturn fileName;\n\t}",
"public String getFileName ()\n\t{\n\t\treturn FileName;\n\t}",
"public String getDataFileName() {\treturn dataFileName;\t}",
"public String getFileName()\r\n {\r\n return sFileName;\r\n }",
"public String getFILE_NAME() { return FILE_NAME; }",
"public String getDatabaseFileName();",
"public String getFileName(){\n\t\treturn fileName;\n\t}",
"public String getFile_name() {\n\t\treturn file_name;\n\t}",
"public java.lang.String getApplicationBinaryFileName() {\r\n return applicationBinaryFileName;\r\n }",
"public String getFileName() {\n\t\treturn mItems.getJustFileName();\n\t}",
"@Column(name = \"FILE_NAME\", nullable = false, length = 100 )\n public String getFileName() {\n return fileName;\n }",
"public final String getAppName( )\n\t{\n\t\treturn this.data.getString( \"applicationName\" );\n\t}",
"private File getAppDatabaseFile() {\n Log.i(\"getAppDatabase\", \"Getting app database\");\n try {\n File file = new File(this.context.getFilesDir(), SecretConstants.DATABASE_NAME);\n Log.i(\"getAppDatabase\", \"File name: \" + file.getName());\n FileOutputStream outputStream = new FileOutputStream(file);\n DropboxAPI.DropboxFileInfo info =\n MainActivity.mDBApi.getFile(file.getName(), null, outputStream, null);\n Log.i(\"getAppDatabase\", \"The file's rev is: \" + info.getMetadata().rev);\n return file;\n } catch (Exception e) {\n Log.e(\"getAppDatabase\", e.toString(), e);\n }\n return null;\n }",
"public String getFileName()\n\t{\n\t\treturn fileName;\n\t}",
"public String getFileName()\n\t{\n\t\treturn fileName;\n\t}",
"public String getFileName()\r\n/* 11: */ {\r\n/* 12:45 */ return this.fileName;\r\n/* 13: */ }",
"public String getFileName() {\n/* 43:43 */ return this.fileName;\n/* 44: */ }",
"public String getFileName() \n {\n return fileName;\n }",
"public String getFileName()\r\n {\r\n return fileName;\r\n }",
"protected String getMailFileName(MessageMetaData message) {\n \t\treturn \"\" + message.date.getTime() + '-' + message.unid;\n \t}",
"public final String getFileName()\r\n {\r\n return _fileName;\r\n }",
"public String getFilename() {\n\treturn(filename);\n }",
"private String getFileName() {\n\t\t// retornamos el nombre del fichero\n\t\treturn this.fileName;\n\t}",
"public String getFileName()\r\n\t{\r\n\t\treturn settings.getFileName();\r\n\t}",
"public String getFileName() {\n return mFileNameTextField == null ? \"\" : mFileNameTextField.getText(); //$NON-NLS-1$\n }",
"public final String getFileName() {\n\t\treturn m_info.getFileName();\n\t}",
"public String getFileName() {\n\t\treturn fileName;\n\t}",
"public String getFileName() {\n\t\treturn fileName;\n\t}",
"public String getFileName() {\n\t\treturn fileName;\n\t}",
"public String getFileName() {\n\t\treturn fileName;\n\t}",
"public String getFileName() {\n\t\treturn fileName;\n\t}",
"public String getFileName() {\r\n\t\treturn fileName;\r\n\t}",
"public String getFileName() {\r\n\t\treturn fileName;\r\n\t}",
"public String getFileName() {\r\n\t\treturn fileName;\r\n\t}",
"public String getAPP_NAME() {\r\n return APP_NAME;\r\n }",
"public String getAPP_NAME() {\r\n return APP_NAME;\r\n }",
"public String getFileName() {\n return this.fileName;\n }",
"public String getFileName() {\n return this.fileName;\n }",
"@Column(name = \"FILE_REAL_NAME\", length = 100 )\n\tpublic String getFileObjFileName() {\n\t\treturn fileObjFileName;\n\t}",
"@Override\n\tpublic String getFileName() {\n\t\treturn null;\n\t}",
"public String getFileName() {\r\n return fileName;\r\n }",
"public String getFileName() {\r\n return fileName;\r\n }",
"public String getFileName() {\r\n return fileName;\r\n }",
"public String getDataFileName() {\n return dataFileName;\n }",
"@Override\n\tpublic java.lang.String getExeFileName() {\n\t\treturn _scienceApp.getExeFileName();\n\t}",
"public String getFileName() {\n return filename;\n }",
"public String getFileName() {\n return fileName;\n }",
"public String getFilename()\r\n\t{\r\n\t\treturn _filename; \r\n\t}",
"public String getFilename(){\n\t\treturn filename;\n\t}",
"public String getFilename(){\n\t\treturn filename;\n\t}",
"public String getFileName() {\n return fileName;\n }",
"public String getFileName() {\n return fileName;\n }",
"public String getFileName() {\n return fileName;\n }",
"public String getFileName() {\n return fileName;\n }",
"public String getFileName() {\n return fileName;\n }",
"public String getFileName() {\n return fileName;\n }",
"public String getFileName() {\n return fileName;\n }",
"public String getFileName() {\n return fileName;\n }",
"public String getFileName() {\n return fileName;\n }",
"public String getFileName() {\n return fileName;\n }",
"public String getFilename() {\n\treturn file.getFilename();\n }",
"public String getFileName() {\n return ScreenRecordService.getFileName();\n }",
"java.lang.String getFileName();",
"java.lang.String getFileName();",
"java.lang.String getFileName();",
"java.lang.String getFileName();",
"java.lang.String getFileName();",
"java.lang.String getFileName();",
"java.lang.String getFileName();",
"java.lang.String getFileName();",
"java.lang.String getFileName();",
"@Override\n\tprotected String getFileName() {\n\t\treturn null;\n\t}",
"public String getFileName();",
"public String getFileName();",
"public static String getAppName()\n\t{\n\t\treturn APP_NAME;\n\t}",
"public static String getEmailAttachmentsPath() {\n\t\t//return \"d:\\\\PBC\";\n\t\treturn \"/Users/anaswhb/Documents/Eclipse/Workspace\";\n\t\t\n\t}",
"String getUserDatabaseFilePath();",
"public String fileName () {\n\t\treturn fileName;\n\t}",
"public String getFilename()\r\n\t{\r\n\t\treturn filename;\r\n\t}",
"public String getAppName( )\n\t{\n\t\treturn appName;\n\t}",
"public String getStrappname() {\n return strappname;\n }",
"public String fileName() {\n return this.fileName;\n }",
"public String fileName() {\n return this.fileName;\n }",
"public String getApplicationdata() {\r\n return applicationdata;\r\n }",
"String getFileName();",
"String getFileName();",
"String getFileName();",
"String getFileName();",
"String getFileName();",
"public final String getFileName() {\n return this.fileName;\n }",
"public String getNameFile(){\n\t\t\treturn this.nameFile;\n\t\t}",
"public File getFileName() {\n\t\treturn mFileName;\n\t}",
"private String getFilename() {\r\n\t\treturn (String) txtFlnm.getValue();\r\n\t}",
"public String getFileName ();",
"public String getFileName() {\n\t\treturn file.getFileName();\n\t}"
] | [
"0.6309197",
"0.62721",
"0.6195964",
"0.6136243",
"0.6100749",
"0.6059064",
"0.6041043",
"0.6020658",
"0.60060775",
"0.60055745",
"0.60027355",
"0.5999785",
"0.5996406",
"0.59432703",
"0.5938304",
"0.5928301",
"0.5920293",
"0.5917208",
"0.5913456",
"0.5908247",
"0.5908247",
"0.5906741",
"0.58985496",
"0.5898544",
"0.58790773",
"0.58553636",
"0.5841185",
"0.58274144",
"0.58222765",
"0.582012",
"0.5816171",
"0.58113444",
"0.5808268",
"0.5808268",
"0.5808268",
"0.5808268",
"0.5808268",
"0.5786344",
"0.5786344",
"0.5786344",
"0.5785577",
"0.5785577",
"0.5785259",
"0.5785259",
"0.5784098",
"0.5783756",
"0.5783641",
"0.5783641",
"0.5783641",
"0.5783237",
"0.57712173",
"0.57649165",
"0.57517964",
"0.57476485",
"0.573195",
"0.573195",
"0.57219255",
"0.57219255",
"0.57219255",
"0.57219255",
"0.57219255",
"0.57219255",
"0.57219255",
"0.57219255",
"0.57219255",
"0.57219255",
"0.5718333",
"0.5715605",
"0.5703838",
"0.5703838",
"0.5703838",
"0.5703838",
"0.5703838",
"0.5703838",
"0.5703838",
"0.5703838",
"0.5703838",
"0.5689862",
"0.56804246",
"0.56804246",
"0.56734085",
"0.5662683",
"0.56565154",
"0.5655454",
"0.5646655",
"0.5637429",
"0.5629663",
"0.56258595",
"0.56258595",
"0.56258184",
"0.5624706",
"0.5624706",
"0.5624706",
"0.5624706",
"0.5624706",
"0.56229186",
"0.5620318",
"0.5619451",
"0.56181467",
"0.5617612",
"0.5616602"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void onClick(View v) {
try {
File myFile = new File(path + "/" + fileName + "."
+ fileType);
String string = myFile.getAbsolutePath();
if (string.endsWith(".rar")) {
} else if (string.endsWith(".apk")) {
return;
} else {
CallOtherOpeanFile.openFile(mContext, myFile);
}
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void onClick(View v) {
ToastUtils.show(mContext, "已删除该邮件");
int index = SQLiteUtils.getInstance(mContext)
.emailUpdate(mReciveOneMailDB.getUserid(),
"emailVisual");
LogUtils.e("index = " + index);
if (index > 0) {
setResult(RESULT_OK);
finish();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
Create button onClick handler. Creates the numbers.txt file, with 1..10, one number per line. | public void createFile(View view) {
// start the background file creation task
CreateFileTask task = new CreateFileTask();
task.execute();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void main(String[] args) throws IOException\n {\n \n // Declare Variables \n int count = 0;\n \n // PrintWriter class to create and open new file\n PrintWriter outputFile = new PrintWriter(\"NumbersJamesM.txt\"); \n \n // For loop to add 1 to the number each time\n for (count = 1; count <= 10; count++) // Initilize count to 1,\n { // Run until count is more than 10\n // After each loop add 1 to count. \n \n outputFile.println(count); // Output current count number to outputFile\n \n } \n \n // Close the file \n outputFile.close();\n \n }",
"public void numeros() {\r\n \tint[] lista= new int[3001];\r\n\r\n\t\tFile crear = new File (\"Numerosaleatorios.txt\");\r\n \r\n\t\tFileWriter escribir = null;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tescribir = new FileWriter (crear);\r\n\t\t\tBufferedWriter escribir1 = new BufferedWriter (escribir);\r\n\t\t\tint linea;\r\n\t\t\tRandom aleatorios = new Random();\r\n\t\t\tfor (int i =0; i<3000; i++) {\r\n\t\t\t\tlinea = aleatorios.nextInt(1000);\r\n\t\t\t\tlista[i]= aleatorios.nextInt(1000);\r\n\t\t\t\tescribir1.write(linea + \"\\n\");\r\n\t\t}\r\n\t\t\r\n\t\tescribir.close();\r\n\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.exit(0);\r\n\t}\r\n\t}",
"public void createFiles() {\r\n try {\r\n FileWriter file = new FileWriter(registerNumber + \".txt\");\r\n file.write(\"Name : \" + name + \"\\n\");\r\n file.write(\"Surname : \" + surname + \"\\n\");\r\n file.write(\"Registration Number : \" + registerNumber + \"\\n\");\r\n file.write(\"Position : \" + position + \"\\n\");\r\n file.write(\"Year of Start : \" + yearOfStart + \"\\n\");\r\n file.write(\"Total Salary : \" + Math.round(totalSalary) + \".00 TL\" +\"\\n\");\r\n file.close();\r\n }\r\n catch(IOException e) {\r\n e.printStackTrace();\r\n }\r\n }",
"public void configure_buttonNumbers() {\n button0 = findViewById(R.id.button0);\n button0.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n putNumber(\"0\");\n }\n });\n\n // Button for number 1\n button1 = findViewById(R.id.button1);\n button1.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n putNumber(\"1\");\n }\n });\n\n // Button for number 2\n button2 = findViewById(R.id.button2);\n button2.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n putNumber(\"2\");\n }\n });\n\n // Button for number 3\n button3 = findViewById(R.id.button3);\n button3.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n putNumber(\"3\");\n }\n });\n\n // Button for number 4\n button4 = findViewById(R.id.button4);\n button4.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n putNumber(\"4\");\n }\n });\n\n // Button for number 5\n button5 = findViewById(R.id.button5);\n button5.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n putNumber(\"5\");\n }\n });\n\n // Button for number 6\n button6 = findViewById(R.id.button6);\n button6.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n putNumber(\"6\");\n }\n });\n\n // Button for number 7\n button7 = findViewById(R.id.button7);\n button7.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n putNumber(\"7\");\n }\n });\n\n // Button for number 8\n button8 = findViewById(R.id.button8);\n button8.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n putNumber(\"8\");\n }\n });\n\n // Button for number 9\n button9 = findViewById(R.id.button9);\n button9.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n putNumber(\"9\");\n }\n });\n }",
"public static void makeText(double[] numbers){\r\n\t\tPrintWriter outStream = null;\r\n\t\ttry {\r\n\t\t\toutStream = new PrintWriter(new FileOutputStream(\"textFile.txt\"));\r\n\t\t} catch(FileNotFoundException e){\r\n\t\t\tSystem.out.println(\"Error opening the file\");\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\t\tfor (double x : AvgAndStanDev.tehNumbs){\r\n\t\t\toutStream.println(x);\r\n\t\t}\r\n\t\tSystem.out.println(\"Text File Created\");\r\n\t\toutStream.close();\t\t//Important to close so that we can re-open later\r\n\t}",
"public static void textFile() throws IOException\n \t{ \n \t// Initialize the list\n \tArrayList<String[]> list = new ArrayList<String[]>();\n \t// Calling to random string generated by the randGenerator function! \n \tlist.add(new String[] {Datatostring});\n \t\t // File writer\n \tFileWriter Datawriter = new FileWriter(\"NumOUTPUT.txt\",true); // by adding true at the end is save to text file without overwriting older data\n \t\n \t\n \t// For loop for list data\n \tfor(String[] arr: list)\n \t{\n \t\tString appender = \"\";\n \t\tfor(String s : arr)\n \t\t{\n \t\tDatawriter.write(appender + s);\n \t\t\tappender = \",\";\n \t\t}\n \t\tDatawriter.flush();\n \t}\n \tDatawriter.close();\n }",
"@Override\n public void onClick(View v) {\n switch (v.getId()) {\n case R.id.btn_1:\n num = (num*10) + 1;\n break;\n case R.id.btn_2:\n num = (num*10) + 2;\n break;\n case R.id.btn_3:\n num = (num*10) + 3;\n break;\n case R.id.btn_4:\n num = (num*10) + 4;\n break;\n case R.id.btn_5:\n num = (num*10) + 5;\n break;\n case R.id.btn_6:\n num = (num*10) + 6;\n break;\n case R.id.btn_7:\n num = (num*10) + 7;\n break;\n case R.id.btn_8:\n num = (num*10) + 8;\n break;\n case R.id.btn_9:\n num = (num*10) + 9;\n break;\n case R.id.btn_0:\n num = (num*10);\n break;\n case R.id.btn_clr:\n num = 0;\n break;\n case R.id.btn_bck:\n num = num/10;\n break;\n default:\n break;\n }\n\n prepareContactData(num);\n dialerView.setText(String.valueOf(num));\n }",
"void addFile(int numberLines);",
"public void actionPerformed(ActionEvent e){\r\n \r\n final int MAXNUM = 99;\r\n int num;\r\n try\r\n {\r\n num = Integer.parseInt(room.getText());\r\n if(num > MAXNUM){\r\n num = MAXNUM;\r\n }\r\n dormFile.seek((num - 1) * RECORD_SIZE);\r\n dormFile.writeInt(num);\r\n dormFile.writeUTF(first.getText());\r\n dormFile.writeUTF(last.getText());\r\n room.setText(\"\");\r\n last.setText(\"\");\r\n first.setText(\"\");\r\n } \r\n catch(NumberFormatException e2)\r\n {\r\n\r\n System.err.println(\"Invalid room number\");\r\n }\r\n\r\n catch(IOException e3)\r\n {\r\n System.err.println(\"Error writing file\");\r\n System.exit(1);\r\n }\r\n }",
"@FXML\n\tprivate void onSaveClicked(){\n\t\tPrintWriter writer = null;\n\t\ttry {\n\t\t\tFile file = new File(\"log.txt\");\n\t\t\tif (!file.exists()) {\n\t\t\t\tfile.createNewFile();\n\t\t\t}\n\t\t\tFileWriter fw = new FileWriter(file, true);\n\t\t\tBufferedWriter bw = new BufferedWriter(fw);\n\t\t\twriter = new PrintWriter(bw);\n\t\t\twriter.println(\"New record\");\n\t\t\tfor (int i = 0; i < list.size(); i++) {\n\n\t\t\t\twriter.println(list.get(i) +\" & \"+ (dat.get(i)));\n\t\t\t}\n\t\t} catch (IOException ioe) {\n\t\t\ttextArea.setText(\"Exception occurred:\" + ioe.getMessage());\n\t\t} finally {\n\t\t\tif (writer != null) {\n\t\t\t\twriter.close();\n\t\t\t}\n\t\t}\n\n\t}",
"public static void randomNumsFile(String fileName, int howMany, int rangeFrom, int rangeTo) throws IOException\n {\n int temp; //to hold temporary value for swapping\n int number; //to hold generated random numbers\n if (rangeTo<rangeFrom) //check if upper limit is smaller than lower limit \n {\n //swap\n temp = rangeFrom;\n rangeFrom = rangeTo;\n rangeTo = temp;\n } \n // Open the file.\n PrintWriter outputFile = new PrintWriter(fileName);\n\n // Get data and write it to the file.\n for (int i = 1; i <= howMany; i++)\n {\n Random randomNumber = new Random();//set up an object to generate random nubmers\n number = randomNumber.nextInt((rangeTo - rangeFrom) + 1) + rangeFrom; // generate random number\n // Write the number to the file.\n outputFile.println(number);\n }\n // Close the file.\n outputFile.close();\n }",
"public static void writeNumberToFile() {\n try {\n FileOutputStream outputStream = new FileOutputStream(\"ex1.txt\");\n outputStream.write(String.valueOf(53).getBytes());\n } catch (FileNotFoundException e) {\n // handle FileNotFoundException\n } catch (IOException e) {\n // handle IOException\n } finally {\n System.out.println(\"Finally block\");\n }\n }",
"public void writeTextFile(int[][] a, int n) {\n\t\ttry {\n\t\t\twriter = new PrintWriter(new BufferedWriter(new FileWriter(filename,true)));\n\t\t\twriter.print(\"_|_\");\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\twriter.print(i + 1 + \"_\");\n\t\t\twriter.println();\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\twriter.print(i + 1 + \"| \");\n\t\t\t\tfor (int j = 0; j < n; j++) {\n\t\t\t\t\twriter.print(a[i][j] + \" \");\n\t\t\t\t}\n\t\t\t\twriter.println();\n\t\t\t}\n\t\t\twriter.println();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Could not write to\\t\\\"\" + filename + \"\\\"\");\n\t\t\tSystem.out.println(e.getMessage());\n\t\t\te.printStackTrace();\n\t\t}finally{\n\t\t\twriter.close();\n\t\t}\n\t\t\n\t}",
"public void writeFile(){\n try{\n FileWriter writer = new FileWriter(\"Highscores.txt\");\n for (int i = 0; i<10; i++){\n if (i >= this.highscores.size()){\n break;\n }\n writer.write(String.valueOf(this.highscores.get(i)) + \"\\n\");\n }\n writer.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public static void main(String[] args) throws Exception {\n FileOutputStream file = new FileOutputStream(\"randoms.txt\");\n PrintWriter output = new PrintWriter(file);\n\n //write 100 random numbers to the file\n\n\n\n\n //open the file for input\n\n\n\n\n //print the sorted array on the screen\n\n\n\n}",
"public void writeToFile() {\n try {\n // stworz plik\n File file = new File(\"../Alice.ids\");\n // stworz bufor zapisu do pliku\n FileWriter fileWriter = new FileWriter(file);\n for(int i = 0; i < identificationNumbers.length; i++) {\n for(int j = 0; j < identificationNumbers[i].length; j++)\n fileWriter.write(Integer.toString(identificationNumbers[i][j]));\n\t\t\t fileWriter.write(\"\\n\");\n }\n\t\t\tfileWriter.flush();\n\t\t\tfileWriter.close();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }",
"private void processGenerateOutputButton() {\n try {\n if(selectedFile != null) {\n //initialScannerOfDataFile();\n world = new World(\"My World\", 0, 0, selectedFile);\n String myTotalOutput = world.toString();\n dataOutputArea.setText(myTotalOutput);\n createTree();\n\n } else {\n JOptionPane.showMessageDialog(null, \"No selected file!\");\n }\n } catch(Exception e2) {\n System.out.println(\"Something is wrong with output generation!\\n\\n\" + e2.getMessage());\n } //end of catch()\n }",
"@Override\n protected Void doInBackground(Void... params) {\n File file = new File(getApplicationContext().getFilesDir(), FILENAME);\n\n PrintWriter writer = null;\n try {\n writer = new PrintWriter(file);\n for (int i = 1; i <= 10; i++) {\n writer.println(i);\n Thread.sleep(250);\n publishProgress(i * 10);\n }\n }\n catch (FileNotFoundException | InterruptedException ex) {\n Log.e(LOG_TAG, \"createFile:\" + ex.toString());\n }\n finally {\n if (writer != null) {\n writer.close();\n }\n }\n return null;\n }",
"void create() {\n\t\ttry {\n\t\t\tFile file = new File(\"Student.txt\");\n\t\t\t//File named Student.txt is created\n\t\t\tboolean x = file.createNewFile();\n\t\t\tif (x) {\n\t\t\t\tSystem.out.println(\"File has been created successfully! \");\n\t\t\t//Message of successful creation after new file is created\n\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"File already present\");\n\t\t\t\t//message if file already exists\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Exception Occurred:\");\n\n\t\t}\t\t\t\t\n\t\t\n\t\t\t\t\n\t\ttry {\n\t\tPrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter(\"Student.txt\", true)));\n\t\tint x = 1;\n\t\t\n\t\tdo {\n\t\t\tScanner sc = new Scanner(System.in);\n\t\t\tint y;\n\t\t\t//take input from user for name,roll no and mobile no.\n\t\t\t\n\t\t\tSystem.out.print(\"\\nEnter Student Name: \");\n\t\t\tstudentname = br.readLine();\n\t\t\t\n\t\t\tSystem.out.print(\"Student Roll no: \");\n\t\t\trollno = Integer.parseInt(br.readLine());\t\t\n\t\t\t\n\t\t\tSystem.out.print(\"Mobile Number: \");\n\t\t\tmob_no = Integer.parseInt(br.readLine());\n\t\t\t\n\t\t\tSystem.out.print(\"Marks : \");\n\t\t\tmarks = Float.parseFloat(br.readLine());\n\t\t\t\n\t\t\t//display student data\n\n\t\t\tpw.println(studentname + \"\\t\" + rollno + \"\\t\" + marks + \"\\t\" + mob_no);\n\t\t\t\n\t\t\tSystem.out.println(\"Do you want to enter more records? \\n1) Yes\\n2) No\");\n\t\t\t\n\t\t\ty = sc.nextInt();\n\t\t\t\n\t\t\tif(y == 2) {\n\t\t\t\tx = 0;\n\t\t\t}\n\t\t}while(x==1); //loop to add more records\n\t\tpw.close();\n\t\t}catch(IOException e) {\n\t\t\tSystem.out.println(e);\n\t\t}\n\t\t\n\t}",
"public static void writeTextToFile() {\n try {\n FileOutputStream outputStream = new FileOutputStream(\"ex1.txt\");\n int number = Integer.parseInt(\"2f5\");\n outputStream.write(String.valueOf(number).getBytes());\n\n } catch (IOException | NumberFormatException e) {\n // handle exception\n } finally {\n System.out.println(\"Finally block\");\n }\n }",
"private Button createNewArrayButton(BorderPane root) {\n Button newArr = new Button(\"Generate New Array\");\n\n newArr.setOnMouseClicked(event -> {\n ((HBox) root.getTop()).getChildren().get(2).setDisable(false);\n ((HBox) root.getTop()).getChildren().get(3).setDisable(false);\n\n generateRandomHeights();\n root.setBottom(createSortingDisplay());\n });\n\n return newArr;\n }",
"public void displayToFile(){\n String data = \"\";\n try{\n FileWriter fstream = new FileWriter(\"output.txt\", true);\n BufferedWriter out = new BufferedWriter(fstream);\n\n for (int i=0 ; i<40; i++) {\n for (int j=0; j<146 ;j++ ){\n if (board.getCharacter(j,i) == '0') {\n data += '-';\n } else {\n data += board.getCharacter(j,i);\n }\n }\n out.write(data);\n data = \"\";\n }\t\n out.close();\n } catch (Exception e){\n System.err.println(\"Error: \" + e.getMessage());\n }\n }",
"private String createNumberLine(){\n StringBuilder numberLine = new StringBuilder();\n for(int i = 0; i < this.columns; i++){\n numberLine.append(i + 1).append(\" \");\n }\n return numberLine.toString();\n }",
"private void btn1Event(){\n int cnt = Integer.parseInt(tfNum1.getText());\n int i = 0;\n for (i=0; i<cnt; i++){\n list.add(new NumGenA());\n taResults.appendText(String.valueOf(i) + \n \" = \" + String.valueOf(list.get(i).getValue() + \"\\n\"));\n \n lab2.setText(String.valueOf(NumGenA.getCount()));\n }\n }",
"Button getGenerateCSVFileButton();",
"private void createEvents() {\n\t\taddBtn.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tbuildOutput();\n\t\t\t}\n\t\t});\n\t}",
"public void numberEvent(View view) {\n if (isNewOp)\n input.setText(\"\");\n isNewOp = false;\n String number = input.getText().toString();\n switch (view.getId()) {\n case R.id.oneBTN:\n number += \"1\";\n break;\n case R.id.twoBTN:\n number += \"2\";\n break;\n case R.id.threeBTN:\n number += \"3\";\n break;\n case R.id.fourBTN:\n number += \"4\";\n break;\n case R.id.fiveBTN:\n number += \"5\";\n break;\n case R.id.sixBTN:\n number += \"6\";\n break;\n case R.id.sevenBTN:\n number += \"7\";\n break;\n case R.id.eightBTN:\n number += \"8\";\n break;\n case R.id.nineBTN:\n number += \"9\";\n break;\n case R.id.zeroBTN:\n number += \"0\";\n break;\n case R.id.pointBTN:\n number += \".\";\n break;\n }\n input.setText(number);\n }",
"@Override\n public void actionPerformed(ActionEvent e) {\n int id = waiterGraphicalUserInterface.getId();\n Order order = restaurant.getOrder(id);\n FileWriter fileWriter = new FileWriter(restaurant,order);\n }",
"@Override\n\t\t\tpublic void onClick(View arg0) {\n\n\t\t\t\tString fileName = \"TEST.txt\";\n\t\t\t\tString message = \"FFFFFFF11111FFFFF\";\n\t\t\t\twriteFileData(fileName, message);\n//\t\t\t\tToast.makeText(FileActivity.this, \"here\", Toast.LENGTH_SHORT)\n//\t\t\t\t\t\t.show();\n\t\t\t\tgetData(currentPath);\n\t\t\t}",
"@Override\n\t\t\tpublic void onClick(View arg0) {\n\n\t\t\t\tString fileName = \"TEST.txt\";\n\t\t\t\tString message = \"FFFFFFF11111FFFFF\";\n\t\t\t\tfileSave(fileName, message,currentPath);\n\t\t\t\t\n\t\t\t\tgetData(currentPath);\n\t\t\t}",
"public static void main(String[] args) throws IOException {\n\n Writer writer = new FileWriter(\"/home/levon/number1.txt\");\n\n\n for (int i = 93000000; i <= 93999999; i++) {\n writer.write(\"0\"+i+'\\n');\n }\n writer.close();\n\n FileReader fileReader =new FileReader(\"/home/levon/number1.txt\");\n BufferedReader reader = new BufferedReader(fileReader);\n\n String s = reader.readLine();\n Writer writer1 = new BufferedWriter(new FileWriter(\"/home/levon/number2.txt\"));\n while (true)\n writer1.write(s + String.format(\"Hello %h\", \"Levon\"));\n }",
"public static void createFiles()\n\t{\n\t\t//Variable Declaration\n\t\tScanner obj = new Scanner (System.in);\n\t\tString fileName; \n\t\tint linesCount;\n\t\tList<String> content = new ArrayList<String>();\n\t\t\n\t\t//Read file name from user\n\t\tSystem.out.println(\"Enter the FIle Name:\");\n\t\tfileName= obj.nextLine();\n\t\t\n\t\t//Read number of lines from user\n\t\tSystem.out.println(\"Enter how many line in the file:\");\n\t\tlinesCount= Integer.parseInt(obj.nextLine());\n\t\t\n\t\t//Read Lines from user\n\t\tfor(int i=1; i<=linesCount;i++)\n\t\t{\n\t\t\tSystem.out.println(\"Enter line \"+i+\":\");\n\t\t\tcontent.add(obj.nextLine());\n\t\t}\n\t\t\n\t\t//Save the content into the file\n\t\tboolean isSaved = FileManager.createFiles(folderpath, fileName, content);\n\t\t\n\t\tif(isSaved)\n\t\t\tSystem.out.println(\"File and data is saved sucessfully\");\n\t\telse\n\t\t\tSystem.out.println(\"Some error occured. Please contact [email protected]\");\n\t}",
"@Override\r\n\tpublic void actionPerformed(ActionEvent ae) {\n\t\tFile file = FileChooser.SaveCsvFile();\r\n\t\tif(file==null)\r\n\t\t\treturn;\r\n\t\tBufferedWriter bw = null;\r\n\t\ttry {\r\n\t\t\tbw = new BufferedWriter(new FileWriter(file));\r\n\t\t\tSystem.out.println(file.getAbsolutePath());\r\n\t\t\tbw.write(\"Phonenumber\");\r\n\t\t\tbw.newLine();\r\n\t\t\tfor(int i = 0;i<CSVFrame.model.getRowCount();i++) {\r\n\t\t\t\tRecord r = CSVFrame.model.getRowAt(i);\r\n\t\t\t\tSystem.out.println(r.getPhone());\r\n\t\t\t\tbw.write(r.getPhone());\r\n\t\t\t\tbw.newLine();\r\n\t\t\t}\r\n\t\t\tJOptionPane.showMessageDialog(null, \"Finished creating suppression file\");\r\n\t\t} catch(IOException ex) {\r\n\t\t\tex.printStackTrace();\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\ttry {\r\n\t\t\t\tbw.close();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tnumbers[5] = \" x\";\n\t\t \t\tfor (int i = 0; i < 49; i++) {\n\t\t\t\t\tnumbers[i] = \" \"+Integer.toString(i + 1);\n\t\t\t\t}\n\t\t\t\tRandom random = new Random();\n\t\t\t\tfor (int p = 0; p < 6; p++) {\n\t\t\t\t\tint thenum = random.nextInt(49);\n\t\t\t\t\tif (numbers[thenum].equals(\"X\"))\n\t\t\t\t\t\tp--;\n\t\t\t\t\telse {\n\t\t\t\t\t\tnumbers[thenum] = \"X\";\n\t\t\t\t\t\tfinNums[p] = thenum;\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tArrays.sort(finNums);\n\n\t\t\t\tgridView.setAdapter(adapter);\n\t\t\t\tString testOutput = null;\n\t\t\t\tint found = 0;\n\t\t\t\tfor (int o = 0; o < 6; o++) {\n\t\t\t\t\ttestOutput += Integer.toString(finNums[o]) + \", \";\n\t\t\t\t\tInteger nD = finNums[o] + 1;\n\n\t\t\t\t\tfound++;\n\t\t\t\t\tif (found == 1) {\n\t\t\t\t\t\tnumPick1.setMaxValue(nD);\n\t\t\t\t\t\tnumPick1.setMinValue(nD);\n\t\t\t\t\t} else if (found == 2) {\n\t\t\t\t\t\tnumPick2.setMaxValue(nD);\n\t\t\t\t\t\tnumPick2.setMinValue(nD);\n\t\t\t\t\t} else if (found == 3) {\n\t\t\t\t\t\tnumPick3.setMaxValue(nD);\n\t\t\t\t\t\tnumPick3.setMinValue(nD);\n\t\t\t\t\t} else if (found == 4) {\n\t\t\t\t\t\tnumPick4.setMaxValue(nD);\n\t\t\t\t\t\tnumPick4.setMinValue(nD);\n\t\t\t\t\t} else if (found == 5) {\n\t\t\t\t\t\tnumPick5.setMaxValue(nD);\n\t\t\t\t\t\tnumPick5.setMinValue(nD);\n\t\t\t\t\t} else if (found == 6) {\n\t\t\t\t\t\tnumPick6.setMaxValue(nD);\n\t\t\t\t\t\tnumPick6.setMinValue(nD);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttvFix.setText(\".\");\n\t\t\t}",
"public void backup_StudentNumber(int number){\n try {\n outputStreamWriter = new OutputStreamWriter(context.openFileOutput(Constant.STUDENT_NUMBER_FILE, Context.MODE_PRIVATE));\n outputStreamWriter.write(number+\",\");\n outputStreamWriter.close();\n }\n catch (Exception e){\n Message.logMessages(\"ERROR: \",e.toString());\n }\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\texport100();\n\t\t\t}",
"public void createOrderBtn(){\n createOrderBtn = new Button(\"Create order\");\n createOrderBtn.setLayoutX(305);\n createOrderBtn.setLayoutY(710);\n createOrderBtn.setPrefWidth(480);\n createOrderBtn.setPrefHeight(50);\n createOrderBtn.setStyle(\"-fx-background-color: #34ffb9\");\n createOrderBtn.setFont(new Font(18));\n createOrderBtn.setOnAction(event -> createOrderInDB());\n\n root.getChildren().addAll(createOrderBtn);\n }",
"public void Write_data() {\n // add-write text into file\n try {\n FileOutputStream fileout=openFileOutput(\"savedata11.txt\", MODE_PRIVATE);\n OutputStreamWriter outputWriter=new OutputStreamWriter(fileout);\n outputWriter.write(Integer.toString(_cnt));\n outputWriter.close();\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"private void createButton(){\n addButton();\n addStartButton();\n }",
"public void saveFile(int theValue) {\n if (!outputInitialized) {\n return;\n }\n int largest = 0;\n for (int i=0; i<totSamples.length; i++) {\n if (totSamples[i]> largest) {\n largest = totSamples[i];\n }\n //myArray[i] = list_Samples[i].getListBoxItems();\n }\n String fname = ano + nf(mes, 2)+ nf(dia, 2) + nf(hora, 2) + nf(min, 2) + nf(sec, 2);\n foutput = createWriter(\"dados_\"+fname +\".csv\");\n\n\n\n for (int i=0; i<largest; i++) {\n String line =\"\";\n String[] val = new String[6];\n for (int j=0; j < numSamples; j++) {\n if (i < totSamples[j]) {\n ListBoxItem lb1 = list_Samples[j].getItem(i);\n val[j]=lb1.getText();\n } else {\n val[j]=\"\";\n }\n line += val[j]+\",\";\n } \n if (outputInitialized) {\n foutput.println(i+\",\"+line);\n }\n }\n foutput.flush(); // Writes the remaining data to the file\n foutput.close();\n}",
"public static void main(String args[])throws FileNotFoundException {\n PrintStream diskWriter = new PrintStream(new File(\"please.txt\"));\n\n\n int numbers=0;\n Random myRandom = new Random();\n numbers = myRandom.nextInt(10)+1;\n diskWriter.println(numbers);\n System.out.println(numbers);\n\n\n numbers = myRandom.nextInt(10)+1;\n diskWriter.println(numbers);\n System.out.println(numbers);\n //numbers = myRandom.nextInt(10)+1;\n //diskWriter.println(numbers);\n //System.out.println(diskScanner.next());\n\n //numbers = myRandom.nextInt(10)+1;\n //diskWriter.println(numbers);\n // System.out.println(diskScanner.next());\n\n //numbers = myRandom.nextInt(10)+1;\n //diskWriter.println(numbers);\n // System.out.println(diskScanner.next());\n\n //numbers = myRandom.nextInt(10)+1;\n //diskWriter.println(numbers);\n //System.out.println(diskScanner.next());\n\n // numbers = myRandom.nextInt(10)+1;\n //diskWriter.println(numbers);\n //System.out.println(diskScanner.next());\n\n // numbers = myRandom.nextInt(10)+1;\n // diskWriter.println(numbers);\n // System.out.println(diskScanner.next());\n\n }",
"private void createButton(int i){\n\t\tint x = 10, y = 120, width = 100, height = 20;\n\t\tint temp = 0;\n\t\t\n\t\tbuttons.add(new JButton(\"New Student\"));\n\t\tbuttons.get(i).addActionListener(this);\n\t\t\n\t\tfor (int a = 0; a<i; a++){\n\t\t\tx += 110;\n\t\t\ttemp++;\n\t\t\tif(temp >= Integer.parseInt(askColumns.getText())){\n\t\t\t\ty += 140;\n\t\t\t\tx = 10;\n\t\t\t\ttemp = 0;\n\t\t\t}\n\t\t\t\n\n\t\t}\n\t\t\n\t\t\n\t\tbuttons.get(i).setBounds(x, y, width, height);\n\t\tthis.add(buttons.get(i));\t\n\t\tbuttons.get(i).revalidate();\n\t\tbuttons.get(i).repaint();\n\t\t\n\t}",
"private void numbersPanel(JPanel panel_Numbers) {\n\t\tJButton btnNumButton = new JButton(\"0\");\n\t\tbtnNumButton.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbtnNumButton.setBackground(Color.LIGHT_GRAY);\n\t\tbtnNumButton.setBounds(0, 0, 52, 35);\n\t\tpanel_Numbers.add(btnNumButton);\n\t\t\n\t\tJButton button = new JButton(\"1\");\n\t\tbutton.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton.setBackground(Color.LIGHT_GRAY);\n\t\tbutton.setBounds(52, 0, 52, 35);\n\t\tpanel_Numbers.add(button);\n\t\t\n\t\tJButton button_1 = new JButton(\"2\");\n\t\tbutton_1.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_1.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_1.setBounds(105, 0, 52, 35);\n\t\tpanel_Numbers.add(button_1);\n\t\t\n\t\tJButton button_2 = new JButton(\"3\");\n\t\tbutton_2.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_2.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_2.setBounds(157, 0, 52, 35);\n\t\tpanel_Numbers.add(button_2);\n\t\t\n\t\tJButton button_3 = new JButton(\"4\");\n\t\tbutton_3.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_3.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_3.setBounds(210, 0, 52, 35);\n\t\tpanel_Numbers.add(button_3);\n\t\t\n\t\tJButton button_4 = new JButton(\"5\");\n\t\tbutton_4.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_4.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_4.setBounds(263, 0, 52, 35);\n\t\tpanel_Numbers.add(button_4);\n\t\t\n\t\tJButton button_5 = new JButton(\"6\");\n\t\tbutton_5.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_5.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_5.setBounds(316, 0, 52, 35);\n\t\tpanel_Numbers.add(button_5);\n\t\t\n\t\tJButton button_6 = new JButton(\"7\");\n\t\tbutton_6.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_6.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_6.setBounds(0, 37, 52, 35);\n\t\tpanel_Numbers.add(button_6);\n\t\t\n\t\tJButton button_7 = new JButton(\"8\");\n\t\tbutton_7.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_7.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_7.setBounds(52, 37, 52, 35);\n\t\tpanel_Numbers.add(button_7);\n\t\t\n\t\tJButton button_8 = new JButton(\"9\");\n\t\tbutton_8.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_8.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_8.setBounds(105, 37, 52, 35);\n\t\tpanel_Numbers.add(button_8);\n\t\t\n\t\tJButton button_9 = new JButton(\"10\");\n\t\tbutton_9.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_9.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_9.setBounds(157, 37, 52, 35);\n\t\tpanel_Numbers.add(button_9);\n\t\t\n\t\tJButton button_10 = new JButton(\"11\");\n\t\tbutton_10.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_10.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_10.setBounds(210, 37, 52, 35);\n\t\tpanel_Numbers.add(button_10);\n\t\t\n\t\tJButton button_11 = new JButton(\"12\");\n\t\tbutton_11.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_11.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_11.setBounds(263, 37, 52, 35);\n\t\tpanel_Numbers.add(button_11);\n\t\t\n\t\tJButton button_12 = new JButton(\"13\");\n\t\tbutton_12.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_12.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_12.setBounds(316, 37, 52, 35);\n\t\tpanel_Numbers.add(button_12);\n\t\t\n\t\tJButton button_13 = new JButton(\"14\");\n\t\tbutton_13.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_13.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_13.setBounds(0, 74, 52, 35);\n\t\tpanel_Numbers.add(button_13);\n\t\t\n\t\tJButton button_14 = new JButton(\"15\");\n\t\tbutton_14.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_14.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_14.setBounds(52, 74, 52, 35);\n\t\tpanel_Numbers.add(button_14);\n\t\t\n\t\tJButton button_15 = new JButton(\"16\");\n\t\tbutton_15.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_15.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_15.setBounds(105, 74, 52, 35);\n\t\tpanel_Numbers.add(button_15);\n\t\t\n\t\tJButton button_16 = new JButton(\"17\");\n\t\tbutton_16.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_16.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_16.setBounds(157, 74, 52, 35);\n\t\tpanel_Numbers.add(button_16);\n\t\t\n\t\tJButton button_17 = new JButton(\"18\");\n\t\tbutton_17.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_17.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_17.setBounds(210, 74, 52, 35);\n\t\tpanel_Numbers.add(button_17);\n\t\t\n\t\tJButton button_18 = new JButton(\"19\");\n\t\tbutton_18.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_18.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_18.setBounds(263, 74, 52, 35);\n\t\tpanel_Numbers.add(button_18);\n\t\t\n\t\tJButton button_19 = new JButton(\"20\");\n\t\tbutton_19.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_19.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_19.setBounds(316, 74, 52, 35);\n\t\tpanel_Numbers.add(button_19);\n\t\t\n\t\tJButton button_20 = new JButton(\"21\");\n\t\tbutton_20.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_20.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_20.setBounds(0, 108, 52, 35);\n\t\tpanel_Numbers.add(button_20);\n\t\t\n\t\tJButton button_21 = new JButton(\"22\");\n\t\tbutton_21.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_21.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_21.setBounds(52, 108, 52, 35);\n\t\tpanel_Numbers.add(button_21);\n\t\t\n\t\tJButton button_22 = new JButton(\"23\");\n\t\tbutton_22.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_22.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_22.setBounds(105, 108, 52, 35);\n\t\tpanel_Numbers.add(button_22);\n\t\t\n\t\tJButton button_23 = new JButton(\"24\");\n\t\tbutton_23.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_23.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_23.setBounds(157, 108, 52, 35);\n\t\tpanel_Numbers.add(button_23);\n\t\t\n\t\tJButton button_24 = new JButton(\"25\");\n\t\tbutton_24.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_24.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_24.setBounds(210, 108, 52, 35);\n\t\tpanel_Numbers.add(button_24);\n\t\t\n\t\tJButton button_25 = new JButton(\"26\");\n\t\tbutton_25.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_25.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_25.setBounds(263, 108, 52, 35);\n\t\tpanel_Numbers.add(button_25);\n\t\t\n\t\tJButton button_26 = new JButton(\"27\");\n\t\tbutton_26.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_26.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_26.setBounds(316, 108, 52, 35);\n\t\tpanel_Numbers.add(button_26);\n\t\t\n\t\tJButton button_34 = new JButton(\"35\");\n\t\tbutton_34.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_34.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_34.setBounds(0, 181, 52, 35);\n\t\tpanel_Numbers.add(button_34);\n\t\t\n\t\tJButton button_35 = new JButton(\"36\");\n\t\tbutton_35.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_35.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_35.setBounds(52, 181, 52, 35);\n\t\tpanel_Numbers.add(button_35);\n\t\t\n\t\tJButton button_36 = new JButton(\"37\");\n\t\tbutton_36.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_36.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_36.setBounds(105, 181, 52, 35);\n\t\tpanel_Numbers.add(button_36);\n\t\t\n\t\tJButton button_37 = new JButton(\"38\");\n\t\tbutton_37.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_37.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_37.setBounds(157, 181, 52, 35);\n\t\tpanel_Numbers.add(button_37);\n\t\t\n\t\tJButton button_38 = new JButton(\"39\");\n\t\tbutton_38.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_38.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_38.setBounds(210, 181, 52, 35);\n\t\tpanel_Numbers.add(button_38);\n\t\t\n\t\tJButton button_39 = new JButton(\"40\");\n\t\tbutton_39.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_39.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_39.setBounds(263, 181, 52, 35);\n\t\tpanel_Numbers.add(button_39);\n\t\t\n\t\tJButton button_40 = new JButton(\"41\");\n\t\tbutton_40.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_40.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_40.setBounds(316, 181, 52, 35);\n\t\tpanel_Numbers.add(button_40);\n\t\t\n\t\tJButton button_41 = new JButton(\"42\");\n\t\tbutton_41.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_41.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_41.setBounds(0, 216, 52, 35);\n\t\tpanel_Numbers.add(button_41);\n\t\t\n\t\tJButton button_42 = new JButton(\"43\");\n\t\tbutton_42.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_42.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_42.setBounds(52, 216, 52, 35);\n\t\tpanel_Numbers.add(button_42);\n\t\t\n\t\tJButton button_43 = new JButton(\"44\");\n\t\tbutton_43.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_43.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_43.setBounds(105, 216, 52, 35);\n\t\tpanel_Numbers.add(button_43);\n\t\t\n\t\tJButton button_44 = new JButton(\"45\");\n\t\tbutton_44.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_44.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_44.setBounds(157, 216, 52, 35);\n\t\tpanel_Numbers.add(button_44);\n\t\t\n\t\tJButton button_45 = new JButton(\"46\");\n\t\tbutton_45.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_45.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_45.setBounds(210, 216, 52, 35);\n\t\tpanel_Numbers.add(button_45);\n\t\t\n\t\tJButton button_46 = new JButton(\"47\");\n\t\tbutton_46.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_46.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_46.setBounds(263, 216, 52, 35);\n\t\tpanel_Numbers.add(button_46);\n\t\t\n\t\tJButton button_47 = new JButton(\"48\");\n\t\tbutton_47.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_47.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_47.setBounds(316, 216, 52, 35);\n\t\tpanel_Numbers.add(button_47);\n\t\t\n\t\tJButton button_27 = new JButton(\"28\");\n\t\tbutton_27.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_27.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_27.setBounds(0, 143, 52, 35);\n\t\tpanel_Numbers.add(button_27);\n\t\t\n\t\tJButton button_28 = new JButton(\"29\");\n\t\tbutton_28.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_28.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_28.setBounds(52, 143, 52, 35);\n\t\tpanel_Numbers.add(button_28);\n\t\t\n\t\tJButton button_29 = new JButton(\"30\");\n\t\tbutton_29.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_29.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_29.setBounds(105, 143, 52, 35);\n\t\tpanel_Numbers.add(button_29);\n\t\t\n\t\tJButton button_30 = new JButton(\"31\");\n\t\tbutton_30.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_30.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_30.setBounds(157, 143, 52, 35);\n\t\tpanel_Numbers.add(button_30);\n\t\t\n\t\tJButton button_31 = new JButton(\"32\");\n\t\tbutton_31.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_31.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_31.setBounds(210, 143, 52, 35);\n\t\tpanel_Numbers.add(button_31);\n\t\t\n\t\tJButton button_32 = new JButton(\"34\");\n\t\tbutton_32.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_32.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_32.setBounds(316, 143, 52, 35);\n\t\tpanel_Numbers.add(button_32);\n\t\t\n\t\tJButton button_33 = new JButton(\"33\");\n\t\tbutton_33.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));\n\t\tbutton_33.setBackground(Color.LIGHT_GRAY);\n\t\tbutton_33.setBounds(263, 143, 52, 35);\n\t\tpanel_Numbers.add(button_33);\n\t}",
"@Override\n public void onClick(View v) {\n if(createFile())\n {\n new exportContactsAsync(BaseActivity.progressDialog).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);\n }\n }",
"public void Number_Button(int i){\n\t}",
"private HBox getGenerateButtons()\n {\n HBox arrayOptions = new HBox(20);\n arrayOptions.setAlignment(Pos.CENTER);\n\n Button generateButton1 = new Button(\"Generate Array [1000]\");\n generateButton1.setPrefWidth(175);\n generateButton1.setOnMouseClicked(\n (MouseEvent me) -> {\n currentArray = Helpers.generateArray(1000);\n //Updating 'Current: ' text which is at root[1]\n Platform.runLater(\n () -> { \n root.getChildren().remove(1);\n root.getChildren().add(1, Helpers.displayText(\"Current: Randomized array with length of \" + currentArray.length, null, Color.PINK));\n });\n }\n );\n\n Button generateButton2 = new Button(\"Generate Array [10,000]\");\n generateButton2.setPrefWidth(175);\n generateButton2.setOnMouseClicked(\n (MouseEvent me) -> {\n currentArray = Helpers.generateArray(10000);\n //Updating 'Current: ' text which is at root[1]\n Platform.runLater(\n () -> { \n root.getChildren().remove(1);\n root.getChildren().add(1, Helpers.displayText(\"Current: Randomized array with length of \" + currentArray.length, null, Color.PINK));\n });\n }\n );\n\n Button generateButton3 = new Button(\"Generate Array [100,000]\");\n generateButton3.setPrefWidth(175);\n generateButton3.setOnMouseClicked(\n (MouseEvent me) -> {\n currentArray = Helpers.generateArray(100000);\n //Updating 'Current: ' text which is at root[1]\n Platform.runLater(\n () -> { \n root.getChildren().remove(1);\n root.getChildren().add(1, Helpers.displayText(\"Current: Randomized array with length of \" + currentArray.length, null, Color.PINK));\n });\n }\n );\n\n arrayOptions.getChildren().addAll(generateButton1, generateButton2, generateButton3);\n\n return arrayOptions;\n }",
"@Override\r\n\t\t\tpublic void handle(ActionEvent event) {\n\r\n\t\t\t\tvalue[10]++;\r\n\t\t\t\tvalue[10] %= 3;\r\n\t\t\t\tif (value[10] == 0) {\r\n\t\t\t\t\tbtn[10].setText(\"0\");\r\n\t\t\t\t}\r\n\t\t\t\tif (value[10] == 1) {\r\n\t\t\t\t\tbtn[10].setText(\"1\");\r\n\t\t\t\t}\r\n\t\t\t\tif (value[10] == 2) {\r\n\t\t\t\t\tbtn[10].setText(\"X\");\r\n\t\t\t\t}\r\n\t\t\t}",
"public static void WriteToFile(){\r\n try {\r\n File file = new File(\"output.txt\");\r\n file.createNewFile();\r\n \r\n FileWriter fw = new FileWriter(file.getAbsoluteFile());\r\n BufferedWriter bw = new BufferedWriter(fw);\r\n String[] FinalBoard = new String[Board.ReportBoardValues().length];\r\n FinalBoard = Board.ReportBoardValues();\r\n for(int i = 0; i < Board.ReportBoardValues().length; i++){\r\n bw.write(FinalBoard[i]);\r\n bw.newLine();\r\n }\r\n bw.close();\r\n fw.close();\r\n \r\n }\r\n catch (IOException e) {\r\n System.out.println (\"Output error\");\r\n }\r\n }",
"public static void readFile() {\n\t\tbufferedReader = null;\n\t\ttry {\n\t\t\tFileReader fileReader = new FileReader(\"/home/bridgeit/Desktop/number.txt\");\n\t\t\tbufferedReader = new BufferedReader(fileReader);\n\n\t\t\tString line;\n\t\t\twhile ((line = bufferedReader.readLine()) != null) {\n\t\t\t\tString[] strings = line.split(\" \");\n\t\t\t\tfor (String integers : strings) {\n\t\t\t\t\thl.add(Integer.parseInt(integers));\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"File Not Found...\");\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\ttry {\n\t\t\tbufferedReader.close();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}",
"@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.lottozahlen);\n\n\t\tInit();\n\n\t\tfinal ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,\n\t\t\t\tandroid.R.layout.simple_list_item_1, numbers);\n\t\tgridView.setAdapter(adapter);\n\n\t\tfinal String testString;\n\n\t\tgo.setOnClickListener(new View.OnClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tnumbers[5] = \" x\";\n\t\t \t\tfor (int i = 0; i < 49; i++) {\n\t\t\t\t\tnumbers[i] = \" \"+Integer.toString(i + 1);\n\t\t\t\t}\n\t\t\t\tRandom random = new Random();\n\t\t\t\tfor (int p = 0; p < 6; p++) {\n\t\t\t\t\tint thenum = random.nextInt(49);\n\t\t\t\t\tif (numbers[thenum].equals(\"X\"))\n\t\t\t\t\t\tp--;\n\t\t\t\t\telse {\n\t\t\t\t\t\tnumbers[thenum] = \"X\";\n\t\t\t\t\t\tfinNums[p] = thenum;\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tArrays.sort(finNums);\n\n\t\t\t\tgridView.setAdapter(adapter);\n\t\t\t\tString testOutput = null;\n\t\t\t\tint found = 0;\n\t\t\t\tfor (int o = 0; o < 6; o++) {\n\t\t\t\t\ttestOutput += Integer.toString(finNums[o]) + \", \";\n\t\t\t\t\tInteger nD = finNums[o] + 1;\n\n\t\t\t\t\tfound++;\n\t\t\t\t\tif (found == 1) {\n\t\t\t\t\t\tnumPick1.setMaxValue(nD);\n\t\t\t\t\t\tnumPick1.setMinValue(nD);\n\t\t\t\t\t} else if (found == 2) {\n\t\t\t\t\t\tnumPick2.setMaxValue(nD);\n\t\t\t\t\t\tnumPick2.setMinValue(nD);\n\t\t\t\t\t} else if (found == 3) {\n\t\t\t\t\t\tnumPick3.setMaxValue(nD);\n\t\t\t\t\t\tnumPick3.setMinValue(nD);\n\t\t\t\t\t} else if (found == 4) {\n\t\t\t\t\t\tnumPick4.setMaxValue(nD);\n\t\t\t\t\t\tnumPick4.setMinValue(nD);\n\t\t\t\t\t} else if (found == 5) {\n\t\t\t\t\t\tnumPick5.setMaxValue(nD);\n\t\t\t\t\t\tnumPick5.setMinValue(nD);\n\t\t\t\t\t} else if (found == 6) {\n\t\t\t\t\t\tnumPick6.setMaxValue(nD);\n\t\t\t\t\t\tnumPick6.setMinValue(nD);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttvFix.setText(\".\");\n\t\t\t}\n\t\t});\n\n\t}",
"private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setBounds(100, 100, 450, 300);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(null);\n\t\t\n\t\tJButton btnNewButton = new JButton(\"1\");\n\t\tbtnNewButton.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tnumber(\"1\");\n\t\t\t}\n\t\t});\n\t\tbtnNewButton.setBounds(6, 69, 58, 29);\n\t\tframe.getContentPane().add(btnNewButton);\n\t\t\n\t\tJButton button = new JButton(\"2\");\n\t\tbutton.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tnumber(\"2\");\n\t\t\t}\n\t\t});\n\t\tbutton.setBounds(58, 69, 58, 29);\n\t\tframe.getContentPane().add(button);\n\t\t\n\t\tJButton button_1 = new JButton(\"3\");\n\t\tbutton_1.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tnumber(\"3\");\n\t\t\t}\n\t\t});\n\t\tbutton_1.setBounds(111, 69, 58, 29);\n\t\tframe.getContentPane().add(button_1);\n\t\t\n\t\tJButton button_2 = new JButton(\"4\");\n\t\tbutton_2.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tnumber(\"4\");\n\t\t\t}\n\t\t});\n\t\tbutton_2.setBounds(6, 98, 58, 29);\n\t\tframe.getContentPane().add(button_2);\n\t\t\n\t\tJButton button_3 = new JButton(\"5\");\n\t\tbutton_3.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tnumber(\"5\");\n\t\t\t}\n\t\t});\n\t\tbutton_3.setBounds(58, 98, 58, 29);\n\t\tframe.getContentPane().add(button_3);\n\t\t\n\t\tJButton button_4 = new JButton(\"6\");\n\t\tbutton_4.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tnumber(\"6\");\n\t\t\t}\n\t\t});\n\t\tbutton_4.setBounds(111, 98, 58, 29);\n\t\tframe.getContentPane().add(button_4);\n\t\t\n\t\tJButton button_5 = new JButton(\"7\");\n\t\tbutton_5.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tnumber(\"7\");\n\t\t\t}\n\t\t});\n\t\tbutton_5.setBounds(6, 127, 58, 29);\n\t\tframe.getContentPane().add(button_5);\n\t\t\n\t\tJButton button_6 = new JButton(\"8\");\n\t\tbutton_6.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tnumber(\"8\");\n\t\t\t}\n\t\t});\n\t\tbutton_6.setBounds(58, 127, 58, 29);\n\t\tframe.getContentPane().add(button_6);\n\t\t\n\t\tJButton button_7 = new JButton(\"9\");\n\t\tbutton_7.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tnumber(\"9\");\n\t\t\t}\n\t\t});\n\t\tbutton_7.setBounds(111, 127, 58, 29);\n\t\tframe.getContentPane().add(button_7);\n\t\t\n\t\tJButton button_8 = new JButton(\".\");\n\t\tbutton_8.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tif(edit_flag == true)\n\t\t\t\t{\n\t\t\t\t\tif(editing ==1)\n\t\t\t\t\t{\n\t\t\t\t\t\tdec = true;\n\t\t\t\t\t\tnum1 = num1+\".\";\n\t\t\t\t\t\tval = Double.parseDouble(num1);\n\t\t\t\t\t//System.out.println(val);\n\t\t\t\t\t\ttextField.setText(\"\"+(int)val);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tdec2 = true;\n\t\t\t\t\t\tnum2 = num2+\".\";\n\t\t\t\t\t\tval2 = Double.parseDouble(num2);\n\t\t\t\t\t//System.out.println(val2);\n\t\t\t\t\t\ttextField.setText(\"\"+(int)val2);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(c_flag == 0)//go in val\n\t\t\t\t\t{\n\t\t\t\t\t\tdec = true;\n\t\t\t\t\t\tnum1 = num1+\".\";\n\t\t\t\t\t\tval = Double.parseDouble(num1);\n\t\t\t\t\t//System.out.println(val);\n\t\t\t\t\t\ttextField.setText(\"\"+(int)val);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tdec2 = true;\n\t\t\t\t\t\tnum2 = num2+\".\";\n\t\t\t\t\t\tval2 = Double.parseDouble(num2);\n\t\t\t\t\t//System.out.println(val2);\n\t\t\t\t\t\ttextField.setText(\"\"+(int)val2);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tbutton_8.setBounds(6, 157, 58, 29);\n\t\tframe.getContentPane().add(button_8);\n\t\t\n\t\tJButton button_9 = new JButton(\"0\");\n\t\tbutton_9.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tnumber(\"0\");\n\t\t\t}\n\t\t});\n\t\tbutton_9.setBounds(58, 157, 58, 29);\n\t\tframe.getContentPane().add(button_9);\n\t\t\n\t\tJButton button_10 = new JButton(\"=\");\n\t\tbutton_10.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tprint();\n\t\t\t\ttotal_flag = true;\n\t\t\t\tdec = false;\n\t\t\t\tdec2 = false;\n\t\t\t\tc_flag = 0;\n\t\t\t\t//val = 0;\n\t\t\t\t//val2 = 0;\n\t\t\t\tnum1 = \"\";\n\t\t\t\tnum2 = \"\";\n\t\t\t}\n\t\t});\n\t\tbutton_10.setBounds(111, 157, 58, 29);\n\t\tframe.getContentPane().add(button_10);\n\t\t\n\t\tJButton button_11 = new JButton(\"+\");\n\t\tbutton_11.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tSystem.out.println(pos);\n\t\t\t\tc_flag++;\n\t\t\t\t//System.out.println(\"You have pressed +\");\n\t\t\t\toperator = '+';\n\t\t\t}\n\t\t});\n\t\tbutton_11.setBounds(181, 69, 85, 29);\n\t\tframe.getContentPane().add(button_11);\n\t\t\n\t\tJButton button_12 = new JButton(\"-\");\n\t\tbutton_12.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tc_flag++;\n\t\t\t\t//System.out.println(\"You have pressed -\");\n\t\t\t\toperator = '-';\n\t\t\t}\n\t\t});\n\t\tbutton_12.setBounds(181, 98, 85, 29);\n\t\tframe.getContentPane().add(button_12);\n\t\t\n\t\tJButton button_13 = new JButton(\"/\");\n\t\tbutton_13.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tc_flag++;\n\t\t\t\t//System.out.println(\"You have pressed /\");\n\t\t\t\toperator = '/';\n\t\t\t}\n\t\t});\n\t\tbutton_13.setBounds(181, 127, 85, 29);\n\t\tframe.getContentPane().add(button_13);\n\t\t\n\t\tJButton button_14 = new JButton(\"*\");\n\t\tbutton_14.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tc_flag++;\n\t\t\t\t//System.out.println(\"You have pressed *\");\n\t\t\t\toperator = '*';\n\t\t\t}\n\t\t});\n\t\tbutton_14.setBounds(181, 157, 85, 29);\n\t\tframe.getContentPane().add(button_14);\n\t\t\n\t\ttextField = new JTextField();\n\t\ttextField.setBounds(6, 29, 260, 28);\n\t\tframe.getContentPane().add(textField);\n\t\ttextField.setColumns(10);\n\t\t\n\t\tJButton btnCe = new JButton(\"CE\");\n\t\tbtnCe.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tdec = false;\n\t\t\t\tdec2 = false;\n\t\t\t\tedit_flag = false;\n\t\t\t\tc_flag = 0;\n\t\t\t\tval = 0;\n\t\t\t\tval2 = 0;\n\t\t\t\ttotal = 0;\n\t\t\t\tnum1 = \"\";\n\t\t\t\tnum2 = \"\";\n\t\t\t\ttextField.setText(\"\");\n\t\t\t\tlist.clear();\n\t\t\t}\n\t\t});\n\t\tbtnCe.setBounds(6, 191, 58, 29);\n\t\tframe.getContentPane().add(btnCe);\n\t\t\n\t\tJButton btnNewButton_1 = new JButton(\"<\");\n\t\tbtnNewButton_1.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tfor(int i = 0; i < list.size()-3; i++)\n\t\t\t\t{\n\t\t\t\t\tlist.remove(i);\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"size = \"+list.size());\n\t\t\t\ttheList(-1);\n\t\t\t}\n\t\t});\n\t\tbtnNewButton_1.setBounds(68, 191, 43, 29);\n\t\tframe.getContentPane().add(btnNewButton_1);\n\t\t\n\t\tJButton btnNewButton_2 = new JButton(\">\");\n\t\tbtnNewButton_2.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tfor(int i = 0; i < list.size()-3; i++)\n\t\t\t\t{\n\t\t\t\t\tlist.remove(i);\n\t\t\t\t}\n\t\t\t\ttheList(1);\n\t\t\t}\n\t\t});\n\t\tbtnNewButton_2.setBounds(121, 191, 43, 29);\n\t\tframe.getContentPane().add(btnNewButton_2);\n\t\t\n\t\tJButton btnNewButton_3 = new JButton(\"EDIT\");\n\t\tbtnNewButton_3.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\ttextField.setText(\"\");\n\t\t\t\tedit_flag = true;\n\t\t\t}\n\t\t});\n\t\tbtnNewButton_3.setBounds(181, 191, 85, 29);\n\t\tframe.getContentPane().add(btnNewButton_3);\n\t}",
"public static void generateNewNumbersForKeyboard(JLabel[] keyboardButtons) {\r\n ArrayList<Integer> numbers = new ArrayList<>();\r\n Random randomGenerator = new Random();\r\n while (numbers.size() < keyboardButtons.length - 1) {\r\n int random = randomGenerator.nextInt(10);\r\n if (!numbers.contains(random))\r\n numbers.add(random);\r\n }\r\n\r\n for (int i = 1; i < keyboardButtons.length; i++)\r\n keyboardButtons[i].setText(String.valueOf(numbers.get(i - 1)));\r\n\r\n }",
"@Override\n public void onClick(View view) {\n // Create a new intent to open the {@link NumbersActivity}\n Intent recordIntent = new Intent(MainActivity.this, recordActivity.class);\n\n // Start the new activity\n startActivity(recordIntent);\n }",
"@Override\n protected void onCreate (Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n surname = (EditText) findViewById(R.id.surname);\n group = (EditText) findViewById(R.id.group);\n faculty = (EditText) findViewById(R.id.faculty);\n\n w_file = (EditText) findViewById(R.id.w_file);\n r_file = (EditText) findViewById(R.id.r_file);\n\n b_write = (Button) findViewById(R.id.b_write);\n b_read = (Button) findViewById(R.id.b_read);\n\n tv_text = (TextView) findViewById(R.id.tv_text);\n\n b_read.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n String fileName;\n fileName = r_file.getText().toString() + \".txt\";\n tv_text.setText(readFile(fileName));\n }\n });\n\n\n b_write.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n String record, fileName;\n record = surname.getText().toString() + \"\\n\" + group.getText().toString() + \"\\n\" + faculty.getText().toString();\n fileName = w_file.getText().toString() + \".txt\";\n saveFile (fileName,record);\n }\n });\n\n\n }",
"private void createSaveData(){\n try {\n File f = new File(filePath, highScores);\n FileWriter output = new FileWriter(f);\n BufferedWriter writer = new BufferedWriter(output);\n\n writer.write(\"0-0-0-0-0\");\n writer.newLine();\n writer.write(\".....-.....-.....-.....-.....\");\n writer.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"@Override\r\n\t\t\tpublic void handle(ActionEvent event) {\n\r\n\t\t\t\tvalue[15]++;\r\n\t\t\t\tvalue[15] %= 3;\r\n\t\t\t\tif (value[15] == 0) {\r\n\t\t\t\t\tbtn[15].setText(\"0\");\r\n\t\t\t\t}\r\n\t\t\t\tif (value[15] == 1) {\r\n\t\t\t\t\tbtn[15].setText(\"1\");\r\n\t\t\t\t}\r\n\t\t\t\tif (value[15] == 2) {\r\n\t\t\t\t\tbtn[15].setText(\"X\");\r\n\t\t\t\t}\r\n\t\t\t}",
"public void writeOutputToFile(ArrayList<Object> transformNums) throws IOException {\r\n FileWriter file = new FileWriter(writeFilename);\r\n\r\n for(int i=0; i<transformNums.size(); i++){\r\n file.write(transformNums.get(i)+\" \");\r\n }\r\n\r\n file.close();\r\n\r\n }",
"private void createExecutableFile() throws IOException {\r\n //if (report.getErrorList() == null)\r\n //{\r\n System.out.println(\"Currently generating the executable file.....\");\r\n executableFile = new File(sourceName + \".lst\");\r\n // if creating the lst file is successful, then you can start to write in the lst file\r\n executableFile.delete();\r\n if (executableFile.createNewFile()) {\r\n writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(sourceName + \".asm\"), \"utf-8\")); //create an object to write into the lst file\r\n\r\n String [] hex = generate.split(\" \");\r\n\r\n for (int index = 0; index < hex.length; index++) {\r\n String hex1 = hex[index].trim();\r\n System.out.println(hex1);\r\n\r\n int i = Integer.parseInt(hex1, 16);\r\n String bin = Integer.toBinaryString(i);\r\n System.out.println(bin);\r\n\r\n writer.write(bin); // once the instruction is converted to binary it is written into the exe file\r\n }\r\n\r\n writer.close();\r\n\r\n }\r\n }",
"@Override\n public void actionPerformed(ActionEvent e) {\n int returnVal = fc.showOpenDialog(panel);\n if(returnVal == JFileChooser.APPROVE_OPTION){\n file = fc.getSelectedFile();\n System.out.println(file);\n \n try {\n Scanner scanner = new Scanner(file);\n String appendString = \"\";\n \n while(scanner.hasNext()){\n String oneString = scanner.nextLine();\n txtArea.append(oneString + \"\\n\");\n }\n \n try {\n read_characters(file.toString());\n } catch (IOException e1) {\n // TODO Auto-generated catch block\n e1.printStackTrace();\n }\n \n resultArea.append(resultString);\n resultPane.setText(resultString);\n } catch (FileNotFoundException e1) {\n // TODO Auto-generated catch block\n e1.printStackTrace();\n }\n \n //Print ID table\n Map<String,Integer> map = new TreeMap<String,Integer>(userDefinedWords);\n identifierTableArea.append(\"Number of Occurences \" + \"\\t\" +\n \t\t\t\t\t\t\t\"Symbol\" + \"\\n\\n\");\n Iterator iter = \n \t\tmap.entrySet().iterator();\n while(iter.hasNext()){\n \t Map.Entry pair = \n \t\t\t (Map.Entry)iter.next();\n \t identifierTableArea.append(\n \t\t\t pair.getValue() + \"\\t\\t\" + pair.getKey() + \"\\n\");\n }\n \n }\n }",
"static void createNewFile(String path) \n\t\t{\n\t\tLinkedList<String> defaultData = new LinkedList<String>();\n\t\tdefaultData.add(\"1,Frank,West,98,95,87,78,77,80\");\n\t\tdefaultData.add(\"2,Dianne,Greene,78,94,88,87,95,92\");\n\t\tdefaultData.add(\"3,Doug,Lei,78,94,88,87,95,92\");\n\t\tdefaultData.add(\"4,James,Hewlett,69,92,74,77,89,91\");\n\t\tdefaultData.add(\"5,Aroha,Wright,97,92,87,83,82,92\");\n\t\t\n\t\ttry \n\t\t{\n\t\t\tPrintWriter newFile = new PrintWriter(path, \"UTF-8\"); // Create .txt file in given path\n\t\t\t\n\t\t\tfor (String s : defaultData) \n\t\t\t{\n\t\t\t\tnewFile.println(s); // Write To file\n\t\t\t}\n\t\t\t\n\t\t\tnewFile.close(); // Close File\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 (UnsupportedEncodingException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tSystem.out.println(\"studentData.txt Created Successfully!\");\n\t\t\n\t}",
"@Override\r\n\t\t\tpublic void handle(ActionEvent event) {\n\r\n\t\t\t\tvalue[12]++;\r\n\t\t\t\tvalue[12] %= 3;\r\n\t\t\t\tif (value[12] == 0) {\r\n\t\t\t\t\tbtn[12].setText(\"0\");\r\n\t\t\t\t}\r\n\t\t\t\tif (value[12] == 1) {\r\n\t\t\t\t\tbtn[12].setText(\"1\");\r\n\t\t\t\t}\r\n\t\t\t\tif (value[12] == 2) {\r\n\t\t\t\t\tbtn[12].setText(\"X\");\r\n\t\t\t\t}\r\n\t\t\t}",
"@FXML\n public void createRecentsButtons(ActionEvent ae) throws Exception {\n\n // do your job of creating Buttons and pass the arraylist as function parameters\n for(int k=0; k<11; k++)\n myArray.add(k);\n this.getNumberOfRecentGroups(myArray);\n System.out.println(\"I was clicked\");\n }",
"public void importFileClick() {\n\n //Lets the user choose a file location\n FileChooser fileChooser = new FileChooser();\n fileChooser.setTitle(\"Open Resource File\");\n fileChooser.setInitialDirectory(new File(System.getProperty(\"user.dir\")));\n fileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter(\"Run-length encoding\",\n \"*.rle\"));\n File file = fileChooser.showOpenDialog(new Stage());\n\n //If a file was chosen, will stop the game and set the generation to 0 and try to load the file.\n if (file != null) {\n timeline.stop();\n gOL.resetGenCounter();\n generationLabel.setText(Integer.toString(gOL.getGenCounter()));\n try {\n fileHandler.readGameBoardFromDisk(file);\n } catch (IOException ie) {\n //Produces a warning if unsuccessful\n PopUpAlerts.ioAlertFromDisk();\n }\n }\n\n aliveLabel.setText(Integer.toString(board.getCellsAlive()));\n ruleLabel.setText(gOL.getRuleString().toUpperCase());\n isMovable = true;\n canvasArea.requestFocus();\n setFocusTraversable(false);\n\n //Resets offset to accommodate for the new pattern and calls draw().\n canvasDrawer.resetOffset(board, canvasArea);\n draw();\n }",
"@Override\r\n\t\t\tpublic void handle(ActionEvent event) {\n\r\n\t\t\t\tvalue[11]++;\r\n\t\t\t\tvalue[11] %= 3;\r\n\t\t\t\tif (value[11] == 0) {\r\n\t\t\t\t\tbtn[11].setText(\"0\");\r\n\t\t\t\t}\r\n\t\t\t\tif (value[11] == 1) {\r\n\t\t\t\t\tbtn[11].setText(\"1\");\r\n\t\t\t\t}\r\n\t\t\t\tif (value[11] == 2) {\r\n\t\t\t\t\tbtn[11].setText(\"X\");\r\n\t\t\t\t}\r\n\t\t\t}",
"private void createButton() {\n\t\tbtnAddTask = new JButton(\"Add Task\");\n\t\tbtnSave = new JButton(\"Save\");\n\t\tbtnCancel = new JButton(\"Cancel\");\n\n\t\tbtnAddTask.addActionListener(new ToDoAction());\n\t\tbtnSave.addActionListener(new ToDoAction());\n\t\tbtnCancel.addActionListener(new ToDoAction());\n\t}",
"@Override\r\n\t\t\tpublic void handle(ActionEvent event) {\n\r\n\t\t\t\tvalue[14]++;\r\n\t\t\t\tvalue[14] %= 3;\r\n\t\t\t\tif (value[14] == 0) {\r\n\t\t\t\t\tbtn[14].setText(\"0\");\r\n\t\t\t\t}\r\n\t\t\t\tif (value[14] == 1) {\r\n\t\t\t\t\tbtn[14].setText(\"1\");\r\n\t\t\t\t}\r\n\t\t\t\tif (value[14] == 2) {\r\n\t\t\t\t\tbtn[14].setText(\"X\");\r\n\t\t\t\t}\r\n\t\t\t}",
"@Override\n public void onGenerateButtonClicked() {\n\n String result;\n try {\n int c = Integer.parseInt(view.getEndpointTextViewValue());\n result = model.generate(c);\n } catch (NumberFormatException e) {\n view.showToast(\"Wrong input!\");\n return;\n } catch (WrongParametersException e) {\n view.showToast(e.getMessage());\n return;\n }\n Intent intent = view.createNewIntent(SecondActivity.class);\n intent.putExtra(\"result\", result);\n view.startNewActivity(intent);\n }",
"@Override\r\n\t\t\tpublic void handle(ActionEvent event) {\n\r\n\t\t\t\tvalue[9]++;\r\n\t\t\t\tvalue[9] %= 3;\r\n\t\t\t\tif (value[9] == 0) {\r\n\t\t\t\t\tbtn[9].setText(\"0\");\r\n\t\t\t\t}\r\n\t\t\t\tif (value[9] == 1) {\r\n\t\t\t\t\tbtn[9].setText(\"1\");\r\n\t\t\t\t}\r\n\t\t\t\tif (value[9] == 2) {\r\n\t\t\t\t\tbtn[9].setText(\"X\");\r\n\t\t\t\t}\r\n\t\t\t}",
"public ifrm_historial() {\n initComponents();\n this.setTitle(\"Historial bitacoraCalculadora.txt\");\n File archivo;\n try{\n final BufferedReader lector = new BufferedReader(new FileReader(\"bitacoraCalculadora.txt\"));\n String line = \"\";\n while ((line = lector.readLine()) != null){\n //txt_mostrar.setText(line);\n txt_mostrar.append(line +\"\\n\");\n }lector.close();\n }catch(FileNotFoundException e){\n e.printStackTrace();\n } catch(IOException e){\n e.printStackTrace();\n }\n }",
"@Override\r\n\t\t\tpublic void handle(ActionEvent event) {\n\r\n\t\t\t\tvalue[7]++;\r\n\t\t\t\tvalue[7] %= 3;\r\n\t\t\t\tif (value[7] == 0) {\r\n\t\t\t\t\tbtn[7].setText(\"0\");\r\n\t\t\t\t}\r\n\t\t\t\tif (value[7] == 1) {\r\n\t\t\t\t\tbtn[7].setText(\"1\");\r\n\t\t\t\t}\r\n\t\t\t\tif (value[7] == 2) {\r\n\t\t\t\t\tbtn[7].setText(\"X\");\r\n\t\t\t\t}\r\n\t\t\t}",
"private void paintNumbers() {\n\n g2d.setColor(_BOARDCOLOR);\n g2d.drawString(\"0\", 100, 150);\n g2d.drawString(\"1\", 200, 150);\n g2d.drawString(\"2\", 300, 150);\n g2d.drawString(\"3\", 400, 150);\n g2d.drawString(\"4\", 100, 250);\n g2d.drawString(\"5\", 200, 250);\n g2d.drawString(\"6\", 300, 250);\n g2d.drawString(\"7\", 400, 250);\n g2d.drawString(\"8\", 100, 350);\n g2d.drawString(\"9\", 200, 350);\n g2d.drawString(\"10\", 300, 350);\n g2d.drawString(\"11\", 400, 350);\n g2d.drawString(\"12\", 100, 450);\n g2d.drawString(\"13\", 200, 450);\n g2d.drawString(\"14\", 300, 450);\n g2d.drawString(\"15\", 400, 450);\n }",
"@Override\n\tpublic void actionPerformed (ActionEvent e)\n\t{\n\t\n\t\t// Create the File Save dialog.\n\t\tFileDialog fd = new FileDialog(\n\t\t\tAppContext.cartogramWizard, \n\t\t\t\"Save Computation Report As...\", \n\t\t\tFileDialog.SAVE);\n\n\t\tfd.setModal(true);\n\t\tfd.setBounds(20, 30, 150, 200);\n\t\tfd.setVisible(true);\n\t\t\n\t\t// Get the selected File name.\n\t\tif (fd.getFile() == null)\n\t\t\treturn;\n\t\t\n\t\tString path = fd.getDirectory() + fd.getFile();\n\t\tif (path.endsWith(\".txt\") == false)\n\t\t\tpath = path + \".txt\";\n\t\t\n\t\t\n\t\t// Write the report to the file.\n\t\ttry\n\t\t{\n\t\t\tBufferedWriter out = new BufferedWriter(new FileWriter(path));\n\t\t\tout.write(AppContext.cartogramWizard.getCartogram().getComputationReport());\n\t\t\tout.close();\n\t\t} \n\t\tcatch (IOException exc)\n\t\t{\n\t\t}\n\n\t\t\n\t\n\t}",
"private static void writeFile(String filePath) {\n\t\tFileWriter file = null;\n\t\tPrintWriter printWriter = null;\n\t\t\n\t\ttry {\n\t\t\t// Create the printer.\n\t\t\tfile = new FileWriter(filePath);\n\t\t\tprintWriter = new PrintWriter(file);\n\t\t\t\n\t\t\t// Create the output.\n\t\t\tString output = Integer.toString(slideList.size());\n\t\t\t\n\t\t\tfor (Slide slide : slideList) {\n\t\t\t\toutput = output.concat(BREAK_LINE).concat(Integer.toString(slide.getId1()));\n\t\t\t\t\n\t\t\t\tif (slide.getId1() != slide.getId2()) {\n\t\t\t\t\toutput = output.concat(ONE_SPACE).concat(Integer.toString(slide.getId2()));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Print the output in the file.\n\t\t\tprintWriter.print(output);\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Error while writing the output file: \" + e);\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tprintWriter.close();\n\t\t\t\tfile.close();\n\t\t\t\tSystem.out.println(\">> Output file has been written!\");\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.out.println(\"Error while closing the output file: \" + e);\n\t\t\t}\n\t\t}\n\t}",
"public void recordOrder(){\n PrintWriter output = null;\n try{\n output = \n new PrintWriter(new FileOutputStream(\"record.txt\", true));\n }\n catch(Exception e){//throws exception\n System.out.println(\"File not found\");\n System.exit(0);\n }\n output.println(Coffee);//prints in file contents of Coffee\n output.close();//closes file\n }",
"protected void createButtonActionPerformed(ActionEvent evt) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\ttextArea.append(\"My mark is X\\n\");\r\n\t\tmyMark =\"X\";\r\n\t\tyourMark=\"O\";\r\n\t\tnew CreateButtonThread(\"CreateButton\");\t\t\t\t\t\r\n\t}",
"public void actionPerformed(ActionEvent e){\n\t\t\tInputStream f = getClass().getResourceAsStream(\"/LoadTXT.txt\");\n\t\t\tboolean isFirst = true;\n\t\t\tBufferedReader reader = null;\n\t\t\ttry {\n\t\t\t\treader = new BufferedReader(new InputStreamReader(f));\n\t\t\t\tString Ins = null;\n\t\t\t\tint line = 1;\n\t\t\t\t//Read the file line by line and split the line into two parts by symbol \",\"\n\t\t\t\twhile ((Ins = reader.readLine()) != null) {\n\t\t\t\t\tString[] str = Ins.split(\",\");\n\t\t\t\t\tint index = Integer.parseInt(str[0]);\t\t\t\t\t\n\t\t\t\t\tShort con = Integer.valueOf(str[1],2).shortValue();\n\t\t\t\t\tif(isFirst){\n\t\t\t\t\t\tcpu.setPc((short) index);\n\t\t\t\t\t\tisFirst=false;\n\t\t\t\t\t}\n\t\t\t\t\tcpu.setMem(con, index);\t\t\t\t\t\n\t\t\t\t\tline++;\n\t\t\t\t}\n\t\t\t\treader.close();\n\t\t\t} catch (IOException ex) {\n\t\t\t\tex.printStackTrace();\n\t\t\t} finally {\n\t\t\t\tif (reader != null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\treader.close();\n\t\t\t\t\t} catch (IOException e1) {\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\tSystem.out.println(\"The PC value is: \");\n\t\t\tSystem.out.println(cpu.getPc());\n\t\t\t//Call the function to show the data on the screen\n\t\t\tShowData();\n\t\t}",
"@FXML\n void loadButtonClicked(ActionEvent event) throws FileNotFoundException\n {\n FileChooser file = new FileChooser();\n\n file.setTitle(\"Load file (.txt)\");\n\n file.getExtensionFilters().addAll(new FileChooser.ExtensionFilter(\"Text Files\", \"*.txt\"));\n\n File selectedFile = file.showOpenDialog(listView.getScene().getWindow());\n\n // Create new file with all info on file, do this in a method\n loadFile(selectedFile);\n\n // Send all this info to the list in order to create new one\n for(int i=0; i<Item.getToDoList().size(); i++)\n {\n // Display items\n display();\n\n }\n }",
"@Override\r\n\t\t\tpublic void handle(ActionEvent event) {\n\r\n\t\t\t\tvalue[13]++;\r\n\t\t\t\tvalue[13] %= 3;\r\n\t\t\t\tif (value[13] == 0) {\r\n\t\t\t\t\tbtn[13].setText(\"0\");\r\n\t\t\t\t}\r\n\t\t\t\tif (value[13] == 1) {\r\n\t\t\t\t\tbtn[13].setText(\"1\");\r\n\t\t\t\t}\r\n\t\t\t\tif (value[13] == 2) {\r\n\t\t\t\t\tbtn[13].setText(\"X\");\r\n\t\t\t\t}\r\n\t\t\t}",
"private void saveInFile() {\n\t\tthis.deleteFile();\n\t\tfor (CounterModel obj : counterListModel.getCounterList()) {\n\t\t\ttry {\n\t\t\t\tGson gson = new Gson();\n\t\t\t\tif (obj.getCounterName().equals(counterModel.getCounterName())) {\n\t\t\t\t\tobj = counterModel;\n\t\t\t\t}\n\t\t\t\tString json = gson.toJson(obj) +'\\n';\n\t\t\t\tFileOutputStream fos = openFileOutput(FILENAME,\n\t\t\t\t\t\tContext.MODE_APPEND);\n\t\t\t\tfos.write(json.getBytes());\n\t\t\t\tfos.close();\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"public void createlevel() {\n if (level == 21)\n {\n Intent myIntent = new Intent(GameActivity.this, finalActivity.class);\n startActivity(myIntent);\n finish();\n }\n else {\n BufferedReader reader;\n String line = \"\";\n try{\n InputStream file = getAssets().open(\"inputtt.txt\");\n if (selectedlanguage.equals(\"germ\"))\n file = getAssets().open(\"inputGer.txt\");\n else if (selectedlanguage.equals(\"svk\"))\n file = getAssets().open(\"inputSvk.txt\");\n reader = new BufferedReader(new InputStreamReader(file));\n line = reader.readLine();\n int i = 1;\n while(line != null){\n line = reader.readLine();\n if (i == level) {\n break;\n }\n i++;\n }\n\n } catch(IOException ioe){\n ioe.printStackTrace();\n }\n\n String[] splitter = line.split(\"#\", 5);\n counter = Integer.parseInt(splitter[1]);\n text = splitter[2];\n\n char[] ch = new char[splitter[0].length()];\n for (int i = 0; i < splitter[0].length(); i++) {\n ch[i] = splitter[0].charAt(i);\n }\n int moves = 0;\n for (int i = 0; i < 4; i++)\n {\n for (int j = 0; j < 4; j++) {\n if(Character.getNumericValue(ch[moves]) == 1) {\n buttColor[i][j] = \"red\";\n } else {\n buttColor[i][j] = \"green\";\n }\n applyColor(buttons[i][j], buttColor[i][j]);\n moves++;\n }\n }\n }\n }",
"private void createEvents() {\n\t\tbtnPushTheButton.addActionListener(new ActionListener() {\n\t\t\t\n\t\t\t\n\t\t\tprivate List<String> b;\n\n\t\n\t\t\t//@SuppressWarnings(\"unchecked\")\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tact = true;\n\t\t\t\t\n//\t\t\t\tb = new ArrayList<String>();\n//\t\t\t\t\n//\t\t\t\tthis.b= (List<String>) ((List<Object>) (agent.v.getData())).stream().map(item -> {\n//\t\t\t\t\treturn (String) item;\n//\t\t\t\t});\n//\t\t\t\tString c = String.join(\", \", b);\n//\t\t\t\tclassTextArea.setText(c);\n//\t\t\t\n//\t\t\t\tclassTextArea.setText(b.toString());\n//\t\t\t\t\n//\t\t\t\treturn;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t});\n\t\t\n\t}",
"public void output2File(String outputName, ArrayList<Integer> source){\n this.outputContent = new StringBuilder();\n Iterator<Integer> itr = source.iterator();\n\n while(itr.hasNext()){\n this.outputContent.append((itr.next().intValue()));\n this.outputContent.append(\" \");\n }\n\n try {\n FileWriter fileWriter = new FileWriter(outputName, true);\n fileWriter.write(this.outputContent.toString());\n fileWriter.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }",
"@Override\r\n\t\t\tpublic void handle(ActionEvent event) {\n\r\n\t\t\t\tvalue[5]++;\r\n\t\t\t\tvalue[5] %= 3;\r\n\t\t\t\tif (value[5] == 0) {\r\n\t\t\t\t\tbtn[5].setText(\"0\");\r\n\t\t\t\t}\r\n\t\t\t\tif (value[5] == 1) {\r\n\t\t\t\t\tbtn[5].setText(\"1\");\r\n\t\t\t\t}\r\n\t\t\t\tif (value[5] == 2) {\r\n\t\t\t\t\tbtn[5].setText(\"X\");\r\n\t\t\t\t}\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic void handle(ActionEvent event) {\n\r\n\t\t\t\tvalue[1]++;\r\n\t\t\t\tvalue[1] %= 3;\r\n\t\t\t\tif (value[1] == 0) {\r\n\t\t\t\t\tbtn[1].setText(\"0\");\r\n\t\t\t\t}\r\n\t\t\t\tif (value[1] == 1) {\r\n\t\t\t\t\tbtn[1].setText(\"1\");\r\n\t\t\t\t}\r\n\t\t\t\tif (value[1] == 2) {\r\n\t\t\t\t\tbtn[1].setText(\"X\");\r\n\t\t\t\t}\r\n\t\t\t}",
"public static void main(String[] args) {\n\t\tint [] gnumber = new int[101];\n\t\tint one,ten,hundred;\n\n\n\t\tfor (int i = 0; i < gnumber.length; i++) {\n\t\t\tone = i % 10;\n\t\t\tten = (i /10) % 10;\n\t\t\thundred = (i/100) % 10;\n\t\t\tgnumber[i] = i+one+ten+hundred;\n\t\t}\n\t\t\n\t\tSystem.out.format(\"%-10s%s\\n\", \"Index\",\"Generated Number\");\n\t\t\n\t\tfor (int i = 0; i < gnumber.length; i++) {\n\t\t\tSystem.out.format(\"%-10d%d\\n\", i,gnumber[i]);\n\t\t}\n\t}",
"public static void createFile(double[] array){\n //String for the name of the file that's going to be created.\n String newFileName = \"results.csv\";\n\n //Create a file variable using the created file name\n try{\n File newFile = new File(newFileName);\n\n //Create new instance of PrintWriter to write into the new file\n FileWriter csvWriter = new FileWriter(newFile, false);\n //For each number, print the percentage into the file\n for(int i = 0; i < 9; i++){\n csvWriter.write((i+1) + \": \" + array[i] + \"%\\n\");\n }\n //Close the PrintWriter since we don't need it anymore.\n csvWriter.close();\n }\n catch(FileNotFoundException e){\n System.out.println(\"File not found\");\n }\n catch(IOException e){\n System.out.println(\"IO Exception\");\n }\n }",
"public static void searchNumber() {\n\t\t// Scanner scan = new Scanner(System.in);\n\t\tSystem.out.print(\"Enter a number to search: \");\n\t\tint search = scan.nextInt();\n\t\t// scan.close();\n\t\tif (hl.contains(search)) {\n\t\t\tSystem.out.println(\"File contgains the number and deleted from it\");\n\t\t\thl.pop(search);\n\t\t} else {\n\t\t\tSystem.out.println(\"File does not contain the number. Adding it to the file.\");\n\t\t\thl.add(search);\n\t\t}\n\t\tint[] integerArray = hl.getAll();\n\t\tPrintWriter printWriter = null;\n\t\ttry {\n\t\t\tprintWriter = new PrintWriter(\"/home/bridgeit/Desktop/number.txt\", \"UTF-8\");\n\t\t} catch (FileNotFoundException | UnsupportedEncodingException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tfor (int integer : integerArray) {\n\t\t\tprintWriter.print(integer + \" \");\n\t\t}\n\t\tprintWriter.close();\n\t}",
"public void recordOrder(){ \n PrintWriter output = null;\n try{\n output = \n new PrintWriter(new FileOutputStream(\"record.txt\", true));\n }\n catch(Exception e){\n System.out.println(\"File not found\");\n System.exit(0);\n }\n output.println(Tea);//writes into the file contents of String Tea\n output.close();//closes file\n }",
"public static int append(int numElements, int[] vals) throws IOException{\r\n\t\t\r\n\t\tFile myFile = new File(\"newValues.txt\"); // making a new file for the new values that will be appended\r\n\t\tScanner inputFile1 = new Scanner(myFile); // reading the file\r\n\t\t\r\n\t\tint newValue = 0; // declaring needed variable\r\n\t\t\r\n\t\twhile(inputFile1.hasNext()) {\r\n\t\t\t\r\n\t\t\tnewValue = inputFile1.nextInt(); // will simply store into the initial array starting at where the initial array ends.\r\n\t\t\tvals[numElements] = newValue;\r\n\t\t\tnumElements++;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\r\n\t\tinputFile1.close();\r\n\t\t\r\n\t\treturn numElements; // return value to main\r\n\t}",
"@Override\n public void onClick(View view) {\n //switch statement to determine which button was cliked\n switch (view.getId()){\n //case when number one was clicked\n case R.id.one:\n //if the the screen shows 0 then we just replace the 0 with 1, and set currentNumber\n if(screen.getText().toString().equals(\"0\")) {\n screen.setText(one.getText().toString());\n currentNumber = one.getText().toString();\n }else{\n //if the screen shows something besides 0, we concatenate whatever was on the\n //screen before plus the 1, and put it on the screen, and update current number\n //accordingly\n screen.setText(screen.getText().toString() + one.getText().toString());\n currentNumber = currentNumber + one.getText().toString();\n }\n break;\n\n //cases two - zero are same as case one except the number changes\n case R.id.two:\n if(screen.getText().toString().equals(\"0\")) {\n screen.setText(two.getText().toString());\n currentNumber = two.getText().toString();\n }else{\n screen.setText(screen.getText().toString() + two.getText().toString());\n currentNumber = currentNumber + two.getText().toString();\n }\n break;\n\n case R.id.three:\n if(screen.getText().toString().equals(\"0\")) {\n screen.setText(three.getText().toString());\n currentNumber = three.getText().toString();\n }else{\n screen.setText(screen.getText().toString() + three.getText().toString());\n currentNumber = currentNumber + three.getText().toString();\n }\n break;\n\n case R.id.four:\n if(screen.getText().toString().equals(\"0\")) {\n screen.setText(four.getText().toString());\n currentNumber = four.getText().toString();\n }else{\n screen.setText(screen.getText().toString() + four.getText().toString());\n currentNumber = currentNumber + four.getText().toString();\n }\n break;\n\n case R.id.five:\n if(screen.getText().toString().equals(\"0\")) {\n screen.setText(five.getText().toString());\n currentNumber = five.getText().toString();\n }else{\n screen.setText(screen.getText().toString() + five.getText().toString());\n currentNumber = currentNumber + five.getText().toString();\n }\n break;\n\n case R.id.six:\n if(screen.getText().toString().equals(\"0\")) {\n screen.setText(six.getText().toString());\n currentNumber = six.getText().toString();\n }else{\n screen.setText(screen.getText().toString() + six.getText().toString());\n currentNumber = currentNumber + six.getText().toString();\n }\n break;\n\n case R.id.seven:\n if(screen.getText().toString().equals(\"0\")) {\n screen.setText(seven.getText().toString());\n currentNumber = seven.getText().toString();\n }else{\n screen.setText(screen.getText().toString() + seven.getText().toString());\n currentNumber = currentNumber + seven.getText().toString();\n }\n break;\n\n case R.id.eight:\n if(screen.getText().toString().equals(\"0\")) {\n screen.setText(eight.getText().toString());\n currentNumber = eight.getText().toString();\n }else{\n screen.setText(screen.getText().toString() + eight.getText().toString());\n currentNumber = currentNumber + eight.getText().toString();\n }\n break;\n\n case R.id.nine:\n if(screen.getText().toString().equals(\"0\")) {\n screen.setText(nine.getText().toString());\n currentNumber = nine.getText().toString();\n }else{\n screen.setText(screen.getText().toString() + nine.getText().toString());\n currentNumber = currentNumber + nine.getText().toString();\n }\n break;\n\n case R.id.zero:\n if(screen.getText().toString().equals(\"0\")) {\n screen.setText(zero.getText().toString());\n currentNumber = zero.getText().toString();\n }else{\n screen.setText(screen.getText().toString() + zero.getText().toString());\n currentNumber = currentNumber + zero.getText().toString();\n\n }\n break;\n\n //case plus, minus, multiply, and divide are very similar, so comments here can be used\n //for all\n //When plus is clicked we will add the current number and plus sign to the numberAndOperands array\n //and update the screen accordingly\n case R.id.plus:\n //if the user is not performing operation on a result of a previous calculation\n //then this if statement will run\n if(!isContinueFromResult) {\n //if current number is not equal to \"\" that means user has a number before this\n //plus sign.\n if(!currentNumber.equals(\"\")) {\n //so we add the currentNumber and the + sign to the array list of Operands\n //and numbers and update the screen accordingly\n numbersAndOperands.add(currentNumber);\n numbersAndOperands.add(\"+\");\n screen.setText(screen.getText().toString() + plus.getText().toString());\n }\n //if the current number is \"\" that means that the user is trying to click an\n //operand right after another operand. So in that case we do the following\n else{\n //replace the last operand with current operand\n String newScreen = screen.getText().toString().substring(0, screen.getText().toString().length() - 1) + \"+\";\n numbersAndOperands.remove(numbersAndOperands.size() - 1);\n numbersAndOperands.add(\"+\");\n screen.setText(newScreen);\n }\n }\n //else means that the user is performing an operation on a result from previous\n //calculations\n else{\n if(!currentNumber.equals(\"\")) {\n numbersAndOperands.add(currentNumber);\n numbersAndOperands.add(\"+\");\n //so instead of updating the screen from what it already had, we update it\n //with current number and the operand, because inside the equals case the\n //current number is being set to the result of calculations\n screen.setText(currentNumber + plus.getText().toString());\n isContinueFromResult = false;\n }\n }\n //in the end we set the current number to \"\" because we want to keep track of\n //when the user is clicking numbers are Operands\n currentNumber = \"\";\n break;\n\n case R.id.minus:\n if(!isContinueFromResult) {\n if(!currentNumber.equals(\"\")) {\n numbersAndOperands.add(currentNumber);\n numbersAndOperands.add(\"-\");\n screen.setText(screen.getText().toString() + minus.getText().toString());\n }else{\n //replace the last operand with current\n String newScreen = screen.getText().toString().substring(0, screen.getText().toString().length() - 1) + \"-\";\n numbersAndOperands.remove(numbersAndOperands.size() - 1);\n numbersAndOperands.add(\"-\");\n screen.setText(newScreen);\n }\n }else {\n if(!currentNumber.equals(\"\")) {\n numbersAndOperands.add(currentNumber);\n numbersAndOperands.add(\"-\");\n screen.setText(currentNumber + minus.getText().toString());\n isContinueFromResult = false;\n }\n }\n currentNumber = \"\";\n break;\n\n case R.id.multiply:\n if(!isContinueFromResult) {\n if(!currentNumber.equals(\"\")) {\n numbersAndOperands.add(currentNumber);\n numbersAndOperands.add(\"*\");\n screen.setText(screen.getText().toString() + multiply.getText().toString());\n }else{\n //replace the last operand with current\n String newScreen = screen.getText().toString().substring(0, screen.getText().toString().length() - 1) + \"*\";\n numbersAndOperands.remove(numbersAndOperands.size() - 1);\n numbersAndOperands.add(\"*\");\n screen.setText(newScreen);\n }\n }else {\n if(!currentNumber.equals(\"\")) {\n numbersAndOperands.add(currentNumber);\n numbersAndOperands.add(\"*\");\n screen.setText(currentNumber + multiply.getText().toString());\n isContinueFromResult = false;\n }\n }\n currentNumber = \"\";\n break;\n\n case R.id.divide:\n if(!isContinueFromResult) {\n if(!currentNumber.equals(\"\")) {\n numbersAndOperands.add(currentNumber);\n numbersAndOperands.add(\"/\");\n screen.setText(screen.getText().toString() + divide.getText().toString());\n }else{\n //replace the last operand with current\n String newScreen = screen.getText().toString().substring(0, screen.getText().toString().length() - 1) + \"/\";\n numbersAndOperands.remove(numbersAndOperands.size() - 1);\n numbersAndOperands.add(\"/\");\n screen.setText(newScreen);\n }\n }else{\n if(!currentNumber.equals(\"\")) {\n numbersAndOperands.add(currentNumber);\n numbersAndOperands.add(\"/\");\n screen.setText(currentNumber + divide.getText().toString());\n isContinueFromResult = false;\n }\n }\n currentNumber = \"\";\n break;\n\n\n\n case R.id.equals:\n //the following if statement will add the last number to the numbersAndOperands array\n if(!currentNumber.equals(\"\")){\n numbersAndOperands.add(currentNumber);\n }\n\n //if the last thing in the array numbersAndOperands is +-*/ that means it is an invalid\n //and we tell the user and it is invalid and do not do any calculations\n if(numbersAndOperands.get(numbersAndOperands.size() - 1).equals(\"+\") ||\n numbersAndOperands.get(numbersAndOperands.size() - 1).equals(\"-\") ||\n numbersAndOperands.get(numbersAndOperands.size() - 1).equals(\"*\") ||\n numbersAndOperands.get(numbersAndOperands.size() - 1).equals(\"/\")){\n Toast.makeText(getActivity(), \"Invalid\", Toast.LENGTH_SHORT).show();\n }\n //When the last thing in the array of numbersAndOperands is a number then we can\n //do the following and calculate the result\n else {\n numbersAndOperands.add(\"=\");\n currentNumber = \"\";\n screen.setText(screen.getText().toString() + equals.getText().toString());\n\n //find all the multiplications and divisions first, and do the calculations\n for (int i = 1; i < numbersAndOperands.size(); i++) {\n if (numbersAndOperands.get(i).equals(\"*\") || numbersAndOperands.get(i).equals(\"/\")) {\n if (numbersAndOperands.get(i).equals(\"*\")) {\n double n1 = Double.parseDouble(numbersAndOperands.get(i - 1));\n double n2 = Double.parseDouble(numbersAndOperands.get(i + 1));\n double result = n1 * n2;\n\n numbersAndOperands.remove(i);\n numbersAndOperands.remove(i);\n numbersAndOperands.remove(i - 1);\n numbersAndOperands.add(i - 1, result + \"\");\n i--;\n\n } else {\n double n1 = Double.parseDouble(numbersAndOperands.get(i - 1));\n double n2 = Double.parseDouble(numbersAndOperands.get(i + 1));\n double result = n1 / n2;\n\n numbersAndOperands.remove(i);\n numbersAndOperands.remove(i);\n numbersAndOperands.remove(i - 1);\n numbersAndOperands.add(i - 1, result + \"\");\n i--;\n }\n }\n }\n\n //find all the plus and minus and do the calculations\n for (int i = 1; i < numbersAndOperands.size(); i++) {\n if (numbersAndOperands.get(i).equals(\"+\") || numbersAndOperands.get(i).equals(\"-\")) {\n if (numbersAndOperands.get(i).equals(\"+\")) {\n double n1 = Double.parseDouble(numbersAndOperands.get(i - 1));\n double n2 = Double.parseDouble(numbersAndOperands.get(i + 1));\n double result = n1 + n2;\n\n numbersAndOperands.remove(i);\n numbersAndOperands.remove(i);\n numbersAndOperands.remove(i - 1);\n numbersAndOperands.add(i - 1, result + \"\");\n i--;\n } else {\n\n double n1 = Double.parseDouble(numbersAndOperands.get(i - 1));\n double n2 = Double.parseDouble(numbersAndOperands.get(i + 1));\n double result = n1 - n2;\n\n numbersAndOperands.remove(i);\n numbersAndOperands.remove(i);\n numbersAndOperands.remove(i - 1);\n numbersAndOperands.add(i - 1, result + \"\");\n i--;\n }\n }\n }\n\n //display the answer and prepare for the next round of the calculations if\n //the user were to perform calculations on the result\n screen.setText(screen.getText().toString() + numbersAndOperands.get(0));\n currentNumber = numbersAndOperands.get(0);\n numbersAndOperands.clear();\n isContinueFromResult = true;\n }\n break;\n\n //here we reset everything we are using to keep track of order of operations and all\n case R.id.clear:\n numbersAndOperands.clear();\n currentNumber = \"0\";\n screen.setText(\"0\");\n break;\n }\n\n\n }",
"private static void outputResult(int result, File file) {\n\n try (FileWriter fileWriter = new FileWriter(file)) {\n fileWriter.write(result + \"\");\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n }",
"public void actionPerformed(ActionEvent e){\n\t\t\t\ttry{ //trys to print it into the the file, which NOT work, and has error handling to keep up with this\n\t\t\t\t\tpw = new BufferedWriter(new FileWriter(\"Questions.txt\" ,true));\n\t\t\t\t\tpw.newLine();//prints it in a specific format \n\t\t\t\t\tpw.write( question.getText());\n\t\t\t\t\tpw.newLine();\n\t\t\t\t\tpw.write( answer.getText());\n\t\t\t\t\tpw.close();\n\t\t\t\t}\n\t\t\t\tcatch(IOException est){\n\t\t\t\t\tSystem.err.println(\"sucks\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tJFrame goodframe = new JFrame (\"Frame\"); //creates a frame to show if you entered your question correctly\n\t\t\t\tgoodframe.setSize(300,200);\n\t\t\t\tgoodframe.getContentPane().add(new JLabel(\"Succesfully entered question\"), BorderLayout.CENTER);\n\t\t\t\tgoodframe.setLocationRelativeTo(null);\n\t\t\t\tgoodframe.setVisible(true);\n\t\t\t\tanswer.setText(\"Enter the answer to your question here\");\n\t\t\t\tquestion.setText(\"Enter your question here\");\n\t\t\t\tinitializeQuestionArray();\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t}",
"public void SaveMethod(String Num){\n Save1[c] = Num;\n String tmp = Save1[0];\n for(int n = 1;n<=c;n++){\n tmp = tmp + Save1[n];\n }\n TFCalcBox.setText(tmp);\n AfterEqual = 0;\n c = c + 1;\n }",
"public static void main(String[] args) throws IOException{\r\n\t\t\r\n\t\t\r\n\t\tint[] vals = new int[100]; // new int array to hold the initial values. up to 100 indexes / positions.\r\n\t\tint numElements = 0; // declaring needed variables to pass through methods.\r\n\t\tint numOfZeros = 0;\r\n\t\t\r\n\t\tPrintWriter outputFile = new PrintWriter(\"HW7_2output.txt\"); // making output file\r\n\t\t\r\n\t\toutputFile.print(\"Ceyhun Cafer \\nProfessor Ziegler \\nHW7_2\\nCISC 1115\\n\\n\"); // heading\r\n\t\r\n\t\tnumElements = readData(vals, outputFile); // saving return values done by other method readData\r\n\t\tnumOfZeros = countZeros(numElements, vals); // saving return value done by method countZeros\r\n\t\t\r\n\t\toutputFile.println(\"Total zeros counted: \" + numOfZeros); // print the number of zeros in the initial array\r\n\t\toutputFile.println(); // blank line to separate in output file\r\n\t\t\r\n\t\toutputFile.println(\"Appended Array: \\n\"); // new array will be under here in output file\r\n\t\t\r\n\t\tnumElements = append(numElements, vals); // new method is called to save new number into existing variable, will return and save a new number of elements\r\n\t\tnumOfZeros = countZeros(numElements, vals); // new method is called to save new number into existing variable, will return and save a new number of zeros within the elements.\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tfor(int i = 0; i < numElements; i++) {\r\n\t\t\t\r\n\t\t\toutputFile.println(vals[i]); // display new array elements\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\toutputFile.println(\"\\nNew total integers counted: \" + numElements); // prints new total element value to text file\r\n\t\toutputFile.println(\"New total zeros counted: \" + numOfZeros); // print new zeros counted\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\toutputFile.close();\r\n\r\n\t}",
"void random(){\r\n Random dice = new Random ();\r\n int number;\r\n \r\n for (int counter=1; counter<=10;counter++);\r\n number = 10000+dice.nextInt(100000);\r\n \r\n String hasil = TF3.getText();\r\n isi4.setText(number + \" \");\r\n }",
"public void actionPerformed(ActionEvent e) {\n\t\t\t\tfinal JFileChooser fc = new JFileChooser();\r\n\t\t\t\t\r\n\t\t\t\tif(currentDirectory != null) fc.setCurrentDirectory(currentDirectory);\r\n\t\t\t\t\r\n\t\t\t\t//In response to a button click:\r\n\t\t\t\tint returnVal = fc.showOpenDialog(null);\r\n\t\t\t\tcurrentDirectory = fc.getCurrentDirectory();\r\n\t\t\t\t\r\n\t\t if (returnVal == JFileChooser.APPROVE_OPTION) {\t\t \t\r\n\t\t \tList<String> lines = null;\r\n\t\t File file = fc.getSelectedFile();\r\n\t\t Path path = Paths.get(file.getAbsolutePath());\r\n\t\t int loopLength = antennaArray.position.length;\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tlines = Files.readAllLines(path, StandardCharsets.UTF_8);\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(lines.size() < antennaArray.position.length) {\r\n\t\t\t\t\t\t\tint difference = antennaArray.position.length - lines.size();\r\n\t\t\t\t\t\t\tfor(int addition = 0; addition < difference; addition++)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tlines.add(\"0\");\r\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfor (int conversion = 0; conversion < loopLength; conversion++) {\r\n\t\t\t\t\t\t\tdouble positionFromFile = 0;\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tpositionFromFile = Double.parseDouble(lines.get(conversion));\r\n\t\t\t\t\t\t\t} catch (NumberFormatException ex) {\r\n\t\t\t\t\t\t\t\tpositionFromFile = 0;\r\n\t\t\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tantennaArray.position[conversion] = positionFromFile;\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\trefreshPositionTable();\r\n\t\t\t\t\t\tdrawPlotWithInitialParameterValues();\t\t\t\t\t\t\r\n\t\t\t\t\t} catch (IOException ex) {\r\n\t\t\t\t\t\tex.printStackTrace();\r\n\t\t\t\t\t}\t\t\t\t\t\r\n\t\t } else {\r\n\t\t // Cancelled by the user.\r\n\t\t }\r\n\t\t\t}",
"public JButton makeDigitButton(String digit)\r\n {\r\n JButton button = new JButton(digit); \r\n ActionListener listener = new DigitButtonListener(digit);\r\n button.addActionListener(listener); \r\n return button; \r\n }",
"void createFile()\n {\n //Check if file already exists\n try {\n File myObj = new File(\"src/main/java/ex45/exercise45_output.txt\");\n if (myObj.createNewFile()) {\n System.out.println(\"File created: \" + myObj.getName());// created\n } else {\n System.out.println(\"File already exists.\"); //exists\n }\n //Error check\n } catch (IOException e) {\n System.out.println(\"An error occurred.\");\n e.printStackTrace();\n }\n }",
"public void actionPerformed (ActionEvent ev){\n\t\t\tQAinput += qtextarea.getText() + \"/\" + atextarea.getText() ;\n\t\t\t\n\t\t\t//creating a new filename and write the array of questions and answers there. This works for Japanese as well\n\t\t\tFile filepath = new File(filename);\n\t\t\ttry {\n\t\t\t\tOutputStream out = new FileOutputStream(filepath);\n \t\t\t\tWriter writer = new OutputStreamWriter(out, StandardCharsets.UTF_8);\n\t\t\t\twriter.write(QAinput);\n\t\t\t\twriter.close();\n\t\t\t} catch(IOException ex) { System.out.print(\"caught\"); ex.printStackTrace(); }\n\n\t\t\t/*\n\t\t\tadding the filename to \"ListofDecks.txt\". This is done first by reading all of the data (all of filename that has been recorded previously)\n\t\t\tand then convert it to string and then you added your new filename to the string, and the last, you record the string to the file.\n\t\t\t*/\n\t\t\ttry {\t\n\t\t\t\tFile targetfile = new File (\"\");\n\t\t\t\tif (targetfile.exists()){\n\t\t\t\t\tBufferedReader reader = new BufferedReader (new FileReader (\"ListofDecks\"));\n\t\t\t\t\tString message = null;\n\t\t\t\t\tString fullmessage = null;\n\t\t\t\t\tfullmessage = \"\";\n\t\t\t\t\twhile ((message = reader.readLine()) != null ){\n\t\t\t\t\t\tfullmessage += message;\n\t\t\t\t\t}\t\n\t\t\t\t\treader.close();\n\t\t\t\t\tBufferedWriter writer = new BufferedWriter(new FileWriter (new File(\"ListofDecks\")));\n\t\t\t\t\twriter.write(fullmessage + filename + \"/\");\n\t\t\t\t\twriter.close();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tBufferedWriter writer = new BufferedWriter(new FileWriter (new File(\"ListofDecks\")));\n\t\t\t\t\twriter.write(filename + \"/\");\n\t\t\t\t\twriter.close();\n\t\t\t\t}\n\t\t\t} catch (IOException excc) { System.out.print(\"caught\"); excc.printStackTrace(); }\n\t\t\tframe.setVisible(false);\n\t\t\tmoriHomepage mori = new moriHomepage();\n\t\t}",
"@Override\r\n\t\t\tpublic void handle(ActionEvent event) {\n\r\n\t\t\t\tvalue[3]++;\r\n\t\t\t\tvalue[3] %= 3;\r\n\t\t\t\tif (value[3] == 0) {\r\n\t\t\t\t\tbtn[3].setText(\"0\");\r\n\t\t\t\t}\r\n\t\t\t\tif (value[3] == 1) {\r\n\t\t\t\t\tbtn[3].setText(\"1\");\r\n\t\t\t\t}\r\n\t\t\t\tif (value[3] == 2) {\r\n\t\t\t\t\tbtn[3].setText(\"X\");\r\n\t\t\t\t}\r\n\t\t\t}"
] | [
"0.6609609",
"0.6200563",
"0.61131126",
"0.5838026",
"0.58350974",
"0.5770209",
"0.5643823",
"0.5640331",
"0.5579948",
"0.5526979",
"0.54935867",
"0.54868746",
"0.5465847",
"0.5459456",
"0.5450006",
"0.54392934",
"0.54257333",
"0.5419778",
"0.5411668",
"0.5389393",
"0.53785926",
"0.53751",
"0.53750515",
"0.5307225",
"0.5304466",
"0.52922845",
"0.5267546",
"0.5225841",
"0.52106524",
"0.5201073",
"0.51560175",
"0.51468545",
"0.5144543",
"0.5139541",
"0.5120095",
"0.51139385",
"0.5091024",
"0.5080894",
"0.50729537",
"0.50609994",
"0.5047986",
"0.50429875",
"0.5023934",
"0.50165117",
"0.50152326",
"0.49951375",
"0.49928063",
"0.49849984",
"0.4984366",
"0.49687892",
"0.49663553",
"0.495525",
"0.49456808",
"0.49451035",
"0.49272108",
"0.49254304",
"0.49212965",
"0.49130353",
"0.4901214",
"0.48956275",
"0.48902208",
"0.48893654",
"0.4887868",
"0.48807836",
"0.48796916",
"0.487056",
"0.48681244",
"0.48618338",
"0.48598433",
"0.4859795",
"0.48567393",
"0.48544008",
"0.4853179",
"0.48487443",
"0.4847356",
"0.48468778",
"0.48436937",
"0.484139",
"0.4841203",
"0.48374423",
"0.4831549",
"0.48305842",
"0.48157775",
"0.48157647",
"0.48141423",
"0.48060554",
"0.48017985",
"0.48000968",
"0.47981408",
"0.47967568",
"0.47923023",
"0.47876164",
"0.4777685",
"0.47736195",
"0.4773466",
"0.47674754",
"0.47652382",
"0.47639185",
"0.47629523",
"0.47616825"
] | 0.47828314 | 92 |
Load button onClick handler. Loads the numbers.txt file and populates a ListView with each number on a separate line. | public void loadFile(View view) {
// start the background file loading task
LoadFileTask task = new LoadFileTask();
task.execute();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@FXML\n void loadButtonClicked(ActionEvent event) throws FileNotFoundException\n {\n FileChooser file = new FileChooser();\n\n file.setTitle(\"Load file (.txt)\");\n\n file.getExtensionFilters().addAll(new FileChooser.ExtensionFilter(\"Text Files\", \"*.txt\"));\n\n File selectedFile = file.showOpenDialog(listView.getScene().getWindow());\n\n // Create new file with all info on file, do this in a method\n loadFile(selectedFile);\n\n // Send all this info to the list in order to create new one\n for(int i=0; i<Item.getToDoList().size(); i++)\n {\n // Display items\n display();\n\n }\n }",
"private void loadFromFile() {\n\t\ttry {\n\t\t\tFileInputStream fis = openFileInput(FILENAME);\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(fis));\n\t\t\tString line = in.readLine();\n\t\t\tGson gson = new Gson();\n\t\t\twhile (line != null) {\n\t\t\t\tCounterModel counter = gson.fromJson(line, CounterModel.class);\n\t\t\t\tif (counterModel.getCounterName().equals(counter.getCounterName())) {\n\t\t\t\t\tcounterListModel.addCounterToList(counterModel);\n\t\t\t\t\tcurrentCountTextView.setText(Integer.toString(counterModel.getCount()));\n\t\t\t\t} else {\n\t\t\t\t\tcounterListModel.addCounterToList(counter);\n\t\t\t\t}\n\t\t\t\tline = in.readLine();\n\t\t\t} \n\t\t\tfis.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public static void readFile() {\n\t\tbufferedReader = null;\n\t\ttry {\n\t\t\tFileReader fileReader = new FileReader(\"/home/bridgeit/Desktop/number.txt\");\n\t\t\tbufferedReader = new BufferedReader(fileReader);\n\n\t\t\tString line;\n\t\t\twhile ((line = bufferedReader.readLine()) != null) {\n\t\t\t\tString[] strings = line.split(\" \");\n\t\t\t\tfor (String integers : strings) {\n\t\t\t\t\thl.add(Integer.parseInt(integers));\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"File Not Found...\");\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\ttry {\n\t\t\tbufferedReader.close();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}",
"public void loadFile(File file) throws FileNotFoundException\n {\n FileReader reader = new FileReader(file);\n\n // Clear table to make sure it only shows tasks from file\n Item.getToDoList().clear();\n if(this.listView != null)\n {\n listView.getItems().clear();\n }\n\n index = 0;\n\n try(BufferedReader temp = new BufferedReader(reader))\n {\n String info;\n boolean check;\n\n while((info = temp.readLine()) != null)\n {\n // Make an array of values\n String[] values = info.split(\",\");\n\n //Array length is 3, since 3 columns. If not that then incorrect file\n if(values.length != 3)\n {\n if(this.status != null)\n {\n status.setText(\"Incompatible File. \");\n }\n break;\n }\n\n // If correct, add information from file to list\n else\n {\n check = !values[2].equals(\"false\");\n Item.getToDoList().add(new Item(values[0], values[1], check));\n }\n }\n\n } catch (IOException exception)\n {\n // If error, let user know\n if(this.status != null)\n {\n status.setText(\"File not found. \");\n }\n\n exception.printStackTrace();\n }\n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n\n super.onCreate(savedInstanceState);\n setContentView(R.layout.calculator);\n frag = null;\n try{\n FileInputStream fin = openFileInput(\"test.txt\");\n int c;\n String temp=\"\";\n while( (c = fin.read()) != -1){\n temp = temp + Character.toString((char)c);\n }\n String[] list = temp.split(\"\\\\|\");\n for(String t : list)\n {\n doneLoading =0;\n String[] tempList = t.split(\"\\\\ \");\n mealEntry tempMeal = new mealEntry(Integer.parseInt(tempList[0]),Integer.parseInt(tempList[1])\n ,Integer.parseInt(tempList[2]),Integer.parseInt(tempList[3]));\n updateMealView(tempMeal);\n updateTotals(tempMeal);\n mealsArray.add(tempMeal);\n }\n\n setFrag();\n }catch(Exception e){\n\n }\n doneLoading =1;\n\n\n }",
"private void loadFromFile() {\n try {\n /* Load in the data from the file */\n FileInputStream fIn = openFileInput(FILENAME);\n BufferedReader inRead = new BufferedReader(new InputStreamReader(fIn));\n\n /*\n * access from the GSON file\n * Taken from lonelyTwitter lab code\n */\n Gson gson = new Gson();\n Type listType = new TypeToken<ArrayList<Counter>>() {}.getType();\n counters = gson.fromJson(inRead, listType);\n\n } catch (FileNotFoundException e) {\n counters = new ArrayList<Counter>();\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }",
"private void readListFromFile() {\n // clear existing list\n if (listArr == null || listArr.size() > 0) {\n listArr = new ArrayList<>();\n }\n\n try {\n Scanner scan = new Scanner(openFileInput(LIST_FILENAME));\n\n while (scan.hasNextLine()) {\n String line = scan.nextLine();\n listArr.add(line);\n }\n\n if (listAdapter != null) {\n listAdapter.notifyDataSetChanged();\n }\n\n } catch (IOException ioe) {\n Log.e(\"ReadListFromFile\", ioe.toString());\n }\n\n }",
"private void loadList(int number)\n {\n ArrayList<Movie> sort = new ArrayList<>();\n title.setText(\"Page \"+(number+1)+\" of \"+pageCount);\n\n int start = number * NUM_ITEMS_PAGE;\n for(int i=start;i<(start)+NUM_ITEMS_PAGE;i++)\n {\n if(i < movieList.size())\n {\n sort.add(movieList.get(i));\n }\n else\n {\n break;\n }\n }\n\n adapter = new MovieListViewAdapter(sort, this);\n listView.setAdapter(adapter);\n\n listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {\n @Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n //Person person = people.get(position);\n //String message = String.format(\"Clicked on position: %d, name: %s, %d\", position, person.getName(), person.getBirthYear());\n //Toast.makeText(getApplicationContext(), message, Toast.LENGTH_SHORT).show();\n Movie single_movie = movieList.get(position);\n goToSingleMovie(single_movie);\n\n }\n });\n\n }",
"private void loadFromFile(){\n try {\n FileInputStream fis = openFileInput(FILENAME);\n BufferedReader in = new BufferedReader(new InputStreamReader(fis));\n Gson gson = new Gson();\n Type listType = new TypeToken<ArrayList<Countbook>>() {}.getType();\n countbookList = gson.fromJson(in, listType);\n } catch (FileNotFoundException e) {\n countbookList = new ArrayList<Countbook>();\n }\n }",
"public void actionPerformed(ActionEvent e){\n\t\t\tInputStream f = getClass().getResourceAsStream(\"/LoadTXT.txt\");\n\t\t\tboolean isFirst = true;\n\t\t\tBufferedReader reader = null;\n\t\t\ttry {\n\t\t\t\treader = new BufferedReader(new InputStreamReader(f));\n\t\t\t\tString Ins = null;\n\t\t\t\tint line = 1;\n\t\t\t\t//Read the file line by line and split the line into two parts by symbol \",\"\n\t\t\t\twhile ((Ins = reader.readLine()) != null) {\n\t\t\t\t\tString[] str = Ins.split(\",\");\n\t\t\t\t\tint index = Integer.parseInt(str[0]);\t\t\t\t\t\n\t\t\t\t\tShort con = Integer.valueOf(str[1],2).shortValue();\n\t\t\t\t\tif(isFirst){\n\t\t\t\t\t\tcpu.setPc((short) index);\n\t\t\t\t\t\tisFirst=false;\n\t\t\t\t\t}\n\t\t\t\t\tcpu.setMem(con, index);\t\t\t\t\t\n\t\t\t\t\tline++;\n\t\t\t\t}\n\t\t\t\treader.close();\n\t\t\t} catch (IOException ex) {\n\t\t\t\tex.printStackTrace();\n\t\t\t} finally {\n\t\t\t\tif (reader != null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\treader.close();\n\t\t\t\t\t} catch (IOException e1) {\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\tSystem.out.println(\"The PC value is: \");\n\t\t\tSystem.out.println(cpu.getPc());\n\t\t\t//Call the function to show the data on the screen\n\t\t\tShowData();\n\t\t}",
"public void loadShoppingList(){\n try{\n //load the shopping list from the external file\n List<Ingredient> returnedList = Data.<Ingredient>loadList(shoppingListFile);\n if (returnedList != null){\n //convert list to an observableList\n shoppingListIngredients = FXCollections.observableList(returnedList);\n //set to the shopping list\n shoppingList.setItems(shoppingListIngredients);\n } else {\n System.out.println(\"No Shopping List Loaded \");\n }\n } catch (Exception e){\n System.out.println(\"Unable to load shopping list from file \" + shoppingListFile +\n \", the file may not exist\");\n e.printStackTrace();\n }\n }",
"private void loadRec() {\n\t\tString test = \"ID, Name, Amount, Price\\n\";\n\t\t//formatting for string to load into the screen\n\t\tfor(int i=0 ; i< t.items.size() ; i++) {\n\t\t\ttest += (i+1) + \" \" + t.items.get(i).name +\", \" \n\t\t\t\t\t+ t.items.get(i).amount + \n\t\t\t\t\t\", $\"+ t.items.get(i).price +\"\\n\";\n\t\t}\n\t\tthis.reciet.setText(test);\n\t}",
"public void importFileClick() {\n\n //Lets the user choose a file location\n FileChooser fileChooser = new FileChooser();\n fileChooser.setTitle(\"Open Resource File\");\n fileChooser.setInitialDirectory(new File(System.getProperty(\"user.dir\")));\n fileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter(\"Run-length encoding\",\n \"*.rle\"));\n File file = fileChooser.showOpenDialog(new Stage());\n\n //If a file was chosen, will stop the game and set the generation to 0 and try to load the file.\n if (file != null) {\n timeline.stop();\n gOL.resetGenCounter();\n generationLabel.setText(Integer.toString(gOL.getGenCounter()));\n try {\n fileHandler.readGameBoardFromDisk(file);\n } catch (IOException ie) {\n //Produces a warning if unsuccessful\n PopUpAlerts.ioAlertFromDisk();\n }\n }\n\n aliveLabel.setText(Integer.toString(board.getCellsAlive()));\n ruleLabel.setText(gOL.getRuleString().toUpperCase());\n isMovable = true;\n canvasArea.requestFocus();\n setFocusTraversable(false);\n\n //Resets offset to accommodate for the new pattern and calls draw().\n canvasDrawer.resetOffset(board, canvasArea);\n draw();\n }",
"public void loadInfo(){\n list=control.getPrgList();\n refreshpsTextField(list.size());\n populatepsListView();\n }",
"public void readFile(){\n try {\n highscores = new ArrayList<>();\n BufferedReader br = new BufferedReader(new FileReader(\"Highscores.txt\"));\n String line = br.readLine();\n while (line != null){\n try{\n highscores.add(Integer.parseInt(line));\n } catch (NumberFormatException e){}\n line = br.readLine();\n }\n br.close();\n } catch (FileNotFoundException e) {\n System.out.println(\"No file found\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"@Override\n protected void onStart(){\n super.onStart();\n loadFromFile();\n adapter= new CustomAdapter(countbookList,getApplicationContext());\n listView.setAdapter(adapter);\n }",
"private void loadButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_loadButtonMouseClicked\n // open file dialog\n FileDialog dialog = new FileDialog(this, \"Choisir le fichier dictionnaire\", FileDialog.LOAD);\n dialog.setFile(\"*.txt\");\n dialog.setVisible(true);\n \n String filename = dialog.getFile();\n if(filename != null) // if user selected a file\n {\n filename = dialog.getDirectory() + filename;\n lexiNodeTrees = DictioFileOperations.loadListFromFile(filename);\n \n if(lexiNodeTrees != null) // if list was successfully retrieved\n {\n loadedDictionaryFilename = filename;\n refreshAllWordsList();\n \n // clear text area and search suggestion\n searchSuggestionList.setModel(new DefaultListModel());\n definitionTextArea.setText(\"\");\n searchField.setText(\"\");\n }\n \n else // if file could not be loaded, show error dialog\n JOptionPane.showMessageDialog(this, \"ERREUR: Le fichier n'a \"\n + \"pas pu être chargé!\\n\\nVérifiez que le fichier est \"\n + \"valid est contient <<mot & définition>> sur toutes \"\n + \"les lignes\\n\\n\", \"ERREUR\", JOptionPane.ERROR_MESSAGE);\n }\n }",
"private Runnable loadItems() {\n File file = new File(getFilesDir(), \"data.txt\");\n\n try {\n // Clears and adds appropriate items\n this._items.clear();\n this._items.addAll(FileUtils.readLines(file, Charset.defaultCharset()));\n } catch (IOException e) {\n Log.e(\"MainActivity\", \"Error reading items\", e);\n }\n\n // Return a callback function for saving items\n return () -> {\n try {\n FileUtils.writeLines(file, this._items);\n } catch (IOException e) {\n Log.e(\"MainActivity\", \"Error writing items\", e);\n }\n };\n }",
"public void load(View v) {\n if (itemList.size() > 0 && currentMode.equals(Mode.GAME)) {\n Toast.makeText(this, \"Spielstand bereits geladen!\", Toast.LENGTH_LONG).show();\n return;\n }\n\n // Datei einlesen\n String[] rows = readFromSaveFile().split(\"\\n\");\n\n // Kein Spielstand vorhanden ueberpruefen\n if (!(rows.length > 1)) {\n Toast.makeText(this, \"Kein Spielstand vorhanden!\", Toast.LENGTH_LONG).show();\n return;\n }\n\n clearList();\n currentMode = Mode.GAME;\n\n // TODO Spielfeld laden\n randomCode = rows[1].replaceAll(\"<code>\", \"\").replaceAll(\"</code>\", \"\");\n\n // guesses einslesen\n for (int i = 2; i < rows.length - 1; i++) {\n // Für jeden guess\n String userInput = \"\";\n String result = \"\";\n\n if (rows[i].contains(\"<userInput>\")) {\n userInput = rows[i].replaceAll(\"<userInput>\", \"\").replaceAll(\"</userInput>\", \"\");\n result = rows[i + 1].replaceAll(\"<result>\", \"\").replaceAll(\"</result>\", \"\");\n addItemToList(userInput + \" | \" + result);\n }\n }\n }",
"private void fromFileJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fromFileJButtonActionPerformed\n //load new database\n JFileChooser chooser = new JFileChooser(\"src/Cities\");\n FileNameExtensionFilter filter = new FileNameExtensionFilter(\n \"text Files\", \"txt\");\n chooser.setFileFilter(filter);\n int choice = chooser.showOpenDialog(null);\n if(choice == JFileChooser.APPROVE_OPTION)\n {\n namesArray = new ArrayList<>();\n tempArray = new ArrayList<>();\n File chosenFile = chooser.getSelectedFile();\n fileName = \"src/Cities/\" + chosenFile.getName();\n //read file into array list\n myReader.readFromFile(fileName);\n namesArray = myReader.getStringArr();\n tempArray = myReader.getNumberArr();\n \n \n if(namesArray == null || tempArray == null) //if try to open an empty file\n {\n JOptionPane.showMessageDialog(null, \"File you are trying to \"\n + \"open is empty\", \" File Error\", \n JOptionPane.INFORMATION_MESSAGE);\n }\n else\n {\n //make list of edges\n makeEdgeList(namesArray, tempArray);\n //make weighted graph object\n graph = new WeightedGraph(namesArray, edgeArray);\n loadJList();\n checkEnabled();\n clearStats();\n calculateJButton.doClick();\n //check what should be selected\n }\n }\n else\n {\n JOptionPane.showMessageDialog(null, \"Unable to open file\", \" File \"\n + \"Input Error\", JOptionPane.INFORMATION_MESSAGE);\n }\n }",
"public void load_from_file() {\r\n // prompting file name from user\r\n System.out.print(\"Enter in FileName:\\n>\");\r\n\r\n // taking user input of file name\r\n String filename = Menu.sc.next();\r\n Scanner input;\r\n\r\n // try to open file, if fails throws exception and returns to main menu\r\n try {\r\n input = new Scanner(new FileReader(filename));\r\n } catch (FileNotFoundException e) {\r\n System.out.println(\"Unable to open file!!\");\r\n System.out.println();\r\n return;\r\n }\r\n\r\n int count = 0; // variable to count number of address entry read\r\n\r\n /* reading data until end of file */\r\n while (input.hasNextLine()) {\r\n String firstName = \"\", lastName = \"\", street = \"\", city = \"\", state = \"\", email = \"\", phone = \"\";\r\n int zip = 0;\r\n if (input.hasNextLine())\r\n firstName = input.nextLine();\r\n if (input.hasNextLine())\r\n lastName = input.nextLine();\r\n if (input.hasNextLine())\r\n street = input.nextLine();\r\n if (input.hasNextLine())\r\n city = input.nextLine();\r\n if (input.hasNextLine())\r\n state = input.nextLine();\r\n if (input.hasNextLine())\r\n zip = Integer.parseInt(input.nextLine());\r\n if (input.hasNextLine())\r\n phone = input.nextLine();\r\n if (input.hasNext())\r\n email = input.nextLine();\r\n if (input.hasNext())\r\n input.nextLine();\r\n addressEntryList.add(new AdressEntry(firstName, lastName, street, city, state, zip, phone, email));\r\n count++;\r\n }\r\n\r\n /*\r\n printing number of address entry variables\r\n and printing total number of AddressEntry in the list\r\n */\r\n System.out.println(\"Read in \" + count + \" new Addresses, successfully loaded, currently \"\r\n + addressEntryList.size() + \" Addresses\");\r\n input.close();\r\n System.out.println();\r\n }",
"private void loadAPlayListPressed() {\n\n\t\t// go to the selected folder and look for a file called list.txt and then load all the names of the files onto the jlist\n\n\t\tJFileChooser outputChooser = new JFileChooser();\n\t\toutputChooser.setCurrentDirectory(new java.io.File(\".\"));\n\t\toutputChooser.setDialogTitle(\"Choose a directory to output to\");\n\n\t\toutputChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\n\n\t\tint returnValue = outputChooser.showOpenDialog(Library.this);\n\n\t\tif (returnValue == JFileChooser.APPROVE_OPTION) {\n\t\t\tplaylistDirectory = outputChooser.getSelectedFile().getAbsoluteFile();\n\n\t\t}\n\n\t\t// now look in the playlist directory for the list.txt file. If there is one then go to all the paths and then load the file \n\t\t// names onto the jlist\n\t\tFile[] files;\n\t\tif(playlistDirectory !=null){\n\t\t\tfiles = playlistDirectory.listFiles();\n\n\t\t\tboolean textFileExists = false;\n\t\t\tFile a = null;\n\t\t\tfor(File f : files ){\n\t\t\t\tif((f.getName().toLowerCase().endsWith(\".txt\"))){\n\t\t\t\t\ttextFileExists = true;\n\t\t\t\t\ta = f;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// checks if the file exists\n\t\t\tif(textFileExists){\n\n\t\t\t\ttry {\n\t\t\t\t\tl.clear();\n\t\t\t\t\tBufferedReader br = new BufferedReader(new FileReader(a));\n\t\t\t\t\tString line = br.readLine();\n\t\t\t\t\twhile (line != null) {\n\t\t\t\t\t\tString[] split = line.split(File.separator);\n\t\t\t\t\t\tint last = split.length;\n\t\t\t\t\t\tString lastString = split[last-1];\n\t\t\t\t\t\tpaths.put(lastString, line);\n\t\t\t\t\t\tFile mock = new File(line);\n\t\t\t\t\t\tsizes.put(lastString,mock.length());\n\t\t\t\t\t\tl.addElement(lastString);\n\t\t\t\t\t\tline = br.readLine();\n\t\t\t\t\t}\n\t\t\t\t\tbr.close();\n\t\t\t\t} catch (IOException e3) {\n\t\t\t\t\t// Could not read log file, display error message\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Could not open file\", \"ERROR\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t}\n\n\t\t\t}else{\n\t\t\t\tJOptionPane.showMessageDialog(Library.this, \"Sorry, no plyalist exists in this folder!\");\n\t\t\t}\n\t\t}\n\t}",
"public static void Load() {\n System.out.println(\"LOADED DATA:\");\n try {\n File object = new File(\"Output.txt\");\n Scanner reader = new Scanner(object);\n while (reader.hasNextLine()) {\n String info = reader.nextLine();\n System.out.println(info);\n }\n reader.close();\n } catch (FileNotFoundException e) {\n System.out.println(\"An error occurred\");\n e.printStackTrace();\n }\n System.out.println(\"|--------------------------------------------------------------| \");\n\n }",
"protected void ACTION_B_LOAD(ActionEvent arg0) {\n\t\tString capturedata=\"\";\r\n\t\ttry {\r\n\t\t\tFile DATA = new File(\"capturedata.txt\");\r\n\t\t\t\r\n\t\t\tFileInputStream datastream = new FileInputStream(DATA);\r\n\t\t\tInputStreamReader input = new InputStreamReader(datastream);\r\n\t\t\tBufferedReader reader = new BufferedReader(input);\r\n\t\t\t\r\n\t\t\twhile(reader.read() != -1)\r\n\t\t\t{\r\n\t\t\t\tcapturedata=capturedata+reader.readLine();\r\n\t\t\t\tcapturedata=capturedata + \"\\n\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treader.close();\r\n\t\t\tinput.close();\r\n\t\t\tdatastream.close();\r\n\t\t\t\r\n\t\t\ttextArea_1.setText(capturedata);\r\n\t\t\t\r\n\t\t\tJOptionPane.showMessageDialog(null, \"Data Loaded Successfully\");\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\tJOptionPane.showMessageDialog(null, \"File Access Error !! Unable to Load data\");\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t}",
"void load_from_file(){\n\t\tthis.setAlwaysOnTop(false);\n\t\t\n\t\t/**\n\t\t * chose file with file selector \n\t\t */\n\t\t\n\t\tFileDialog fd = new FileDialog(this, \"Choose a file\", FileDialog.LOAD);\n\t\t\n\t\t//default path is current directory\n\t\tfd.setDirectory(System.getProperty(\"user.dir\"));\n\t\tfd.setFile(\"*.cmakro\");\n\t\tfd.setVisible(true);\n\t\t\n\t\t\n\t\t\n\t\tString filename = fd.getFile();\n\t\tString path = fd.getDirectory();\n\t\tString file_withpath = path + filename;\n\t\t\n\t\t\n\t\tif (filename != null) {\n\t\t\t System.out.println(\"load path: \" + file_withpath);\t\n\t\t\n\t\t\t \n\t\t\t /**\n\t\t\t * read object from file \n\t\t\t */\n\t\t\t\ttry {\n\t\t\t\t\tObjectInputStream in = new ObjectInputStream(new FileInputStream(file_withpath));\n\n\t\t\t\t\tKey_Lists = Key_Lists.copy((key_lists) in.readObject());\n\n\t\t\t\t\tkeys_area.setText(Key_Lists.arraylist_tostring());\t\t\n\t\t\t\t\t\n\t\t\t\t\tin.close();\n\t\t\t\t\t\n\t\t\t\t\tinfo_label.setForeground(green);\n\t\t\t\t\tinfo_label.setText(\"file loaded :D\");\n\t\t\t\t\t\n\t\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tinfo_label.setForeground(white);\n\t\t\t\t\tinfo_label.setText(\"wrong file format\");\n\t\t\t\t\tSystem.out.println(\"io exception\");\n\t\t\t\t\t//e.printStackTrace();\n\t\t\t\t} catch (ClassNotFoundException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\tthis.setAlwaysOnTop(true);\n\t\n\t}",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n Button detailButton = (Button) findViewById(R.id.detail);\n Button addButton = (Button) findViewById(R.id.add);\n Button deleteButton = (Button) findViewById(R.id.delete);\n Button editButton = (Button) findViewById(R.id.edit);\n Button increaseButton = (Button) findViewById(R.id.increase);\n Button decreaseButton = (Button) findViewById(R.id.decrease);\n Button resetButton = (Button) findViewById(R.id.reset);\n\n listView = (ListView) findViewById(R.id.list);\n countbookList = new ArrayList<Countbook>();\n\n //Taken from https://developer.android.com/guide/topics/ui/binding.html\n //2017/10/1\n AdapterView.OnItemClickListener mMessageClickedHandler = new AdapterView.OnItemClickListener() {\n public void onItemClick(AdapterView parent, View v, int position, long id) {\n countbook = countbookList.get(position);\n currentLocation = position;\n }\n };\n listView.setOnItemClickListener(mMessageClickedHandler);\n\n /**\n * Show a detail snackbar which shows initial counter and comment.\n */\n detailButton.setOnClickListener(new View.OnClickListener() {\n public void onClick(View v) {\n if (currentLocation != -1) {\n setResult(RESULT_OK);\n detail_intent(v);\n loadFromFile();\n adapter.notifyDataSetChanged();\n// Snackbar.make(v, \"initial counter: \" + countbook.getInitialCounter()\n// + \"| comment: \" + countbook.getComment(), Snackbar.LENGTH_LONG)\n// .setAction(\"No action\", null).show();\n }\n }\n });\n\n /**\n * The button \"Add\" which calls add_intent function and uses for creating new countbook.\n */\n addButton.setOnClickListener(new View.OnClickListener() {\n public void onClick(View v) {\n setResult(RESULT_OK);\n add_intent(v);\n loadFromFile();\n adapter.notifyDataSetChanged();\n }\n });\n\n /**\n * The button \"Delete\" which deletes the current selected countbook.\n */\n deleteButton.setOnClickListener(new View.OnClickListener() {\n public void onClick(View v) {\n if (currentLocation != -1) {\n setResult(RESULT_OK);\n countbookList.remove(currentLocation);\n adapter.notifyDataSetChanged();\n saveInFile();\n }\n }\n });\n\n /**\n * The button \"Edit\" which calls edit_intent and edit the current seleced countbook.\n */\n editButton.setOnClickListener(new View.OnClickListener() {\n public void onClick(View v) {\n if (currentLocation != -1) {\n setResult(RESULT_OK);\n edit_intent(v);\n loadFromFile();\n adapter.notifyDataSetChanged();\n }\n }\n });\n\n /**\n * The button \"Increase\" which increases the current counter.\n */\n increaseButton.setOnClickListener(new View.OnClickListener() {\n public void onClick(View v) {\n if (currentLocation != -1) {\n setResult(RESULT_OK);\n countbook.increCounter();\n saveInFile();\n adapter.notifyDataSetChanged();\n }\n }\n });\n\n /**\n * The button \"decrease\" which decreases the current counter.\n */\n decreaseButton.setOnClickListener(new View.OnClickListener() {\n public void onClick(View v) {\n if (currentLocation != -1) {\n setResult(RESULT_OK);\n countbook.decreCounter();\n saveInFile();\n adapter.notifyDataSetChanged();\n }\n }\n });\n\n /**\n * The button \"reset\" which resets the current counter to initial value.\n */\n resetButton.setOnClickListener(new View.OnClickListener() {\n public void onClick(View v) {\n if (currentLocation != -1){\n setResult(RESULT_OK);\n int initialCounter=countbook.getInitialCounter();\n countbook.setCounter(initialCounter);\n saveInFile();\n adapter.notifyDataSetChanged();\n }\n }\n });\n\n }",
"@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.lottozahlen);\n\n\t\tInit();\n\n\t\tfinal ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,\n\t\t\t\tandroid.R.layout.simple_list_item_1, numbers);\n\t\tgridView.setAdapter(adapter);\n\n\t\tfinal String testString;\n\n\t\tgo.setOnClickListener(new View.OnClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tnumbers[5] = \" x\";\n\t\t \t\tfor (int i = 0; i < 49; i++) {\n\t\t\t\t\tnumbers[i] = \" \"+Integer.toString(i + 1);\n\t\t\t\t}\n\t\t\t\tRandom random = new Random();\n\t\t\t\tfor (int p = 0; p < 6; p++) {\n\t\t\t\t\tint thenum = random.nextInt(49);\n\t\t\t\t\tif (numbers[thenum].equals(\"X\"))\n\t\t\t\t\t\tp--;\n\t\t\t\t\telse {\n\t\t\t\t\t\tnumbers[thenum] = \"X\";\n\t\t\t\t\t\tfinNums[p] = thenum;\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tArrays.sort(finNums);\n\n\t\t\t\tgridView.setAdapter(adapter);\n\t\t\t\tString testOutput = null;\n\t\t\t\tint found = 0;\n\t\t\t\tfor (int o = 0; o < 6; o++) {\n\t\t\t\t\ttestOutput += Integer.toString(finNums[o]) + \", \";\n\t\t\t\t\tInteger nD = finNums[o] + 1;\n\n\t\t\t\t\tfound++;\n\t\t\t\t\tif (found == 1) {\n\t\t\t\t\t\tnumPick1.setMaxValue(nD);\n\t\t\t\t\t\tnumPick1.setMinValue(nD);\n\t\t\t\t\t} else if (found == 2) {\n\t\t\t\t\t\tnumPick2.setMaxValue(nD);\n\t\t\t\t\t\tnumPick2.setMinValue(nD);\n\t\t\t\t\t} else if (found == 3) {\n\t\t\t\t\t\tnumPick3.setMaxValue(nD);\n\t\t\t\t\t\tnumPick3.setMinValue(nD);\n\t\t\t\t\t} else if (found == 4) {\n\t\t\t\t\t\tnumPick4.setMaxValue(nD);\n\t\t\t\t\t\tnumPick4.setMinValue(nD);\n\t\t\t\t\t} else if (found == 5) {\n\t\t\t\t\t\tnumPick5.setMaxValue(nD);\n\t\t\t\t\t\tnumPick5.setMinValue(nD);\n\t\t\t\t\t} else if (found == 6) {\n\t\t\t\t\t\tnumPick6.setMaxValue(nD);\n\t\t\t\t\t\tnumPick6.setMinValue(nD);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttvFix.setText(\".\");\n\t\t\t}\n\t\t});\n\n\t}",
"public void onLoadButtonCLick(ActionEvent e){\n\t\tloadFile();\n\t}",
"void loadSet() {\n int returnVal = fc.showOpenDialog(this);\n if (returnVal != JFileChooser.APPROVE_OPTION) {\n System.out.println(\"Open command cancelled by user.\");\n return;\n }\n file = fc.getSelectedFile();\n System.out.println(\"Opening: \" + file.getName());\n closeAllTabs();\n try {\n FileInputStream fis = new FileInputStream(file);\n ObjectInputStream ois = new ObjectInputStream(fis);\n //loopButton.setSelected( ois.readObject() ); \n ArrayList l = (ArrayList) ois.readObject();\n System.out.println(\"read \"+l.size()+\" thingies\");\n ois.close();\n for(int i=0; i<l.size(); i++) {\n HashMap m = (HashMap) l.get(i);\n openNewTab();\n getCurrentTab().paste(m);\n }\n } catch(Exception e) {\n System.out.println(\"Open error \"+e);\n }\n }",
"private void loadEntryList() {\n EntryAdapter adapter = new EntryAdapter(MainActivity.this, db.selectAll());\n listView.setAdapter(adapter);\n }",
"void loadArticleMenuItem_actionPerformed(ActionEvent e) {\n\n // Action from Open... Show the OpenFileDialog\n openFileDialog.show();\n String fileName = openFileDialog.getFile();\n\n if (fileName != null) {\n NewsArticle art = new NewsArticle(fileName);\n\n art.readArticle(fileName);\n articles.addElement(art);\n filterAgent.score(art, filterType); // score the article\n refreshTable();\n articleTextArea.setText(art.getBody());\n articleTextArea.setCaretPosition(0); // move cursor to start of article\n }\n }",
"private void sortFileToScreen() throws FileNotFoundException {\n Scanner file = new Scanner(new File(FILE_NAME));\n while (file.hasNext()) {\n addToOrderedList(file.nextInt());\n }\n file.close();\n printList();\n }",
"void loadAll(int pageNum, LoadView mLoadView);",
"void handleLoadClicked(ActionEvent event);",
"public ArrayList<Integer> readNumbersFromFile() throws FileNotFoundException {\r\n ArrayList<Integer> arrayList = new ArrayList<>();\r\n File file = new File(readFilename);\r\n Scanner scanner = new Scanner(file);\r\n while(scanner.hasNextInt())\r\n {\r\n arrayList.add(scanner.nextInt());\r\n }\r\n return arrayList;\r\n }",
"private void LoadTempId() {\n SQLiteDatabase db = BaseConfig.GetDb();\n Cursor c = db.rawQuery(\n \"select tnum from TemplateMax;\",\n null);\n\n List<String> list = new ArrayList<String>();\n\n if (c != null) {\n if (c.moveToFirst()) {\n do {\n\n template_no.setText(c.getString(c.getColumnIndex(\"tnum\")));\n\n\n } while (c.moveToNext());\n }\n }\n\n ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this,\n android.R.layout.simple_list_item_1, list);\n\n\n db.close();\n c.close();\n }",
"private void initiateUI()\n\t{\n\t\t//Set List\n\t\tListView list = (ListView) findViewById(R.id.rewards_list);\n\t\trAdapter = new RowAdapter();\n\t\tlist.setAdapter(rAdapter);\n\t\t//Set Score\n\t\trewardPointsTV.setText(Integer.toString(fileIO.rewardPoints));\n\n\t}",
"@Override\n\tpublic void LoadView(Bundle loadData) {\n\t\thelpExpLstV.setAdapter(helpExpAdapter);\n\t}",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\treadFromFile(excelname);\n\t\t\t}",
"public void load(String filename){\n //Create a file if its not already on disk\n File extDir = new File(this.getFilesDir(), filename);\n\n //Read text from file\n StringBuilder text = new StringBuilder();\n\n\n //Needs lots of try and catch blocks because so much can go wrong\n try{\n\n BufferedReader br = new BufferedReader(new FileReader(extDir));\n String line;\n\n while ((line = br.readLine()) != null) {\n text.append(line);\n text.append('\\n');\n }//end while\n\n br.close();//Close the buffer\n }//end try\n catch (FileNotFoundException e){//If file not found on disk here.\n Toast.makeText(this, \"There was no data to load\", Toast.LENGTH_LONG).show();\n e.printStackTrace();\n }\n\n catch (IOException e)//If io Exception here\n {\n Toast.makeText(this, \"Error loading file\", Toast.LENGTH_LONG).show();\n e.printStackTrace();\n }//end catch\n\n\n //Set the data from the file content and conver it to a String\n String data = new String(text);\n\n //Safety first Parse data if available.\n if (data.length() > 0) {\n parseXML(data);\n }\n else\n Toast.makeText(this, \"There is no data to display\", Toast.LENGTH_LONG).show();\n }",
"private ArrayList<Integer> fileReader() {\n ArrayList<Integer> data = new ArrayList<>();\n try {\n Scanner scanner = new Scanner(new File(\"andmed.txt\"));\n while (scanner.hasNextLine()) {\n data.add(Integer.valueOf(scanner.nextLine()));\n }\n scanner.close();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n return data;\n }",
"private void loadFile(){\n\tint returnVal = fileChooser.showOpenDialog(this);\n\n\tif (returnVal == JFileChooser.APPROVE_OPTION) {\n\t File file = fileChooser.getSelectedFile();\n\t SAXParserFactory spf = SAXParserFactory.newInstance();\n\t try {\n\t\tInputStream xmlInput = new FileInputStream(file);\n\t\tSAXParser saxParser = spf.newSAXParser();\n\t\tRoomXMLParser rxp = new RoomXMLParser();\n\t\tsaxParser.parse(xmlInput, rxp);\n\n\t\trooms = rxp.getRooms();\n\t\tnumPlayers = rxp.getPlayers();\n\t\tnumNPCs = rxp.getNPCs();\n\t\trevalidate();\n\t }\n\t catch(SAXException|ParserConfigurationException|IOException e){\n\t\te.printStackTrace();\n\t }\n\t}\n }",
"public void loadingSequence(String filepath) {\n\t\tif(checkInputOk()) {\n\t\t\tload(songFromInput(), filepath);\n\t\t\tnew HomogeneousFileHandler().saveAs(\"songlist.list\", songList);\n\t\t} else {\n\t\t\tuploadPanel.setResponse(\"Fields cannot be empty\", false);\t \n\t\t}\n\t}",
"public void loadItems() {\n\t\tArrayList<String> lines = readData();\n\t\tfor (int i = 1; i < lines.size(); i++) {\n\t\t\tString line = lines.get(i);\n\t\t\t\n\t\t\tString[] parts = line.split(\",\");\n\t\t\t\n//\t\t\tSystem.out.println(\"Name: \" + parts[0]);\n//\t\t\tSystem.out.println(\"Amount: \" + parts[1]);\n//\t\t\tSystem.out.println(\"Price: \" + parts[2]);\n//\t\t\tSystem.out.println(\"-------\");\n\t\t\t\n\t\t\tString name = parts[0].trim();\n\t\t\tint amount = Integer.parseInt(parts[1].trim());\n\t\t\tdouble price = Double.parseDouble(parts[2].trim());\n\t\t\t\n\t\t\tItem item = new Item(name, amount, price);\n\t\t\titemsInStock.add(item);\n\t\t}\n\t}",
"private void readItems() {\n // open file\n File file = getFilesDir();\n File todoFile = new File(file, \"scores.txt\");\n // try to find items to add\n try {\n items = new ArrayList<>(FileUtils.readLines(todoFile));\n } catch (IOException e) {\n items = new ArrayList<>();\n }\n }",
"public static void readNumbers(String filePath, int[] nums) {\n JSONParser parser = new JSONParser();\n try {\n JSONObject jsonObject = (JSONObject) parser.parse(new FileReader(filePath));\n nums[0] = Integer.parseInt((String) jsonObject.get(\"number of primary\"));\n nums[1] = Integer.parseInt((String) jsonObject.get(\"number of backup\"));\n } catch (IOException | ParseException e) {\n e.printStackTrace();\n }\n\n }",
"public void clearFile(View view) {\n // clear the displayed list of numbers\n ListView lvNumbers = (ListView) findViewById(R.id.lvNumbers);\n ArrayAdapter aaNumbers = (ArrayAdapter) lvNumbers.getAdapter();\n if (aaNumbers != null) {\n aaNumbers.clear();\n aaNumbers.notifyDataSetChanged();\n }\n\n // clear progress bar\n ProgressBar pbFileIO = (ProgressBar) findViewById(R.id.pbFileIO);\n pbFileIO.setProgress(0);\n }",
"private void showLoadDialog() {\n\t\tSet<String> entries = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getStringSet(RECORDED_ENTRIES, null);\n\t\tfinal String[] entriesArray = Arrays.copyOf(entries.toArray(), entries.toArray().length, String[].class);\n\t\tAlertDialog.Builder builder = new AlertDialog.Builder(this);\n\t\tbuilder.setTitle(R.string.pick_a_recording);\n\t\tbuilder.setItems(entriesArray, new DialogInterface.OnClickListener() {\n\t\t public void onClick(DialogInterface dialog, int item) {\n\t\t \t// Load the JSON\n\t\t \tnew LoadRecordingAsyncTask(entriesArray[item]).execute();\n\t\t }\n\t\t});\n\t\tAlertDialog alert = builder.create();\n\t\talert.show();\n\t}",
"public void addTestLoads(){\r\n testLoad.getItems().clear();\r\n testLoad.setPromptText(\"Test Load\");\r\n testLoad.setButtonCell(new ListCell<String>() {\r\n @Override\r\n protected void updateItem(String item, boolean empty) {\r\n super.updateItem(item, empty);\r\n if (empty || item == null)\r\n setText(\"Test Load\");\r\n else\r\n setText(item);\r\n }\r\n });\r\n testLoad.setValue(null);\r\n\r\n if (tx_cb.getValue() != null) {\r\n DocumentBuilderFactory loadsFactory = DocumentBuilderFactory.newInstance();\r\n DocumentBuilder loadsBuilder = null;\r\n\r\n try {\r\n loadsBuilder = loadsFactory.newDocumentBuilder();\r\n } catch (ParserConfigurationException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n Document loadsDocument = null;\r\n\r\n try {\r\n loadsDocument = loadsBuilder.parse(new File(\"loads.xml\"));\r\n } catch (SAXException e) {\r\n e.printStackTrace();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n List<sample.Loads> theLoads = new ArrayList<sample.Loads>();\r\n NodeList loadsNodeList = loadsDocument.getDocumentElement().getChildNodes();\r\n for (int i = 0; i < loadsNodeList.getLength(); i++) { //loop through to get every item and its attributes from the test.xml\r\n Node loadsNode = loadsNodeList.item(i);\r\n if (loadsNode.getNodeType() == Node.ELEMENT_NODE) {\r\n Element loadsElement = (Element) loadsNode;\r\n\r\n ID = loadsNode.getAttributes().getNamedItem(\"ID\").getNodeValue();\r\n TestPower = Double.parseDouble(loadsElement.getElementsByTagName(\"Power\").item(0).getChildNodes().item(0).getNodeValue());\r\n\r\n if (TestPower > powerRating) {\r\n theLoads.add(new sample.Loads(ID, TestPower));\r\n testLoad.getItems().add(ID);\r\n }\r\n }\r\n }\r\n }\r\n }",
"public void loadFile()\n {\n\n FileDialog fd = null; //no value\n fd = new FileDialog(fd , \"Pick up a bubble file: \" , FileDialog.LOAD); //create popup menu \n fd.setVisible(true); // make visible manu\n String directory = fd.getDirectory(); // give the location of file\n String name = fd.getFile(); // give us what file is it\n String fullName = directory + name; //put together in one sting \n \n File rideNameFile = new File(fullName); //open new file with above directory and name\n \n Scanner nameReader = null;\n //when I try to pick up it read as scanner what I choose\n try\n {\n nameReader = new Scanner(rideNameFile);\n }\n catch (FileNotFoundException fnfe)//if dont find return this message below\n {\n return; // immedaitely exit from here\n }\n \n //if load button pressed, it remove all ride lines in the world\n if(load.getFound()){\n removeAllLines();\n } \n \n //read until is no more stings inside of file and until fullfill max rides\n while(nameReader.hasNextLine()&¤tRide<MAX_RIDES)\n {\n \n String rd= nameReader.nextLine();//hold and read string with name of ride\n RideLines nova =new RideLines(rd);\n rides[currentRide]=nova;\n \n //Create a RideLine with string given from file\n addObject(rides[currentRide++], 650, 20 + 40*currentRide);\n }\n \n //when is no more strings inside it close reader\n nameReader.close();\n }",
"public void readFile(View view) {\n ReadFileTask task = new ReadFileTask();\n task.execute();\n\n Toast toast = Toast.makeText(getApplicationContext(), \"Begin reading file...\", Toast.LENGTH_SHORT);\n toast.show();\n }",
"private void loadFromFile() {\n try {\n FileInputStream fis = openFileInput(FILENAME);\n BufferedReader in = new BufferedReader(new InputStreamReader(fis));\n\n Gson gson = new Gson();\n Type listType = new TypeToken<ArrayList<Sub>>(){}.getType();\n subList = gson.fromJson(in, listType);\n\n } catch (FileNotFoundException e) {\n subList = new ArrayList<Sub>();\n }\n }",
"private void loadData(){\n\n fileName = EditedFiles.getActiveFacilityFile();\n getFacilities().clear();\n\n try {\n getFacilities().addAll(ReaderThreadRunner.startReader(fileName));\n } catch (ExecutionException | InterruptedException e) {\n e.printStackTrace();\n }\n\n\n observableList = FXCollections.observableList(getFacilities());\n facilitiesView.setItems(observableList);\n }",
"public ifrm_historial() {\n initComponents();\n this.setTitle(\"Historial bitacoraCalculadora.txt\");\n File archivo;\n try{\n final BufferedReader lector = new BufferedReader(new FileReader(\"bitacoraCalculadora.txt\"));\n String line = \"\";\n while ((line = lector.readLine()) != null){\n //txt_mostrar.setText(line);\n txt_mostrar.append(line +\"\\n\");\n }lector.close();\n }catch(FileNotFoundException e){\n e.printStackTrace();\n } catch(IOException e){\n e.printStackTrace();\n }\n }",
"private void loadInv() {\n\t\titem = Main.inventory.business.getAllBaked();\n\t\tString test = \"ID, Name, Amount, Price\\n\";\n\t\t//formatting for string to load into the screen\n\t\tfor(int i=0 ; i< item.size() ; i++) {\n\t\t\ttest += (i+1) + \" \" + item.get(i).getName() +\", \" \n\t\t\t\t\t+ item.get(i).getQuantity() + \n\t\t\t\t\t\", $\"+ Main.inventory.business.getItemCost(item.get(i).getName()) +\"\\n\";\n\t\t}\n\t\tthis.inv.setText(test);\n\t}",
"@Override\n public void onClick(View view) {\n // Create a new intent to open the {@link NumbersActivity}\n Intent SongsIntent = new Intent(MainActivity.this, LoadMusicActivity.class);\n\n // Start the new activity\n startActivity(SongsIntent);\n }",
"public void populateList(){\n\t\tfor (int i = 0; i < 10; i++){\n\t\t\tscoreList.add(-1);\t\t\t\n\t\t\tnameList.add(\"\");\n\t\t}\n\t\tint i=0; \n\t\ttry {\n\t\t\tScanner results = new Scanner(new File(\"results.txt\"));\n\t\t\twhile (results.hasNext()){\n\t\t\t\tnameList.set(i, results.next());\n\t\t\t\tscoreList.set(i, results.nextInt());\n\t\t\t\ti++;\n\t\t\t}\n\t\t} catch (FileNotFoundException e1){\n\t\t\te1.printStackTrace();\n\t\t}\n\t}",
"@Override\n protected List<String> doInBackground(Void... params) {\n File file = new File(getApplicationContext().getFilesDir(), FILENAME);\n BufferedReader reader = null;\n List<String> list = new ArrayList<>();\n try {\n reader = new BufferedReader(new FileReader(file));\n String s;\n int progress = 0;\n while ((s = reader.readLine()) != null) {\n list.add(s);\n Thread.sleep(250);\n progress += 10;\n publishProgress(progress);\n }\n }\n catch (IOException | InterruptedException ex) {\n Log.e(LOG_TAG, \"loadFile:\" + ex.toString());\n }\n finally {\n if (reader != null) {\n try {\n reader.close();\n }\n catch(IOException ex) {\n // do nothing\n }\n }\n }\n return list;\n }",
"public ArrayList<Item> loadItems(String filename) {\n ArrayList<Item> itemsList = new ArrayList<>();\n try {\n File file = new File(filename);\n BufferedReader reader= new BufferedReader(new InputStreamReader(new FileInputStream(file), \"UTF-8\"));\n String line= reader.readLine();\n while (line != null){\n String[] splitedLine = line.split(\"=\");\n String name = splitedLine[0];\n int weight = Integer.parseInt(splitedLine[1]) / 1000; // on convertit en tonnes\n itemsList.add(new Item(name,weight));\n line = reader.readLine();\n }\n reader.close(); //pour arreter la memoire tampon\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n\n return itemsList;\n }",
"private static ArrayList<ArrayList<Integer>> populateListOfInputs() {\n\t\t\n\t\tArrayList<ArrayList<Integer>> listOflist = new ArrayList<ArrayList<Integer>>();\n\t\ttry {\n\t\t\tFileReader fr = new FileReader(filePath);\n\t\t\tBufferedReader br = new BufferedReader(fr);\t\t\n\t\t\t\n\t\t\tString line;\n\t\t\twhile ((line = br.readLine()) != null) {\n\t\t\t\t// Remove all spaces, '[' and ']'\n\t\t\t\tString numbers = line.replace(\" \", \"\");\n\t\t\t\tnumbers = numbers.replace(\"[\", \"\");\n\t\t\t\tnumbers = numbers.replace(\"]\", \"\");\n\t\t\t\t\n\t\t\t\tif(line.equals(\"\")) {\n\t\t\t\t\t//if empty line leave it and continue the loop\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tArrayList<Integer> list = new ArrayList<Integer>();\n\t\t\t\t\n\t\t\t\tString[] individualnums = numbers.split(\",\");\n\t\t\t\tfor (int i = 0; i < individualnums.length; i++) {\t\t\t\t\t\n\t\t\t\t\tlist.add(Integer.parseInt(individualnums[i]));\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tlistOflist.add(list);\t\t\t\t\n\t\t\t}\t\t\n\t\t\t\n\t\t\tbr.close();\n\t\t\tfr.close();\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn listOflist;\n\t}",
"private void loadDataFromMemory(String filename){\n shoppingList.clear();\n new ReadFromMemoryAsync(filename, getCurrentContext(), new ReadFromMemoryAsync.AsyncResponse(){\n\n @Override\n public void processFinish(List<ShoppingItem> output) {\n shoppingList.addAll(output);\n sortItems();\n }\n }).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);\n// for (ShoppingItem item: items) {\n// shoppingList.add(item);\n// }\n// sortItems();\n }",
"private void updateListView() {\n fileList.getItems().setAll(files.readList());\n //System.out.println(System.currentTimeMillis() - start + \" мс\");\n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView( R.layout.main );\n\n ListView list = (ListView)findViewById( R.id.ListView01 );\n\n store = new MainStore( this );\n store.add(\"Xperia\");\n store.add(\"NexusOne\");\n store.add(\"desire\");\n data = store.loadAll();\n store.close();\n \n ArrayAdapter<String> arrayAdapter\n = new ArrayAdapter<String>(this, R.layout.rowitem, data);\n\n list.setAdapter(arrayAdapter);\n }",
"private void Init() {\n\t\tnumPick1 = (NumberPicker) findViewById(R.id.lottoNumPicker1);\n\t\tnumPick2 = (NumberPicker) findViewById(R.id.lottoNumPicker2);\n\t\tnumPick3 = (NumberPicker) findViewById(R.id.lottoNumPicker3);\n\t\tnumPick4 = (NumberPicker) findViewById(R.id.lottoNumPicker4);\n\t\tnumPick5 = (NumberPicker) findViewById(R.id.lottoNumPicker5);\n\t\tnumPick6 = (NumberPicker) findViewById(R.id.lottoNumPicker6);\n\t\tgridView = (GridView) findViewById(R.id.lottoGridView);\n\t\ttvFix = (TextView) findViewById(R.id.lottoTvFix);\n\t\tgo = (Button) findViewById(R.id.lottoGo);\n\n\t\tfor (int i = 0; i < 49; i++) {\n\t\t\tnumbers[i] = Integer.toString(i + 1);\n\t\t}\n\t}",
"private void initList() {\r\n\t\tlist = new JList<>();\r\n\t\tFile rootFile = new File(System.getProperty(\"user.dir\"));\r\n\t\tloadFilesInFolder(rootFile);\r\n\t\tlist.addListSelectionListener(new FileListSelectionListener());\r\n\t}",
"@FXML\n void importFromFile() {\n generalTextArea.clear();\n clearEverything();\n\n try {\n FileChooser chooser = new FileChooser();\n chooser.setTitle(\"Open Source File for the Import\");\n chooser.getExtensionFilters().addAll(new FileChooser.ExtensionFilter(\"Text Files\", \"*.txt\"));\n Stage stage = new Stage();\n File sourceFile = chooser.showOpenDialog(stage); //get the reference of the source file\n Scanner input = new Scanner(sourceFile);\n\n while (input.hasNextLine()) {\n String line = input.nextLine();\n handleImportLines(line);\n }\n input.close();\n\n } catch (IOException | NullPointerException ex) {\n generalTextArea.appendText(\"There was an error with accessing your imported file. Please try with a valid file. \\n\");\n return;\n }\n generalTextArea.appendText(\"Successfully imported database\");\n }",
"public void setLoadItems(String borrowedFileName) \n\t{\n\t\trecordCount = RESET_VALUE;\n\n\t\ttry \n\t\t{\n\t\t\tScanner infile = new Scanner(new FileInputStream(borrowedFileName));\n\n\t\t\twhile(infile.hasNext() == true && recordCount < MAX_ITEMS) \n\t\t\t{\n\t\t\t\titemIDs[recordCount] = infile.nextInt();\n\t\t\t\titemNames[recordCount] = infile.next(); \n\t\t\t\titemPrices[recordCount] = infile.nextDouble(); \n\t\t\t\tinStockCounts[recordCount] = infile.nextInt();\n\t\t\t\trecordCount++;\n\t\t\t}\n\n\t\t\tinfile.close();\n\n\t\t\t//sort parallel arrays by itemID\n\t\t\tsetBubbleSort();\n\n\t\t}//END try\n\n\t\tcatch(IOException ex) \n\t\t{\n\t\t\trecordCount = NOT_FOUND;\n\t\t}\n\t}",
"public void loadListView(ArrayList<LonelyPicture> picList){\n \t\n\t\t\t\t\n\n\t\t adapter = new ArrayAdapter<LonelyPicture>(getActivity().getApplicationContext(),\n\t\t android.R.layout.simple_list_item_multiple_choice, android.R.id.text1, picList);\n\t\t \n\n\t\t picListView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);\n\t\t picListView.setAdapter(adapter);\n\t\t\n\t\t \n\t\t //picListView = (ListView) findViewById(R.id.picListView);\n\t\t//will this really work?\n\t\t\n\t\t\t picListView = (ListView) getActivity().findViewById(R.id.picListView);\n\t\t\t picListView.setOnItemClickListener(new OnItemClickListener() {\n\t\t\t\t\t\n\t\t\t\t public void onItemClick(AdapterView<?> a, View v, int i, long l){\n\t\t\t\t\t MainActivity.fetch = (LonelyPicture) picListView.getItemAtPosition(i);\n\t\t\t\t\tMainActivity.printList.add((LonelyPicture) picListView.getItemAtPosition(i));\n\t\t\t\t\tButton right = (Button) getActivity().findViewById(R.id.show_and_back_button);\n\t\t\t\t\tright.setEnabled(true);\n\t\t\t\t\tLog.e(\"From picListFragment--guid\", MainActivity.fetch.getGUID());\n\t\t\t\t\t\n\t\t\t\t }});\n\t\t \n }",
"public void show() {\n numberList.show();\n }",
"public void load() {\n notification = \"Hi \" + reader.getusername() + \"!\"\n + \"\\n\\n Latest nofitications:\\n\" + reader.notificationsToString();\n label.setText(notification);\n }",
"private void LoadList() {\n try {\n //get the list\n ListView termListAdpt = findViewById(R.id.assessmentListView);\n //set the adapter for term list\n AssessmentAdapter = new ArrayAdapter<String>(AssessmentActivity.this, android.R.layout.simple_list_item_1, AssessmentData.getAssessmentsbyNames());\n termListAdpt.setAdapter(AssessmentAdapter);\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }",
"public void readTable() {\r\n\r\n try ( BufferedReader b = new BufferedReader(new FileReader(\"Hashdata.txt\"))) {\r\n\r\n String line;\r\n ArrayList<String> arr = new ArrayList<>();\r\n while ((line = b.readLine()) != null) {\r\n\r\n arr.add(line);\r\n }\r\n\r\n for (String str : arr) {\r\n this.load(str);\r\n }\r\n this.print();\r\n\r\n } catch (IOException e) {\r\n System.out.println(\"Unable to read file\");\r\n }\r\n\r\n this.userInterface();\r\n\r\n }",
"public void importFile() {\n \ttry {\n\t File account_file = new File(\"accounts/CarerAccounts.txt\");\n\n\t FileReader file_reader = new FileReader(account_file);\n\t BufferedReader buff_reader = new BufferedReader(file_reader);\n\n\t String row;\n\t while ((row = buff_reader.readLine()) != null) {\n\t String[] account = row.split(\",\"); //implementing comma seperated value (CSV)\n\t String[] users = account[6].split(\"-\");\n\t int[] usersNew = new int[users.length];\n\t for (int i = 0; i < users.length; i++) {\n\t \tusersNew[i] = Integer.parseInt(users[i].trim());\n\t }\n\t this.add(Integer.parseInt(account[0]), account[1], account[2], account[3], account[4], account[5], usersNew);\n\t }\n\t buff_reader.close();\n } catch (IOException e) {\n System.out.println(\"Unable to read text file this time.\");\n \t}\n\t}",
"private void readFromFile() {\n\t\tPath filePath = Paths.get(inputFile);\n\n\t\ttry (BufferedReader reader = Files.newBufferedReader(filePath,\n\t\t\t\tCharset.forName(\"UTF-8\"));) {\n\t\t\tString line = null;\n\n\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\tString[] splitLine = line.split(\",\");\n\t\t\t\tcurrentGen.setValue(Integer.parseInt(splitLine[0]),\n\t\t\t\t\t\tInteger.parseInt(splitLine[1]), true);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Could not find file provided.\");\n\t\t}\n\t}",
"public void openList() {\n\t\tString title = resourceManager.getString(\"process.view.list.title\");\n\t\tint indexOfTab = tabbedPane.indexOfTab(title);\n\t\tif (indexOfTab >= 0) {\n\t\t\ttabbedPane.setSelectedIndex(indexOfTab);\n\t\t} else {\n\t\t\tlView = new ListView(this, resourceManager);\n\t\t\ttabbedPane.addTab(title, lView);\n\n\t\t\ttabbedPane.setTabComponentAt(tabbedPane.indexOfTab(title),\n\t\t\t\t\tnew ButtonTabComponent(tabbedPane, this, lView,\n\t\t\t\t\t\t\tresourceManager));\n\t\t\tindexOfTab = tabbedPane.indexOfTab(title);\n\t\t\ttabbedPane.setSelectedIndex(indexOfTab);\n\t\t\tloadListView();\n\t\t}\n\t}",
"public void makeLoadButton() {\r\n JButton load = new JButton(\"Load saved accounts\");\r\n new Button(load, main);\r\n// load.setAlignmentX(Component.LEFT_ALIGNMENT);\r\n// load.setPreferredSize(new Dimension(2500, 100));\r\n// load.setFont(new Font(\"Arial\", Font.PLAIN, 40));\r\n load.addActionListener(new ActionListener() {\r\n @Override\r\n public void actionPerformed(ActionEvent e) {\r\n loadAccounts();\r\n displayMessage(\"Accounts loaded from file\");\r\n }\r\n });\r\n// main.add(load);\r\n }",
"@Override\n public void onClick(View arg0) {\n\n File f=new File(e1.getText().toString());\n\n String s=\"\";\n StringBuilder sb=new StringBuilder();\n FileReader fr = null;\n try {\n fr = new FileReader(f);\n\n } catch (FileNotFoundException e) {\n\n//\tTODO Auto-generated catch block\n\n e.printStackTrace();\n }\n BufferedReader br=new BufferedReader(fr);\n try {\n while((s=br.readLine())!=null)\n {\n sb.append(s+\"\\n\");\n }\n } catch (IOException e) {\n\n// TODO Auto-generated catch block\n e.printStackTrace();\n }\n\n Toast.makeText(getApplicationContext(), \"File ReadSuccessfully\", Toast.LENGTH_LONG).show();\n e2.setText(sb);\n }",
"public void loadEPILine(File file)\r\n\t{\r\n\t\tString name=file.getName();\r\n\t\tint [][] result=null;\r\n\t\ttry \r\n\t\t{\r\n\t\t\tScanner scanner=new Scanner(file);\r\n\t\t\tint size=scanner.nextInt();\r\n\t\t\tint width=scanner.nextInt();\t\t\t\r\n\t\t\tresult=new int[size][width];\r\n\t\t\tscanner.useDelimiter(\",\");\r\n\t\t\tString temp;\r\n\t\t\tfor(int i=0;i<size;i++)\r\n\t\t\t\tfor(int j=0;j<width;j++)\r\n\t\t\t\t{\r\n\t\t\t\t\ttemp=scanner.next();\r\n\t\t\t\t\tresult[i][j]=Integer.parseInt(temp.trim());\r\n\t\t\t\t}\r\n\t\t\tscanner.close();\t\r\n\t\t} catch (FileNotFoundException e) \r\n\t\t{\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t_pixels=result;\r\n\t\t\r\n\t\t//That's why I needed to get rid of \"_\" in directory name\r\n\t\tname=name.substring(0,name.lastIndexOf(\".\"));\r\n\t\tString[] split=name.split(\"_\");\r\n\t\t_line=Integer.parseInt(split[1])+1;\r\n\t\t_position=Position.valueOf(split[2]);\r\n\t\t\r\n\t}",
"private void loadEmployees() {\n Cursor cursor = databaseHelper.getAllPersons();\n\n if (cursor.moveToFirst()) {\n do {\n personList.add(new PersonClass(\n cursor.getString(0),\n cursor.getString(1),\n cursor.getInt(2),\n cursor.getString(3)\n\n ));\n } while (cursor.moveToNext());\n cursor.close();\n\n PersonAdapter personAdapter = new PersonAdapter(this, R.layout.list_person, personList, databaseHelper);\n listView.setAdapter(personAdapter);\n\n\n }\n }",
"private void leituraTexto() {\n try {\n Context context = getApplicationContext();\n\n InputStream arquivo = context.getResources().openRawResource(R.raw.catalogo_restaurantes);\n InputStreamReader isr = new InputStreamReader(arquivo);\n\n BufferedReader br = new BufferedReader(isr);\n\n String linha = \"\";\n restaurantes = new ArrayList<>();\n\n while ((linha = br.readLine()) != null) {\n restaurante = new Restaurante(linha);\n String id = Biblioteca.parserNome(restaurante.getId());\n String nome = Biblioteca.parserNome(restaurante.getNome());\n String descricao = Biblioteca.parserNome(restaurante.getDescricao());\n// Log.i(\"NOME\", nome);\n String rank = Biblioteca.parserNome(restaurante.getRank());\n int imagem = context.getResources().getIdentifier(nome, \"mipmap\", context.getPackageName());\n restaurante.setLogo(imagem);\n\n int imgrank = context.getResources().getIdentifier(rank, \"drawable\", context.getPackageName());\n restaurante.setRank(String.valueOf(imgrank));\n\n restaurantes.add(restaurante);\n }\n carregarListView();\n br.close();\n isr.close();\n arquivo.close();\n// Log.i(\"Quantidade\", \"\" + produtos.size());\n } catch (Exception erro) {\n Log.e(\"FRUTARIA Erro\", erro.getMessage());\n }\n\n }",
"public void loadFile() {\n\t\t\n\t\tString fileloc = \"\";\n\t\tif(!prf.foldername.getText().equals(\"\"))\n\t\t\tfileloc += prf.foldername.getText()+\"/\";\n\t\t\n\t\tString filename = JOptionPane.showInputDialog(null,\"Enter the filename.\");\n\t\tfileloc += filename;\n\t\tFile fl = new File(fileloc);\n\t\t\n\t\tif(!fl.exists()) {\n\t\t\tJOptionPane.showMessageDialog(null, \"The specified file doesnt exist at the given location.\");\n\t\t} else {\n\t\t\tMinLFile nminl = new MinLFile(filename);\n\t\t\t\n\t\t\ttry {\n\t\t\t\tFileReader flrd = new FileReader(fileloc);\n\t\t\t\tBufferedReader bufread = new BufferedReader(flrd);\n\t\t\t\t\n\t\t\t\tnminl.CodeArea.setText(\"\");\n\t\t\t\n\t\t\t\tString str;\n\t\t\t\twhile((str = bufread.readLine()) != null) {\n\t\t\t\t\tDocument doc = nminl.CodeArea.getDocument();\n\t\t\t\t\ttry {\n\t\t\t\t\tdoc.insertString(doc.getLength(), str, null);\n\t\t\t\t\t} catch (BadLocationException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbufread.close();\n\t\t\t\tflrd.close();\n\t\t\t\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\t\t\n\t\t\t\n\t\t\tJComponent panel = nminl;\n\t\t\t\n\t\t\ttabbedPane.addTab(filename, null, panel,\n\t\t\t\t\tfilename);\t\t\n\t\t\ttabbedPane.setMnemonicAt(0, 0);\n\t\t}\t\n\t}",
"@Override\n protected void onPostExecute(List<String> list) {\n ArrayAdapter<String> aaNumbers = new ArrayAdapter<>(MainActivity.this,\n android.R.layout.simple_list_item_1, list);\n ListView lvNumbers = (ListView)findViewById(R.id.lvNumbers);\n lvNumbers.setAdapter(aaNumbers);\n }",
"public void loadScores() {\n try {\n File f = new File(filePath, highScores);\n if(!f.isFile()){\n createSaveData();\n }\n BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(f)));\n\n topScores.clear();\n topName.clear();\n\n String[] scores = reader.readLine().split(\"-\");\n String[] names = reader.readLine().split(\"-\");\n\n for (int i =0; i < scores.length; i++){\n topScores.add(Integer.parseInt(scores[i]));\n topName.add(names[i]);\n }\n reader.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"public void populateListFromFile() \n\t{\n\t\tBufferedReader bufferedReader = null;\n\t\tallQuestions = new ArrayList<ArrayList<String>>();\n\t\tquestionAndAnswers = new ArrayList<String>();\n\n\t\ttry {\n\t\t bufferedReader = new BufferedReader(new FileReader(\"questions.txt\"));\n\t\t String line = \"\";\n\t\t \n\t\t while ((line = bufferedReader.readLine()) != null) \n\t\t {\t\t\t \t\n\t\t \tif(line.length() > 0)\n\t\t \t\tquestionAndAnswers.add(line);\n\t\t \telse if (line.length() == 0)\n\t\t \t{\n\t\t \t\tallQuestions.add(questionAndAnswers);\n\t\t \t\tquestionAndAnswers = new ArrayList<String>();\n\t\t \t}\n\t\t } \n\t\t} catch (IOException e) {\n\t\t e.printStackTrace();\n\t\t}\n\t}",
"public void loadPeriodInfo() throws IOException{\r\n try { \r\n String line;\r\n FileReader in = new FileReader (\"Period List.txt\");\r\n BufferedReader input = new BufferedReader(in); \r\n String line1;\r\n teacherListModel.removeAllElements();\r\n periodModel.removeAllElements();\r\n removeTeachersListModel.removeAllElements();\r\n editTeachersListModel.removeAllElements();\r\n teachers.clear();\r\n //Running through each line of code\r\n while ((line1 = input.readLine()) != null) {\r\n String tempLine = line1; \r\n String[] teacherData = new String [2];\r\n for (int i = 0; i < 2; i++) {\r\n teacherData [i] = tempLine.substring (0, tempLine.indexOf(\",\")); \r\n tempLine = tempLine.substring(tempLine.indexOf(\",\") + 1, tempLine.length()); \r\n } \r\n //Adding the teachers and their data\r\n Teacher tempTeacher = new Teacher (teacherData[0]);//name\r\n teacherListModel.addElement(teacherData[0]); \r\n periodModel.addElement(teacherData[0]); \r\n removeTeachersListModel.addElement(teacherData[0]); \r\n editTeachersListModel.addElement (teacherData[0]);\r\n teachers.add (tempTeacher);\r\n for (int j = 0; j < teacherData[1].length(); j++) {\r\n tempTeacher.addPeriod (Integer.parseInt(teacherData[1].substring (j, j + 1))); //period\r\n }\r\n }\r\n }catch (IOException E) {\r\n System.out.println (\"ERROR READING 'Period List.txt\"); \r\n }\r\n }",
"@FXML\n public void ballot_import(ActionEvent e)throws IOException\n {\n //checks the voting status\n if(voting_state==1)\n {\n a=new Alert(AlertType.ERROR);\n a.setContentText(\"You Cannot Import Ballots During Voting !\");\n a.show();\n }\n //if not started voting the ballot file will imported\n else\n {\n //setting file chooser for get text file\n FileChooser fc = new FileChooser();\n Stage filechooser=new Stage();\n Button select = new Button(\"Select File\");\n select.setOnAction(f -> {\n File Ballotpaper = fc.showOpenDialog(filechooser);\n });\n Node node = (Node) e.getSource();\n //allows only .txt files to import\n fc.getExtensionFilters().addAll(new FileChooser.ExtensionFilter(\"Text Files\", \"*.txt\"));\n File selectedFile =fc.showOpenDialog(node.getScene().getWindow());\n if (selectedFile != null)\n {\n if (selectedFile.exists())\n {\n //if file selected the data will read line by line and put in hashmap\n try\n {\n File Ballot_File = new File(selectedFile.getPath());\n Scanner Ballot_Reader = new Scanner(Ballot_File);\n while (Ballot_Reader.hasNextLine())\n {\n //split line by '|' character and stored in local string array\n String[] ballot = Ballot_Reader.nextLine().split(\"\\\\|\");\n //System.out.println(ballot[0]+\" k \"+ballot[1]);\n Ballot bal = new Ballot(ballot[0], ballot[1]);\n allBallots.put(ballot[0], bal);\n }\n a = new Alert(AlertType.INFORMATION);\n a.setContentText(\"Successfully Imported !\");\n a.show();\n Ballot_Reader.close();\n }\n catch (FileNotFoundException ex)\n {\n a = new Alert(AlertType.ERROR);\n a.setContentText(ex.getMessage());\n a.show();\n }\n }\n }\n }\n }",
"public static void readFile(String myFile, List <Integer> myList) throws FileNotFoundException{\n \t \n Scanner fileScanner = new Scanner(new File(myFile)); // Reads in from filePath.\n \n while (fileScanner.hasNextInt()){ // Loops while there is still a next integer in the list.\n \t myList.add(fileScanner.nextInt()); // Adds all integers to RandomIntegers arraylist.\n }\n \n System.out.println(\"\\nFile read in successfully.\"); \n }",
"public void loadNextChapter(int target){\n //reading from file and displaying in the textview\n StringBuilder stringBuilder = new StringBuilder();\n String bookText = bibleVersion + \"/\" + bookTitle + \"/\" + bookTitle + target + \".txt\";\n InputStream inputStream = null;\n try {\n inputStream = getApplicationContext().getAssets().open(bookText);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));\n String line;\n\n try {\n while ((line = bufferedReader.readLine()) != null) {\n stringBuilder.append(line).append(\"\\n\");\n }\n\n bufferedReader.close();\n\n } catch (IOException ioe) {\n ioe.printStackTrace();\n }\n getSupportActionBar().setTitle(bookTitle + \" \" + target);\n textView.setText(stringBuilder.toString());\n chapter = target;\n }",
"public void fillFromFile()\n\t{\n\t\tJFileChooser fc = new JFileChooser();\t//creates a new fileChooser object\n\t\tint status = fc.showOpenDialog(null);\t//creates a var to catch the dialog output\n\t\tif(status == JFileChooser.APPROVE_OPTION)\t\n\t\t{\n\t\t\tFile selectedFile = fc.getSelectedFile ( );\n\t\t\tthis.fileName = selectedFile;\n\t\t\tScanner file = null; //scans the file looking for information to load\n\n\t\t\tif(selectedFile.exists())\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tfile = new Scanner(fileName); //scans the input file\n\t\t\t\t}\n\t\t\t\tcatch(Exception IOException)\n\t\t\t\t{\n\t\t\t\t\tJOptionPane.showConfirmDialog (null, \"Unable to import data from the list\");\n\t\t\t\t\tSystem.exit (-1);\n\t\t\t\t}//if there was an error it will pop up this message\n\t\t\t\t\n\t\t\t\tString str = file.nextLine ( ); //names the line\n\t\t\t\tString [] header = str.split (\"\\\\|\"); //splits the line at the |\n\t\t\t\tsetCourseNumber(header[1]);\n\t\t\t\tsetCourseName(header[0]);\n\t\t\t\tsetInstructor(header[2]);\n\t\t\t\t\n\t\t\t\twhile(file.hasNextLine ( ))\n\t\t\t\t{\n\t\t\t\t\tstr = file.nextLine ( ); //names the line\n\t\t\t\t\tString [] tokens = str.split (\"\\\\|\"); //splits the line at the |\n\t\t\t\t\tStudent p = new Student();\n\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tp.setStrNameLast (String.valueOf (tokens[0]));\n\t\t\t\t\t\tp.setStrNameFirst (String.valueOf (tokens[1]));\n\t\t\t\t\t\tp.setStrMajor (String.valueOf (tokens[2]));\n\t\t\t\t\t\tp.setClassification (tokens[3]);\n\t\t\t\t\t\tp.setiHoursCompleted (new Integer (tokens[4]).intValue ( ));\n\t\t\t\t\t\tp.setfGPA (new Float (tokens[5]).floatValue ( ));\n\t\t\t\t\t\tp.setStrStudentPhoto (String.valueOf (tokens[6]));\n\t\t\t\t\t//creates a person object and then populates it with an array of scanned input values\n\t\t\t\t\t\tclassRoll.add (p);\n\t\t\t\t\t\t}//creates a person object and then populates it with an array of scanned input values\n\t\t\t\t\t\tcatch(Exception IOException)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tIOException.printStackTrace ( );\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog (null, \"Bad input record: '\" + str + \"'\" + IOException.getMessage());\n\t\t\t\t\t\t}//pops up a message if there were any errors reading from the file\n\t\t\t\t}//continues through the file until there are no more lines to scan\n\t\t\tfile.close ( ); //closes the file\n\n\t\t\t\tif(selectedFile.exists ( )==false)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new Exception();\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception IOException)\n\t\t\t\t\t{\n\t\t\t\t\t\tJOptionPane.showMessageDialog (null, \"Bad input record: '\" + selectedFile + \"' \" + IOException.getMessage());\n\t\t\t\t\t}\n\t\t\t\t}//if the user picks a file that does not exist this error message will be caught.\n\t\t\t}\n\t\t}//if the input is good it will load the information from the selected file to and Array List\n\t\t\telse\n\t\t\t{\n\t\t\t\tSystem.exit (0);\n\t\t\t}\n\t\tthis.saveNeed = true;\n\n\t\t}",
"private void btnLoadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLoadActionPerformed\r\n\r\n int returnVal = getInChooser().showOpenDialog(this);\r\n \r\n if(returnVal == JFileChooser.APPROVE_OPTION) {\r\n try {\r\n blackWords.setText(Utils.loadFile(getInChooser().getSelectedFile()).trim());\r\n } catch (FileNotFoundException ex) {\r\n ex.printStackTrace();\r\n } catch (IOException ex) {\r\n ex.printStackTrace();\r\n }\r\n }\r\n \r\n putWizardData(\"blacksaved\", \"false\");\r\n }",
"public void setLoadItems(String borrowedFileName, int borrowedSize) \n\t{\n\t\trecordCount = RESET_VALUE;\n\n\t\ttry \n\t\t{\n\t\t\tScanner infile = new Scanner(new FileInputStream(borrowedFileName));\n\n\t\t\twhile(infile.hasNext() == true && recordCount < MAX_ITEMS && recordCount < borrowedSize) \n\t\t\t{\n\t\t\t\titemIDs[recordCount] = infile.nextInt();\n\t\t\t\titemNames[recordCount] = infile.next();\n\t\t\t\titemPrices[recordCount] = infile.nextDouble();\n\t\t\t\torderQuantity[recordCount] = infile.nextInt();\n\t\t\t\torderTotals[recordCount] = infile.nextDouble(); \n\t\t\t\trecordCount++;\n\t\t\t}\n\n\t\t\t//close file\n\t\t\tinfile.close();\n\n\t\t\t//sort by itemID\n\t\t\tsetBubbleSort();\n\t\t}//END try\n\n\t\tcatch(IOException ex) \n\t\t{\n\t\t\trecordCount = NOT_FOUND;\n\t\t}\n\t}",
"ArrayList<WordListItem> addDataFromFile(){\n BufferedReader br;\n InputStream inputStream = context.getResources().openRawResource(R.raw.animal_list);\n br = new BufferedReader(\n new InputStreamReader(inputStream, Charset.forName(\"UTF-8\"))\n );\n String currentLine;\n ArrayList<WordListItem> wordListItems = new ArrayList<WordListItem>();\n try {\n while ((currentLine = br.readLine()) != null) {\n String[] tokens = currentLine.split(\";\");\n\n String word = tokens[0];\n String pronunciation = tokens[1];\n String description = tokens[2];\n\n WordListItem wordItem = new WordListItem(word, pronunciation, description);\n wordItem.setImgResNbr(setImgResFromWord(wordItem.getWord().toLowerCase()));\n wordListItems.add(wordItem);\n }\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n if (br != null) br.close();\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n }\n\n return wordListItems;\n }",
"private void loadFromFile() {\n try {\n FileInputStream fis = openFileInput(FILENAME);\n InputStreamReader isr = new InputStreamReader(fis);\n BufferedReader reader = new BufferedReader(isr);\n Gson gson = new Gson();\n Type listFeelingType = new TypeToken<ArrayList<Feeling>>(){}.getType();\n recordedFeelings.clear();\n ArrayList<Feeling> tmp = gson.fromJson(reader, listFeelingType);\n recordedFeelings.addAll(tmp);\n fis.close();\n\n } catch (FileNotFoundException e) {\n // TODO Auto-generated catch block\n recordedFeelings = new ArrayList<Feeling>();\n e.printStackTrace();\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }",
"public static void loadProgramData() {\n\r\n try {\r\n File f = new File(\"DetailsOfVaccination.txt.txt\"); //Accessing the file\r\n Scanner read = new Scanner(f);\r\n while (read.hasNextLine()) { //Print data in the file line by line\r\n String data = read.nextLine();\r\n System.out.println(data);\r\n }\r\n read.close();\r\n }\r\n catch (FileNotFoundException e) { //Runs if there was an error\r\n System.out.println(\"An error occurred while reading data from the file.\");\r\n e.printStackTrace();\r\n }\r\n }",
"@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_load_screen);\n\n // Get all of the file names\n List<String> fileNames = new ArrayList<>();\n File[] files = this.getFilesDir().listFiles();\n\n if (files != null) {\n for (File file : files) {\n fileNames.add(file.toString());\n } // end for\n } // end if\n\n // Set up recycler view\n RecyclerView recyclerView = findViewById(R.id.file_name_view);\n RecyclerView.Adapter myAdapter = new MyAdapter(fileNames, this);\n recyclerView.setHasFixedSize(true);\n RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this);\n recyclerView.setLayoutManager(layoutManager);\n recyclerView.setAdapter(myAdapter);\n }",
"public void stockLoad() {\n try {\n File file = new File(stockPath);\n Scanner scanner = new Scanner(file);\n while (scanner.hasNextLine()) {\n String data = scanner.nextLine();\n String[] userData = data.split(separator);\n Stock stock = new Stock();\n stock.setProductName(userData[0]);\n int stockCountToInt = Integer.parseInt(userData[1]);\n stock.setStockCount(stockCountToInt);\n float priceToFloat = Float.parseFloat(userData[2]);\n stock.setPrice(priceToFloat);\n stock.setBarcode(userData[3]);\n\n stocks.add(stock);\n }\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n }",
"private void loadFromFile(ArrayList<Question> questionsList) {\n String tempString = \"\"; // Holds the \"identifier\" of the line\n String question = \"\"; // text containing actual question\n ArrayList<Integer> scoreList = new ArrayList<>(); // contains scores of questions\n ArrayList<String> answers = new ArrayList<>(); // contains answers of questions\n ArrayList<String> nextQuestions = new ArrayList<>(); // contains next question of current question\n int specialCase = 0; // special case of question\n boolean backExists = false; // boolean indicating if back button does(n't) exist\n Question tempQuestion; // temporary question which is later added to the list\n\n // Attempt to open a the question_data file and read its contents\n try {\n InputStream in = getClass().getResourceAsStream(\"question_data\");\n Scanner sc = new Scanner(in);\n\n while (sc.hasNextLine()) {\n tempString = sc.nextLine();\n if (tempString.equals(\"\")) {\n continue;\n }\n\n switch (tempString.charAt(0)) {\n case '#':\n // Anything beginning with '#' is ignored.\n break;\n case 'Q':\n // 'Q' indicated the text of the question\n question = tempString.substring(3);\n break;\n case 'A':\n // 'A' indicates an answer\n answers.add(tempString.substring(3));\n break;\n case 'B':\n // 'B' indicates if a back button exists or not\n backExists = Boolean.parseBoolean(tempString.substring(3));\n break;\n case 'N':\n // 'N' indicates the next question of every answer\n nextQuestions.add(tempString.substring(3));\n break;\n case 'S':\n // 'S' indicates the score of every answer, can be set to -1 if no score is needed\n scoreList.add(Integer.parseInt(tempString.substring(3)));\n break;\n case 'C':\n // Special case. Every special case (number other than 0) has to be accounted for...\n specialCase = Integer.parseInt(tempString.substring(3));\n break;\n case 'T':\n // 'T' stands for terminate and create. A 'T' should be placed at the end of a\n // question and all of its answers. This indicated the creation of the question.\n\n // Create new question, set its answer, reset all lists, etc.\n tempQuestion = new Question(question, backExists);\n tempQuestion.setSpecialCase(specialCase);\n for (int i = 0; i < answers.size(); i++) {\n tempQuestion\n .addAnswer(answers.get(i), nextQuestions.get(i), scoreList.get(i));\n tempQuestion.setBackAvailable(backExists);\n }\n questionsList.add(tempQuestion);\n answers.clear();\n scoreList.clear();\n nextQuestions.clear();\n specialCase = 0;\n break;\n default:\n break;\n }\n\n }\n } catch (Exception e){\n System.out.println(System.getProperty(\"user.dir\"));\n System.out.println(\"An error occurred while parsing the file, make sure the file exists.\"\n + \"and/or has the correct filename (question_data)\");\n\n }\n }",
"private void importFile()\n\t{\n\t\tint count = 0;\n\n\t\ttry{\n\t\t\tFileReader readFile = new FileReader(drinkListFile);\n\t\t\tBufferedReader reader = new BufferedReader(readFile);\n\n\t\t\tint i = 0;\n\t\t\timportDrinkList = \"\";\n\t\t\tString drinkListFileLine = reader.readLine();\n\t\t\tdo//this leaves you with a string of the drinkListFile with a space at the end. \n\t\t\t{\n\t\t\t\timportDrinkList += drinkListFileLine + \"\\n\";//adds the line on the txt file to the string\n\t\t\t\tdrinkListFileLine = reader.readLine();//goes to the next line.\n\n\t\t\t\t//keeps track of times through with a null line\n\t\t\t\tif(drinkListFileLine == null) //increments count if there is a space sensed\n\t\t\t\t{\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t\telse if(drinkListFileLine != null)//resets count if there is only one space in between drinks\n\t\t\t\t{\n\t\t\t\t\tcount = 0;\n\t\t\t\t}\n\n\t\t\t\ti++;\n\t\t\t}\n\t\t\twhile(drinkListFileLine!= null && count != 2);\n\t\t\treader.close();\n\n\n\t\t}\n\t\tcatch(IOException e)\n\t\t{\n\t\t\te.toString();//change this\n\t\t\tJOptionPane.showMessageDialog(null, \"Drink file read error: \" + e.toString());\n\t\t}\n\n\n\t}",
"private static void printNumbers(String f1) throws IOException {\n DataInputStream in = readFile(f1,f1,true);\n System.out.println(\"\\nThe numbers in \" + f1 + \" are :\");\n int i=0;\n while(i<20 && in.available()>=4){ //print first 20 numbers\n int val = in.readInt();\n System.out.print(val + \" \");\n\n i++;\n\n }\n }",
"public void loadToDoList() {\n try {\n toDoList = jsonReader.read();\n System.out.println(\"Loaded \" + toDoList.getName() + \" from \" + JSON_STORE);\n } catch (IOException e) {\n System.out.println(\"Unable to read from file: \" + JSON_STORE);\n }\n }"
] | [
"0.6834371",
"0.6606782",
"0.6400561",
"0.6064404",
"0.5964384",
"0.57811123",
"0.5719406",
"0.57096595",
"0.5677936",
"0.5662896",
"0.5604541",
"0.5557453",
"0.5548776",
"0.55164534",
"0.55135095",
"0.55048573",
"0.5472068",
"0.54182076",
"0.5414057",
"0.53832024",
"0.5350198",
"0.53329664",
"0.53042156",
"0.52824533",
"0.5261561",
"0.52600175",
"0.5246683",
"0.52458024",
"0.5237175",
"0.5233406",
"0.5204737",
"0.5194335",
"0.5194317",
"0.51896644",
"0.5188745",
"0.5187172",
"0.5181584",
"0.5138598",
"0.51340914",
"0.5126175",
"0.51221436",
"0.5120709",
"0.51197374",
"0.51195294",
"0.51114887",
"0.51092106",
"0.5103739",
"0.5103446",
"0.50961256",
"0.50939035",
"0.50912905",
"0.5090633",
"0.50887847",
"0.5076752",
"0.5064737",
"0.50621253",
"0.5057078",
"0.50547725",
"0.50479263",
"0.504653",
"0.50454223",
"0.5027707",
"0.5024648",
"0.50217605",
"0.50176483",
"0.50164545",
"0.5009034",
"0.5006603",
"0.5004421",
"0.500318",
"0.5000933",
"0.4995323",
"0.49948573",
"0.4993081",
"0.4991858",
"0.49910262",
"0.4987396",
"0.49809194",
"0.49681675",
"0.49631363",
"0.4957033",
"0.49556458",
"0.49537697",
"0.49530327",
"0.49449813",
"0.4943104",
"0.4940952",
"0.49403968",
"0.4936167",
"0.49340117",
"0.49308848",
"0.49275452",
"0.4922294",
"0.49199283",
"0.49089113",
"0.4908583",
"0.4904994",
"0.49032965",
"0.49011824",
"0.4900772"
] | 0.52245426 | 30 |
Clear button onClick handler. Clears the ListView containing the numbers list. | public void clearFile(View view) {
// clear the displayed list of numbers
ListView lvNumbers = (ListView) findViewById(R.id.lvNumbers);
ArrayAdapter aaNumbers = (ArrayAdapter) lvNumbers.getAdapter();
if (aaNumbers != null) {
aaNumbers.clear();
aaNumbers.notifyDataSetChanged();
}
// clear progress bar
ProgressBar pbFileIO = (ProgressBar) findViewById(R.id.pbFileIO);
pbFileIO.setProgress(0);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void listClear(View view){\n ProgressBar myBar = (ProgressBar) findViewById(R.id.progressBar);\n myBar.setProgress(0);\n\n ListView listView = (ListView) findViewById(R.id.listView);\n ArrayAdapter<Integer> myAdapter = (ArrayAdapter<Integer>) listView.getAdapter();\n if(myAdapter != null){\n myAdapter.clear();\n }\n }",
"@FXML\n void clearEntireListClicked(ActionEvent event)\n {\n Item.getToDoList().clear();\n\n // Clear the table view\n listView.getItems().clear();\n\n // Reset the index to 0 and clear\n index = 0;\n clear();\n\n }",
"void onItemClear();",
"void onItemClear();",
"public void clearList(View view) {\n list.clear();\n adapter.notifyDataSetChanged();\n progressBar.setProgress(0);\n\n Toast toast = Toast.makeText(getApplicationContext(), \"List cleared\", Toast.LENGTH_SHORT);\n toast.show();\n }",
"private void clearViews()\n {\n prepareNumbers();\n }",
"public void clear(){\n listData.clear();\n notifyDataSetChanged();\n }",
"public void clear() {\n lb.setText(\"\");\n }",
"public void clear() {\n listItems.clear();\n notifyDataSetChanged();\n }",
"public void clearList() {\n data.clear();\n notifyDataSetChanged();\n }",
"public void clearTaskListRecNums() { taskListRecNums.clear(); }",
"public void clear() {\n list.clear();\n notifyDataSetChanged();\n }",
"public void ClearAdd(){\n \n PID.setText(\"\");\n MN.setText(\"\");\n PN.setText(\"\");\n price.setText(\"\");\n category.setSelectedIndex(0);\n buttonGroup1.clearSelection();\n }",
"public void clear(){\r\n NotesList.clear();\r\n }",
"public void clear()\r\n {\r\n phoneList = new ArrayList<String>();\r\n }",
"public void clearBtn(View view){\n formula.editText(\"$$ $$\", 3);\r\n //formula.cursPosition = 3;\r\n refresh();\r\n\r\n }",
"@Override\n public void clear() {\n view.setText(\"\");\n view.setSelection(view.getText().length());\n }",
"public void clear(){\n nyts.clear();\n notifyDataSetChanged();\n }",
"public void clear() {\n tweetList.clear();\n notifyDataSetChanged();\n }",
"public void onClickClear(View view) {\n textView.setText(\" \");\n }",
"private void clear() {\n\n machrefno.setText(null);\n machname.setText(null);\n manu.setSelectedItem(null);\n Date.setDate(null);\n dept.setSelectedItem(null);\n stat.setSelectedItem(null);\n \n }",
"public void clear(View view) {\n new Cart().deleteAll();\n Intent i = getIntent();\n finish();\n startActivity(i);\n }",
"public void clearButtonClick (ActionEvent e) {\r\n\t\tSearchDate1.setText(\"\");\r\n\t\tSearchDate2.setText(\"\");\r\n\t\tLat1.setText(\"\");\r\n\t\tLat2.setText(\"\");\r\n\t\tLon1.setText(\"\");\r\n\t\tLon2.setText(\"\");\r\n\t\tDepth1.setText(\"\");\r\n\t\tDepth2.setText(\"\");\r\n\t\tMag1.setText(\"\");\r\n\t\tMag2.setText(\"\");\r\n\t\tMagType.setText(\"\");\r\n\t\tPlace.setText(\"\");\r\n\t\tStatus.setText(\"\");\r\n\t\tReportArea.setText(\"\");\r\n\t\tquakes.clear();\r\n\t\treportList.clear();\r\n\t}",
"private void btn_clearitemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_clearitemActionPerformed\n //Code to remove only item detailsdsfsdf\n txt_iniId.setText(\"\");\n cbo_iniName.setSelectedItem(0);\n txt_inQty.setText(\"\");\n }",
"public void Reset()\n {\n this.list1.clear();\n }",
"@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\ttry {\n\t\t\t\t\tmyDataBase.delete(pnm, null, null);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t}\n\t\t\t\tTBDispContacts.items.clear();\n\t\t\t\tfinish();\n\t\t\t}",
"public void clear() {\n\n mItems.clear();\n notifyDataSetChanged();\n\n }",
"private void toClear()\n {\n tfPaintId.setText(\"\");\n tfName.setText(\"\");\n tfPrice.setText(\"\");\n tfColor.setText(\"\");\n rwCombo.setSelectedIndex(0);\n bCombo.setSelectedIndex(0);\n typeCombo.setSelectedIndex(0);\n tfQuantity.setText(\"\");\n bg.clearSelection();\n \n }",
"public void clearAllTapped(View view){\n final AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);\n alertDialogBuilder.setMessage(\"Do you really want to remove all items?\");\n alertDialogBuilder.setPositiveButton(\"yes\",\n new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface arg0, int arg1) {\n scannedList.clear();\n arrayAdapter.notifyDataSetChanged();\n View view = findViewById(R.id.id_fab);\n id_txtInfo.setText(\"Hey! you're all set to start scanning...\\nJust press Floating Action Button below to get Started.\");\n id_layoutClear.setVisibility(GONE);\n id_listView.setVisibility(GONE);\n id_layoutInfo.setVisibility(VISIBLE);\n Snackbar.make(view, \"All items cleared successfully...\", Snackbar.LENGTH_LONG).show(); }\n });\n alertDialogBuilder.setNegativeButton(\"No\",new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n AlertDialog alertDialog = alertDialogBuilder.create();\n alertDialog.dismiss();\n }\n });\n AlertDialog alertDialog = alertDialogBuilder.create();\n alertDialog.show();\n }",
"public void clear() {\r\n mActivityList.clear();\r\n notifyDataSetChanged();\r\n }",
"public void clearBtn( View v )\n\t {\n\t // clear out the display of everything\n \tTextView TV = (TextView) findViewById( R.id.inputText );\n \tTV.setText( \"\" );\t\t\n \tTV = (TextView) findViewById( R.id.sheepnameText );\n\t TV.setText( \"\" );\n//\t TV = (TextView) findViewById( R.id.eidText );\n//\t TV.setText( \"\" );\n//\t TV = (TextView) findViewById( R.id.fedText );\n//\t TV.setText( \"\" );\n//\t TV = (TextView) findViewById( R.id.farmText );\n//\t TV.setText( \"\" );\n//\t TV = (TextView) findViewById( R.id.paintText );\n//\t TV.setText( \"\" );\n//\t TV = (TextView) findViewById( R.id.fed_colorText );\n//\t TV.setText( \"\" );\n//\t TV = (TextView) findViewById( R.id.fed_locationText );\n//\t TV.setText( \"\" );\n//\t TV = (TextView) findViewById( R.id.farm_colorText );\n//\t TV.setText( \"\" );\n//\t TV = (TextView) findViewById( R.id.farm_locationText);\n//\t TV.setText( \"\" );\n//\t TV = (TextView) findViewById( R.id.paint_colorText );\n//\t TV.setText( \"\" );\n//\t TV = (TextView) findViewById( R.id.paint_locationText);\n//\t TV.setText( \"\" );\n//\t TV = (TextView) findViewById( R.id.eid_colorText );\n//\t TV.setText( \"\" );\n//\t TV = (TextView) findViewById( R.id.eid_locationText);\n//\t TV.setText( \"\" );\n\t TV = (TextView) findViewById( R.id.new_tag_number);\n\t TV.setText( \"\" );\n\t //\tClear out the tag ids\n\t fedtagid = 0;\n \tfarmtagid = 0;\n \teidtagid = 0;\n \tpaintid = 0;\n \ttattooid = 0;\n \tsplitid = 0;\n \tnotchid = 0;\n \tnew_tag_number = null;\n \t//\tclear out the add tag spinners\n \ttry {\n\t \ttag_type_spinner2.setSelection(0);\n\t \ttag_color_spinner.setSelection(0);\n\t \ttag_location_spinner.setSelection(0);\n \t}catch (Exception e){\n \t\t// \tcouldn't clear an empty spinner\n \t} \t\n \t// make the alert button normal and disabled\n \tbtn = (Button) findViewById( R.id.alert_btn );\n \tbtn.getBackground().setColorFilter(new LightingColorFilter(0xFF000000, 0xFF000000));\n \tbtn.setEnabled(false); \n\t \t//\tmake the scan eid button red\n \tbtn = (Button) findViewById( R.id.scan_eid_btn );\n \tbtn.getBackground().setColorFilter(new LightingColorFilter(0xFF000000, 0xFFCC0000)); \n \t// Clear out the list of tags\n\t\tLog.i(\"clear btn\", \"before changing myadapter\");\n\t\ttry {\n\t\t\tmyadapter.changeCursor(null);\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\t// In this case there is no adapter so do nothing\n\t\t}\n }",
"public void EmptyList(){\n BusStopSearcherPresenter.setListview(initList(emptylist));\n }",
"public void buttonClearViewOnClick(View view){\n display.setText(\"\");\n operation= \"\";\n result = 0;\n}",
"private void btn_clearAllActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_clearAllActionPerformed\n \n //Code to remove all selected items \n txt_inDate.setDate(null);\n txt_iniId.setText(\"\");\n cbo_iniName.setSelectedItem(0);\n txt_inQty.setText(\"\");\n }",
"public void clear() {\n tweets.clear();\n notifyDataSetChanged();\n }",
"public void clear() \r\n\t{\r\n\t\ttotal = 0;\r\n\t\thistory = \"\";\r\n\t}",
"public void clear() {\n\t\tsuper.clear();\n\t\tthis.modelList.clear();\n\t\tif (elementoSeleccionar != null) {\n\t\t\tinsertItem(adapter.getListBoxDescription(elementoSeleccionar), elementoSeleccionar, 0);\n\t\t}\n\t}",
"protected void clearOnClickListener() {\n itemView.setOnClickListener(null);\n }",
"public void resetAll(View view){\n quantity = 1;\n displayQuantity(quantity);\n }",
"public void clear() {\n mItems.clear();\n notifyDataSetChanged();\n }",
"public void clear() {\n mItems.clear();\n notifyDataSetChanged();\n }",
"private void actionClear() {\n layoutPanel.inhNList.clear();\n layoutPanel.activeNList.clear();\n layoutPanel.probedNList.clear();\n\n Graphics g = layoutPanel.getGraphics();\n layoutPanel.writeToGraphics(g);\n }",
"public void clearItems(){\n conversationsList.clear();\n notifyDataSetChanged();\n }",
"public void clear() {\n mTweets.clear();\n notifyDataSetChanged();\n }",
"public void clear() {\n mTweets.clear();\n notifyDataSetChanged();\n }",
"public void clear() {\n mTweets.clear();\n notifyDataSetChanged();\n }",
"public void clear() {\n this.next = null;\n this.mList.clear();\n this.notifyDataSetChanged();\n }",
"public void reset() {\n this.list.clear();\n }",
"void clear()\n\t{\n\t\tgetItems().clear();\n\t}",
"public void clear() {\n\t\tshowList = new ArrayList<Slide>();\n\t\tsetSlideNumber(-1);\n\t}",
"private void clearFields() {\n Button clearButton = (Button) findViewById(R.id.activity_one_clear_button); //clear button declaration\n clearButton.setOnClickListener(new View.OnClickListener() //set listener for clear button\n {\n @Override\n public void onClick(View view) {\n EditText name = (EditText) findViewById(R.id.activity_one_name_editText); //name EditText declaration\n EditText email = (EditText) findViewById(R.id.activity_one_email_editText); //phone EditText declaration\n EditText number = (EditText) findViewById(R.id.activity_one_number_editText); //email EditText declaration\n Spinner phonespinner = (Spinner) findViewById(R.id.activity_one_phonetype_spinner); //phone type EditText declaration\n phonespinner.setSelection(Constants.HOME); //set spinner to first selection i.e home\n name.setText(Constants.CLEAR); //clear the name EditText\n email.setText(Constants.CLEAR); // clear the email EditText\n number.setText(Constants.CLEAR); //clear the number EditText\n }\n });\n }",
"private void clear() {\n\t\ttxtId.setText(\"\");\n\t\ttxtAlert.setText(\"\");\n\t\ttxtNbMax.setText(\"\");\n\t\t\n\t}",
"public void clearButton(View view)\n {\n question1.clearCheck();\n question2.clearCheck();\n question33.clearCheck();\n question44.clearCheck();\n question55.clearCheck();\n score.setText(\"\");\n }",
"private void butClearActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_butClearActionPerformed\n radDum.setSelected(true);\n radDum2.setSelected(true);\n tfBookID.setText(\"\");\n tfBorrowerID.setText(\"\");\n tfDate.setText(\"\");\n scrollPane.setViewportView(null);\n }",
"public void clear() {\n mStrings.clear();\n notifyDataSetChanged();\n }",
"public void clear() {\r\n items = Arrays.copyOf(new int[items.length], items.length);\r\n NumItems = 0;\r\n }",
"public void clear(){\r\n MetersList.clear();\r\n }",
"private void clearButtons()\n {\n // remove all saved search Buttons\n listTableLayout.removeAllViews();\n }",
"private void clearList() {\n for (JRadioButton task : toDoButtonList){\n task.setText(\"\");\n }\n }",
"private void clearBtn1ActionPerformed(java.awt.event.ActionEvent evt) {\n modelTxt.setText(\"\");\n catCombo.setSelectedIndex(0);\n rentTxt.setText(\"\");\n }",
"public void clear() {\r\n\t\tdisplayEntries.clear();\r\n\t\tupdate();\r\n\t}",
"@Override\n\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\tFinalDb db = Main.instance.getDb();\n\t\t\t\tdb.deleteAll(Temperature.class);\n\n\t\t\t\tListViewAdapter la = (ListViewAdapter) Main.instance.getListView().getAdapter();\n\t\t\t\tla.items.clear();\n\t\t\t\tla.notifyDataSetChanged();\n\t\t\t\tfinish();\n\t\t\t\t\n\t\t\t}",
"@Override\n public void actionPerformed(ActionEvent e) {\n clear();\n\n }",
"private void Clear() {\n AAccLevel_AdEdRe_TextF_AccLevelID.setText(\"\");\n AAccLevel_AdEdRe_TextF_AccLevelName.setText(\"\");\n AAccLevel_AdEdRe_TextA_Discription.setText(\"\");\n }",
"public void clear(){\n\n \tlist = new ArrayList();\n\n }",
"public void clearPressed() {\n PresentationCtrl.getInstance().clearHistory();\n refreshPressed();\n }",
"public void clearItemSelections() {\n mQuantityOrdered = new int[EMOJI_DOLLARSIGN.length];\n notifyDataSetChanged();\n if (mTotalItemsChangedListener != null) {\n mTotalItemsChangedListener.onTotalItemsChanged(0);\n }\n }",
"public void buttonClear(View v) {\n expression = \"\";\n\n TextView expressionText = (TextView) findViewById(R.id.expressionText);\n expressionText.setText(expression);\n\n EditText calculatorInput = (EditText) findViewById(R.id.calculatorInput);\n calculatorInput.setText(\"\");\n }",
"@Override\n\t\t\t\tpublic void onClick(ClickEvent event) {\n\t\t\t\t\tint removeIndex = listtel.indexOf(rowb);\n\t\t\t\t\tlisttel.remove(removeIndex);\n\t\t\t\t\tgetView().getTelefono().removeRow(removeIndex + 1);\n\t\t\t\t}",
"public void clear() {\n\t\tthis.count = (emptyItem ? 1 : 0);\n\t\tpages.clear();\n\t}",
"@FXML\n public void clear() {\n }",
"@FXML\n public void clear() {\n }",
"public void clear() {\n\t\tlists.clear();\n\t}",
"public void clear()\r\n {\r\n throw new RuntimeException(\"Cannot modify the display data.\");\r\n }",
"public void setClear()\n\t{\n\t\tsbm_consignCom1.db.remove(text_BookingID.getSelectedItem());\n\t\tsbm_consignCom1.cb.setSelectedItem(\"\");\n\t\ttext_advance.setText(\"\");\n\t\ttext_adults.setText(\"\");\n\t\ttext_children.setText(\"\");\n\t}",
"public final void clearForm() {\n\t\tlb.addItem(\"\");\n\t\tlb.clear();\n\t}",
"public void clearOrderView(){\n tableID_view.setText(\"Table: \");\n order.removeAll();\n orderLayout.removeAllViews();\n refreshPriceView();\n orderLayout.addView(build_header());\n }",
"public void clear(){\r\n BarsList.clear();\r\n }",
"public void clickClear2(View v) {\r\n\t\t\r\n\t\tport.setText(\"\");\r\n\t}",
"public void clear(){\n this.items.clear();\n }",
"public void clear() {\n mComments.clear();\n notifyDataSetChanged();\n }",
"public void clearList()\n {\n for (Category item : itemsList)\n {\n item.setSelected(false);\n }\n notifyDataSetChanged();\n }",
"public void clearData() {\n\t\tdrawnRect.clear();\n\t\tboxList.setListData(drawnRect);\n\t\tcurrRect = null;\n\t\ttextField.setText(\"\");\n\t}",
"public void clear() {\n history.clear();\n position = -1;\n }",
"private void clearJMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_clearJMenuItemActionPerformed\n // TODO add your handling code here:\n listModel.clear();\n printJMenuItem.setEnabled(false);\n }",
"public void clear() {\n\trows.removeAllElements();\n\tfireTableDataChanged();\n}",
"@Override\n\t\t\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\t\t\tmOptList.clear();\n\t\t\t\t\t\t\t\trenew();\n\t\t\t\t\t\t\t}",
"public void reset() {\n next = 0;\n renderList.clear();\n viewList.clear();\n }",
"public void clear()\n {\n int llSize = ll.getSize();\n for(int i=0; i<llSize; i++){\n ll.remove(0);\n }\n }",
"public void clearTable()\n\t{\n\t\tWListItemRenderer renderer = null;\n\n\t\t// First clear the model\n\t\tgetModel().clear();\n\n\t\t// Then the renderer\n\t\tif (getItemRenderer() instanceof WListItemRenderer)\n\t\t{\n\t\t\trenderer = (WListItemRenderer)getItemRenderer();\n\t\t\trenderer.clearSelection();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new IllegalArgumentException(\"Renderer must be instance of WListItemRenderer\");\n\t\t}\n\n\t\treturn;\n\t}",
"public static void clearReceipt()\r\n\t{\r\n\t\tlistModel.removeAllElements();\r\n\t\tsubtotalAmount = 0;\r\n\t\ttaxAmount = 0;\r\n\t\ttotalAmount = 0;\r\n\t}",
"public void onDestroyView() {\n super.onDestroyView();\n activity.setCastDetailsCreditsBundle(null);\n listView.setAdapter(null);\n }",
"public void clear(){\r\n \t\tcollapsingList.clear();\r\n \t}",
"@FXML\n public void clearPlanner(){\n\n String confirmationBoxTitle = \"Clear Planner\";\n String confirmationMessage = \"Are you sure you want to clear the planner?\";\n\n //If the user confirms to clear the planner from the dialog box\n if (plannerBox.confirmDiaglogBox(confirmationBoxTitle, confirmationMessage)){\n for (Days dm : weekList.getItems()){\n dm.setBreakfast(null);\n dm.setLunch(null);\n dm.setDinner(null);\n }\n breakfastCombo.getSelectionModel().clearSelection();\n lunchCombo.getSelectionModel().clearSelection();\n dinnerCombo.getSelectionModel().clearSelection();\n weekList.refresh();\n\n //if the shopping List is greater than 0 then the cleared planner will not be synced to the shopping List\n if (shoppingListIngredients.size() > 0){\n plannerOutOfSyncWithShoppingList(true);\n } else {\n plannerOutOfSyncWithShoppingList(false);\n }\n\n saveMealPlanner();\n }\n\n }",
"public void Clear(View v) {\r\n ClearAll();\r\n ControlsSetEnabled();\r\n\r\n }",
"@Override\n\tpublic void clear() {\n\n\t\tDisplay.findDisplay(uiThread).syncExec(new Runnable() {\n\n\t\t\tpublic void run() {\n\t\t\t\tclearInputs();\n\t\t\t\tsetDefaultValues();\n\t\t\t}\n\t\t});\n\n\t}",
"public void onClearGridButtonClick()\n {\n // CODE MISSING !\n // Should call ensureEmpty for every location in the grid.\n\n // Create a warning dialog box (JOptionPane).\n JOptionPane.showMessageDialog(null,\n \"The method for clearing the grid \" +\n \"has not been fully implemented yet.\",\n \"Under Development\",\n JOptionPane.WARNING_MESSAGE);\n\n // Display the grid after it has been completely cleared.\n display.showGrid();\n }",
"@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tclear();\r\n\t\t\t}",
"@Override\n public void onClick(View v) {\n clearFields();\n }",
"public void clearItems(){\n items.clear();\n }"
] | [
"0.7241737",
"0.715555",
"0.6778984",
"0.6778984",
"0.66800183",
"0.65658563",
"0.6538498",
"0.6410758",
"0.63852715",
"0.6381883",
"0.6349517",
"0.6309617",
"0.6295457",
"0.62703365",
"0.62305737",
"0.6220627",
"0.6209089",
"0.6192311",
"0.61890393",
"0.6168538",
"0.6159685",
"0.61180896",
"0.60904115",
"0.6083374",
"0.60804474",
"0.60794675",
"0.6066477",
"0.6065155",
"0.6060979",
"0.6056293",
"0.60420716",
"0.60300785",
"0.6026506",
"0.6025477",
"0.6023964",
"0.6016773",
"0.60075164",
"0.5997689",
"0.59954643",
"0.5979589",
"0.5979589",
"0.5974238",
"0.5972549",
"0.5956405",
"0.5956405",
"0.5956405",
"0.5951337",
"0.5929369",
"0.5904466",
"0.58992225",
"0.5893627",
"0.58622956",
"0.5853725",
"0.5831441",
"0.5819276",
"0.5788075",
"0.57861924",
"0.57812655",
"0.57795036",
"0.5772936",
"0.5770257",
"0.5761817",
"0.5749563",
"0.57493377",
"0.57491225",
"0.5748612",
"0.5741721",
"0.5738517",
"0.57245606",
"0.5719336",
"0.57168007",
"0.57168007",
"0.5713306",
"0.5708597",
"0.57023215",
"0.56996185",
"0.569228",
"0.56905824",
"0.5690581",
"0.569004",
"0.56789553",
"0.5676127",
"0.5674762",
"0.5672157",
"0.566633",
"0.565348",
"0.56513184",
"0.5644763",
"0.5630183",
"0.56296945",
"0.56249744",
"0.5618228",
"0.5615252",
"0.56141007",
"0.56110084",
"0.56097054",
"0.56088436",
"0.560452",
"0.5593283",
"0.55909574"
] | 0.6721091 | 4 |
create a file with the numbers 1..10, each on its own line. | @Override
protected Void doInBackground(Void... params) {
File file = new File(getApplicationContext().getFilesDir(), FILENAME);
PrintWriter writer = null;
try {
writer = new PrintWriter(file);
for (int i = 1; i <= 10; i++) {
writer.println(i);
Thread.sleep(250);
publishProgress(i * 10);
}
}
catch (FileNotFoundException | InterruptedException ex) {
Log.e(LOG_TAG, "createFile:" + ex.toString());
}
finally {
if (writer != null) {
writer.close();
}
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void main(String[] args) throws IOException\n {\n \n // Declare Variables \n int count = 0;\n \n // PrintWriter class to create and open new file\n PrintWriter outputFile = new PrintWriter(\"NumbersJamesM.txt\"); \n \n // For loop to add 1 to the number each time\n for (count = 1; count <= 10; count++) // Initilize count to 1,\n { // Run until count is more than 10\n // After each loop add 1 to count. \n \n outputFile.println(count); // Output current count number to outputFile\n \n } \n \n // Close the file \n outputFile.close();\n \n }",
"public void numeros() {\r\n \tint[] lista= new int[3001];\r\n\r\n\t\tFile crear = new File (\"Numerosaleatorios.txt\");\r\n \r\n\t\tFileWriter escribir = null;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tescribir = new FileWriter (crear);\r\n\t\t\tBufferedWriter escribir1 = new BufferedWriter (escribir);\r\n\t\t\tint linea;\r\n\t\t\tRandom aleatorios = new Random();\r\n\t\t\tfor (int i =0; i<3000; i++) {\r\n\t\t\t\tlinea = aleatorios.nextInt(1000);\r\n\t\t\t\tlista[i]= aleatorios.nextInt(1000);\r\n\t\t\t\tescribir1.write(linea + \"\\n\");\r\n\t\t}\r\n\t\t\r\n\t\tescribir.close();\r\n\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.exit(0);\r\n\t}\r\n\t}",
"public static void main(String[] args) throws IOException {\n\n Writer writer = new FileWriter(\"/home/levon/number1.txt\");\n\n\n for (int i = 93000000; i <= 93999999; i++) {\n writer.write(\"0\"+i+'\\n');\n }\n writer.close();\n\n FileReader fileReader =new FileReader(\"/home/levon/number1.txt\");\n BufferedReader reader = new BufferedReader(fileReader);\n\n String s = reader.readLine();\n Writer writer1 = new BufferedWriter(new FileWriter(\"/home/levon/number2.txt\"));\n while (true)\n writer1.write(s + String.format(\"Hello %h\", \"Levon\"));\n }",
"public void writeFile(){\n try{\n FileWriter writer = new FileWriter(\"Highscores.txt\");\n for (int i = 0; i<10; i++){\n if (i >= this.highscores.size()){\n break;\n }\n writer.write(String.valueOf(this.highscores.get(i)) + \"\\n\");\n }\n writer.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public static void randomNumsFile(String fileName, int howMany, int rangeFrom, int rangeTo) throws IOException\n {\n int temp; //to hold temporary value for swapping\n int number; //to hold generated random numbers\n if (rangeTo<rangeFrom) //check if upper limit is smaller than lower limit \n {\n //swap\n temp = rangeFrom;\n rangeFrom = rangeTo;\n rangeTo = temp;\n } \n // Open the file.\n PrintWriter outputFile = new PrintWriter(fileName);\n\n // Get data and write it to the file.\n for (int i = 1; i <= howMany; i++)\n {\n Random randomNumber = new Random();//set up an object to generate random nubmers\n number = randomNumber.nextInt((rangeTo - rangeFrom) + 1) + rangeFrom; // generate random number\n // Write the number to the file.\n outputFile.println(number);\n }\n // Close the file.\n outputFile.close();\n }",
"public void writeTextFile(int[][] a, int n) {\n\t\ttry {\n\t\t\twriter = new PrintWriter(new BufferedWriter(new FileWriter(filename,true)));\n\t\t\twriter.print(\"_|_\");\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\twriter.print(i + 1 + \"_\");\n\t\t\twriter.println();\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\twriter.print(i + 1 + \"| \");\n\t\t\t\tfor (int j = 0; j < n; j++) {\n\t\t\t\t\twriter.print(a[i][j] + \" \");\n\t\t\t\t}\n\t\t\t\twriter.println();\n\t\t\t}\n\t\t\twriter.println();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Could not write to\\t\\\"\" + filename + \"\\\"\");\n\t\t\tSystem.out.println(e.getMessage());\n\t\t\te.printStackTrace();\n\t\t}finally{\n\t\t\twriter.close();\n\t\t}\n\t\t\n\t}",
"public static void main(String[] args) throws Exception {\n FileOutputStream file = new FileOutputStream(\"randoms.txt\");\n PrintWriter output = new PrintWriter(file);\n\n //write 100 random numbers to the file\n\n\n\n\n //open the file for input\n\n\n\n\n //print the sorted array on the screen\n\n\n\n}",
"public void outputByRows(String filename) throws IOException {\n BufferedWriter rowsWriter = new BufferedWriter(new FileWriter(new File(filename)));\n for (int i = 0; i < this.numRows; i++) {\n for (int j = 0; j < this.rows[i].length; j++) {\n if (j > 0) {\n rowsWriter.write(\" \");\n }\n // Add 1 to get back 1-indexing\n rowsWriter.write(Integer.toString(this.rows[i][j] + 1));\n }\n rowsWriter.newLine();\n }\n rowsWriter.close();\n }",
"void addFile(int numberLines);",
"public void createFiles() {\r\n try {\r\n FileWriter file = new FileWriter(registerNumber + \".txt\");\r\n file.write(\"Name : \" + name + \"\\n\");\r\n file.write(\"Surname : \" + surname + \"\\n\");\r\n file.write(\"Registration Number : \" + registerNumber + \"\\n\");\r\n file.write(\"Position : \" + position + \"\\n\");\r\n file.write(\"Year of Start : \" + yearOfStart + \"\\n\");\r\n file.write(\"Total Salary : \" + Math.round(totalSalary) + \".00 TL\" +\"\\n\");\r\n file.close();\r\n }\r\n catch(IOException e) {\r\n e.printStackTrace();\r\n }\r\n }",
"public static void main(String args[])throws FileNotFoundException {\n PrintStream diskWriter = new PrintStream(new File(\"please.txt\"));\n\n\n int numbers=0;\n Random myRandom = new Random();\n numbers = myRandom.nextInt(10)+1;\n diskWriter.println(numbers);\n System.out.println(numbers);\n\n\n numbers = myRandom.nextInt(10)+1;\n diskWriter.println(numbers);\n System.out.println(numbers);\n //numbers = myRandom.nextInt(10)+1;\n //diskWriter.println(numbers);\n //System.out.println(diskScanner.next());\n\n //numbers = myRandom.nextInt(10)+1;\n //diskWriter.println(numbers);\n // System.out.println(diskScanner.next());\n\n //numbers = myRandom.nextInt(10)+1;\n //diskWriter.println(numbers);\n // System.out.println(diskScanner.next());\n\n //numbers = myRandom.nextInt(10)+1;\n //diskWriter.println(numbers);\n //System.out.println(diskScanner.next());\n\n // numbers = myRandom.nextInt(10)+1;\n //diskWriter.println(numbers);\n //System.out.println(diskScanner.next());\n\n // numbers = myRandom.nextInt(10)+1;\n // diskWriter.println(numbers);\n // System.out.println(diskScanner.next());\n\n }",
"public void writeToFile() {\n try {\n // stworz plik\n File file = new File(\"../Alice.ids\");\n // stworz bufor zapisu do pliku\n FileWriter fileWriter = new FileWriter(file);\n for(int i = 0; i < identificationNumbers.length; i++) {\n for(int j = 0; j < identificationNumbers[i].length; j++)\n fileWriter.write(Integer.toString(identificationNumbers[i][j]));\n\t\t\t fileWriter.write(\"\\n\");\n }\n\t\t\tfileWriter.flush();\n\t\t\tfileWriter.close();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }",
"public void output2File(String outputName, ArrayList<Integer> source){\n this.outputContent = new StringBuilder();\n Iterator<Integer> itr = source.iterator();\n\n while(itr.hasNext()){\n this.outputContent.append((itr.next().intValue()));\n this.outputContent.append(\" \");\n }\n\n try {\n FileWriter fileWriter = new FileWriter(outputName, true);\n fileWriter.write(this.outputContent.toString());\n fileWriter.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }",
"public void printPopulationToFile(int i) throws IOException {\n\t\tFileWriter fstream;\n\t\tBufferedWriter out;\n\n\t\tFile f = new File(FILENAME);\n\t\tif (!f.isFile()) {\n\t\t\ttry { // Create file\n\t\t\t\tfstream = new FileWriter(FILENAME);\n\t\t\t\tout = new BufferedWriter(fstream);\n\t\t\t\tout.write(\"Generation: \" + i + \"\\r\\n\");\n\n\t\t\t\tfor (AI ai : this.individuals) {\n\t\t\t\t\tout.write(ai.toString() + \"\\r\\n\");\n\t\t\t\t}\n\t\t\t\t// Close the output stream\n\t\t\t\tout.close();\n\t\t\t} catch (Exception e) { // Catch exception if any\n\t\t\t\tSystem.err.println(\"Error: \" + e.getMessage());\n\t\t\t}\n\t\t} else {\n\t\t\ttry { // append to file if file already exists\n\t\t\t\tfstream = new FileWriter(FILENAME, true);\n\t\t\t\tout = new BufferedWriter(fstream);\n\t\t\t\tout.write(\"Generation: \" + i + \"\\r\\n\");\n\t\t\t\tfor (AI ai : this.individuals) {\n\t\t\t\t\tout.write(ai.toString() + \"\\r\\n\");\n\t\t\t\t}\n\t\t\t\tout.close();\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.err.println(\"Error: \" + e.getMessage());\n\t\t\t}\n\t\t}\n\t}",
"@Test\r\n\tpublic void generateFile() {\n\t\tfor (int i = 1; i <= 5; i++) {\r\n\t\t\t// String filePath = \"C://Users//AtifKhan//Desktop//sample-\" + i +\r\n\t\t\t// \".csv\";\r\n\t\t\tString filePath = \"C://Users//olcay tarazan//Desktop//sample-\" + i + \".csv\";\r\n\t\t\tint numberOfDataLines = 400;\r\n\t\t\ttry {\r\n\t\t\t\tgenerateCsvFile(filePath, numberOfDataLines);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"File generated : sample-\" + i + \".csv \");\r\n\t\t}\r\n\t}",
"private String createNumberLine(){\n StringBuilder numberLine = new StringBuilder();\n for(int i = 0; i < this.columns; i++){\n numberLine.append(i + 1).append(\" \");\n }\n return numberLine.toString();\n }",
"public static void writeNumberToFile() {\n try {\n FileOutputStream outputStream = new FileOutputStream(\"ex1.txt\");\n outputStream.write(String.valueOf(53).getBytes());\n } catch (FileNotFoundException e) {\n // handle FileNotFoundException\n } catch (IOException e) {\n // handle IOException\n } finally {\n System.out.println(\"Finally block\");\n }\n }",
"public static File generateTestInput(int min, int max, int size) throws IOException\r\n {\r\n int i;\r\n File data = new File(DATA_FILE_NAME);\r\n data.createNewFile();\r\n //try (FileWriter writer = new FileWriter(data)) {\r\n FileWriter writer = new FileWriter(data);\r\n writer.write(String.valueOf(size));\r\n writer.write(\" \");\r\n for (i = 0; i < size; i++)\r\n {\r\n Random rand = new Random();\r\n writer.write(String.valueOf(rand.nextInt(max - min + 1) + min));\r\n writer.write(\" \");\r\n }\r\n writer.flush();\r\n writer.close();\r\n //}\r\n return data;\r\n }",
"public void writeOutputToFile(ArrayList<Object> transformNums) throws IOException {\r\n FileWriter file = new FileWriter(writeFilename);\r\n\r\n for(int i=0; i<transformNums.size(); i++){\r\n file.write(transformNums.get(i)+\" \");\r\n }\r\n\r\n file.close();\r\n\r\n }",
"private static void printNumber(){\r\n\t\tfor(int i = 1;i <= 10; i++)\r\n\t\t\tSystem.out.println(i);\r\n\t}",
"public static void makeText(double[] numbers){\r\n\t\tPrintWriter outStream = null;\r\n\t\ttry {\r\n\t\t\toutStream = new PrintWriter(new FileOutputStream(\"textFile.txt\"));\r\n\t\t} catch(FileNotFoundException e){\r\n\t\t\tSystem.out.println(\"Error opening the file\");\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\t\tfor (double x : AvgAndStanDev.tehNumbs){\r\n\t\t\toutStream.println(x);\r\n\t\t}\r\n\t\tSystem.out.println(\"Text File Created\");\r\n\t\toutStream.close();\t\t//Important to close so that we can re-open later\r\n\t}",
"public static File createTestFile(File file, long length) throws IOException {\n FileOutputStream output = new FileOutputStream(file);\n for (long i = 0; i < length; i++) {\n output.write((int) i);\n }\n output.close();\n return file;\n }",
"public static void textFile() throws IOException\n \t{ \n \t// Initialize the list\n \tArrayList<String[]> list = new ArrayList<String[]>();\n \t// Calling to random string generated by the randGenerator function! \n \tlist.add(new String[] {Datatostring});\n \t\t // File writer\n \tFileWriter Datawriter = new FileWriter(\"NumOUTPUT.txt\",true); // by adding true at the end is save to text file without overwriting older data\n \t\n \t\n \t// For loop for list data\n \tfor(String[] arr: list)\n \t{\n \t\tString appender = \"\";\n \t\tfor(String s : arr)\n \t\t{\n \t\tDatawriter.write(appender + s);\n \t\t\tappender = \",\";\n \t\t}\n \t\tDatawriter.flush();\n \t}\n \tDatawriter.close();\n }",
"public void writeScoresToFile(File f) throws IOException, FileNotFoundException{\r\n\t\tBufferedWriter bw = null;\r\n\t\ttry{\r\n\t\t\tFileWriter fw = new FileWriter(f);\r\n\t\t\tbw = new BufferedWriter(fw);\r\n\t\t\t\r\n\t\t\tfor (int count = 0; count < scores.length; count++){\r\n\t\t\t\tbw.write(scores[9-count].getInitials()+SEPARATOR+scores[9-count].getScore());\r\n\t\t\t\tbw.newLine();\r\n\t\t\t}\r\n\t\t} catch (Exception ex){\r\n\t\t\tSystem.err.println(\"Trouble with file: \" +ex.getMessage());\r\n\t\t} finally {\r\n\t\t\ttry{\r\n\t\t\t\tif (bw != null){\r\n\t\t\t\t\tbw.close();\r\n\t\t\t\t}\r\n\t\t\t} catch (Exception ex1) {\r\n\t\t\t\tex1.printStackTrace();\r\n\t\t\t\tSystem.exit(-1);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private static void writeToFileEmployees() throws IOException {\n FileWriter write = new FileWriter(path2, append);\n PrintWriter print_line = new PrintWriter(write);\n for (int i = 0; i < RegisteredEmployees.listOfEmployees.size(); i++) {\n ArrayList<Integer> list = RegisteredEmployees.getEmployeeList();\n Integer ID = list.get(i);\n textLine = String.valueOf(ID);\n print_line.printf(\"%s\" + \"%n\", textLine);\n }\n print_line.close();\n }",
"public static void main(String [] args){\n writeFile1(\"1234567890987654321\");\n }",
"public static void main(String[] args) throws IOException {\n\t\tFileWriter fw = new FileWriter(\"C:\\\\Users\\\\·ùÇÑ¿\\\\Desktop\\\\Data.csv\");\n\t\tfor(int i = 11; i <16; i++) {\n\t\t\tString data = \"Linssse #\" + i + \"\\n\";\n\t\t\tfw.write(data);\n\t\t}\n\t\t}",
"public static void createFile(double[] array){\n //String for the name of the file that's going to be created.\n String newFileName = \"results.csv\";\n\n //Create a file variable using the created file name\n try{\n File newFile = new File(newFileName);\n\n //Create new instance of PrintWriter to write into the new file\n FileWriter csvWriter = new FileWriter(newFile, false);\n //For each number, print the percentage into the file\n for(int i = 0; i < 9; i++){\n csvWriter.write((i+1) + \": \" + array[i] + \"%\\n\");\n }\n //Close the PrintWriter since we don't need it anymore.\n csvWriter.close();\n }\n catch(FileNotFoundException e){\n System.out.println(\"File not found\");\n }\n catch(IOException e){\n System.out.println(\"IO Exception\");\n }\n }",
"public static void main(String[] args) {\nint i=1;\nwhile(i<=10)\n{\n\tSystem.out.println(i+\"raj\");//display nos from 1 to 10 and raj \n\ti=i+1;\n}\n\t}",
"public static void main(String[] args) {\n\t\tint [] gnumber = new int[101];\n\t\tint one,ten,hundred;\n\n\n\t\tfor (int i = 0; i < gnumber.length; i++) {\n\t\t\tone = i % 10;\n\t\t\tten = (i /10) % 10;\n\t\t\thundred = (i/100) % 10;\n\t\t\tgnumber[i] = i+one+ten+hundred;\n\t\t}\n\t\t\n\t\tSystem.out.format(\"%-10s%s\\n\", \"Index\",\"Generated Number\");\n\t\t\n\t\tfor (int i = 0; i < gnumber.length; i++) {\n\t\t\tSystem.out.format(\"%-10d%d\\n\", i,gnumber[i]);\n\t\t}\n\t}",
"public static void main(String[] args) throws IOException {\n\n long count=0;\n int line_num = 0;\n try{\n\n File file = new File(\"C:\\\\Users\\\\achyutha.aluru\\\\Desktop\\\\Files\\\\newfile_shortest1.txt\");\n PrintWriter writer = new PrintWriter(file, \"UTF-8\");\n\n\n Random random = new Random();\n// int randomInt = random.nextInt(10);\n for(long i = 0; i < 5000; i++) //858993451 for 6.2gb\n { \n char[] word = new char[random.nextInt(8)+3]; // words of length 3 through 10. (1 and 2 letter words are boring.)\n count+=word.length;\n for(int j = 0; j < word.length; j++)\n {\n word[j] = (char)('a' + random.nextInt(26));\n\n }\n writer.print(new String(word) + ' ');\n count+=1;\n if (i % 10 == 0){\n writer.print(\".\");\n// writer.print(\"\\n\");\n line_num+=1;\n count+=1;\n }\n// if (line_num == randomInt) {\n// \twriter.print(\"\\n\");\n// \tline_num=0;\n// \trandomInt = random.nextInt(10);\n// }\n }\n writer.close();\n } catch (IOException e) {\n // do something\n }\n \n FileWrite fw = new FileWrite();\n fw.AppendToFile(\"C:\\\\\\\\Users\\\\\\\\achyutha.aluru\\\\\\\\Desktop\\\\\\\\Files\\\\\\\\newfile_shortest1.txt\");\n System.out.println(count);\n\n}",
"public void toFile(String filename) {\n\t\tsortPool();\n\t\ttry (BufferedWriter bw = new BufferedWriter(new FileWriter(filename))) {\n\t\t\tfor(int i = 0; i < genepool.size(); i++) {\n\t\t\t\tbw.write(genepool.get(i).toWrite());\n\t\t\t\tbw.newLine();\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public static void main(String[] args) throws IOException {\n PrintWriter outputFile = new PrintWriter(\"ResultFile.txt\");\n\n outputFile.println(\"Line 1\");\n outputFile.println(\"Line 2\");\n outputFile.println(\"Line 3\");\n outputFile.println(\"Line 4\");\n\n\n outputFile.close();\n\n }",
"public static void generateCostTable(int n, String fileName) \r\n\tthrows FileNotFoundException {\r\n\t\tPrintStream output = new PrintStream(new File(fileName));\r\n\t\t\r\n\t\tfor(int i = 0; i < n; i++) {\r\n\t\t\tfor(int j = 0; j < n; j++) {\r\n\t\t\t\tif(i > j) {\r\n\t\t\t\t\toutput.print(\"NA\\t\");\r\n\t\t\t\t}\r\n\t\t\t\telse if(i == j) {\r\n\t\t\t\t\toutput.print(0 + \"\\t\");\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t// randCost between 1 inclusive and MAX_COST inclusive\r\n\t\t\t\t\tint randCost = (new Random().nextInt(MAX_COST)) + 1; \r\n\t\t\t\t\toutput.print(randCost + \"\\t\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\toutput.println();\r\n\t\t}\r\n\t\t\r\n\t\toutput.close();\r\n\t}",
"void startFile() {\n writeToFile(defaultScore);\n for (int i = 0; i < 5; i++) {\n writeToFile(readFromFile() + defaultScore);\n }\n }",
"public static void addLines(File f) throws Exception\n {\n PrintStream out = new PrintStream(\"temp_2.txt\");\n BufferedReader b = new BufferedReader(new FileReader(f));\n\n int length = -1;\n while(b.ready())\n {\n String line = b.readLine();\n if(line.endsWith(\"\\t\")) {\n out.println(line + \"0\");\n length = line.split(\"\\t\").length;\n }\n else {\n length = line.split(\"\\t\").length+1;\n out.println(line + \"\\t0\");\n }\n }\n for(int i = 0; i < length;i++)\n {\n if(i==length-1)\n out.println(\"0\");\n else\n out.print(\"0\\t\");\n }\n out.flush();\n out.close();\n b.close();\n }",
"private static void writeToBuffer(int index, RandomAccessFile fos) {\n\n try {\n\n // x is the current integer value to be written.\n int x;\n // loc is the current location in the buffer to be written.\n int loc = 0;\n\n // iterates through each value in the sorted integer array.\n for (int k = 0; k < index; k++) {\n // gets the current integer.\n x = ints[k];\n\n // checks if the buffer is full.\n if (loc == BUF_SIZE) {\n // if the buffer is full, write its contents out to the file.\n fos.write(buf);\n // the buffer has been emptied, so set its current location back to the start.\n loc = 0;\n }\n\n // convert the current integer value to be written to a byte array.\n buf[loc] = (byte) (x >> 24);\n buf[loc + 1] = (byte) (x >> 16);\n buf[loc + 2] = (byte) (x >> 8);\n buf[loc + 3] = (byte) (x);\n\n // increment the location in the buffer now that a value has been written in.\n loc += BYTES_TO_INTS;\n }\n\n if (loc > 0) {\n // if there are any values left over in the buffer, write them out to the file.\n fos.write(buf, 0, loc);\n\n }\n } catch (IOException e){\n e.printStackTrace();\n }\n }",
"public void displayToFile(){\n String data = \"\";\n try{\n FileWriter fstream = new FileWriter(\"output.txt\", true);\n BufferedWriter out = new BufferedWriter(fstream);\n\n for (int i=0 ; i<40; i++) {\n for (int j=0; j<146 ;j++ ){\n if (board.getCharacter(j,i) == '0') {\n data += '-';\n } else {\n data += board.getCharacter(j,i);\n }\n }\n out.write(data);\n data = \"\";\n }\t\n out.close();\n } catch (Exception e){\n System.err.println(\"Error: \" + e.getMessage());\n }\n }",
"public void printToFile(Path filename) {\n\t\t\n\t\tlock.lockRead();\n\t\ttry{\n//\t\t\t create a new file if it is not existed; \n//\t\t\t otherwise delete previous one and create a new one.\n\t\t\tif(!Files.exists(filename)){\n\t\t\t\ttry {\n\t\t\t\t\tFiles.createFile(filename);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\ttry {\n\t\t\t\t\tFiles.delete(filename);\n\t\t\t\t\tFiles.createFile(filename);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(String hotelId : hotelMap.keySet()){\n\t\t\t\tString output = this.toString(hotelId);\n\t\t\t\t\t\t\t\n\t\t\t\t// start of the hotel.\n\t\t\t\tString emptyLine = \"\\n\";\n\t\t\t\tString ast = \"********************\";\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tFiles.write(filename, emptyLine.getBytes(), StandardOpenOption.APPEND);\n\t\t\t\t\tFiles.write(filename, ast.getBytes(), StandardOpenOption.APPEND);\n\t\t\t\t\tFiles.write(filename, emptyLine.getBytes(), StandardOpenOption.APPEND);\n\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry{\n\t\t\t\t\tFiles.write(filename, output.getBytes(), StandardOpenOption.APPEND);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfinally{\n\t\t\tlock.unlockRead();\n\t\t}\n\t\t\t\n\t}",
"private static void writeFile(String filePath) {\n\t\tFileWriter file = null;\n\t\tPrintWriter printWriter = null;\n\t\t\n\t\ttry {\n\t\t\t// Create the printer.\n\t\t\tfile = new FileWriter(filePath);\n\t\t\tprintWriter = new PrintWriter(file);\n\t\t\t\n\t\t\t// Create the output.\n\t\t\tString output = Integer.toString(slideList.size());\n\t\t\t\n\t\t\tfor (Slide slide : slideList) {\n\t\t\t\toutput = output.concat(BREAK_LINE).concat(Integer.toString(slide.getId1()));\n\t\t\t\t\n\t\t\t\tif (slide.getId1() != slide.getId2()) {\n\t\t\t\t\toutput = output.concat(ONE_SPACE).concat(Integer.toString(slide.getId2()));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Print the output in the file.\n\t\t\tprintWriter.print(output);\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Error while writing the output file: \" + e);\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tprintWriter.close();\n\t\t\t\tfile.close();\n\t\t\t\tSystem.out.println(\">> Output file has been written!\");\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.out.println(\"Error while closing the output file: \" + e);\n\t\t\t}\n\t\t}\n\t}",
"public static void main(String[] args){\n for(int i = 23; i <= 89; i++){\n System.out.print(i + \" \");\n if(i % 10 == 2)\n System.out.print(\"\\n\"); }\n }",
"public static void main(String[] args){\n\n for(int n = 2; n < 102; n+=2)System.out.printf(\"%d\\n\",n);\n \n \n }",
"public static void WriteToFile(){\r\n try {\r\n File file = new File(\"output.txt\");\r\n file.createNewFile();\r\n \r\n FileWriter fw = new FileWriter(file.getAbsoluteFile());\r\n BufferedWriter bw = new BufferedWriter(fw);\r\n String[] FinalBoard = new String[Board.ReportBoardValues().length];\r\n FinalBoard = Board.ReportBoardValues();\r\n for(int i = 0; i < Board.ReportBoardValues().length; i++){\r\n bw.write(FinalBoard[i]);\r\n bw.newLine();\r\n }\r\n bw.close();\r\n fw.close();\r\n \r\n }\r\n catch (IOException e) {\r\n System.out.println (\"Output error\");\r\n }\r\n }",
"private void writeToFile(){\n try(BufferedWriter br = new BufferedWriter(new FileWriter(filename))){\n for(Teme x:getAll())\n br.write(x.toString()+\"\\n\");\n br.close();\n }catch (IOException e){\n e.printStackTrace();\n }\n }",
"public static void main(String[] args){\n int number = Integer.parseInt(args[0]);\n \n if (number >= 10000) {\n \twriteNumber(number / 1000);\n \twriteNumber(1000);\n number %= 1000;\n\t\t}\n \n if(number >= 1000) {\n writeNumber(number / 1000);\n writeNumber(1000);\n number %= 1000;\n }\n\n if(number >= 100) {\n writeNumber(number / 100);\n writeNumber(100);\n number %= 100;\n }\n\n if(number <= 20) {\n writeNumber(number);\n } else if(number < 100) {\n writeNumber(number / 10 * 10);\n \n writeNumber(number % 10);\n \n }\n }",
"private static void createCSV(String filename, ArrayList<Long> sizes, ArrayList<Long> times){\n File csv = new File(\"\"+filename);\n try {\n if(csv.createNewFile()) {\n PrintWriter file = new PrintWriter(new FileWriter(csv));\n file.print(\"Size (n)\");\n for (Long size : sizes)\n file.print(\",\" + size);\n file.print(\"\\nTimes (ms)\");\n for(Long time:times)\n file.print(\",\"+time);\n file.println();\n file.close();\n\n } else {\n Scanner fileReader = new Scanner(csv);\n String currentSizes = fileReader.nextLine();\n int size=currentSizes.split(\",\").length-1;\n if(size<sizes.size()){\n for(int i=size;i<sizes.size();i++)\n currentSizes+=\",\"+sizes.get(i);\n currentSizes+=\"\\n\";\n while(fileReader.hasNextLine())\n currentSizes+=fileReader.nextLine()+\"\\n\";\n FileWriter writer = new FileWriter(csv);\n writer.write(currentSizes);\n writer.close();\n }\n\n PrintWriter file = new PrintWriter(new FileWriter(csv,true));\n file.print(\"Times (ms)\");\n for(Long time:times)\n file.print(\",\"+time);\n file.println();\n file.close();\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public void writeMatrix(String filename, int[][] matrix) {\n\n\t try {\n\t FileWriter writer = new FileWriter(filename, true);\n\t for (int i = 0; i < matrix.length; i++) {\n\t for (int j = 0; j < matrix[i].length; j++) {\n\t \tint loc = ClusterTAD.startloc + (matrix[i][j]* ClusterTAD.Resolution);\n\t writer.write(loc + \"\\t\");\n\t }\n\t //this is the code that you change, this will make a new line between each y value in the array\n\t writer.write(\"\\n\"); // write new line\n\t }\n\t writer.close();\n\t } catch (IOException e) {\n\t e.printStackTrace();\n\t }\n\n\t}",
"private void makeTestLines(int n) {\n testLines = new ArrayList<>();\n for (int i = 0; i < n; i += 1) {\n testLines.add(\"Line \" + i);\n }\n }",
"public static void main(String[] args) {\n\t\twriteNums(12);\r\n\t\tSystem.out.println();\r\n\r\n\t\twriteNums(6);\r\n\t\tSystem.out.println();\r\n\r\n\t\twriteNums(2);\r\n\t\tSystem.out.println();\r\n\r\n\t\twriteNums(0);\r\n\t\tSystem.out.println();\r\n\r\n\t}",
"public static void main( String[] args )\n \n {\n \tString filenamePrefix = \"esa0000\";\n \tfor(int i=22;i<164;i++){\n \t\tFile file = new File(\"C:\\\\work\\\\10.6\\\\reporting_10.6\\\\ASOC-1529\\\\poc\\\\src\\\\main\\\\java\\\\org\\\\somtest\\\\poc\\\\\"+filenamePrefix+i);\n if (!file.exists()) {\n try {\n\t\t\t\t\tfile.createNewFile();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n }\n \t}\n \t\n }",
"private Line[] makeTenRandomLines() {\n Random rand = new Random(); // create a random-number generator\n Line[] lines = new Line[NUM_LINE];\n for (int i = 0; i < NUM_LINE; ++i) {\n int x1 = rand.nextInt(400) + 1; // get integer in range 1-400\n int y1 = rand.nextInt(300) + 1; // get integer in range 1-300\n int x2 = rand.nextInt(400) + 1; // get integer in range 1-400\n int y2 = rand.nextInt(300) + 1; // get integer in range 1-300\n lines[i] = new Line(x1, y1, x2, y2);\n }\n return lines;\n }",
"public static void main(String[] args) {\nint[] num = new int[10];\r\nfor (int i= 0; i < 10; i++) {\r\n\tnum[i] = ((i+1)*10);\r\n}\r\nint i=0;\r\nwhile(i<10) {\r\n\tSystem.out.println(\"num[\"+ i + \"]\" + num[i]);\r\n\ti++;\r\n\r\n}\r\n\t}",
"public void saveFile(int theValue) {\n if (!outputInitialized) {\n return;\n }\n int largest = 0;\n for (int i=0; i<totSamples.length; i++) {\n if (totSamples[i]> largest) {\n largest = totSamples[i];\n }\n //myArray[i] = list_Samples[i].getListBoxItems();\n }\n String fname = ano + nf(mes, 2)+ nf(dia, 2) + nf(hora, 2) + nf(min, 2) + nf(sec, 2);\n foutput = createWriter(\"dados_\"+fname +\".csv\");\n\n\n\n for (int i=0; i<largest; i++) {\n String line =\"\";\n String[] val = new String[6];\n for (int j=0; j < numSamples; j++) {\n if (i < totSamples[j]) {\n ListBoxItem lb1 = list_Samples[j].getItem(i);\n val[j]=lb1.getText();\n } else {\n val[j]=\"\";\n }\n line += val[j]+\",\";\n } \n if (outputInitialized) {\n foutput.println(i+\",\"+line);\n }\n }\n foutput.flush(); // Writes the remaining data to the file\n foutput.close();\n}",
"public void backup_StudentNumber(int number){\n try {\n outputStreamWriter = new OutputStreamWriter(context.openFileOutput(Constant.STUDENT_NUMBER_FILE, Context.MODE_PRIVATE));\n outputStreamWriter.write(number+\",\");\n outputStreamWriter.close();\n }\n catch (Exception e){\n Message.logMessages(\"ERROR: \",e.toString());\n }\n }",
"public static void writeArray(String fileName, int[] array) throws Exception{\n\n // Create DataOutputStream to create a binary file.\n // Use fileName from Demo file and write from the array\n DataOutputStream output = new DataOutputStream(new FileOutputStream(fileName));\n\n // for each number in array\n for(int i : array) {\n //write the number to the binary file\n output.writeInt(i);\n }\n\n // close the output file\n output.close();\n }",
"private void writeTotalsToFile(PrintWriter writer) {\n Set set = tokenSizes.entrySet();\n String delimiter = \"\\t\";\n\n // Use of Iterator for the while loop that is no longer being used.\n // Iterator iterator = set.iterator();\n \n for(Map.Entry<Integer, Integer> entry : tokenSizes.entrySet()) {\n writer.println(entry.getKey() + delimiter + entry.getValue());\n } \n\n /**\n * This is a while loop I used in project 1 but Paula told me to use an \n * enhanced for loop instead. \n * \n * while (iterator.hasNext()) {\n * Map.Entry me = (Map.Entry) iterator.next();\n * writer.println(me.getKey() + \"\\t\" + me.getValue());\n * }\n */\n }",
"public static void writeFile(ArrayList<Integer> data, String path) {\n\t\ttry {\n\t\t\tFileOutputStream fos = new FileOutputStream(path);\n\t\t\tOutputStreamWriter osw = new OutputStreamWriter(fos);\n\t\t\tBufferedWriter bw = new BufferedWriter(osw);\n\n//\t\t\tfor (String dt : data) {\n//\t\t\t\tbw.write(dt);\n//\t\t\t\tbw.newLine();\n//\t\t\t}\n\n\t\t\tfor (int i = 0; i < data.size(); i++) {\n\t\t\t\tbw.write(data.get(i).toString());\n\t\t\t\tif (i < data.size() - 1)\n\t\t\t\t\tbw.write(\", \");\n\n\t\t\t\t// bw.newLine();\n\t\t\t}\n\t\t\tbw.newLine();\n\t\t\tbw.close();\n\t\t\tosw.close();\n\t\t\tfos.close();\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public void generateReport(){\n String fileOutput = \"\";\n fileOutput += allCustomers()+\"\\n\";\n fileOutput += getNoAccounts()+\"\\n\";\n fileOutput += getTotalDeposits()+\"\\n\";\n fileOutput += accountsOfferingLoans()+\"\\n\";\n fileOutput += accountsReceivingLoans()+\"\\n\";\n fileOutput += customersOfferingLoans()+\"\\n\";\n fileOutput += customersReceivingLoans()+\"\\n\";\n System.out.println(fileOutput);\n writeToFile(fileOutput);\n }",
"private void writeToFile(){\r\n File file = new File(\"leaderboard.txt\");\r\n\r\n try {\r\n FileWriter fr = new FileWriter(file, true);\r\n BufferedWriter br = new BufferedWriter(fr);\r\n for(Player player : this.sortedPlayers){\r\n br.write(player.toString());\r\n br.write(\"\\n\");\r\n }\r\n br.close();\r\n fr.close();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n }",
"public void writeCSVLine(int[] entries) {\n\t\tint size = entries.length;\n\t\tString[] convertedEntries = new String[size];\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tconvertedEntries[i] = Integer.toString(entries[i]);\n\t\t}\n\t\twriter.writeNext(convertedEntries);\n\t}",
"public static void main(String[] args) throws IOException{\n\t\tBufferedReader in =new BufferedReader(new FileReader(input));\r\n\tPrintWriter out = new PrintWriter(new FileWriter(output));\r\n\t\t\r\n\t\tint t = Integer.parseInt(in.readLine());\r\n\t\t\r\n\t\tfor(int i=1; i<=t; i++){\r\n\t\t\tout.print(\"Case #\"+i+\": \");\r\n\t\t\tint n = Integer.parseInt(in.readLine());\r\n\t\t\toneTest(n, in, out);\r\n\t\t\tout.println();\r\n\t\t}\r\n\t\tout.flush();\r\n\t}",
"public static void pattern10(int input){\n\t\tfor(int i= input;i >0;i--){\n\t\t\tfor(int j=i;j<=input;j++){\n\t\t\t\tSystem.out.print(j+\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"public void writeGridToFile(int[][] writtenGrid) throws IOException {\n StringBuilder sb = new StringBuilder();\n int count = 0;\n for (int i = 0; i < 9; i++) {\n for (int j = 0; j < 9; j++) {\n sb.append(count).append(\",\").append(writtenGrid[i][j]).append(\"\\n\");\n count++;\n }\n }\n try {\n FileWriter fw = new FileWriter(\"grid.txt\");\n fw.write(sb.toString());\n fw.close();\n } catch (IOException e) {\n System.out.println(\"An error occurred.\");\n e.printStackTrace();\n }\n }",
"void writeRepetitionCount(int count);",
"public static void generateLogFile (int numberOfMembers, int numberOfTimestamps) {\n\t\ttry {\n\t\t\tPath logFile = Files.createTempFile(\"logFile\", \".txt\");\n\t\t\tBufferedWriter bw = new BufferedWriter(new FileWriter(logFile.toFile()));\n\t\t\tRandom rand = new Random();\n\t\t\tLinkedList<String> list = new LinkedList<>();\n\t\t\tfor (int i = 0; i < numberOfTimestamps; i++) {\n\t\t\t\tint hours = rand.nextInt(24);\n\t\t\t\tint minutes = rand.nextInt(60);\n\t\t\t\tint seconds = rand.nextInt(60);\n\t\t\t\tint p = rand.nextInt(numberOfMembers);\n\t\t\t\tint q;\n\t\t\t\tdo {\n\t\t\t\tq = rand.nextInt(numberOfMembers);\n\t\t\t\t} while (q == p);\n\t\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\t\tsb.append(hours);\n\t\t\t\tsb.append(\":\");\n\t\t\t\tsb.append(minutes);\n\t\t\t\tsb.append(\":\");\n\t\t\t\tsb.append(seconds);\n\t\t\t\tsb.append(\" \");\n\t\t\t\tsb.append(p);\n\t\t\t\tsb.append(\" \");\n\t\t\t\tsb.append(q);\n\t\t\t\tsb.append(\"\\n\");\n\t\t\t\tlist.add(sb.toString());\n\t\t\t}\n\t\t\tCollections.sort(list);\n\t\t\tfor (String line : list) {\n\t\t\t\tbw.write(line);\t\n\t\t\t}\n\t\t\tbw.close();\n\t\t\tpath = logFile.toString();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"private static void outputResult(int result, File file) {\n\n try (FileWriter fileWriter = new FileWriter(file)) {\n fileWriter.write(result + \"\");\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n }",
"private void createSaveData(){\n try {\n File f = new File(filePath, highScores);\n FileWriter output = new FileWriter(f);\n BufferedWriter writer = new BufferedWriter(output);\n\n writer.write(\"0-0-0-0-0\");\n writer.newLine();\n writer.write(\".....-.....-.....-.....-.....\");\n writer.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"public void writeToFile(RandomAccessFile fio) {\n try {\n fio.writeInt(number);\n fio.writeUTF(name);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }",
"static void createNewFile(String path) \n\t\t{\n\t\tLinkedList<String> defaultData = new LinkedList<String>();\n\t\tdefaultData.add(\"1,Frank,West,98,95,87,78,77,80\");\n\t\tdefaultData.add(\"2,Dianne,Greene,78,94,88,87,95,92\");\n\t\tdefaultData.add(\"3,Doug,Lei,78,94,88,87,95,92\");\n\t\tdefaultData.add(\"4,James,Hewlett,69,92,74,77,89,91\");\n\t\tdefaultData.add(\"5,Aroha,Wright,97,92,87,83,82,92\");\n\t\t\n\t\ttry \n\t\t{\n\t\t\tPrintWriter newFile = new PrintWriter(path, \"UTF-8\"); // Create .txt file in given path\n\t\t\t\n\t\t\tfor (String s : defaultData) \n\t\t\t{\n\t\t\t\tnewFile.println(s); // Write To file\n\t\t\t}\n\t\t\t\n\t\t\tnewFile.close(); // Close File\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 (UnsupportedEncodingException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tSystem.out.println(\"studentData.txt Created Successfully!\");\n\t\t\n\t}",
"public void generate(File file) throws IOException;",
"private static void printNumbers(String f1) throws IOException {\n DataInputStream in = readFile(f1,f1,true);\n System.out.println(\"\\nThe numbers in \" + f1 + \" are :\");\n int i=0;\n while(i<20 && in.available()>=4){ //print first 20 numbers\n int val = in.readInt();\n System.out.print(val + \" \");\n\n i++;\n\n }\n }",
"private static void printSortedArray(String outputFileName) {\n try {\n File output = new File(outputFileName);\n BufferedWriter writer = new BufferedWriter(new FileWriter(output));\n for(int i = 0; i < array.length; i++) {\n writer.write(array[i] + \"\\n\");\n }\n writer.close();\n }\n catch(IOException e){\n System.out.println(\"File Error\");\n }\n }",
"public String getNumbers(){\n StringBuilder htmlNumbers = new StringBuilder(\"<h2>\");\n for (int i = 1; i<=10; i++){\n htmlNumbers.append(String.valueOf(i) + \".<br>\");\n }\n htmlNumbers.append(\"</h2>\");\n return htmlNumbers.toString();\n }",
"private static void writeRow(PrintStream out, double[] vals, int digits) {\n final String fmt = String.format(\"%%.%df\", digits);\n DoubleFunction<String> fmtVal = v -> String.format(fmt, v);\n writeRow(out, DoubleStream.of(vals).mapToObj(fmtVal)\n .toArray(n -> new String[n]));\n }",
"private void outputToFile() {\n\t\tPath filePath = Paths.get(outputFile);\n\n\t\ttry (BufferedWriter writer = Files.newBufferedWriter(filePath,\n\t\t\t\tCharset.forName(\"UTF-8\"));) {\n\t\t\tRowIterator iterator = currentGen.iterateRows();\n\t\t\twhile (iterator.hasNext()) {\n\t\t\t\tElemIterator elem = iterator.next();\n\t\t\t\twhile (elem.hasNext()) {\n\t\t\t\t\tMatrixElem mElem = elem.next();\n\t\t\t\t\twriter.write(mElem.rowIndex() + \",\" + mElem.columnIndex());\n\t\t\t\t\twriter.newLine();\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Unable to write to the provided file\");\n\t\t}\n\n\t}",
"private static void writeToOrder() throws IOException {\n FileWriter write = new FileWriter(path5, append);\n PrintWriter print_line = new PrintWriter(write);\n ArrayList<Order> orders = Inventory.getOrderHistory();\n for (int i = 0; i < orders.size(); i++) {\n Order o = (Order) orders.get(i);\n\n String orderNum = String.valueOf(o.getOrderNumber());\n String UPC = String.valueOf(o.getUpc());\n String productName = o.getProductName();\n String distName = o.getDistributorName();\n String cost = String.valueOf(o.getCost());\n String quantity = String.valueOf(o.getQuantity());\n String isProcesed = String.valueOf(o.isProcessed());\n\n textLine =\n orderNum + \", \" + UPC + \", \" + quantity + \",\" + productName + \", \" + distName + \", \" + cost\n + \", \" + isProcesed;\n print_line.printf(\"%s\" + \"%n\", textLine);\n\n }\n print_line.close();\n\n }",
"public void startNumberMethod(int startNumber) {\n for (int i = startNumber; i <= 100; i++) {\n System.out.println(i);\n }\n }",
"public void writer(List<String> toStore) throws IOException{\n //creates writer and clears file\n PrintWriter writer = new PrintWriter(\"output.txt\", \"UTF-8\");\n //for each loop to store all the values in the file into the file named output.txt\n for(String s : toStore)\n //stores the strings for outputting\n writer.println(s);\n //closes the writer and outputs to the file\n writer.close();\n }",
"private static void myLine(int zahl) {\n\n for (int i = 7; i < zahl; i += 7) {\n System.out.print(i + \" \");\n }\n }",
"public static void main(String[] args) {\n Scanner scan =new Scanner(System.in);\n\n System.out.println(\"What's the path to the file?\");\n String path = scan.next();\n System.out.println(\"What text should i put there?\");\n String text = scan.next();\n System.out.println(\"How many lines of it?\");\n int lines = scan.nextInt();\n //while loop for asking number lines>0\n\n writeMoreLinesIntoFile(path, text, lines);\n }",
"private static void printNos() {\n\t\tfor(int i=0; i<=10; i++) { //this is a single line comment\n\t\t\tSystem.out.println(i);\n\t\t}\n\t\t/*\n\t\t * this is a multiline comment\n\t\t */\n\t}",
"private static String create50DigitString(){\n StringBuilder sb = new StringBuilder(\"1\");\n for(int i = 1; i < 50; i++){\n sb.append(\"0\");\n }\n return sb.toString();\n }",
"public static String createString(int integer){\n StringBuilder result = new StringBuilder(\"\");\n\n for(int i = 0; i < 20; i++){\n result.append(integer);\n }\n\n result.append(\"\\n\");\n return result.toString();\n }",
"public void CreateCsv1(int[][]a,int[] b,int[][] c,String C)throws IOException{\r\n int [][] sample = new int[a.length][b.length*2]; \r\n try( PrintWriter writer = new PrintWriter(new File(C))){ \r\n StringBuilder sb = new StringBuilder();\r\n \r\n for( int i =0;i<a.length;i++){\r\n for( int j =0;j<(b.length);j++){\r\n\r\n sample[i][j*2+1] =c[i][b[j]]; \r\n sample[i][j*2]= a[i][j]-c[i][b[j]];\r\n \r\n }\r\n }\r\n \r\n for( int i =0;i<sample.length;i++){\r\n for( int j =0;j<sample[0].length;j++){\r\n if(j%2==0){\r\n \r\n for( int k=j-1;k>=0;k--){\r\n sample[i][j] -= sample[i][k];\r\n }\r\n \r\n }\r\n }\r\n }\r\n\r\n for( int i =0;i<b.length;i++){\r\n sb.append(\"Start\").append(\",\").append(\"Job\").append(b[i]+1).append(',');//.append(\"End\").append(\",\");\r\n }\r\n sb.append(\"\\n\");\r\n for( int i =0;i<a.length;i++){\r\n\r\n for(int j=0;j<sample[i].length;j++){ \r\n sb.append(sample[i][j]).append(',');\r\n\r\n \r\n \r\n }\r\n sb.append(\"\\n\");\r\n }\r\n writer.write(sb.toString());\r\n }\r\n \r\n catch(FileNotFoundException e){\r\n System.out.println(e.getMessage());\r\n }\r\n \r\n}",
"private void createExecutableFile() throws IOException {\r\n //if (report.getErrorList() == null)\r\n //{\r\n System.out.println(\"Currently generating the executable file.....\");\r\n executableFile = new File(sourceName + \".lst\");\r\n // if creating the lst file is successful, then you can start to write in the lst file\r\n executableFile.delete();\r\n if (executableFile.createNewFile()) {\r\n writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(sourceName + \".asm\"), \"utf-8\")); //create an object to write into the lst file\r\n\r\n String [] hex = generate.split(\" \");\r\n\r\n for (int index = 0; index < hex.length; index++) {\r\n String hex1 = hex[index].trim();\r\n System.out.println(hex1);\r\n\r\n int i = Integer.parseInt(hex1, 16);\r\n String bin = Integer.toBinaryString(i);\r\n System.out.println(bin);\r\n\r\n writer.write(bin); // once the instruction is converted to binary it is written into the exe file\r\n }\r\n\r\n writer.close();\r\n\r\n }\r\n }",
"public static void main(String[] args) throws IOException {\n \r\nFile f=new File(\"d:\\\\addition.txt\");\r\nString s=\" addition\"+\"\\n\"+( 2+ 1);\r\n FileOutputStream fos=new FileOutputStream(f,true);\r\n byte[] b=s.getBytes();\r\n fos.write(13);\r\n fos.write(b);\r\n fos.flush();\r\n\t}",
"private void writeFile(File file, String... lines) throws IOException {\n try (BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(file))) {\n for (String line : lines) {\n bufferedWriter.write(line);\n bufferedWriter.newLine();\n }\n }\n }",
"public static void printNum() {\n\t\tfor(int i = 1; i<= 20; i++) {\n\t\t\tSystem.out.print(\" \" + i);\n\t\t}\n\t\tSystem.out.println(\"\\n\");\n\t\t}",
"public static void writeFile(ArrayList<String> lines, String fileName)\n {\n try\n {\n // Create file \n FileWriter fstream = new FileWriter(fileName);\n BufferedWriter out = new BufferedWriter(fstream);\n for (String line: lines)\n {\n out.write(line);\n }\n //Close the output stream\n out.close();\n }\n catch (Exception e){//Catch exception if any\n System.err.println(\"Error: \" + e.getMessage());\n }\n }",
"private void writeCsv(float[] vals, String stimulus, PrintWriter outfile) throws FileNotFoundException {\n for (int i = 0; i < vals.length; i++) {\n outfile.append(vals[i] + \",\");\n }\n outfile.append(stimulus);\n outfile.append(\"\\n\");\n\n }",
"private void writeToFile(List<Record> records) {\n try (\n FileWriter writer = new FileWriter(FILE_PATH);\n BufferedWriter bufferedWriter =\n new BufferedWriter(writer);\n PrintWriter out = new PrintWriter(bufferedWriter)\n\n ) {\n\n for (Record record : records) {\n out.format(\"%d;%s;%s;%s;%s;%s\\n\",\n record.getId(),\n record.getFirstName(),\n record.getLastName(),\n record.getPhone().getNumber(),\n record.getPhone().getType(),\n record.getCategory().getId());\n }\n// writer.close();\n out.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n\n\n }",
"public static int append(int numElements, int[] vals) throws IOException{\r\n\t\t\r\n\t\tFile myFile = new File(\"newValues.txt\"); // making a new file for the new values that will be appended\r\n\t\tScanner inputFile1 = new Scanner(myFile); // reading the file\r\n\t\t\r\n\t\tint newValue = 0; // declaring needed variable\r\n\t\t\r\n\t\twhile(inputFile1.hasNext()) {\r\n\t\t\t\r\n\t\t\tnewValue = inputFile1.nextInt(); // will simply store into the initial array starting at where the initial array ends.\r\n\t\t\tvals[numElements] = newValue;\r\n\t\t\tnumElements++;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\r\n\t\tinputFile1.close();\r\n\t\t\r\n\t\treturn numElements; // return value to main\r\n\t}",
"public static void writeTextToFile() {\n try {\n FileOutputStream outputStream = new FileOutputStream(\"ex1.txt\");\n int number = Integer.parseInt(\"2f5\");\n outputStream.write(String.valueOf(number).getBytes());\n\n } catch (IOException | NumberFormatException e) {\n // handle exception\n } finally {\n System.out.println(\"Finally block\");\n }\n }",
"public static void customerGen() {\n BufferedReader fname, lname;\r\n ArrayList<String> firstN = new ArrayList(),\r\n lastN = new ArrayList();\r\n int id = (int)Math.pow(10,IDDIGIT - 1);\r\n try {\r\n fname = new BufferedReader(new FileReader(\"firstName.txt\"));\r\n lname = new BufferedReader(new FileReader(\"lastName.txt\"));\r\n String line;\r\n while((line = fname.readLine()) != null) {firstN.add(line);}\r\n while((line = lname.readLine()) != null) {lastN.add(line);}\r\n fname.close();\r\n lname.close();\r\n } catch(Exception e){e.printStackTrace();}\r\n for(int j = 0; j < COUNT; j++){\r\n id ++;\r\n String n = nameGen(firstN,lastN);\r\n long i = phoneGen();\r\n System.out.printf(\"insert into customer values(%d,%20s,%10d);\",id,n,i);\r\n }\r\n }",
"void create() {\n\t\ttry {\n\t\t\tFile file = new File(\"Student.txt\");\n\t\t\t//File named Student.txt is created\n\t\t\tboolean x = file.createNewFile();\n\t\t\tif (x) {\n\t\t\t\tSystem.out.println(\"File has been created successfully! \");\n\t\t\t//Message of successful creation after new file is created\n\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"File already present\");\n\t\t\t\t//message if file already exists\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Exception Occurred:\");\n\n\t\t}\t\t\t\t\n\t\t\n\t\t\t\t\n\t\ttry {\n\t\tPrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter(\"Student.txt\", true)));\n\t\tint x = 1;\n\t\t\n\t\tdo {\n\t\t\tScanner sc = new Scanner(System.in);\n\t\t\tint y;\n\t\t\t//take input from user for name,roll no and mobile no.\n\t\t\t\n\t\t\tSystem.out.print(\"\\nEnter Student Name: \");\n\t\t\tstudentname = br.readLine();\n\t\t\t\n\t\t\tSystem.out.print(\"Student Roll no: \");\n\t\t\trollno = Integer.parseInt(br.readLine());\t\t\n\t\t\t\n\t\t\tSystem.out.print(\"Mobile Number: \");\n\t\t\tmob_no = Integer.parseInt(br.readLine());\n\t\t\t\n\t\t\tSystem.out.print(\"Marks : \");\n\t\t\tmarks = Float.parseFloat(br.readLine());\n\t\t\t\n\t\t\t//display student data\n\n\t\t\tpw.println(studentname + \"\\t\" + rollno + \"\\t\" + marks + \"\\t\" + mob_no);\n\t\t\t\n\t\t\tSystem.out.println(\"Do you want to enter more records? \\n1) Yes\\n2) No\");\n\t\t\t\n\t\t\ty = sc.nextInt();\n\t\t\t\n\t\t\tif(y == 2) {\n\t\t\t\tx = 0;\n\t\t\t}\n\t\t}while(x==1); //loop to add more records\n\t\tpw.close();\n\t\t}catch(IOException e) {\n\t\t\tSystem.out.println(e);\n\t\t}\n\t\t\n\t}",
"void writeNumber(Number num);",
"public static void usePrintWriter(String fileName, int size, String[] stable) throws IOException\n\t{\n\t \n\t FileWriter fileWriter = new FileWriter(fileName);\n\t PrintWriter printWriter = new PrintWriter(fileWriter);\n\t \n\t \n\t\tfor(int i = 0; i < size; i++)\n\t\t{\n\t\t\tint man = i + 1;\n\t\t\tint woman = Integer.parseInt(stable[i]) + 1;\n\t\t\tprintWriter.println(man + \" \" + woman);\n\t\t}\n\t printWriter.close();\n\t}",
"public static void main(String[] args) {\n\n Scanner myScanner = new Scanner(System.in);\n int numero;\n int i;\n\n System.out.println(\"Ingrese un numero\");\n numero = myScanner.nextInt();\n\n for (i = numero; i<=numero+20; i ++) {\n System.out.println(i);\n }\n\n\n }",
"public static void main(String[] args) {\n List<Integer> id = new ArrayList<>();\r\n for(int i=0 ; i<=10 ;i++){\r\n \t id.add(i);\r\n }\r\n System.out.println(id);\r\n\t}",
"private static void WriteMostFrequentTwoGramsToFile(List<String> input) throws IOException{\n\t\tFile file =new File(filewriteto);\n\t\tFileWriter writer = new FileWriter(file);\n\t\tStringBuffer buffer = new StringBuffer();\n\t\tfor(int i=0; i<input.size();i++)\n\t\t\tbuffer.append(input.get(i)+'\\n');\n\t\twriter.write(buffer.toString());\n\t\twriter.close();\n\t}"
] | [
"0.71012115",
"0.62990016",
"0.61574644",
"0.61409706",
"0.6052335",
"0.5985886",
"0.59809095",
"0.5797125",
"0.57791656",
"0.57476336",
"0.5692907",
"0.5688058",
"0.56084967",
"0.5569259",
"0.5549093",
"0.54970646",
"0.54434264",
"0.5422138",
"0.54088086",
"0.536705",
"0.5362693",
"0.53599906",
"0.5340544",
"0.5328185",
"0.5308763",
"0.5285454",
"0.52595586",
"0.5250342",
"0.52496475",
"0.5244822",
"0.5225022",
"0.5208703",
"0.5197955",
"0.51873165",
"0.5173125",
"0.51678723",
"0.51673234",
"0.5166003",
"0.515527",
"0.5149938",
"0.5126741",
"0.5124464",
"0.51205766",
"0.50817484",
"0.5080988",
"0.50757617",
"0.5057344",
"0.505019",
"0.5041145",
"0.5040097",
"0.50195396",
"0.50167996",
"0.5014839",
"0.50132096",
"0.50109977",
"0.50085646",
"0.500735",
"0.5006045",
"0.50053847",
"0.5001654",
"0.49908534",
"0.4978762",
"0.49736968",
"0.49651176",
"0.49635407",
"0.49619946",
"0.49395916",
"0.4935959",
"0.49304074",
"0.49205497",
"0.49167824",
"0.4900415",
"0.48946136",
"0.4891631",
"0.48902178",
"0.48852",
"0.48850924",
"0.48848566",
"0.48757237",
"0.48749682",
"0.487018",
"0.48500207",
"0.4848982",
"0.48458",
"0.48414242",
"0.4839799",
"0.48375857",
"0.48354763",
"0.48320562",
"0.48316905",
"0.4816914",
"0.48134276",
"0.48105508",
"0.48080292",
"0.4806663",
"0.48058346",
"0.4803627",
"0.47987136",
"0.47900862",
"0.47887218"
] | 0.5279286 | 26 |
load the file of numbers, linebyline, into an array. | @Override
protected List<String> doInBackground(Void... params) {
File file = new File(getApplicationContext().getFilesDir(), FILENAME);
BufferedReader reader = null;
List<String> list = new ArrayList<>();
try {
reader = new BufferedReader(new FileReader(file));
String s;
int progress = 0;
while ((s = reader.readLine()) != null) {
list.add(s);
Thread.sleep(250);
progress += 10;
publishProgress(progress);
}
}
catch (IOException | InterruptedException ex) {
Log.e(LOG_TAG, "loadFile:" + ex.toString());
}
finally {
if (reader != null) {
try {
reader.close();
}
catch(IOException ex) {
// do nothing
}
}
}
return list;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static int[] readMysteriousNumbers(String filename) throws Exception {\n File file = new File(filename);\n Scanner counter = new Scanner(file);\n int numLines = 0;\n while(counter.hasNextLine()){\n counter.nextLine();\n numLines++;\n }\n int[] arr = new int[numLines];\n\n\n\n Scanner reader = new Scanner(file);\n int index = 0;\n while(reader.hasNextLine()){\n arr[index] = Integer.parseInt(reader.nextLine());\n index++;\n }\n\n\n\n\n return arr;\n /*\n List<Integer> nums = new ArrayList<>();\n while (scanner.hasNextInt()) {\n nums.add(scanner.nextInt());\n }\n int[] ret = new int[nums.size()];\n for(int i = 0;i < ret.length;i++) {\n ret[i] = nums.get(i);\n }\n return ret*/\n }",
"private static void readFileIntoArray (String inputFileName) {\n Path path = Paths.get(inputFileName);\n array = new int[countLines(inputFileName)];\n try {\n Scanner sc = new Scanner(path);\n int i = 0;\n while (sc.hasNextLine()) {\n array[i] = Integer.parseInt(sc.nextLine());\n i++;\n }\n sc.close();\n //sort the array\n MergeSort.mergeSort(array);\n }\n catch(FileNotFoundException e) {\n System.out.println(\"File Error\");\n e.printStackTrace();\n }\n catch(IOException e) {\n System.out.println(\"File Error\");\n e.printStackTrace();\n }\n }",
"private static int[] readData(int size, String filename) throws FileNotFoundException {\n\t\tint[] input = new int[size];\t\n\t\tScanner scanner = new Scanner(new File(filename));\n \n int i = 0;\n while (scanner.hasNext() && i < size)\n {\n \tinput[i] = Integer.parseInt(scanner.next());\n \ti++;\n }\n scanner.close();\n\t return input;\n\t}",
"public ArrayList<Integer> readNumbersFromFile() throws FileNotFoundException {\r\n ArrayList<Integer> arrayList = new ArrayList<>();\r\n File file = new File(readFilename);\r\n Scanner scanner = new Scanner(file);\r\n while(scanner.hasNextInt())\r\n {\r\n arrayList.add(scanner.nextInt());\r\n }\r\n return arrayList;\r\n }",
"public static void readFile() {\n\t\tbufferedReader = null;\n\t\ttry {\n\t\t\tFileReader fileReader = new FileReader(\"/home/bridgeit/Desktop/number.txt\");\n\t\t\tbufferedReader = new BufferedReader(fileReader);\n\n\t\t\tString line;\n\t\t\twhile ((line = bufferedReader.readLine()) != null) {\n\t\t\t\tString[] strings = line.split(\" \");\n\t\t\t\tfor (String integers : strings) {\n\t\t\t\t\thl.add(Integer.parseInt(integers));\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"File Not Found...\");\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\ttry {\n\t\t\tbufferedReader.close();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}",
"public void loadEPILine(File file)\r\n\t{\r\n\t\tString name=file.getName();\r\n\t\tint [][] result=null;\r\n\t\ttry \r\n\t\t{\r\n\t\t\tScanner scanner=new Scanner(file);\r\n\t\t\tint size=scanner.nextInt();\r\n\t\t\tint width=scanner.nextInt();\t\t\t\r\n\t\t\tresult=new int[size][width];\r\n\t\t\tscanner.useDelimiter(\",\");\r\n\t\t\tString temp;\r\n\t\t\tfor(int i=0;i<size;i++)\r\n\t\t\t\tfor(int j=0;j<width;j++)\r\n\t\t\t\t{\r\n\t\t\t\t\ttemp=scanner.next();\r\n\t\t\t\t\tresult[i][j]=Integer.parseInt(temp.trim());\r\n\t\t\t\t}\r\n\t\t\tscanner.close();\t\r\n\t\t} catch (FileNotFoundException e) \r\n\t\t{\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t_pixels=result;\r\n\t\t\r\n\t\t//That's why I needed to get rid of \"_\" in directory name\r\n\t\tname=name.substring(0,name.lastIndexOf(\".\"));\r\n\t\tString[] split=name.split(\"_\");\r\n\t\t_line=Integer.parseInt(split[1])+1;\r\n\t\t_position=Position.valueOf(split[2]);\r\n\t\t\r\n\t}",
"public static Integer[] readInputArrayFromFile(Integer[] array, String fileName) {\n\n\t\tList<Integer> ints = readInputArrayFromFile(fileName);\n\n\t\tarray = new Integer[ints.size()];\n\t\tfor (int i = 0; i < ints.size(); i++) {\n\t\t\tarray[i] = ints.get(i);\n\t\t}\n\t\treturn array;\n\t}",
"private ArrayList<Integer> fileReader() {\n ArrayList<Integer> data = new ArrayList<>();\n try {\n Scanner scanner = new Scanner(new File(\"andmed.txt\"));\n while (scanner.hasNextLine()) {\n data.add(Integer.valueOf(scanner.nextLine()));\n }\n scanner.close();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n return data;\n }",
"public ArrayList<Integer> readFile(File file) {\n\t\tArrayList<Integer> fileData = new ArrayList<Integer>();\n\t\t// read the file\n\t\ttry {\n\t\t\tScanner sc = new Scanner(file);\n\t\t\twhile (sc.hasNextInt()) {\n\t\t\t\tfileData.add(sc.nextInt());\n\t\t\t}\n\t\t\tsc.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"An error occurred.\");\n\t\t e.printStackTrace();\n\t\t}\n\t\treturn fileData;\n\t}",
"public static int[] firstNum(File file) {\n int lineCount = dataNum(file); // Storing the return of dataNum method as an integer\n int[] firstNum = new int[lineCount]; // Making an int array with an index the same as the lineCount\n String line = \"\"; // Blank string so it can be used anywhere in method \n \n try { // Try catch\n Scanner scan = new Scanner(file); // Scans file that was specified\n for(int i = 0; i < lineCount; i++) { // For loop that runs as many times as line count\n if (scan.hasNextLine()) { // When there is a next line\n line = scan.nextLine(); // The line is stored in the string \"line\"\n }\n if (Character.isDigit(line.charAt(4)) == false) { // If the 4th character in the line is not an integer\n if (scan.hasNextLine()) { // And there is a line after\n line = scan.nextLine(); // The program skips the line with no integer and scans the next line instead\n }\n }\n char first = line.charAt(4); // The 4th character is stored in a char variable\n int num = Character.getNumericValue(first); // The character is then converted to an integer\n firstNum[i] = num; // That integer is stored in the int array at the index number equal to the times the for loop ran\n //System.out.println(firstNum[i]);\n }\n } catch (FileNotFoundException e) { // If error occurs\n System.out.println(\"An error has occured\"); // Prints that the error has occured\n }\n return firstNum; // Returns the int array with all the values stored\n }",
"public void readIn(String file) {\r\n\r\n\t\ttry {\r\n\r\n\t\t\t/** Initialise loop variable **/\r\n\r\n\t\t\tusedSize = 0;\r\n\r\n\t\t\t/** Set up file for reading **/\r\n\r\n\t\t\tFileReader reader = new FileReader(file);\r\n\r\n\t\t\tScanner in = new Scanner(reader);\r\n\r\n\t\t\t/** Loop round reading in data while array not full **/\r\n\r\n\t\t\twhile (in.hasNextInt() && (usedSize < size)) {\r\n\r\n\t\t\t\tA[usedSize] = in.nextInt();\r\n\r\n\t\t\t\tusedSize++;\r\n\r\n\t\t\t}\r\n\r\n\t\t} catch (IOException e) {\r\n\r\n\t\t\tSystem.out.println(\"Error processing file \" + file);\r\n\r\n\t\t}\r\n\r\n\t}",
"private int[][] readPuzzle(File f) throws NumberFormatException, IOException {\n\t\tint[][] out = new int[N + 1][N + 1];\n\t\tBufferedReader br = new BufferedReader(new FileReader(f));\n\t\tString line = null;\n\t\tint row = 1;\n\t\ttry {\n\t\t\twhile ((line = br.readLine()) != null) {\n\t\t\t\tif (line.isBlank() || row > N)\n\t\t\t\t\tcontinue;\n\t\t\t\tString[] vals = line.split(\" \");\n\t\t\t\tif (vals.length != N)\n\t\t\t\t\treturn null;\n\t\t\t\tfor (int j = 0; j < vals.length; j++) {\n\t\t\t\t\tout[row][j + 1] = Integer.parseInt(vals[j]);\n\t\t\t\t}\n\t\t\t\trow++;\n\t\t\t}\n\t\t} finally {\n\t\t\tbr.close();\n\t\t}\n\t\treturn out;\n\t}",
"public ArrayList<BigInteger> read(String fileName) {\n String line = null; // current line from text file\n String[] numbers = null;\n try {\n BufferedReader lineReader = new BufferedReader\n ( (fileName == null || fileName.length() <= 0 || fileName.equals(\"-\"))\n ? new InputStreamReader(System.in)\n : new FileReader(fileName)\n );\n while ((line = lineReader.readLine()) != null) { // read and process lines\n if (! line.matches(\"\\\\s*#.*\") && ! line.matches(\"\\\\s*\")) { // no comment line, no empty line\n numbers = line.trim().split(\"\\\\s+\");\n int last = numbers.length - 1;\n /*\n try {\n int index = Integer.parseInt(numbers[0]);\n } catch (Exception exc) {\n }\n */\n sequence.add(new BigInteger(numbers[last]));\n } else {\n // ignore comment line\n }\n } // while ! eof\n lineReader.close();\n } catch (Exception exc) {\n log.error(exc.getMessage(), exc);\n } // try\n return sequence;\n }",
"public static int[][] read(String fileName) throws FileNotFoundException {\r\n int i = -1;\r\n int j;\r\n\r\n int row = 1;\r\n int col = 0;\r\n\r\n Scanner read = new Scanner(new File(\".\\\\data\\\\mountain.paths\\\\\" + fileName));\r\n StringTokenizer st = new StringTokenizer(read.nextLine());\r\n\r\n while (st.hasMoreTokens()) {\r\n st.nextToken();\r\n col++;\r\n }\r\n\r\n while (read.hasNextLine()) {\r\n read.nextLine();\r\n row++;\r\n }\r\n\r\n read = new Scanner(new File(\".\\\\data\\\\mountain.paths\\\\\" + fileName));\r\n int[][] data = new int[row][col];\r\n\r\n while (read.hasNextLine()) {\r\n j = -1;\r\n i++;\r\n st = new StringTokenizer(read.nextLine());\r\n while (st.hasMoreTokens()) {\r\n j++;\r\n data[i][j] = Integer.parseInt(st.nextToken());\r\n }\r\n }\r\n return data;\r\n }",
"public static void readNumbers(String filePath, int[] nums) {\n JSONParser parser = new JSONParser();\n try {\n JSONObject jsonObject = (JSONObject) parser.parse(new FileReader(filePath));\n nums[0] = Integer.parseInt((String) jsonObject.get(\"number of primary\"));\n nums[1] = Integer.parseInt((String) jsonObject.get(\"number of backup\"));\n } catch (IOException | ParseException e) {\n e.printStackTrace();\n }\n\n }",
"private static int[][] readInput() throws Exception {\r\n\t\t\r\n\t\t// Read the input into a array of strings.\r\n\t\tList<String> inputLines = new ArrayList<String>();\r\n\t\tString currLine = \"\";\r\n\t\ttry {\r\n\t\t\t// Read the content of the file into an array of strings.\r\n\t\t\tScanner myScanner = new Scanner(new File(myFileName));\r\n\t\t\twhile((currLine = myScanner.nextLine()) != null) {\r\n\t\t\t\t\r\n\t\t\t\tinputLines.add(currLine);\r\n\r\n\t\t\t\tif (!myScanner.hasNextLine()) {\r\n\t\t\t\t\tmyScanner.close();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Based out of the number of lines in the input file\r\n\t\t\t// create a nXn matrix.\r\n\t\t\tint max = inputLines.size();\r\n\t\t\tint[][] data = new int[max][max];\r\n\t\t\tint count = 0;\r\n\t\t\t\r\n\t\t\tfor (int i = 0; i < max; i++) {\r\n\t\t\t\tfor (int j = 0; j < max; j++) {\r\n\t\t\t\t\tdata[i][j] = INFINITY;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Populate the nXn matrix.\r\n\t\t\tfor(int i = 0; i < inputLines.size(); i++) {\r\n\t\t\t\tcurrLine = inputLines.get(i);\r\n\t\t\t\tString[] splitLine = currLine.split(\"\\t\");\r\n\t\t\t\tfor(int j = 0; j < splitLine.length; j++) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tdata[count][j] = Integer.parseInt(splitLine[j]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcatch (NumberFormatException ex) { \r\n\t\t\t\t\t\t//do nothing\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tcount++;\r\n\t\t\t}\t\t\t\r\n\t\t\treturn data;\r\n\t\t\t\r\n\t\t} catch(Exception ex) {\r\n\t\t\tSystem.out.println(ex.toString());\r\n\t\t\tthrow ex;\r\n\t\t}\r\n\t}",
"private Point[] readTestFile(String filename) {\n In in = new In(filename);\n int N = in.readInt();\n Point[] points = new Point[N];\n for (int i = 0; i < N; i++) {\n int x = in.readInt();\n int y = in.readInt();\n points[i] = new Point(x, y);\n }\n return points;\n }",
"public static int [] readMatrix(){\n int[] matrix=null;\n try {\n String linea;\n if((linea = br.readLine()) != null){\n String[] split = linea.split(\",\");\n matrix = new int[split.length];\n for (int i = 0; i < matrix.length; i++) {\n matrix[i] = Integer.parseInt(split[i]);\n }\n }else{\n br.close();\n }\n } catch (IOException ex) {\n System.err.println(\"Error al leer del buffer\");\n }\n return matrix;\n }",
"public Double[] getNumbers() throws IOException {\n List<String> numbersStrs= Files.readAllLines(Paths.get(\"C:\\\\Users\\\\user\\\\Desktop\\\\Software construction git repo\\\\calculator\\\\src\\\\java\\\\com\\\\kelaniya\\\\uni\\\\numbers.txt\"));\n double number1=Integer.parseInt(numbersStrs.get(0));\n double number2=Integer.parseInt(numbersStrs.get(1));\n return new Double[] {number1,number2};\n\n }",
"static int [] readFile() throws IOException {\n\n // Scanner used to get name of file from user\n Scanner in = new Scanner(System.in);\n System.out.println(\"Please enter the name of your file: \");\n String name = in.nextLine();\n\n File file = new File(name); \n \n // Scanner used to read file\n Scanner inputFile = new Scanner(file); \n // reads first line of file for length of array\n int x = inputFile.nextInt();\n\n //Creates array \n int [] scores = new int[x]; \n\n for (int i=0; i<x; i++) {\n int value = inputFile.nextInt();\n scores[i] = value;\n }\n inputFile.close();\n in.close();\n return scores; \n }",
"public static PVector[] readFromFile(String filename) {\n ArrayList<PVector> ledPositionsList= new ArrayList<PVector> ();\n //try to read data from file\n try {\n File file = new File(filename);\n Scanner scanner = new Scanner(file);\n while (scanner.hasNextLine()) {\n String line = scanner.nextLine();\n String[] pieces = line.split(\"\\t\");\n if (pieces.length>3) {\n ledPositionsList.add(new PVector( (Float.parseFloat(pieces[1])/4.0f), Float.parseFloat(pieces[2])/4.0f, Float.parseFloat(pieces[3])/4.0f)); //initialize Leds x,y,z,r,g,b\n }\n }\n scanner.close();\n } \n catch (FileNotFoundException ex) {\n ex.printStackTrace();\n }\n //convert to vanilla Java Array\n PVector[] ledPositions= new PVector[ledPositionsList.size()];\n for (int i=0; i<ledPositionsList.size(); i++) {\n ledPositions[i]=ledPositionsList.get(i);\n }\n return ledPositions;\n }",
"public int[] scanGrades(String filepath) {\n Scanner scanner = null;\n try {\n scanner = new Scanner(new File(filepath));\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n ArrayList<Integer> grades = new ArrayList<Integer>();\n while (scanner.hasNextInt()) {\n grades.add(scanner.nextInt());\n }\n int[] gradeArray = new int[grades.size()];\n for (int i = 0; i < grades.size(); i++) {\n gradeArray[i] = grades.get(i);\n }\n return gradeArray;\n }",
"private ArrayList loadfile(String file_path) throws Exception{\n\t\tFileInputStream fis = null;\n\t\tBufferedReader br = null;\n\t\tArrayList filedata = new ArrayList();\n\t\ttry {\n\t\t\tFile file = new File(file_path);\n\t\t\tfis = new FileInputStream(file);\n\t\t\tbr = new BufferedReader(new InputStreamReader(fis, charset));\n\t\t\tint i = 0;\n\t\t\twhile (br.ready()) {\n\t\t\t\tString line_data = br.readLine();\n\t\t\t\tif (line_data == null) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tnode_line_data nd = new node_line_data(line_data, i++);\n\t\t\t\tfiledata.add(nd);\n\t\t\t}\n\t\t\treturn filedata;\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow new Exception(e.getMessage());\n\t\t}\n\t\tfinally {\n\t\t\ttry {\n\t\t\t\tif (br != null)\n\t\t\t\t\tbr.close();\n\t\t\t\tif (fis != null)\n\t\t\t\t\tfis.close();\n\t\t\t}\n\t\t\tcatch (IOException ex) {\n\t\t\t}\n\t\t}\n\t}",
"public static void readArray(String fileName, int[] newArray) throws Exception{\n\n // Create DataInputStream object to read from binary file.\n // Use fileName from demo file and read into newArray in demo file.\n DataInputStream input = new DataInputStream(new FileInputStream(fileName));\n\n // Create boolean variable to determine End Of File\n boolean EOF = false;\n\n // While it's not the End Of File\n while(!EOF){\n\n // Try Catch Statement\n try{\n\n // for Loop to go through each integer in the binary file\n for(int i = 0; i < newArray.length; i++){\n\n // read the number and place it in the newArray\n newArray[i] = input.readInt();\n }\n }catch(EOFException e){ // Catch clause to find end of file\n // Change EOF to True\n EOF = true;\n }\n\n }\n // Close the file\n input.close();\n }",
"public void readFile(){\n try {\n highscores = new ArrayList<>();\n BufferedReader br = new BufferedReader(new FileReader(\"Highscores.txt\"));\n String line = br.readLine();\n while (line != null){\n try{\n highscores.add(Integer.parseInt(line));\n } catch (NumberFormatException e){}\n line = br.readLine();\n }\n br.close();\n } catch (FileNotFoundException e) {\n System.out.println(\"No file found\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"private void readInFile()\n {\n try\n {\n file = new File(fileAddress);//Create new file from the given file name\n fileScanner = new Scanner(file);//Create a file scanner to scan for all the integers\n }\n catch(FileNotFoundException e) //Throws a FileNotFountException if the given file name doesn't exist\n {\n System.out.println(\"The file \" + fileAddress + \" could not be found\");\n }\n\n int i = 0;\n\n for(int j = 0; j < 1000; j++)\n {\n integerList[j] = fileScanner.nextInt();//Store the next integer from the file in to the integerList\n\n //Check to see if the index is at the end of the array and the file still has more integers,\n //then we reallocate more space for the array.\n\n /* if(i > (integerList.length - 1) && fileScanner.hasNextInt())\n resizeArray();\n i++;*/\n }\n\n /*while(fileScanner.hasNextInt())//Iterate through the file until there are no more integers\n {\n integerList[i] = fileScanner.nextInt();//Store the next integer from the file in to the integerList\n\n //Check to see if the index is at the end of the array and the file still has more integers,\n //then we reallocate more space for the array.\n\n if(i >= (integerList.length - 1) && fileScanner.hasNextInt())\n resizeArray();\n i++;\n }*/\n\n fileScanner.close();//close the scanner\n }",
"public void loadGridFromFile( String filename )\n\t{\n\t\ttry {\n\t\t\tBufferedReader br = new BufferedReader( new FileReader( filename ));\n\t\t\tString[] data = new String[width];\n\t\t\tString delimiter = \",\", line = null;\n\t\t\tint i = 0, j = 0;\n\t\t\t\n\t\t\ttry \n\t\t\t{ \n\t\t\t\tline = br.readLine(); \n\t\t\t\t\n\t\t\t\t// Based on file format, determine grid width / height\n\t\t\t\twidth = line.length() / 2 + 1;\n\t\t\t\theight = line.length() / 2 + 1;\n\t\t\t\tgrid = new int[width][height];\n\t\t\t\t\n\t\t\t\t// While file isn't empty\n\t\t\t\twhile ( line != null )\n\t\t\t\t{\n\t\t\t\t\t// Split lines using delimiter of ','\n\t\t\t\t\tdata = line.split( delimiter );\n\t\t\t\t\t\n\t\t\t\t\t// Put contents of each formatted line into grid array\n\t\t\t\t\tfor (i = 0; i < width; i++) \n\t\t\t\t\t{\n\t\t\t\t\t\tgrid[i][j] = Integer.parseInt( data[i] );\n\t\t\t\t\t\tif ( grid[i][j] == 0 ) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tx0 = i;\n\t\t\t\t\t\t\ty0 = j;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\tj++;\n\t\t\t\t\tline = br.readLine();\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (IOException e) \n\t\t\t{ \n\t\t\t\tSystem.out.println( \"Unable to read from file \" + filename + \". Closing...\" ); \n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t}\n\t\tcatch ( FileNotFoundException e)\n\t\t{\n\t\t\tSystem.out.println( \"File with name \" + filename + \" not found. Closing...\" );\n\t\t\tSystem.exit(0);\n\t\t}\n\t}",
"public int[] readBasicInfo() throws IOException\n\t{\n\t\t//Creates a FileReader and BufferedReader to read from the file that you pass it\n\t\tFileReader fr = new FileReader(path);\n\t\tBufferedReader textReader = new BufferedReader(fr);\n\t\t\n\t\t//Creates a new array to read the first line of data to (is an array because need to convert to int list)\n\t\tString textData;\n\t\t\n\t\t//Reads the first line of the text file into the array\n\t\ttextData = textReader.readLine();\n\t\t\n\t\tint[] data = new int[5];\n\t\t//Create a holding variable that will help to convert the String list over to an int list\n\t\tString[] tempList = new String[6];\n\t\t//List of deliminations that will be parsed out of the read strings in the string list that the function is passed\n\t\tString delims = \"[,()]+\";\n\t\t//Splits the strings from the file by the parenthesis and the commas\n\t\ttempList = textData.split(delims);\n\t\tfor (int i = 1; i < tempList.length; i++)\n\t\t\tdata[i-1] = Integer.parseInt(tempList[i]);\n\t\t\n\t\t//Returns the array containing the first line of the text file\n\t\treturn data;\n\t}",
"public void readFile(String filename) throws IOException {\n BufferedReader buffer = new BufferedReader(new FileReader(filename));\n\n String line;\n int row = 0;\n isFirstLine = true;\n\n while ((line = buffer.readLine()) != null) {\n String[] vals = line.trim().split(\"\\\\s+\");\n int length = vals.length;\n \n if(isFirstLine) {\n \tfor(int col = 0; col < 2; col++) {\n \t\tif(col == 0)\n \t\t\trowSize = Integer.parseInt(vals[col]);\n \t\telse\n \t\t\tcolSize = Integer.parseInt(vals[col]);\n \t}\n \tskiMap = new int[rowSize][colSize];\n \tisFirstLine = false;\n }\n else {\n \tfor (int col = 0; col < length; col++) {\n \tskiMap[row][col] = Integer.parseInt(vals[col]);\n }\n \t row++;\n }\n }\n \n if(buffer != null)\n \tbuffer.close();\n }",
"static Student[] readStudentsFromFile(String filename, int num) {\n\t\ttry (Scanner in = new Scanner(new File(filename))) {\n\t\t\tStudent[] students = new Student[num];\n\t\t\tint index = 0; //prevents ArrayIndexOutOfBounds\n\t\t\tString line;\n\t\t\tString[] input;\n\n\t\t\twhile (in.hasNextLine()) {\n\t\t\t\tline = in.nextLine();\n\t\t\t\tinput = line.split(\",\"); //Splits each String input by the character ','\n\t\t\t\tstudents[index++] = new Student(input[0], Integer.parseInt(input[1]), input[2]);\n\t\t\t}\n\t\t\treturn students;\n\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}",
"public static int[][][] read(String filename) {\n\n\t\t// Calling the right file\n\t\tStdIn.setInput(filename); \n\t\t// This is for ״P3״\n\t\tStdIn.readString(); \n\t\t// The number of columns from file\n\t\tint columns = StdIn.readInt(); \n\t\t// The number of row from file\n\t\tint rows = StdIn.readInt(); \n\t\t // Creating the 3 dim matrix\n\t\tint[][][] readMatrix = new int[rows][columns][3];\n\t\tStdIn.readInt(); // This is the number of colors\n\n\t\tfor (int i = 0; i < rows; i++) {\n\t\t\tfor (int j = 0; j < columns; j++) {\n\t\t\t\tfor (int k = 0; k < 3; k++) {\n\t\t\t\t\t// Getting the value in a 3d matrix\n\t\t\t\t\treadMatrix[i][j][k] = StdIn.readInt(); \n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn readMatrix;\n\t}",
"public void loadMap(String filepath) {\n\n\t\ttry {\n\n\t\t\tInputStream in = getClass().getResourceAsStream(filepath);\n\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(in));\n\n\t\t\tnumCols = Integer.parseInt(br.readLine());\n\t\t\tnumRows = Integer.parseInt(br.readLine());\n\t\t\tmap = new int[numRows][numCols];\n\t\t\twidth = numCols * tileSize;\n\t\t\theight = numRows * tileSize;\n\n\t\t\tString delims = \"\\\\s+\";\n\t\t\tfor (int row = 0; row < numRows; row++) {\n\t\t\t\tString line = br.readLine();\n\t\t\t\tString[] tokens = line.split(delims);\n\t\t\t\tfor (int col = 0; col < numCols; col++) {\n\t\t\t\t\tmap[row][col] = Integer.parseInt(tokens[col]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}",
"public static int loadFile(File f, Data[] datas) throws IOException \n {\n Scanner scf = new Scanner(f);\n int n = 0; // number of lines read\n while (n < datas.length && scf.hasNextLine()) \n {\n String line = scf.nextLine();\n datas[n] = new Data(line);\n n++;\n }\n scf.close();\n return n;\n }",
"private String[] loadFile(String filename) {\n\t\treturn loadFile(filename, new String[0], System.lineSeparator());\n\t}",
"private void readFromFile() {\n\t\tPath filePath = Paths.get(inputFile);\n\n\t\ttry (BufferedReader reader = Files.newBufferedReader(filePath,\n\t\t\t\tCharset.forName(\"UTF-8\"));) {\n\t\t\tString line = null;\n\n\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\tString[] splitLine = line.split(\",\");\n\t\t\t\tcurrentGen.setValue(Integer.parseInt(splitLine[0]),\n\t\t\t\t\t\tInteger.parseInt(splitLine[1]), true);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Could not find file provided.\");\n\t\t}\n\t}",
"public int[][] load(File f) throws IOException {\n BufferedImage image = ImageIO.read(f);\n\n // image is n x m\n int n = image.getWidth();\n int m = image.getHeight();\n\n int[][] imageArray = new int[n][m];\n\n Raster raster = image.getData();\n\n // iterate over new array and populate grayscale values\n for(int i = 0; i < n; i++) {\n for(int j = 0; j < m; j++) {\n\n // FIXME - a way to assert grayscale?\n // 0 is selected as third argument because image is assumed to be grayscale\n // imageArray[i][j] = raster.getSample(i, j, 0);\n\n imageArray[i][j] = image.getRGB(i, j) & 0xFF;\n }\n }\n\n return imageArray;\n }",
"String [][] importData (String path);",
"public ClickerCounterModel[] readObjectFromFile() {\n\t\tStringBuilder sb = new StringBuilder();\n\t\ttry {\n\t\t\tFileInputStream inputStream = openFileInput(filename);\n\t\t\tInputStreamReader isr = new InputStreamReader(inputStream);\n\t\t\tBufferedReader bufferedReader = new BufferedReader(isr);\n\t\t\tString line;\n\t\t\twhile ((line = bufferedReader.readLine()) != null) {\n\t\t\t\tsb.append(line);\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// use Gson to convert it into and object\n\t\tString json = sb.toString();\n\t\tGson gson = new Gson();\n\t\tClickerCounterModel[] object = gson.fromJson(json,\n\t\t\t\tClickerCounterModel[].class);\n\t\treturn object;\n\t}",
"public Integer[] compressFileReader() {\n\t\tint index = 0;\n\t\tString input = \"\";\n\t\ttry {\n\t\t\tint nextChar = 0;\n\t\t\twhile (nextChar != (int) '\\n') {\n\t\t\t\tnextChar = 0;\n\t\t\t\tfor (int i = 0; i < codeLength; i++) {\n\t\t\t\t\tnextChar <<= 1;\n\t\t\t\t\tif (bufferCount == 0) {\n\t\t\t\t\t\tbuffer = in.read();\n\t\t\t\t\t\tbufferCount = 8;\n\t\t\t\t\t}\n\t\t\t\t\tif (buffer == -1) {// in.close();\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tbufferCount--;\n\t\t\t\t\tif ((buffer >> (bufferCount) & 1) == 1)\n\t\t\t\t\t\tnextChar |= 1;\n\t\t\t\t}\n\t\t\t\tinput = input + nextChar + \",\";\n\t\t\t}\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tString[] str = input.split(\",\");\n\t\tInteger[] inputArray = new Integer[str.length];\n\t\tfor (String st : str)\n\t\t\tinputArray[index++] = Integer.parseInt(st);\n\t\treturn inputArray;\n\n\t}",
"private void readFromFile(String filename) {\n\t\ttry {\n\t\t Scanner read = new Scanner(new File(filename));\n\t\t String line;\n\t\t int counter = 0;\n\t\t String temp;\n\t\t line = read.nextLine();\n\t\t temp = line.substring(0);\n\t\t height = convertToInt(temp);\n\n\t\t line = read.nextLine();\n\t\t temp = line.substring(0);\n\n\t\t length = convertToInt(temp);\n\t\t size = height*length;\n\t\t \n\t\t squares = new Square[size][size];\n\n\t\t while(read.hasNextLine()) {\n\t\t\t\tline = read.nextLine();\n\t\t \tfor (int i = 0; i < line.length(); i++) {\n\t\t \t temp = line.substring(i, i+1);\n\n\t\t \t if (temp.equals(\".\")) {\n\t\t \t\t\tsquares[counter][i] = new FindValue(0);\n\t\t \t } \n\t\t \t else {\n\t\t\t\t\t\tsquares[counter][i] = new PreFilled(convertToInt(temp));\n\t\t\t \t\t}\n\t\t \t}\n\t\t \tcounter++;\n\t\t }\n\t\t} catch(IOException e) {\n\t\t e.printStackTrace();\n\t\t}\n }",
"public static void Reader(String fileName) throws FileNotFoundException{\n File filename=new File(fileName);\n Scanner sc=new Scanner(filename);\n row=sc.nextInt();\n col=sc.nextInt();\n arr=new float[row][col];\n\n // use US locale to be able to identify floats in the string\n sc.useLocale(Locale.US);\n \n for(int i=0;i<row;i++){\n for(int j=0; j<col; j++){\n arr[i][j]=sc.nextFloat();\n }\n }\n ArrayList<String> result=new ArrayList<String>();\n\n long tick=System.currentTimeMillis();\n DataThreadProcessor t=new DataThreadProcessor(arr,result, 1,row-1);\n long tock=System.currentTimeMillis()-tick;\n System.out.println(\"Time elapsed: \"+tock);\n ForkJoinPool.commonPool().invoke(t);\n\n for(String value: result){\n System.out.println(value);\n }\n }",
"public int Load(String filepath) throws IOException {\n \t\tint AddeCounter = 0;\n \t\tPath path = Paths.get(filepath);\n \t\ttry (Scanner scanner = new Scanner(path, ENCODING.name())) {\n \t\t\twhile (scanner.hasNextLine()) {\n \t\t\t\t// Read each line into the array list\n \t\t\t\tString line = scanner.nextLine();\n \t\t\t\tif (line != null && !line.isEmpty()) {\n \t\t\t\t\tJobs jobUnit = new Jobs(line);\n \t\t\t\t\tjobqueue.add(jobUnit);\n \t\t\t\t\tAddeCounter++;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\treturn AddeCounter;\n \t}",
"private void loadFromFile() {\n try {\n /* Load in the data from the file */\n FileInputStream fIn = openFileInput(FILENAME);\n BufferedReader inRead = new BufferedReader(new InputStreamReader(fIn));\n\n /*\n * access from the GSON file\n * Taken from lonelyTwitter lab code\n */\n Gson gson = new Gson();\n Type listType = new TypeToken<ArrayList<Counter>>() {}.getType();\n counters = gson.fromJson(inRead, listType);\n\n } catch (FileNotFoundException e) {\n counters = new ArrayList<Counter>();\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }",
"public int[] getData(String filename) throws IOException\n {\n\tScanner scanner = new Scanner(new File(filename)) ;\n\ttry {\n\t readData(scanner) ;\n\t return data ;\n\t}\n\tfinally {\n\t System.out.println(\"Finally closing the scanner.\") ;\n\t scanner.close() ;\n\t}\n }",
"public int[][] readMatrix(String filename, int n) throws Exception\n {\n\t // start with a null file and scanner\n\t File file = null;\n\t Scanner sc = null;\n\t // try to get a file and scanner. If it fails, an exception is thrown\n\t file = new File(filename);\n\t sc = new Scanner(file);\n\t \n\t \n\t // create the return matrix\n\t int[][] matrix = initMatrix(n);\n\t // go through the file line by line and populate the matrix\n\t for (int i = 0; i<n; i++) {\n\t\t String line = sc.nextLine();\n\t\t String[] elements = line.split(\" \");\n\t\t for (int j = 0; j<n; j++) {\n\t\t\t matrix[i][j] = Integer.parseInt(elements[j]);\n\t\t }\n\t }\n\t // close scanner, return the matrix.\n\t sc.close();\n\t return matrix;\n }",
"public int[] readAllInts(){\n\t\tString[] fields=readAllStrings();\n\t\tint[] vals=new int[fields.length];\n\t\tfor (int i=0;i<fields.length;i++){\n\t\t\tvals[i]=Integer.parseInt(fields[i]);\n\t\t}\n\t\treturn vals;\n\t}",
"public static void Load(String filename) throws IOException {\n\t\tLineNumberReader lnr = new LineNumberReader(new FileReader(filename));\r\n\t\t linenumber = 0;\r\n\t\t while (lnr.readLine() != null){\r\n\t\t\t linenumber++;\r\n\t\t }\r\n lnr.close();\r\n \tarrr=new String[linenumber][5];\r\n\t\tarr=arrr;\r\n\t\tBufferedReader br=new BufferedReader(new FileReader(filename));\r\n\t\t Scanner sc1=new Scanner(br);\r\n\t\t String ss=sc1.nextLine();\r\n\t\t String[] str1 = ss.split(\",\") ;\r\n\t\t String r=str1[0];\r\n\t\t String t=str1[1];\r\n\t\t String[] str2 = r.split(\":\") ;\r\n\t\t round= Integer.parseInt(str2[1]);\r\n\t\t String[] str3 = t.split(\":\") ;\r\n\t\t who=Integer.parseInt(str3[1]);\r\n\t\t arr=new String[linenumber][5];\r\n\t\t int num=0;\r\n\t\t while(sc1.hasNextLine()) {\t\r\n\t\t\t int i=0;\r\n\t\t\t num++;\r\n\t\t\t String x=sc1.nextLine();\r\n\t\t\tString[] str = x.split(\",\") ;\r\n\t\t\twhile(i<5) {\r\n\t\t\t\tarr[num][i]=str[i];\r\n\t\t\t\ti++;\r\n\t\t\t }\r\n\t\t }\r\n\t\t int c=1;\r\n\t ch=new Character[linenumber];\r\n\r\n\t\t\twhile(c<(linenumber)) {\r\n\t\t\t\t\r\n\t\t\t\tch[c]=new Character(Integer.parseInt(arr[c][0]),Integer.parseInt(arr[c][1]),Integer.parseInt(arr[c][2]),Integer.parseInt(arr[c][3]),arr[c][4]);\t\t\t\t\t\t\t\r\n\t\t\t\tc++;\r\n\t\t\t}\t\r\n\t\t\r\n\t\t sc1.close();\r\n\t\t String file=\"Land.txt\";\r\n\t\t\tBufferedReader br2=new BufferedReader(new FileReader(file));\r\n\t\t\tland=new String[20][2];\r\n\t\t\tland2=new String[20][2];\r\n\t\t\tland=land2;\r\n\t\t\tScanner sc2=new Scanner(br2);\r\n\t\t\tString strr=sc2.nextLine();\r\n\t\t\tnum=0;\r\n\t\t\t while(sc2.hasNextLine()) {\t\r\n\t\t\t\t int i=0;\r\n\t\t\t\t num++;\r\n\t\t\t\t String x=sc2.nextLine();\t\t\t\r\n\t\t\t\tString[] str = x.split(\",\") ;\r\n\t\t\t\twhile(i<2) {\r\n\t\t\t\t\tland[num][i]=str[i];\r\n\t\t\t\t\ti++;\r\n\t\t\t\t }\t\t\t\r\n\t\t\t }\r\n\t\t\t\r\n\t\t\t String url = \"//localhost:3306/checkpoint?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT\";\r\n\t\t // String url=\"//140.127.220.220/\";\r\n\t\t // String dbname=\"CHECKPOINT\";\r\n\t\t\t Connection conn = null;\r\n\t\t try{\r\n\t\t conn = DriverManager.getConnection(protocol + url,username,passwd);\r\n\t\t Statement s = conn.createStatement();\r\n\t\t String sql = \"SELECT PLACE_NUMBER,LAND_PRICE,TOLLS FROM LAND\";\r\n\t\t rs=s.executeQuery(sql);\r\n\t\t p_number=new int[20];\r\n\t\t l_price=new int[20];\r\n\t\t tolls=new int[20];\r\n\t\t grid=0;\r\n\t\t while(rs.next()){\r\n\t\t \tgrid++;\r\n\t\t \tp_number[grid]=rs.getInt(\"PLACE_NUMBER\");\r\n\t\t \tl_price[grid]=rs.getInt(\"LAND_PRICE\");\r\n\t\t \ttolls[grid]=rs.getInt(\"TOLLS\");\t \t\t \t\r\n\t\t }\t\t \t\t \r\n\t\t rs.close();\r\n\t\t conn.close();\r\n\t\t } catch(SQLException err){\r\n\t\t System.err.println(\"SQL error.\");\r\n\t\t err.printStackTrace(System.err);\r\n\t\t System.exit(0);\r\n\t\t }\r\n\t\t\t Land=new Land[20];\r\n\t\t\t Land2=new Land[20];\r\n\t\t\t Land=Land2;\t\t\t \r\n\t\t \tfor(int i=1;i<=grid;i++) {\r\n\t\t \t\tLand[i]=new Land(p_number[i],Integer.parseInt(land[i][1]),l_price[i],tolls[i]);\t \t\t\r\n\t\t \t}\r\n\t\t\t sc2.close();\r\n\t}",
"public static int[] buildArray() throws IOException {\r\n\r\n //Variable initializations\r\n int[] intArray = {};\r\n int sumOfElements = 0;\r\n int index = 0;\r\n \r\n //Initialization of File and Scanner objects\r\n \r\n File sumOfIntegers = new File(fileInput);\r\n Scanner elementScanner = new Scanner(sumOfIntegers);\r\n\r\n //Loop that increases the num of array elements by 1 every time\r\n //it acknowledges an integer value within the file and subtracts\r\n //1 from the array elements when the sentinel value is reached.\r\n while (elementScanner.hasNextInt()) {\r\n sumOfElements++;\r\n \r\n \r\n //Assign next int scanner method to x variable\r\n //Used to process if boolean condition\r\n int x = elementScanner.nextInt();\r\n\r\n //When -999 sentinel value is reached reduce num of array elements\r\n //by 1 since we do not want it included\r\n if (x == -999) {\r\n sumOfElements = sumOfElements - 1;\r\n intArray = new int[sumOfElements];\r\n }\r\n //Assign sumOfElements as num of array elements\r\n intArray = new int[sumOfElements]; \r\n\r\n }\r\n\r\n //new scanner to reset abstract cursor of file\r\n elementScanner = new Scanner(sumOfIntegers);\r\n for (index = 0; index < sumOfElements; index++) {\r\n int x = elementScanner.nextInt();\r\n\r\n if (x != -999) {\r\n intArray[index] = x;\r\n }\r\n\r\n }\r\n\r\n //Closes the file/scanner\r\n elementScanner.close();\r\n\r\n return intArray;\r\n }",
"public void readAll() throws FileNotFoundException{ \n b = new BinaryIn(this.filename);\n this.x = b.readShort();\n this.y = b.readShort();\n \n int count = (x * y) / (8 * 8);\n this.blocks = new double[count][8][8][3];\n \n Node juuri = readTree();\n readDataToBlocks(juuri);\n }",
"public long[] read();",
"private void readInter() throws FileNotFoundException {\n\t\t\r\n\t\tFile file = new File(\"input.txt\");\r\n\r\n\t\tScanner input = new Scanner(file);\r\n\r\n\t\twhile (input.hasNext()) {\r\n\r\n\t\t\tint x = input.nextInt();\r\n\t\t\tint y = input.nextInt();\r\n\t\t\t\r\n\t\t\tintervals.add(new Point(x, y));\r\n\t\t}\r\n\t\t\r\n\t\t//Close 'input.txt'\r\n\t\tinput.close();\r\n\t\t\r\n\t}",
"public void readFile(String filePath) {\n\n\t\tFile file = new File(filePath);\n\t\t\n\t\ttry {\n\t\t\tScanner sc = new Scanner(file);\n \t while(sc.hasNextLine() ) {\t\t \t \n\t\t \t String line = sc.nextLine();\t\t \t \n\t\t \t linesArray.add( line.split(\",\") );\t\n\t\t \t \n\t\t\t}\n\t\t \t\t \n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\t\t\n\t\n\t}",
"public Interface(String filename) throws FileNotFoundException \n {\n //read file for first time to find size of array\n File f = new File(filename);\n Scanner b = new Scanner(f);\n\n while(b.hasNextLine())\n {\n b.nextLine();\n arraySize++;\n }\n //create properly sized array\n array= new double[arraySize];\n //open and close the file, scanner class does not support rewinding\n b.close();\n b = new Scanner(f);\n //read input \n for(int i = 0; i < arraySize; i++)\n { \n array[i] = b.nextDouble();\n }\n //create a stats object of the proper size\n a = new Stats(arraySize);\n a.loadNums(array); //pass entire array to loadNums to allow Stats object a to have a pointer to the array\n }",
"public ArrayList<Integer> obtainSourceArray(String inputName){\n try{\n this.readFileByLines(inputName);\n StringTokenizer tokenizer = new StringTokenizer(this.inputContent.toString());\n\n ArrayList<Integer> source = new ArrayList<Integer>();\n while(tokenizer.hasMoreTokens()){\n source.add(Integer.valueOf(tokenizer.nextToken()));\n }\n return source;\n }catch (Exception e){\n e.printStackTrace();\n }\n\n return null;\n }",
"private ArrayList<Float> readFile(byte[] data) {\n int pStart = 0;\n ArrayList<Float> points = new ArrayList<Float>();\n\n for (int pEnd = 0; pEnd < data.length; pEnd++) {\n if (data[pEnd] == '\\n' || pEnd == (data.length - 1)) {\n String line = new String(data, pStart, pEnd - pStart);\n if (line.startsWith(\"ncols\")) {\n ncols = Integer.parseInt(line.substring(5).trim());\n } else if (line.startsWith(\"nrows\")) {\n nrows = Integer.parseInt(line.substring(5).trim());\n } else if (line.startsWith(\"xllcorner\")) {\n xll = (int) Float.parseFloat(line.substring(9).trim());\n } else if (line.startsWith(\"yllcorner\")) {\n yll = (int) Float.parseFloat(line.substring(9).trim());\n } else if (line.startsWith(\"cellsize\")) {\n cellsize = Float.parseFloat(line.substring(8).trim());\n } else if (line.startsWith(\"NODATA_value\")) {\n nodata = Float.parseFloat(line.substring(12).trim());\n } else {\n // Assume data\n line = line.trim();\n String[] parts = line.split(\"\\\\s+\");\n for (String part : parts) {\n points.add(Float.parseFloat(part.trim()));\n }\n }\n pStart = pEnd + 1;\n }\n }\n return points;\n }",
"private static ArrayList<ArrayList<Integer>> populateListOfInputs() {\n\t\t\n\t\tArrayList<ArrayList<Integer>> listOflist = new ArrayList<ArrayList<Integer>>();\n\t\ttry {\n\t\t\tFileReader fr = new FileReader(filePath);\n\t\t\tBufferedReader br = new BufferedReader(fr);\t\t\n\t\t\t\n\t\t\tString line;\n\t\t\twhile ((line = br.readLine()) != null) {\n\t\t\t\t// Remove all spaces, '[' and ']'\n\t\t\t\tString numbers = line.replace(\" \", \"\");\n\t\t\t\tnumbers = numbers.replace(\"[\", \"\");\n\t\t\t\tnumbers = numbers.replace(\"]\", \"\");\n\t\t\t\t\n\t\t\t\tif(line.equals(\"\")) {\n\t\t\t\t\t//if empty line leave it and continue the loop\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tArrayList<Integer> list = new ArrayList<Integer>();\n\t\t\t\t\n\t\t\t\tString[] individualnums = numbers.split(\",\");\n\t\t\t\tfor (int i = 0; i < individualnums.length; i++) {\t\t\t\t\t\n\t\t\t\t\tlist.add(Integer.parseInt(individualnums[i]));\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tlistOflist.add(list);\t\t\t\t\n\t\t\t}\t\t\n\t\t\t\n\t\t\tbr.close();\n\t\t\tfr.close();\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn listOflist;\n\t}",
"public int[][][] getData() throws AreaFileException {\r\n int[][][] mydata = readData(0,0,dir[AD_NUMELEMS],numberLines);\r\n return mydata;\r\n }",
"void populateArray () {\r\n\r\n\t\ttry {\r\n\t\t\tfis = new FileInputStream (\"Bank.dat\");\r\n\t\t\tdis = new DataInputStream (fis);\r\n\t\t\t//Loop to Populate the Array.\r\n\t\t\twhile (true) {\r\n\t\t\t\tfor (int i = 0; i < 6; i++) {\r\n\t\t\t\t\trecords[rows][i] = dis.readUTF ();\r\n\t\t\t\t}\r\n\t\t\t\trows++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (Exception ex) {\r\n\t\t\ttotal = rows;\r\n\t\t\tif (total == 0) { }\r\n\t\t\telse {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tdis.close();\r\n\t\t\t\t\tfis.close();\r\n\t\t\t\t}\r\n\t\t\t\tcatch (Exception exp) { }\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}",
"private void readFile() {\r\n\t\tScanner sc = null; \r\n\t\ttry {\r\n\t\t\tsc = new Scanner(inputFile);\t\r\n\t\t\twhile(sc.hasNextLine()){\r\n\t\t\t\tgrade.add(sc.nextLine());\r\n\t } \r\n\t\t}\r\n\t\tcatch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tsc.close();\r\n\t\t}\t\t\r\n\t}",
"private static int[][] processInput (String info) throws FileNotFoundException, IOException\n {\n BufferedReader input = new BufferedReader(new FileReader(info));\n ArrayList<Integer> pointList = new ArrayList<Integer>();\n String point;\n while ((point = input.readLine()) != null)\n {\n StringTokenizer st = new StringTokenizer(point);\n pointList.add(Integer.parseInt(st.nextToken()));\n pointList.add(Integer.parseInt(st.nextToken()));\n }\n int[][] pointSet = new int[2][pointList.size()/2];\n int j = 0;\n for (int i = 0; i<=pointList.size()-1; i=i+2)\n {\n pointSet[0][j] = pointList.get(i);\n pointSet[1][j] = pointList.get(i+1);\n j++;\n }\n return pointSet;\n }",
"public void inputFromStream(BufferedReader dis) throws IOException {\n String line = dis.readLine();\n setFile(line);\n int lines = Str.strToInt(dis.readLine());\n if (lines != 0) {\n lineNos = new int[lines];\n for (int i = 0; i < lineNos.length; ++i) {\n lineNos[i] = Str.strToInt(dis.readLine());\n }\n }\n }",
"private static int[] internal16Readin(String name) {\n try {\n BufferedReader br = new BufferedReader(new InputStreamReader(FileUtils.getResourceInputStream(\"/luts/\" + name)));\n String strLine;\n\n int[] intArray = new int[65536];\n int counter = 0;\n while ((strLine = br.readLine()) != null) {\n\n String[] array = strLine.split(\" \");\n\n for (int i = 0; i < array.length; i++) {\n if (array[i].equals(\" \") || array[i].equals(\"\")) {\n\n } else {\n intArray[counter] = Integer.parseInt(array[i]);\n counter++;\n }\n }\n }\n br.close();\n return intArray;\n } catch (Exception e) {// Catch exception if any\n System.err.println(\"Error open internal color table \" + name);\n e.printStackTrace();\n return null;\n }\n }",
"public static List<String> readLineFromFile(File file) {\r\n List<String> result = new ArrayList<String>();\r\n LineNumberReader lnr = null;\r\n try {\r\n lnr = new LineNumberReader(new BufferedReader(\r\n new InputStreamReader(new FileInputStream(file), Charset\r\n .defaultCharset().name())));\r\n for (String line = lnr.readLine(); line != null; line = lnr\r\n .readLine()) {\r\n result.add(line);\r\n }\r\n } catch (Exception e) {\r\n throw new RuntimeException(e);\r\n } finally {\r\n if (lnr != null) {\r\n try {\r\n lnr.close();\r\n } catch (IOException e) {\r\n throw new RuntimeException(e);\r\n }\r\n }\r\n }\r\n return result;\r\n }",
"public static int[][] loadMap(String fileName) throws Exception{\n FileReader fr=new FileReader(fileName);\n int c;\n String str=\"\";\n List<String> strA=new ArrayList<>(); //list of lines\n //process out newlines from midline\n while((c=fr.read())!=-1){\n System.out.print((char)c); //show map\n if(!(((char)c=='\\n') || ((char)c=='\\r'))){str=str+(char)c;}\n else if(((char)c=='\\n' || (char)c=='\\r')){\n if(strA.size()<1) {strA.add(str);str=\"\";}\n else if(strA.size()>0 && strA.get(0).length()>str.length()){} //newline char found midline\n else {strA.add(str);str=\"\";}\n }\n else System.out.println(\"Err: \"+(char)c);\n }\n strA.add(str);\n System.out.println(\"\\nWidth: \"+str.length()+\"\\nHeight: \"+strA.size());\n //now that size is known, fill info array\n int[][] map=fillMap(strA);\n \n return map;\n }",
"public static void main(String[] args) throws FileNotFoundException {\n\t\tint listArr[] = new int[70];\r\n\t\tString filename = \"MyList.txt\";\r\n\t\tFile file = new File(filename);\r\n\t\tScanner input = new Scanner(file);\r\n\t\tint i = 0;\r\n\t\twhile (input.hasNextLine()) {\r\n\t\t\tlistArr[i] = input.nextInt();\r\n\t\t\ti++;\r\n\t\t}\r\n\t\t\r\n\t\tmergeSort(listArr, 70);\r\n\t\tfor(i = 0; i < 70; i++) {\r\n\t\t\tSystem.out.println(listArr[i]);\r\n\t\t}\r\n\t}",
"public void setReaderToArray(){\n try{\n String client, number = null;\n\n File reader = new File(\"clientFile/clientInfo.txt\");\n\n Scanner scn = new Scanner(reader);\n scn.useDelimiter(\",\");\n\n while(scn.hasNext()){\n number = scn.next();\n client = scn.next();\n\n clientList.add(client + \" - \" + number);\n }\n scn.close();\n }catch (FileNotFoundException exception){\n System.out.println(\"An error occurred.\");\n }\n }",
"public int[] leerarchivoalista(String nombredearchivodetexto) throws IOException \r\n\t {\r\n\t FileReader leer = new FileReader(nombredearchivodetexto);\r\n\t \r\n\t BufferedReader bufferedReader = new BufferedReader(leer);\r\n\t\t\tint[] numeros= new int[3001];\r\n\t String leerlinea = null;\r\n\t int i=0;\r\n\t \r\n\t while ((leerlinea = bufferedReader.readLine()) != null) {\r\n\t\t int convertiraentero =Integer.parseInt(leerlinea);\r\n\r\n\t\t\tnumeros[i]= convertiraentero;\r\n\t i++;\r\n\t }\r\n\t \r\n\t bufferedReader.close();\r\n\t \r\n\t return numeros;\r\n\t }",
"public static List<Matrix> parseFile(Path path) {\n\t\tList<String> lines = null;\n\t\t\n\t\ttry {\n\t\t\tlines = Files.readAllLines(path);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tint lineCount = lines.size();\n\t\tMatrix A = null;\n\t\tMatrix y = null;\n\t\tint rowIndex = 0;\n\t\tfor (String line : lines) {\n\t\t\t\n\t\t\t// If line is a comment skip\n\t\t\tif (line.startsWith(\"#\")) {\n\t\t\t\tlineCount--;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tif (A == null) {\n\t\t\t\tA = new Matrix(lineCount, lineCount);\n\t\t\t}\n\t\t\t\n\t\t\tif (y == null) {\n\t\t\t\ty = new Matrix(lineCount, 1);\n\t\t\t}\n\t\t\t\n\t\t\tList<Double> dList = Util.parseLine(line);\n\t\t\t\n\t\t\t// Extract numbers\n\t\t\tfor (int i = 0, len = dList.size(); i < len; i++) {\n\t\t\t\n\t\t\t\t// Not last number - contained in A\n\t\t\t\tif (i+1 < len) {\n\t\t\t\t\tA.set(rowIndex, i, dList.get(i));\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t// ... else go to y\n\t\t\t\t\ty.set(rowIndex, 0, dList.get(i));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\trowIndex++;\n\t\t}\n\t\t\n\t\tList<Matrix> sol = new ArrayList<>();\n\t\tsol.add(A);\n\t\tsol.add(y);\n\t\t\n\t\treturn sol;\n\t}",
"public Index[] readIndexes(File file){\t\t\n\t\ttry{\n\t\t\tFileReader reader = new FileReader(file);\n\t\t\tBufferedReader buff = new BufferedReader(reader);\n\n\t\t\tboolean eof = false;\t\t//stores if the end of the file (eof) has been reached\n\t\t\tint numberOfRecords = 0;\n\n\t\t\t/**\n\t\t\t * @mastery achieves SL mastery factor 6 with the while loop\n\t\t\t */\n\t\t\twhile(!eof){\n\t\t\t\tString line = buff.readLine();\n\n\t\t\t\t/**\n\t\t\t\t * @mastery achieves SL mastery factor 4 with the if/else selection block\n\t\t\t\t */\n\t\t\t\tif(line == null){\n\t\t\t\t\teof = true;\t\t//the end of the file has been reached\n\t\t\t\t} else {\n\t\t\t\t\tnumberOfRecords++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbuff.close();\n\n\t\t\tIndex[] indexes = new Index[numberOfRecords];\n\n\t\t\tFileReader reader2 = new FileReader(file);\n\t\t\tBufferedReader buff2 = new BufferedReader(reader2);\n\n\t\t\tfor(int i=0;i<numberOfRecords;i++){\n\t\t\t\tString line = buff2.readLine();\n\t\t\t\tindexes[i] = new Index(line);\n\t\t\t}\n\n\t\t\tArrays.sort(indexes);\n\t\t\tbuff.close();\n\t\t\treader.close();\n\t\t\tbuff2.close();\n\t\t\treader2.close();\n\t\t\t\n\t\t\treturn indexes;\n\n\t\t} catch (Exception e){\n\t\t\treturn null;\n\t\t}\n\t}",
"public double[] importFlowRateDataFile(int pumpDataArraySize, String pumpDataFileName)\n\t{\n\t\tdouble[] pumpData = new double[pumpDataArraySize]; //26 as of first design\n\n\t\t////////////////////\n\t\t//Import file data//\n\t\t////////////////////\n\t\tString pumpDataString = \"\";\n\t\tString line = \"\";\n\t\t//search line by line \n\t\ttry{\n\t\t\tFileReader readFile = new FileReader(pumpDataFileName);\n\t\t\tBufferedReader reader = new BufferedReader(readFile);\n\n\t\t\tpumpDataString = reader.readLine();//reads first line\n\t\t\tpumpDataString = reader.readLine();//reads second line so first line isnt remebered\n\t\t\twhile(line != null)\n\t\t\t{\n\t\t\t\tpumpDataString += line + \"\\n\"; \n\t\t\t\tline = reader.readLine();\n\t\t\t}\n\t\t}\n\t\tcatch(IOException e)\n\t\t{\n\t\t\tSystem.out.println(\"Error at 'importPumpDataFile' located in FileWorker: \" + e.toString());\n\t\t}\n\n\t\t//////////////\n\t\t//Parse Data//\n\t\t//////////////\n\t\tString[] stringArray = pumpDataString.split(\"\\n\");\n\t\tfor(int x = 0; x<= pumpDataArraySize-1; x++)\n\t\t{\n\t\t\tpumpData[x] = Double.parseDouble(stringArray[x].split(\"-\")[1]); //get the splitted string array, gets each element, splits and takes the data portion then parses to int and store in final array\n\t\t}\n\n\t\treturn pumpData;\n\t}",
"public static ArrayList<Point> ReadData(String filePath) throws FileNotFoundException{\n \n ArrayList<Point> points = new ArrayList<>();\n\n Scanner inputStream = new Scanner(new File(filePath));\n\n String[] xs = inputStream.nextLine().split(\" \");\n String[] ys = inputStream.nextLine().split(\" \");\n\n int min = Math.min(xs.length, xs.length);\n\n for(int i = 0 ;i < min; i++){\n double x = Float.parseFloat(xs[i]);\n double y = Float.parseFloat(ys[i]);\n points.add(new Point(x,y));\n }\n\n\n\n return points;\n\n }",
"public ArrayList<String> parseFile(String fileName) throws IOException {\n\t\tthis.parrsedArray = new ArrayList<String>();\n\t\tFileInputStream inFile = null;\n\n\t\tinFile = new FileInputStream(mngr.getPath() + fileName);\n\t\tDataInputStream in = new DataInputStream(inFile);\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(in));\n\n\t\tString strLine;\n\n\t\twhile ((strLine = reader.readLine()) != null && strLine.length() > 0) {\n\t\t\t// Print the content on the console\n\t\t\tparrsedArray.add(strLine);\n\t\t}\n\n\t\tinFile.close();\n\n\t\treturn parrsedArray;\n\n\t}",
"static int[][] fileToBoard(String fileName) {\n\t\ttry {\n\t\t\t// open up file\n\t\t\tBufferedReader br = new BufferedReader(new FileReader(fileName));\n\t\t\ttry {\n\t\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\t\tString line = br.readLine();\n\t\t\t\t\n\t\t\t\t// used to record the length and \n\t\t\t\t// height of the board for the 2d int array\n\t\t\t\tint x = 0;\n\t\t\t\tint y = 0;\n\t\t\t\t\n\t\t\t\tx = line.replaceAll(\"\\t\", \"\").length();\n\t\t\t\t// build up string line by line\n\t\t\t\twhile (line != null) {\n\t\t\t\t\ty++;\n\t\t\t\t\tsb.append(line);\n\t\t\t\t\tline = br.readLine();\n\t\t\t\t}\n\n\t\t\t\t// change from string builder to string and take out tabs\n\t\t\t\tString everything = sb.toString();\n\t\t\t\tString noTabs = everything.replaceAll(\"\\t\", \"\");\n\n\t\t\t\t// close file\n\t\t\t\tbr.close();\n\t\t\t\t\n\t\t\t\t// convert string to 2d int array\n\t\t\t\tint [][] board = new int[x][y];\n\t\t\t\tfor(int i = 0; i < x; i++){\n\t\t\t\t\tfor(int j = 0; j < y; j++){\n\t\t\t\t\t\tchar character = noTabs.charAt(i+j*x);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// check to see if the character is a special state (Start and Goal)\n\t\t\t\t\t\tif(character == 'G')\n\t\t\t\t\t\t\tboard[i][j] = State.GOAL;\n\t\t\t\t\t\telse if(character == 'S')\n\t\t\t\t\t\t\tboard[i][j] = State.START;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tboard[i][j] = character - '0';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn board;\n\t\t\t} finally {\n\n\t\t\t}\n\t\t} catch (Exception e) {\n\n\t\t}\n\t\treturn new int[0][0];\n\t}",
"public String[] readLines() {\n\t\tVector linesVector = new Vector(); ;\n\t\ttry {\n\t\t\tFileReader fr = new FileReader(file);\n\t\t\tBufferedReader b = new BufferedReader(fr);\n\t\t\tboolean eof = false;\n\t\t\twhile (!eof) {\n\t\t\t\tString line = b.readLine();\n\t\t\t\tif (line == null) {\n\t\t\t\t\teof = true;\n\t\t\t\t} else {\n\t\t\t\t\tlinesVector.add(line);\n\t\t\t\t}\n\t\t\t}\n\t\t\tb.close();\n\t\t} catch (IOException e) {\n\t\t\tthrow new IllegalArgumentException(\"File \" + file.getName() +\n\t\t\t\t\" is unreadable : \" + e.toString());\n\t\t}\n\t\tString[] lines = new String[linesVector.size()];\n\t\tfor (int i = 0; i < lines.length; i++) {\n\t\t\tlines[i] = (String) (linesVector.get(i));\n\t\t}\n\t\treturn lines;\n\t}",
"public Picture[] readFile (Scanner reader) {\n Picture[] unsortedPics = new Picture[Integer.parseInt(reader.nextLine())];\n int i = 0;\n while (reader.hasNextLine()) {\n Picture picture = new Picture(i, reader.next(), reader.next(), reader.nextLine());\n unsortedPics[i] = picture;\n i++;\n }\n return unsortedPics;\n }",
"private List<Integer> readConfigFile(String filename) {\n\n Scanner input;\n try {\n input = new Scanner(this.getClass().getClassLoader().getResourceAsStream(filename));\n input.useDelimiter(\",|\\\\n\");\n } catch (NullPointerException e){\n throw new IllegalArgumentException(filename + \" cannot be found\", e);\n }\n\n checkConfigFile(filename);\n\n return parseFile(input);\n }",
"private void loadFromFile(){\n try {\n FileInputStream fis = openFileInput(FILENAME);\n BufferedReader in = new BufferedReader(new InputStreamReader(fis));\n Gson gson = new Gson();\n Type listType = new TypeToken<ArrayList<Countbook>>() {}.getType();\n countbookList = gson.fromJson(in, listType);\n } catch (FileNotFoundException e) {\n countbookList = new ArrayList<Countbook>();\n }\n }",
"public static List<Integer> readBinaryFile(String filename) throws IOException\n {\n List<Integer> binary = new ArrayList<>();\n\n FileInputStream inputStream = new FileInputStream(filename);\n BufferedInputStream bufferedInputStream = new BufferedInputStream(inputStream);\n\n byte[] byteInput = bufferedInputStream.readAllBytes();\n\n String stringInput = new String(byteInput);\n\n for(char c : stringInput.toCharArray())\n {\n binary.add((int) (c - '0'));\n }\n\n return binary;\n }",
"public static ArrayList<Point> read_from_file(String file){\n Locale.setDefault(new Locale(\"en\", \"US\"));\n\n ArrayList<Point> points = new ArrayList<>();\n\n try {\n //java.io.File myObj = new java.io.File(\"test_points_2.txt\");\n //java.io.File myObj = new java.io.File(\"points.txt\");\n java.io.File myObj = new java.io.File(file);\n Scanner myReader = new Scanner(myObj);\n int N = myReader.nextInt();\n\n //System.out.println(N);\n for (int i = 0; i < N; i++) {\n double x = myReader.nextDouble();\n double y = myReader.nextDouble();\n points.add(new Point(x, y));\n //System.out.println(\"x: \" + x + \" y: \" + y);\n }\n\n myReader.close();\n } catch (FileNotFoundException e) {\n System.out.println(\"An error occurred.\");\n e.printStackTrace();\n return null;\n }\n return points;\n }",
"public void loadMemory(String inputFile){\n\t\tint pc = 0;\n\t\ttry{\n\t\t\tRandomAccessFile raf = new RandomAccessFile(new File(inputFile),\"rw\");\n\t\t\tString strLine;\n\t\t\tint decimalNumber;\n\t\t\twhile ((strLine = raf.readLine())!=null){\n\t\t\t\tstrLine = strLine.substring(0, 8); //get the first 8 char(hex instruction)\n\t\t\t\tdecimalNumber = new BigInteger(strLine, 16).intValue(); //decode the hex into integer\n\t\t\t\tloadInstructionInMemory(pc, decimalNumber);\n\t\t\t\tpc += 4;\n\t\t\t}\n\t\t\traf.close();\n\t\t}\n\t\tcatch (Exception e){\n\t\t\tSystem.out.println(\"Error:\");\n\t\t\tSystem.out.println(e.getMessage());\n\t\t\tSystem.exit(0);\n\t\t}\n\t}",
"@SuppressWarnings(\"unchecked\")\n public ArrBag( String infileName ) throws Exception\n {\n count = 0; // i.e. logical size, actual number of elems in the array\n BufferedReader infile = new BufferedReader( new FileReader( infileName ) );\n while ( infile.ready() )\n this.add( (T) infile.readLine() );\n infile.close();\n }",
"String[] readFile(String path) {\n ArrayList<String> list = new ArrayList<>();\n String[] output = null;\n Scanner reader;\n File file;\n\n try {\n file = new File(path);\n reader = new Scanner(file);\n while (reader.hasNextLine()) {\n list.add(reader.nextLine());\n }\n output = new String[list.size()];\n for (int i = 0; i < list.size(); i++) output[i] = list.get(i);\n reader.close();\n } catch (FileNotFoundException e) {\n System.out.println(\"File not found exception\");\n }\n return output;\n }",
"public static void main(String[] args) {\n\t\t\r\n\t\tint [] x = new int[6];\r\n\t\tSystem.out.println(x.getClass());\r\n\r\n\t\t\r\n\t\ttry (BufferedReader br = new BufferedReader(new FileReader(\"C:\\\\testing.txt\")))\r\n\t\t{\r\n\r\n\t\t\tString line;\r\n\r\n\t\t\twhile ((line = br.readLine()) != null) {\r\n\t\t\t\tSystem.out.println(line);\r\n\t\t\t}\r\n\r\n\t\t} catch (Throwable e) {\r\n\t\t\t\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}",
"private boolean readBin(String filePath) throws FileNotFoundException, IOException {\n try {\n BufferedReader dataIn = new BufferedReader(new FileReader(filePath + \".bin\"));\n\n String next = dataIn.readLine();\n int length = Integer.parseInt(next);\n next = dataIn.readLine();\n start = Integer.parseInt(next);\n for (int i = 0; i < memory.length; i++) {\n next = dataIn.readLine();\n if (next == null) {\n break;\n }\n memory[i] = Integer.parseInt(next);\n }\n dataIn.close();\n } catch (IOException ex) {\n print(\"File error: \" + ex.toString());\n return true;\n }\n return false;\n\n }",
"@Override\n\tpublic List<double[]> read(String fileName) {\n\t\tlogger.info(\"Loading data from \" + fileName);\n\t\tList<double[]> records = new ArrayList<double[]>();\n\t\tCsvReader csvReader = null;\n\t\ttry{\n\t\t\tcsvReader = new CsvReader(fileName);\n\t\t\t\n\t\t\t\n\t\t\twhile(csvReader.readRecord()){\n\t\t\t\tint cols = csvReader.getColumnCount();\n\t\t\t\tdouble[] record = new double[cols];\n\t\t\t\tfor(int i=0; i< cols; i++){\n\t\t\t\t\trecord[i] = Double.parseDouble(csvReader.get(i));\n\t\t\t\t}\n\t\t\t\trecords.add(record);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\tthrow new LoadDataException(e);\n\t\t}finally{\n\t\t\tif(csvReader != null){\n\t\t\t\tcsvReader.close();\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn records;\n\t}",
"@Override\n public ArrayList parseFile(String pathToFile) {\n\n Scanner scanner = null;\n try {\n scanner = new Scanner(new File(pathToFile));\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n ArrayList<String> data = new ArrayList<>();\n while (scanner.hasNext()) {\n data.add(scanner.next());\n }\n scanner.close();\n\n return data;\n }",
"String[] readFile(File file) {\n ArrayList<String> list = new ArrayList<>();\n String[] output = null;\n Scanner reader = null;\n try {\n if (file.isFile()) {\n reader = new Scanner(file);\n while (reader.hasNextLine()) {\n list.add(reader.nextLine());\n }\n }\n } catch (FileNotFoundException e) {\n System.out.println(\"File not found exception\");\n }\n output = new String[list.size()];\n for (int i = 0; i < list.size(); i++) output[i] = list.get(i);\n reader.close();\n return output;\n }",
"private static City[] fileInterpreter(Scanner file,int numberOfLines){\n City[] cities = new City [numberOfLines];\n for(int i = 0 ; file.hasNextLine(); i++){\n String line = file.nextLine();\n Scanner string = new Scanner(line); //String Scanner to consume the line into city and country and rainfall...\n String cityName = string.next();\n String countryName = string.next();\n double[] data = extractRainfallInformation(line.split(\"[ \\t]+[ \\t]*\")); //to create the array of monthly rainfall\n cities[i] = new City(cityName , countryName , data);\n string.close();\n }\n file.close();\n return cities;\n }",
"@SuppressWarnings(\"unchecked\")\n\tpublic void readData(String fileName) {\n\t\ttry {\n\t\t\tFile file = new File(fileName);;\n\t\t\tif( !file.isFile() ) {\n\t\t\t\tSystem.out.println(\"ERRO\");\n\t\t\t\tSystem.exit(-1);\n\t\t\t}\n\t\t\tBufferedReader buffer = new BufferedReader( new FileReader(file) );\n\t\t\t/* Reconhece o valor do numero de vertices */\n\t\t\tString line = buffer.readLine();\n\t\t\tStringTokenizer token = new StringTokenizer(line, \" \");\n\t\t\tthis.num_nodes = Integer.parseInt( token.nextToken() );\n\t\t\tthis.nodesWeigths = new int[this.num_nodes];\n\t\t\t\n\t\t\t/* Le valores dos pesos dos vertices */\n\t\t\tfor(int i=0; i<this.num_nodes; i++) { // Percorre todas a linhas onde seta valorado os pesos dos vertices\n\t\t\t\tif( (line = buffer.readLine()) == null ) // Verifica se existe a linha a ser lida\n\t\t\t\t\tbreak;\n\t\t\t\ttoken = new StringTokenizer(line, \" \");\n\t\t\t\tthis.nodesWeigths[i] = Integer.parseInt( token.nextToken() ); // Adiciona o peso de vertice a posicao do arranjo correspondente ao vertice\n\t\t\t}\n\t\t\t\n\t\t\t/* Mapeia em um array de lista todas as arestas */\n\t\t\tthis.edges = new LinkedList[this.num_nodes];\n\t\t\tint cont = 0; // Contador com o total de arestas identificadas\n\t\t\t\n\t\t\t/* Percorre todas as linhas */\n\t\t\tfor(int row=0, col; row<this.num_nodes; row++) {\n\t\t\t\tif( (line = buffer.readLine()) == null ) // Verifica se ha a nova linha no arquivo\n\t\t\t\t\tbreak;\n\t\t\t\tthis.edges[row] = new LinkedList<Integer>(); // Aloca nova lista no arranjo, representado a linha o novo vertice mapeado\n\t\t\t\tcol = 0;\n\t\t\t\ttoken = new StringTokenizer(line, \" \"); // Divide a linha pelos espacos em branco\n\t\t\t\t\n\t\t\t\t/* Percorre todas as colunas */\n\t\t\t\twhile( token.hasMoreTokens() ) { // Enquanto ouver mais colunas na linha\n\t\t\t\t\tif( token.nextToken().equals(\"1\") ) { // Na matriz binaria, onde possui 1, e onde ha arestas\n//\t\t\t\t\t\tif( row != col ) { // Ignora-se os lacos\n\t\t\t\t\t\t\t//System.out.println(cont + \" = \" + (row+1) + \" - \" + (col+1) );\n\t\t\t\t\t\t\tthis.edges[row].add(col); // Adiciona no arranjo de listas a aresta\n\t\t\t\t\t\t\tcont++; // Incrementa-se o total de arestas encontradas\n//\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcol++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tthis.num_edges = cont; // Atribui o total de arestas encontradas\n\n\t\t\tif(true) {\n//\t\t\t\tfor(int i=0; i<this.num_nodes; i++) {\n//\t\t\t\t\tSystem.out.print(this.nodesWeigths[i] + \"\\n\");\n//\t\t\t\t}\n\t\t\t\tSystem.out.print(\"num edges = \" + cont + \"\\n\");\n\t\t\t}\n\t\t\t\n\t\t\tbuffer.close(); // Fecha o buffer\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public String[][] toRawArray(String fileName, int rows) throws FileNotFoundException{\n String[][] toReturn = new String[5][rows];\n Scanner file = new Scanner(new File(fileName+\".csv\"));\n file.nextLine();\n file.nextLine();\n for(int j=0; j<rows; j++){ //each row\n String line = file.nextLine();\n String[] lineSplit = line.split(\",\");\n for (int i=0; i<5; i++){\n toReturn[i][j] = lineSplit[i]; //fill columns, hold row constant\n } \n } \n return toReturn; \n }",
"public Student[] constructArray(String fileName)throws IOException{\n \n Student[] ans = new Student[10];\n Scanner Sc = new Scanner(new File(fileName));\n Sc.useDelimiter(\"\\t|\\n\");\n this.amount = 0;\n while(Sc.hasNext()){\n if(this.amount == ans.length){\n ans = doubler(ans);\n }\n String ID = Sc.next();\n String SName = Sc.next();\n String Email = Sc.next();\n String SClass = Sc.next();\n String major = Sc.next();\n ans[this.amount] = new Student(ID, SName, Email, SClass, major);\n amount++;\n }\n return ans;\n }",
"public static ArrayList<String> parseSequenceFile(String filePath) {\n\t\tArrayList<String> sequence = new ArrayList<String>();\n\t\tFile file = new File(filePath);\n\t\tScanner scanner;\n\n\t\ttry {\n\t\t\tscanner = new Scanner(file);\n\n\t\t\twhile (scanner.hasNextLine()) {\n\t\t\t\tsequence.add(scanner.nextLine());\n\t\t\t}\n\n\t\t\tscanner.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"File not found. Program aborted.\");\n\t\t\tSystem.exit(-1);\n\t\t}\n\n\t\treturn sequence;\n\t}",
"private void readFileToArray(FileInputStream fis, Warship[] wsArr) throws Exception {\n\t\tScanner scanner = null;\n\t\ttry {\n\t\t\tscanner = new Scanner(fis);\n\t\t\tint i = 0;\n\t\t\twhile (scanner.hasNextLine()) {\n\t\t\t\twsArr[i] = this.getWarship(scanner.nextLine());\n\t\t\t\ti++;\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tthrow new Exception(e.getMessage());\n\t\t} finally {\n\t\t\tif (scanner != null) {\n\t\t\t\tscanner.close();\n\t\t\t}\n\t\t}\n\t}",
"public static int[] readInts() {\n return readAllInts();\n }",
"public static int[][] readMatrix(int dimensions)\n {\n int row = 0;\n int column = 0;\n int doubleArray[][] = new int[dimensions][dimensions];\n In in = new In(\"matrix_1.txt\");\n while(!in.isEmpty())\n {\n if(column < dimensions)\n {\n doubleArray[row][column] = in.readInt();\n column++;\n }\n else\n {\n column = 0;\n row++;\n }\n }\n // Prints text file.\n for(int i = 0; i < dimensions; i++)\n {\n for(int j = 0; j < dimensions; j++)\n {\n StdOut.print(doubleArray[i][j]);\n }\n StdOut.println();\n }\n return doubleArray;\n }",
"public List<int[]> readCSVint() {\n\t\tCSVReader reader;\n\t\t// The strings pulled from file\n\t\tList<String[]> storedEntries = new ArrayList<String[]>();\n\t\t// Each string converted to int.\n\t\tList<int[]> convertedEntries = new ArrayList<int[]>();\n\n\t\t// Read the entire file into a List.\n\t\ttry {\n\t\t\treader = new CSVReader(new FileReader(getCSVFolder() + File.separator + getFileName() + \".csv\"));\n\t\t\tstoredEntries = reader.readAll();\n\t\t\treader.close();\t\t\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t// The current list contains strings, so we convert them.\n\t\tint size = storedEntries.get(0).length;\n\t\tfor (String[] row : storedEntries) {\n\t\t\tint[] convertedRow = new int[size];\n\t\t\tfor (int i = 0; i < size; i++) {\n\t\t\t\tconvertedRow[i] = Integer.parseInt(row[i]);\n\t\t\t}\n\t\t\tconvertedEntries.add(convertedRow);\n\t\t}\n\n\t\treturn convertedEntries;\n\t}",
"public int[][] getData(int lineNumber, int eleNumber, int numLines, int numEles) throws AreaFileException {\r\n return getData(lineNumber, eleNumber,numLines,numEles,1);\r\n }",
"public void populateGrid(String fname) {\n\t\t// try open file as input stream\n\t\ttry (InputStream is = Files.newInputStream(Paths.get(fname));\n\t\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(is))) {\n\n\t\t\tString line = null;\n\t\t\tint row = 0;\n\n\t\t\t// read every line in the file\n\t\t\twhile ((line = br.readLine()) != null) {\n\t\t\t\tfor (int col = 0; col < line.length(); col++) {\n\t\t\t\t\t// parse number as integer\n\t\t\t\t\tint value = Integer.parseInt(line.charAt(col) + \"\");\n\t\t\t\t\tif (value == 0) {\n\t\t\t\t\t\tgrid[row][col] = new Variable(row, col, value);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tgrid[row][col] = new Variable(row, col, value, \n\t\t\t\t\t\t\t\tnew ArrayList<Integer>(Arrays.asList(value)));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\trow++;\n\t\t\t}\n\n\t\t\t// if file can't be opened or not found\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(e);\n\t\t\tSystem.exit(0); \n\t\t}\n\t}",
"private void readFromConsole(){\n Scanner cin = new Scanner(System.in);\n\n if(cin.hasNext()){\n number = cin.nextInt();\n }\n array = new long[number];\n\n for(int num = 0; num < number; num++){\n if(cin.hasNext()){\n array[num] = cin.nextLong();\n }\n }\n }",
"static String[] copy(Scanner file, int lines){\t\t\n\t\tString[] array = new String[lines];\n\t\tfor(int i = 0; file.hasNextLine(); i++){\n\t\t array[i] = file.nextLine();\n\t\t}\n\t\treturn array;\n\t}",
"protected int[] readIntArray(BinaryDataReader dataReader) throws IOException\n\t{\n\t\tlong offset = ((long) this.value) & 0xffffffffL;\n\n\t\t// allocate memory for result\n\t\tint[] res = new int[this.count];\n\n\t\t// save pointer location\n\t\tlong saveLoc = dataReader.getFilePointer();\n\n\t\t// fill up array\n\t\tdataReader.seek(offset);\n\t\tfor (int c = 0; c < this.count; c++)\n\t\t{\n\t\t\tres[c] = dataReader.readInt();\n\t\t}\n\t\t\n\t\t// restore pointer and return result\n\t\tdataReader.seek(saveLoc);\n\t\treturn res;\n\t}"
] | [
"0.7256715",
"0.7089987",
"0.70297956",
"0.6990646",
"0.661834",
"0.66032505",
"0.64950687",
"0.64647824",
"0.64349294",
"0.64019865",
"0.63433516",
"0.6310875",
"0.6252244",
"0.6183573",
"0.61818224",
"0.6140183",
"0.6138576",
"0.61237115",
"0.6113065",
"0.6110656",
"0.6092032",
"0.60749745",
"0.6052618",
"0.60218",
"0.6014197",
"0.60120213",
"0.59708315",
"0.59459156",
"0.5925801",
"0.59176654",
"0.5891981",
"0.5867484",
"0.584032",
"0.5819029",
"0.57831854",
"0.57752347",
"0.57430667",
"0.57410526",
"0.57352066",
"0.5723045",
"0.57085794",
"0.5701033",
"0.5696549",
"0.56846166",
"0.568315",
"0.5664693",
"0.56628394",
"0.56613827",
"0.5623334",
"0.5622213",
"0.5620586",
"0.5598319",
"0.5598216",
"0.55887985",
"0.5575236",
"0.55653024",
"0.5547227",
"0.5533272",
"0.5532022",
"0.5529566",
"0.5517688",
"0.55131346",
"0.5496228",
"0.5476579",
"0.5475503",
"0.5471659",
"0.54534405",
"0.5436311",
"0.54313654",
"0.54216874",
"0.5413886",
"0.54041934",
"0.5400461",
"0.53990245",
"0.5396992",
"0.5391927",
"0.5383866",
"0.53806436",
"0.5379764",
"0.53543174",
"0.534993",
"0.5346966",
"0.5339892",
"0.5334395",
"0.532873",
"0.53246176",
"0.53235555",
"0.5316627",
"0.5301496",
"0.5301248",
"0.52967995",
"0.5296614",
"0.52863294",
"0.52778757",
"0.5269922",
"0.525533",
"0.5251193",
"0.52489215",
"0.5240399",
"0.52383095",
"0.5236835"
] | 0.0 | -1 |
update the ListView using the list of numbers | @Override
protected void onPostExecute(List<String> list) {
ArrayAdapter<String> aaNumbers = new ArrayAdapter<>(MainActivity.this,
android.R.layout.simple_list_item_1, list);
ListView lvNumbers = (ListView)findViewById(R.id.lvNumbers);
lvNumbers.setAdapter(aaNumbers);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void updateListViewAndCount() {\n \t\n \t//updating the currentTaskItems then getting a array of the list\n \tListView items = (ListView)findViewById(R.id.showAttachedItems);\n \t\n \tArrayList<ItemListElement> item = formatOutputForList();\n \tItemListElement[] elm = new ItemListElement[item.size()];\n \titem.toArray(elm);\n \t\n \t//updating the list view\n \tItemListAdapter adapter = \n \t new ItemListAdapter(this, R.layout.list_multi, elm);\n items.setAdapter(adapter);\n \t\n \t//update the item count\n \tEditText num = (EditText)findViewById(R.id.showCurrentItemNum);\n \tint value = currentTaskItems.size();\n \tString val = Integer.toString(value);\n \tnum.setText(val);\t\n }",
"private void updateExpenseListView() {\n expenseListView.getItems().clear();\n int count = 1;\n for (Expense expense : duke.expenseList.getExternalList()) {\n expenseListView.getItems().add(count + \". \" + expense.toString());\n count++;\n }\n }",
"public void updateListView(){\n mAdapter = new ListViewAdapter(getActivity(),((MainActivity)getActivity()).getRockstarsList());\n mRockstarsListView.setAdapter(mAdapter);\n }",
"public void updateInterpList(){\n System.out.println(\"updating list\");\n tableVals = FXCollections.observableArrayList();\n for(InterpreterStaff interp: getInterpreterStaff()){\n tableVals.add(new InterpreterTableAdapter(interp));\n }\n InterpInfoTable.setItems(tableVals);\n }",
"private void updateListView() {\n adapter = new TableItemAdapter(this, tableItems);\n this.listView.setAdapter(adapter);\n }",
"private void updateListView() {\n ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.textview, geofences);\n ListView list = (ListView) findViewById(R.id.listView);\n list.setAdapter(adapter);\n }",
"private void refreshListView() {\n\t\t\tisEnd=false;\n\t\t\tlistView.setMode(Mode.PULL_FROM_START);\n\t\t\tjsonArray=new JSONArray();\n\t\t\tcurrentPage=0;\n\t\t\tgetSharePage(++currentPage);\n\t\t\t\n\t\t}",
"private void updateUi (){\n //get the first list item postion\n int currentPosition =listView.getFirstVisiblePosition();\n //append the new recipes to listview\n RecipeAdapter adapter = new RecipeAdapter(this , recipesList);\n listView.setAdapter(adapter);\n // Setting new scroll position to continue\n listView.setSelectionFromTop(currentPosition + 1, 0);\n }",
"private void updateListView() {\n fileList.getItems().setAll(files.readList());\n //System.out.println(System.currentTimeMillis() - start + \" мс\");\n }",
"void bind(int listIndex) {\n\n //listItemNumberView.setText(String.valueOf(listIndex));\n }",
"public void populateListView() {\n Cursor scores = myDb.getAllData();\n\n String[] columns = new String[]{\n myDb.COL_2,\n myDb.COL_3,\n myDb.COL_4,\n myDb.COL_5\n };\n\n int[] boundTo = new int[]{\n R.id.topScore,\n R.id.topCount,\n R.id.bottomScore,\n R.id.bottomCount\n };\n\n simpleCursorAdapter = new SimpleCursorAdapter(this,\n R.layout.history_list,\n scores,\n columns,\n boundTo,\n 0);\n scoreHistory.setAdapter(simpleCursorAdapter);\n\n// topScore.setTypeface(numberFont);\n// topCount.setTypeface(numberFont);\n// bottomScore.setTypeface(numberFont);\n// bottomCount.setTypeface(numberFont);\n\n\n }",
"public void update_list_view() {\n\n Collections.sort(mA.alarms);\n\n // make array adapter to bind arraylist to listview with new custom item layout\n AlarmsAdapter aa = new AlarmsAdapter(mA, R.layout.alarm_entry, mA.alarms);\n alarm_list_view.setAdapter(aa);\n registerForContextMenu(alarm_list_view);\n aa.notifyDataSetChanged(); // to refresh items in the list\n }",
"public void populateListView() {\n\n\n }",
"private void populateListView() {\n ArrayAdapter<Representative> adapter = new MyListAdapter();\n ListView list = (ListView) findViewById(R.id.repListView);\n list.setAdapter(adapter);\n }",
"private void updateUi(ArrayList<Book> books) {\n ListView booksList = (ListView) activity.findViewById(R.id.books_list);\n BookAdapter adapter = new BookAdapter(activity, books);\n booksList.setAdapter(adapter);\n\n }",
"public void refreshList() {\n mCursor.requery();\n mCount = mCursor.getCount() + mExtraOffset;\n notifyDataSetChanged();\n }",
"private void updateList() {\r\n\t\tlistaStaff.setItems(FXCollections.observableArrayList(service\r\n\t\t\t\t.getStaff()));\r\n\t}",
"private void refreshList() {\n ArrayAdapter<Plan> planAdapter = new PlanAdapter();\n mListView.setAdapter(planAdapter);\n\n }",
"public void updateListView() {\n listView = findViewById(R.id.list_view);\n contactList = new ArrayList<>();\n Cursor cursor = db.getAllContacts();\n\n if (cursor.getCount() == 0) {\n contactListAdaptor.clear();\n contactListAdaptor.notifyDataSetChanged();\n Toast.makeText(this, \"No contacts added!\", Toast.LENGTH_SHORT).show();\n } else {\n while (cursor.moveToNext()) {\n Pair<String, String> contact = new Pair<>(cursor.getString(1), cursor.getString(2));\n contactList.add(contact);\n }\n contactListAdaptor = new ContactListAdaptor(this, contactList, this);\n listView.setAdapter(contactListAdaptor);\n }\n }",
"public void refreshListClicked(View view){\n\n mPetList = ((ListView) findViewById(R.id.pet_list_view));\n\n final ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_expandable_list_item_1, petList);\n mPetList.setAdapter(adapter);\n }",
"private void updateUI() {\n ArrayList<String> taskList = new ArrayList<>();\n SQLiteDatabase db = mHelper.getReadableDatabase();\n Cursor cursor = db.query(Task.TaskEntry.TABLE,new String[] {Task.TaskEntry.COL_TASK_TITLE},null,null,null,null,null);\n listItems.clear();\n\n while (cursor.moveToNext()){\n int index = cursor.getColumnIndex(Task.TaskEntry.COL_TASK_TITLE);\n taskList.add(cursor.getString(index));\n ListItems item = new ListItems(cursor.getString(index));\n listItems.add(item);\n }\n\n\n R_adapter = new RecyclerAdapterGoals(this.getContext(), listItems);\n mTaskListView.setAdapter(R_adapter);\n cursor.close();\n db.close();\n }",
"private void refreshListView() {\n\t\tSQLiteDatabase db = dbh.getReadableDatabase();\n\t\tsharedListView.setAdapter(null);\n\t\tCursor c1 = db.rawQuery(\"SELECT _id, title, subtitle, content, author, otheruser FROM todos WHERE otheruser = '\" + author + \"'\", null);\n\t\tListAdapter adapter2 = new SimpleCursorAdapter(this, R.layout.activity_items, c1, from, to, 0);\n\t\tsharedListView.setAdapter(adapter2);\n\t\tadapter.notifyDataSetChanged();\n\t}",
"private void updateListView() {\n if (smsListView.getAdapter() == null) {\n Log.d(TAG, \"updateListView: set new adapter\");\n smsListView.setAdapter(new SmsListAdapter(SmsListActivity.this, getDataProviderManager(),\n getLayoutInflater()));\n smsListView.setEmptyView(findViewById(R.id.nosms));\n smsListView.setOnItemClickListener(new OnItemClickListener() {\n\n @Override\n public void onItemClick(AdapterView<?> arg0, View arg1, int index, long itemId) {\n if (itemId != -1) {\n Intent smsDetails = new Intent(SmsListActivity.this, SmsDetailsActivity.class);\n smsDetails.putExtra(EXTRAS_KEY_SMSID, Long.valueOf(itemId));\n startActivityForResult(smsDetails, R.id.requestCode_sms_changeInDetailView);\n }\n }\n });\n\n smsListView.setOnItemLongClickListener(new OnItemLongClickListener() {\n\n @Override\n public boolean onItemLongClick(AdapterView<?> arg0, View arg1, int index, long itemId) {\n return showItemLongClickMenu(arg0, itemId, index);\n }\n });\n } else {\n Log.d(TAG, \"updateListView: notifyDataSetChanged\");\n ((SmsListAdapter) smsListView.getAdapter()).clearImageCache();\n ((SmsListAdapter) smsListView.getAdapter()).notifyDataSetChanged();\n }\n\n }",
"private void updateUI() {\n /* Making an array of strings to store tasks entered by the user. */\n ArrayList<String> taskList = new ArrayList<>();\n SQLiteDatabase db = OpenDB.getReadableDatabase();\n Cursor cursor = db.query(AccessData.ToDoEntry.table,\n new String[]{AccessData.ToDoEntry._ID, AccessData.ToDoEntry.todo_title},\n null, null, null, null, null);\n while (cursor.moveToNext()) {\n int idx = cursor.getColumnIndex(AccessData.ToDoEntry.todo_title);\n taskList.add(cursor.getString(idx));\n }\n\n /* Check if array adapter is created. */\n if (listAdapter == null) {\n /* If adapter is not created i.e. NULL, create a new adapter */\n listAdapter = new ArrayAdapter<>(this,\n R.layout.todo_item,\n R.id.task_title,\n taskList);\n /* Set the above created adapter as the todoListView adapter */\n todoListView.setAdapter(listAdapter);\n } else {\n /* If created: it is assigned to the todoListView */\n listAdapter.clear(); // clear it\n listAdapter.addAll(taskList); // re-populate it\n listAdapter.notifyDataSetChanged(); // notify view to refresh with new data values\n }\n\n cursor.close();\n db.close();\n }",
"private void updateListViewLogWindow()\n {\n listViewMessageItems.clear();\n\n for(int i =0;i<= printResult.size() - 1;i++)\n {\n listViewMessageItems.add(printResult.get(i));\n }\n\n }",
"private void updateUI() {\n ArrayList<String> taskList = new ArrayList<>();\n\n //a read-only database object will be returned\n SQLiteDatabase db = dbHelper.getReadableDatabase();\n\n //query the table, returning a cursor over the set with all the columns\n Cursor cursor = db.query(TaskContract.TaskEntry.TABLE,\n new String[]{TaskContract.TaskEntry._ID, TaskContract.TaskEntry.COL_TASK_TITLE},\n null, null, null, null, null);\n\n //Place the items in an ArrayList of Strings\n while (cursor.moveToNext()) {\n int columnIndex = cursor.getColumnIndex(TaskContract.TaskEntry.COL_TASK_TITLE);\n taskList.add(cursor.getString(columnIndex));\n }\n\n //If the adapter is not created or null, then set it as the adapter of the ListView\n if (arrayAdapterToDo == null) {\n arrayAdapterToDo = new ArrayAdapter<String>(this,\n R.layout.item_todo, //what view to user for the items\n R.id.taskTitle, //where to put the String of data\n taskList); //where to get all the data\n listView.setAdapter(arrayAdapterToDo); //set it as the adapter of the ListView Instance\n } else {\n arrayAdapterToDo.clear(); //remove all the elements from the list\n arrayAdapterToDo.addAll(taskList); //add all the items from the database, came from the while loop populating taskList\n arrayAdapterToDo.notifyDataSetChanged(); //alert the ListView that the data changed and it should refresh itself\n }\n cursor.close(); //close the cursor object\n db.close(); //close the database object\n }",
"public void upDateListView(List<FlightInfoTemp> list) {\n adapter.setData(list);\n adapter.notifyDataSetChanged();\n }",
"public void refreshListView() {\n \n \tLog.i(\"refresh list view\", \"Enter\");\n \ttry {\n \t\tif(taskListCursor != null) {\n\t \t\ttaskListCursor.close();\n\t \t\ttaskListCursor = null;\n \t\t}\n FileDbAdapter fda = new FileDbAdapter();\n fda.open();\n \t\ttaskListCursor = fda.fetchTasksForSource(getSource(), true);\n \tfda.close();\n \t} catch (Exception e) {\n \t\te.printStackTrace(); \t// TODO handle exception\n \t}\n \ttasks.changeCursor(taskListCursor);\n \tstartManagingCursor(taskListCursor);\n \ttasks.notifyDataSetChanged();\n\n }",
"public void updateListView(List<Event> list) {\n this.eventsList = list;\n notifyDataSetChanged();\n }",
"public void updateListView(ArrayList<itemInfo> playerCards){\n final ListView itemListView = findViewById(R.id.itemListView);\n\n // Standard list view adapter\n /*\n final listViewAdapter listAdapter = new listViewAdapter(this,R.layout.itemlistlayout);\n itemListView.setAdapter(listAdapter);\n */\n\n //Array list adapter\n cardArrayAdapter myArrayAdapter = new cardArrayAdapter(this,playerCards);\n itemListView.setAdapter(myArrayAdapter);\n\n //Refresh the adapter data from the arraylist\n myArrayAdapter.notifyDataSetChanged();\n\n //playerCard = playerCards.get(cardCounter);\n\n //listAdapter.add(playerCard);\n\n listCount = itemListView.getAdapter().getCount();\n\n //cardCounter = cardCounter + 1;\n\n }",
"public void setAdapter() {\n\t\tactivityAdapter = new ActivitiesAdapter(getActivity(), List,\n\t\t\t\ttotalmintxt);\n\t\tSystem.out.println(\"listsize=\" + List.size());\n\t\tif (List.size() > 0) {\n\t\t\tint totalmin = 0, totalcal = 0;\n\t\t\tfor (int i = 0; i < List.size(); i++) {\n\t\t\t\ttotalmin += Integer.parseInt(List.get(i).get(\n\t\t\t\t\t\tBaseActivity.total_time_minutes));\n\t\t\t\ttotalcal += Integer.parseInt(List.get(i).get(\n\t\t\t\t\t\tBaseActivity.calories_burned));\n\n\t\t\t}\n\t\t\ttotalmintxt.setText(\"\" + totalmin + \" min\");// calories_burned\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// calories_burned\n\t\t\ttotalcaltxt.setText(\"\" + totalcal + \" cal\");\n\t\t\tactivityListView.setAdapter(activityAdapter);\n\n\t\t\tcom.fitmi.utils.Constants.totalcal = totalcal;\n\n\t\t\tHomeFragment tosetCalory = new HomeFragment();\n\t\t\tNotificationCaloryBurn callBack = (NotificationCaloryBurn) tosetCalory;\n\n\t\t\tcallBack.setTotalCaloryBurn(com.fitmi.utils.Constants.totalcal);\n\t\t} else {\n\n\t\t\ttotalcaltxt.setText(\"0 cal\");\n\t\t\tactivityListView.setAdapter(activityAdapter);\n\t\t}\n\n\t\tsetActivitySpinner();\n\t}",
"private void updateStats(ListView statsMenu) {\n ObservableList<String> scoresList = FXCollections.observableArrayList();\n for (int i = 0; i < quizScores.getSize(); i++) {\n scoresList.add(quizScores.getScore(i));\n }\n statsMenu.setItems(scoresList);\n setCellFormat(statsMenu);\n }",
"public void update()\n\t{\n\t\t//update the view's list of movies...\n\t\tthis.getRemoveButton().setEnabled((this.database.getNumberOfMovies()>0));\n\t\tthis.movieList.setListData(this.database.toList());\n\t}",
"public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n ListView lv = (ListView) findViewById(R.id.contact_list_view);\n BaseAdapter listAdapter = (BaseAdapter) lv.getAdapter();\n Contact selectedContact = (Contact) listAdapter.getItem(position);\n int updatedNumbers = InternationalizerCore.updateContact(getContentResolver(), selectedContact);\n // Update View\n listAdapter.notifyDataSetChanged();\n Toast.makeText(getApplicationContext(), \n \"Internationalized \" + updatedNumbers + \" Numbers.\", Toast.LENGTH_SHORT).show();\n }",
"private void refreshListView() {\n model.updateAllFilteredLists(history.getPrevKeywords(), history.getPrevStartDate(),\n history.getPrevEndDate(), history.getPrevState(),\n history.getPrevSearches());\n }",
"public void updateList() \n { \n model.clear();\n for(int i = ScholarshipTask.repository.data.size() - 1; i >= 0; i--) \n {\n model.addElement(ScholarshipTask.repository.data.get(i));\n }\n }",
"private void updateListAdapter(List<Contact> contacts) {\n ListView lv = (ListView) findViewById(R.id.contact_list_view);\n ArrayAdapter<Contact> listAdapter = new ArrayAdapter<Contact>(this, R.layout.contact_list_item, contacts);\n lv.setAdapter(listAdapter);\n listAdapter.notifyDataSetChanged();\n }",
"private void reloadListView() {\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n mDevicesListViewAdapter.notifyDataSetChanged();\n }\n });\n }",
"public void redrawListView() {\n\t\tMySimpleCursorAdapter adapt = (MySimpleCursorAdapter)this.getListAdapter();\n\t\tadapt.notifyDataSetChanged();\n\t}",
"private void updateListView(ArrayList<MovieAPI> allmovies_list){\n\n moviesAPI_list = allmovies_list;\n\n mtitles_array = new String[allmovies_list.size()];\n\n for(int m=0; m<allmovies_list.size();m++){\n\n mtitles_array[m]=allmovies_list.get(m).getTitle();\n\n }\n\n\n final ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, android.R.id.text1, mtitles_array);\n\n\n runOnUiThread(new Runnable() {\n public void run() {\n apiMoviesListview_m.setAdapter(adapter);\n }\n });\n\n\n apiMoviesListview_m.setOnItemClickListener(new AdapterView.OnItemClickListener() {\n @Override\n public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {\n // TODO Auto-generated method stub\n\n String value = adapter.getItem(position);\n\n switchToSingleRatingActivity(position);\n\n }\n });\n\n }",
"private void setList() {\n Log.i(LOG,\"+++ setList\");\n txtCount.setText(\"\" + projectTaskList.size());\n if (projectTaskList.isEmpty()) {\n return;\n }\n\n projectTaskAdapter = new ProjectTaskAdapter(projectTaskList, darkColor, getActivity(), new ProjectTaskAdapter.TaskListener() {\n @Override\n public void onTaskNameClicked(ProjectTaskDTO projTask, int position) {\n projectTask = projTask;\n mListener.onStatusUpdateRequested(projectTask,position);\n }\n\n\n });\n\n mRecyclerView.setAdapter(projectTaskAdapter);\n mRecyclerView.scrollToPosition(selectedIndex);\n\n }",
"private void supaporn() {\n\t\tlistView = (ListView) findViewById(R.id.listView1);\n\t\tlists = new ArrayList<items_list>();\n\t\tadapter=new MyAdater();\n\t\tlistView.setAdapter(adapter);\n\t}",
"public void updateUsersList() {\n\t adapter = new UsersAdapter(getActivity(), allUsers);\n setListAdapter(adapter);\n\t getListView().setOnItemClickListener(this);\n\t}",
"public void setListView() {\n arr = inSet.toArray(new String[inSet.size()]);\n adapter = new ArrayAdapter(SetBlock.this, android.R.layout.simple_list_item_1, arr);\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n adapter.notifyDataSetChanged();\n listView.setAdapter(adapter);\n }\n });\n }",
"public void show() {\n numberList.show();\n }",
"private void setupListView() {\n potList = loadPotList();\n arrayofpots = potList.getPotDescriptions();\n refresher(arrayofpots);\n }",
"public void refreshList()\n {\n final ArrayAdapter adapter = (ArrayAdapter)this.foodListAdapter;\n this.getActivity().runOnUiThread(new Runnable() {\n public void run() {\n adapter.notifyDataSetChanged();\n }\n });\n }",
"private void setOnListView() {\n\t\tlist.setItems(obs);\n\t\tlist.setCellFactory(new Callback<ListView<User>, ListCell<User>>(){\n\n\t\t\t@Override\n\t\t\tpublic ListCell<User> call(ListView<User> p) {\n\t\t\t\t\n\t\t\t\tListCell<User> cell = new ListCell<User>() {\n\t\t\t\t\t\n\t\t\t\t\t@Override \n\t\t\t\t\tprotected void updateItem(User s, boolean bln) {\n\t\t\t\t\t\tsuper.updateItem(s, bln);\n\t\t\t\t\t\tif(s != null) {\n\t\t\t\t\t\t\tsetText(s.getUserName());\n\t\t\t\t\t\t}else\n\t\t\t\t\t\t\tsetText(\"\");\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\treturn cell;\n\t\t\t}\n\t\t});\n\t}",
"public void run() {\n ListAdapter adapter = new SimpleAdapter(\n Activity_List.this, spotsList,\n R.layout.item_spot, new String[] { TAG_REF,\n TAG_STATE,TAG_UPDATE,TAG_PID},\n new int[] { R.id.tv_spot_ref, R.id.tv_spot_state , R.id.tv_spot_owner,R.id.pid});\n // updating listview\n setListAdapter(adapter);\n }",
"public void updateJList() {\n list.setModel(toListModel(auctionItemList));\n }",
"private void updateAdapter(List<ParseUser> usersList) {\n adapter = new CommunityUsersAdapter(getContext(), usersList); // (1) create adapter\n rvUsers.setAdapter(adapter); // (2) set adapter on rv\n rvUsers.setLayoutManager(new LinearLayoutManager(getContext())); // (3) set layout manager on rv\n adapter.notifyDataSetChanged();\n }",
"private void updateView() {\n model.inlezenHighscore();\n for (int i = 0; i < 10; i++) {\n view.getNaamLabels(i).setText(model.getNaam(i));\n view.getScoreLabels(i).setText(model.getScores(i));\n }\n }",
"public void setDataAndRefresh(List<T> data) {\n this.data = data;\n// views = new ArrayList<>(data.size());\n// // builder data set of all item view\n// for (int i = 0; i < data.size(); i++) {\n// int itemLayoutId = getItemLayoutId();\n// LayoutInflater inflater = LayoutInflater.from(getContext());\n// View itemView = inflater.inflate(itemLayoutId, null);\n// fillData(itemView, data.get(i));\n// // add item titleView\n// views.add(itemView);\n// }\n notifyDataSetChanged();\n }",
"@Override\n\tpublic View getView(final int position, View convertView, ViewGroup parent) {\n\t\tconvertView=LayoutInflater.from(con).inflate(R.layout.lawyerlist, null);\n\t\t\nTextView li=(TextView) convertView.findViewById(R.id.t1);\n\t\t\n\t\tTextView li1=(TextView) convertView.findViewById(R.id.t2);\n\t\tTextView li2=(TextView) convertView.findViewById(R.id.t3);\n\n\t\tTextView li3=(TextView) convertView.findViewById(R.id.t4);\n\t\tTextView li4=(TextView) convertView.findViewById(R.id.t5);\n\n\t\tli.setText(items4.get(position));\n\t\tli1.setText(items5.get(position));\n\t\tli2.setText(items1.get(position));\n\t\tli3.setText(items2.get(position));\n\t\tli4.setText(items3.get(position));\n\n\t\tImageView call = (ImageView) convertView.findViewById(R.id.call);\n\t\tcall.setOnClickListener(new View.OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(View view) {\n\t\t\t\tString number = items3.get(position);\n\t\t\t\tIntent callIntent = new Intent(Intent.ACTION_CALL);\n\t\t\t\tcallIntent.setData(Uri.parse(\"tel:\" + number));\n\t\t\t\tif (ActivityCompat.checkSelfPermission(con, Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED) {\n\t\t\t\t\t// TODO: Consider calling\n\t\t\t\t\t// ActivityCompat#requestPermissions\n\t\t\t\t\t// here to request the missing permissions, and then overriding\n\t\t\t\t\t// public void onRequestPermissionsResult(int requestCode, String[] permissions,\n\t\t\t\t\t// int[] grantResults)\n\t\t\t\t\t// to handle the case where the user grants the permission. See the documentation\n\t\t\t\t\t// for ActivityCompat#requestPermissions for more details.\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcon.startActivity(callIntent);\n\t\t\t}\n\t\t});\n\t\tTextView vm5=(TextView) convertView.findViewById(R.id.vm5);\n\t\t//TextView vm1=(TextView) convertView.findViewById(R.id.vm1);\n\t\t/*TextView vm5=(TextView) convertView.findViewById(R.id.vm5);\n\t\t//TextView vm2=(TextView) convertView.findViewById(R.id.vm2);\n\t\t vm3=(LinearLayout) convertView.findViewById(R.id.vm3);\n\t\tTextView vm4=(TextView) convertView.findViewById(R.id.vm4);\n\t\t vm=(TextView) convertView.findViewById(R.id.vm);\n\t\tvm.setOnClickListener(new View.OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(View view) {\n\t\t\t\t// Toast.makeText(getActivity(), \"clickz....\", Toast.LENGTH_LONG).show();\n\t\t\t\tViewGroup.LayoutParams params = vm3.getLayoutParams();\n\t\t\t\tparams.height = ViewGroup.LayoutParams.WRAP_CONTENT;\n\t\t\t\tvm3.setLayoutParams(params);\n\n\n\t\t\t\tvm.setVisibility(View.INVISIBLE);\n\t\t\t}\n\t\t});\n\t\tvm4.setOnClickListener(new View.OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(View view) {\n\t\t\t\t// Toast.makeText(getActivity(), \"clickz....\", Toast.LENGTH_LONG).show();\n\t\t\t\tViewGroup.LayoutParams params = vm3.getLayoutParams();\n\t\t\t\tparams.height = 0;\n\t\t\t\tvm3.setLayoutParams(params);\n\n\t\t\t\tvm.setVisibility(View.VISIBLE);\n\t\t\t}\n\t\t});*/\n\t\tvm5.setOnClickListener(new View.OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(View view) {\n\n\t\t\t\t dialog = new Dialog(con);\n\t\t\t\tdialog.setContentView(R.layout.casedetail);\n\t\t\t\tdialog.setTitle(\"Case Details\");\n\t\t\t\tdialog.show();\n\n\t\t\t\tsp = PreferenceManager.getDefaultSharedPreferences(con);\n\t\t\t\ted = sp.edit();\n\n\n\n\n\n\t\t\t\tTitle=(EditText) dialog.findViewById(R.id.input_name) ;\n\t\t\t\tradioGroup = (RadioGroup)dialog. findViewById(R.id.radioGender);\n\t\t\t\tradioButton = (RadioButton) dialog.findViewById(R.id.radioMale);\n\t\t\t\tNumber=(EditText) dialog.findViewById(R.id.input_name1) ;\n\t\t\t\tDescription=(EditText)dialog. findViewById(R.id.input_address);\n\n\t\t\t\tsignupButton=(Button) dialog.findViewById(R.id.btn_signup) ;\n\n\n\n\t\t\t\tsignupButton.setOnClickListener(new View.OnClickListener() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\t// Finish the registration screen and return to the Login activity\n\n\n\n\t\t\t\t\t\ttit1 = Title.getText().toString();\n\t\t\t\t\t\tnum1 = Number.getText().toString();\n\t\t\t\t\t\tdesc1 = Description.getText().toString();\n\n\t\t\t\t\t\tint selectedId = radioGroup.getCheckedRadioButtonId();\n\t\t\t\t\t\tif(selectedId == radioButton.getId())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//yo stirng database ma store gara hai ani sabai huncha\n\n\t\t\t\t\t\t\tgender = \"civil\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tgender = \"criminal\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// find the radiobutton by returned id\n\t\t\t\t\t\t// radioButton = (RadioButton) findViewById(selectedId);\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\ttit = URLEncoder.encode(tit1, \"UTF-8\");\n\t\t\t\t\t\t\tnum = URLEncoder.encode(num1, \"UTF-8\");\n\t\t\t\t\t\t\tdesc = URLEncoder.encode(desc1, \"UTF-8\");\n\n\n\n\t\t\t\t\t\t} catch (UnsupportedEncodingException e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Toast.makeText(con ,\"clickz....\"+items6.get(position), Toast.LENGTH_LONG).show();\n\t\t\t\t\t\tuserid=sp.getString(\"user_id\",\"\");\n\t\t\t\t\t\tlawid=items6.get(position);\n\t\t\t\t\t\tnew AsyncHttpTask().execute(\"http://\"+sp.getString(\"ipaddrress\",\"\")+\"/LawSource/clientwebservice/caserequest.jsp?userid=\"+userid+\"&lawid=\"+lawid+\"&tit=\"+tit+\"&type=\"+gender+\"&num=\"+num+\"&desc=\"+desc);\n\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t}\n\t\t});\n\n\t\treturn convertView;\n\t}",
"private void refreshListView(ArrayList<MapPackage> list) {\n if (m_listAdapter != null) {\n m_listAdapter.clear();\n m_listAdapter.addAll(list);\n m_listAdapter.notifyDataSetChanged();\n } else {\n m_listAdapter = new MapListAdapter(m_activity, android.R.layout.simple_list_item_1,\n list);\n m_activity.setListAdapter(m_listAdapter);\n }\n m_currentMapPackageList = list;\n }",
"public void updateAlarmListView() {\n AlarmListViewUpdater alarmListViewUpdater = new AlarmListViewUpdater();\n alarmListViewUpdater.execute();\n\n\n }",
"public void refresh(List<T> list) {\n this.items = list;\n notifyDataSetChanged();\n }",
"protected void updateDisplay() {\n BuildingAdapter adapter = new BuildingAdapter(this, R.layout.item_building, buildingList);\n setListAdapter(adapter);\n }",
"private void initList() {\n tempShopList=wdh.getTempShopList();\n final String[] listIndex=new String[tempShopList.size()];\n \n // System.out.println(tempShopList.size());\n \n for(int i=0;i<tempShopList.size();i++)\n listIndex[i]=String.valueOf(i+1); \n \n// jList1=new JList(listIndex);\n// jScrollPane1=new JScrollPane(jList1);\n// jScrollPane1.setViewportView(jList1);\n \n \n jList1.setModel(new javax.swing.AbstractListModel() {\n String[] strings1 = listIndex;\n public int getSize() { return strings1.length; }\n public Object getElementAt(int i) { return strings1[i]; }\n });\n jScrollPane1.setViewportView(jList1);\n \n }",
"@Override\r\n public void run() {\n mBinding.listView.setAdapter(new ArrayAdapter<>(mBinding.listView.getContext(),\r\n android.R.layout.simple_list_item_1, Arrays.asList(\"a\", \"b\")));\r\n }",
"private void updateListViewHospitalItems()\n {\n\n listViewHospitalItems.clear();\n\n List<Department> departments = humanPlayer.getDepartments();\n for(int i = 0; i < departments.size(); i++)\n {\n Department department = departments.get(i);\n String name = department.getName();\n int waiting_count = department.getWaitingPatientCount();\n int cured_count = department.getCuredPatientCount();\n int capacity = department.getBedCapacity();\n int fee = department.getFee();\n int cost = department.getUpgradeCost();\n String str_waiting = calibrate(waiting_count);\n String str_cured_count = calibrate(cured_count);\n String str_capacity = calibrate(capacity);\n String str_fee = calibrate(fee);\n String str_cost = calibrate(cost);\n\n if(name.equals(\"Fever\"))\n {\n name = \" Fever\";\n }\n listViewHospitalItems.add(\" \" + name + \" \" + str_waiting + \" \" + str_cured_count + \" \" + str_capacity + \" \" + str_fee + \" \" + str_cost );\n }\n }",
"private void btn1Event(){\n int cnt = Integer.parseInt(tfNum1.getText());\n int i = 0;\n for (i=0; i<cnt; i++){\n list.add(new NumGenA());\n taResults.appendText(String.valueOf(i) + \n \" = \" + String.valueOf(list.get(i).getValue() + \"\\n\"));\n \n lab2.setText(String.valueOf(NumGenA.getCount()));\n }\n }",
"private void fillData() {\n adapter = new ListViewAdapter();\n listview01.setAdapter(adapter);\n }",
"public void updateList(){\r\n preyFragmentAdapter=new PreyFragmentAdapter(CPreyArrayList,this);\r\n recyclerView.setAdapter(preyFragmentAdapter);\r\n LinearLayoutManager a=new LinearLayoutManager(this.getContext());\r\n recyclerView.setLayoutManager(a);\r\n\r\n\r\n }",
"private void update(LinkedTaskList linkedTaskList){\n dispose();\n new View(linkedTaskList);\n }",
"private void showList() {\n try {\n swipeRefreshLayout.setVisibility(View.VISIBLE);\n tvMessage.setVisibility(View.GONE);\n\n /* to void duplicate data*/\n Set<NewsDetail> newsDetailSet = new HashSet<NewsDetail>(newsList);\n\n newsList.clear();\n newsList = new ArrayList<NewsDetail>(newsDetailSet);\n if (adapter == null) {\n adapter = new NewsListAdapter(mContext, newsList);\n listView.setAdapter(adapter);\n } else {\n adapter.notifyDataSetChanged();\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }",
"private void updateUserList() {\n\t\tUser u = jdbc.get_user(lastClickedUser);\n\t\tString s = String.format(\"%s, %s [%s]\", u.get_lastname(), u.get_firstname(), u.get_username());\n\t\tuserList.setElementAt(s, lastClickedIndex);\n\t}",
"private void update(){\n\t\tIterator it = lList.iterator();\r\n\t\tString out=\"\"; // it used for collecting all members\r\n\t\tint count = 0;\r\n\t\twhile (it.hasNext()){\r\n\t\t\tObject element = it.next();\r\n\t\t\tout += \"\\nPERSON \" + count + \"\\n\";\r\n\t\t\tout += \"=============\\n\";\r\n\t\t\tout += element.toString();\r\n\t\t\t++count;\r\n\t\t}\t\t\r\n\t\toutputArea.setText(out); \r\n\t}",
"public void updateContent(){\r\n\t\tthis.initRecords();\r\n\t\tlist.show(records);\r\n\t}",
"private void display()\n {\n tasksColumn.setCellValueFactory(new PropertyValueFactory<>(\"task\"));\n completionDateColumn.setCellValueFactory(new PropertyValueFactory<>(\"completionDate\"));\n completedColumn.setCellValueFactory(new PropertyValueFactory<>(\"completed\"));\n\n listView.getItems().add(Item.getToDoList().get(index));\n index++;\n }",
"private void updateList() {\n Model.instace.getAllArticles(new ArticleFirebase.GetAllArticlesAndObserveCallback() {\n @Override\n public void onComplete(List<Article> list) {\n data.clear();\n data = list;\n adapter.notifyDataSetChanged();\n }\n\n @Override\n public void onCancel() {\n\n }\n });\n }",
"public void run() {\n ListAdapter adapter = new SimpleAdapter(\n EscolhaProjeto.this, productsList,\n R.layout.list_residencia, new String[] { TAG_PID,\n TAG_ADDRESS,TAG_HOOD,TAG_ZIP,TAG_CITY,TAG_STATE,TAG_BEGIN,TAG_END,TAG_RESPID},\n new int[] { R.id.pid, R.id.address,R.id.hood,R.id.zip_code,R.id.city,R.id.state,R.id.begin,R.id.end,R.id.idresp});\n // updating listview\n setListAdapter(adapter);\n }",
"private void updateViews() {\n\t\tList<Task> list = null;\n\t\tDBHelper db = new DBHelper();\n\t\ttry {\n\t\t\tlist = db.getTaskList(this, Task.COLUMN_ID, taskID);\n\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tLog.e(\"Could not get Single Task\", \"Bam\", e);\n\t\t}\n\n\t\ttask = list.get(0);\n\n\t\tint prioPos = 0;\n\n\t\tfor (int i = 0; i < prioList.size(); i++) {\n\n\t\t\tif (prioList.get(i).getId() == task.getPriority().getId()) {\n\t\t\t\tprioPos = i;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\t\tprioSpinner.setSelection(prioPos);\n\n\t\tint catPos = 0;\n\n\t\tfor (int i = 0; i < categoryList.size(); i++) {\n\n\t\t\tif (categoryList.get(i).getId() == task.getCategory().getId()) {\n\t\t\t\tcatPos = i;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\t\tcategorySpinner.setSelection(catPos);\n\n\t\ttitle.setText(task.getTitle());\n\t\tdescription.setText(task.getDescription());\n\t\tdatePicker.updateDate(task.getAblaufJahr(), task.getAblaufMonat(),\n\t\t\t\ttask.getAblaufTag());\n\t}",
"private void setdatalistthongbao()\n {\n // showing refresh animation before making http call\n swipeRefreshLayout.setRefreshing(true);\n\n for (int i = 0 ; i < 5 ; i++)\n {\n Arr_listthongbao.add(new listthongbao(\"Lịch khám\" , \"Còn 10p nữa đến giờ khám bệnh nhân Nguyễn Văn A, tại P. 306\"));\n\n }\n\n\n // count noti\n countnoti = Arr_listthongbao.size();\n thongbaoadapter.notifyDataSetChanged();\n\n // stopping swipe refresh\n swipeRefreshLayout.setRefreshing(false);\n\n\n\n\n\n }",
"void notifyListDataSetChanged();",
"public void setData(List<Number> data) {\n this.data = data;\n }",
"private void setUpList() {\n\t\tRoomItemAdapter adapter = new RoomItemAdapter(getApplicationContext(),\n\t\t\t\trName, rRate);\n\t\tlistView.setAdapter(adapter);\n\n\t\tlistView.setOnItemClickListener(new OnItemClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onItemClick(AdapterView<?> parent, View view,\n\t\t\t\t\tint position, long id) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\thandleClick(position);\n\t\t\t}\n\t\t});\n\t}",
"public void refreshListView() {\n if (recyclerViewAdapter != null) {\n recyclerViewAdapter.notifyDataSetChanged();\n }\n }",
"private void updateProductsList() {\n this.productsList = demonstrationApplicationController.getProductsList();\n this.jListProduct.setModel(new ModelListSelectable(this.productsList));\n }",
"private void initListView() {\n listView = (ListView) findViewById(R.id.lv_pingpai_listview);\r\n pingpaiList = new ArrayList<>();\r\n adapter = new PingpaiAdapter(this, pingpaiList);\r\n listView.setAdapter(adapter);\r\n listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {\r\n @Override\r\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\r\n Pingpai pingpai = (Pingpai) adapter.getItem(position);\r\n Intent intent = new Intent(PingpaiActivity.this, XinghaoActivity.class);\r\n intent.putExtra(\"pingpai\", pingpai);\r\n startActivity(intent);\r\n finish();\r\n\r\n }\r\n });\r\n// sortListView.setmOnTouchListener(new SortListView.OnTouchListener() {\r\n// @Override\r\n// public void onTouch(String s) {\r\n// Integer index = adapter.getPosition(s);\r\n// if (index != null) {\r\n// listView.setSelection(index);\r\n// }\r\n// }\r\n// });\r\n// listView.setAdapter(adapter);\r\n }",
"public void displayDataUpListView() {\n\t\ttry {\n\t\t\t// lay tat ca cac du lieu trong sqlite\n\t\t\talNews = qlb.getAllNewsDaTa();\n\t\t\tmListView.setAdapter(new AdapterListNewsSaved(\n\t\t\t\t\tActivity_News_Saved_List.this));\n\t\t} catch (Exception e) {\n\t\t\tmListView.setAdapter(null);\n\t\t}\n\n\t}",
"@Override\n\tpublic void notifyDataSetChanged() {\n\t\tsuper.notifyDataSetChanged();\n\t\tsetIndexer(list);\n\t}",
"@Override\n protected void updateItem(ListCountProject list, boolean empty) {\n super.updateItem(list, empty);\n \n if(empty || list == null) {\n\n setText(null);\n setGraphic(null);\n\n } else {\n if (mLLoader == null) {\n mLLoader = new FXMLLoader(getClass().getResource(\"/view/ListCellCountProject.fxml\"));\n mLLoader.setController(this);\n\n try {\n gridPane = mLLoader.load();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }\n \n textCivitas.setText(list.getCivitascol());\n valueCount.setText(list.getValueCount());\n \n }\n setText(null);\n setGraphic(list == null ? null : gridPane);\n \n\n }",
"private void refreshList()\n {\n String line;\n int temp;\n Classes.getItems().clear();\n for (int i = 0; i < SchModMan.getClasses().length; i++)\n {\n line = \"\";\n line += SchModMan.getClasses()[i].getName();\n temp = line.length();\n for (int j = 0; j < 22 - temp; j++)\n line += \" \";\n line += SchModMan.getClasses()[i].getNumberOfStudents();\n temp = line.length();\n for (int j = 0; j < 36 - temp; j++)\n line += \" \";\n line += SchModMan.getClasses()[i].getNumberOfGroups();\n Classes.getItems().add(line);\n }\n }",
"public void updateList() {\n if (getActivity().getClass().getName().contains(\"BookmarksActivity\")) {\n\n // Call the create right after initializing the helper, just in case\n // the user has never run the app before.\n mDbNodeHelper.createDatabase();\n\n // Get a list of bookmarked node titles.\n loadBookmarks();\n\n // Close the database\n mDbNodeHelper.close();\n\n // Clear the old ListView.\n setListAdapter(null);\n\n // Initialize a new model object\n CategoryModel[] bookmarksModel = new CategoryModel[nodes.length];\n\n for (int i = 0; i < nodes.length; i++) {\n bookmarksModel[i] = new CategoryModel(nodes[i].id, nodes[i].title);\n }\n\n // Create a new list adapter based on our new updated array.\n ListAdapter bookmarksAdapter = new CategoryModelListAdapter(mActivity, bookmarksModel);\n\n // set the new list adapter, thus updating the list display.\n setListAdapter(bookmarksAdapter);\n }\n else if (getActivity().getClass().getName().contains(\"BrowseActivity\")) {\n\n // Call the create right after initializing the helper, just in case\n // the user has never run the app before.\n mDbNodeHelper.createDatabase();\n\n // Get a list of bookmarked node titles.\n loadList();\n\n // Close the database\n mDbNodeHelper.close();\n\n // Clear the old ListView.\n setListAdapter(null);\n\n // Initialize a new model object\n CategoryModel[] bookmarksModel = new CategoryModel[nodes.length];\n\n for (int i = 0; i < nodes.length; i++) {\n bookmarksModel[i] = new CategoryModel(nodes[i].id, nodes[i].title);\n }\n\n // Create a new list adapter based on our new updated array.\n ListAdapter bookmarksAdapter = new CategoryModelListAdapter(mActivity, bookmarksModel);\n\n // set the new list adapter, thus updating the list display.\n setListAdapter(bookmarksAdapter);\n }\n }",
"private void updateProgramWorkoutList(){\n //Create the list.\n workoutsInProgram = work_dbh.get_workouts_in_prog(programName);\n workoutListAdapter = new ArrayAdapter<>(\n this, android.R.layout.simple_list_item_1, workoutsInProgram);\n workoutListView.setAdapter(workoutListAdapter);\n }",
"private void updateList() {\r\n\t\ttry {\r\n\t\t\t// Reset the list\r\n\t\t\tcalls.clear();\r\n\r\n\t\t\tif (apiEnabled) {\r\n\t\t \t// Get list of pending sessions\r\n\t\t \tSet<IPCall> currentCalls = callApi.getIPCalls();\r\n\t\t \tcalls = new ArrayList<IPCall>(currentCalls);\r\n\t\t\t\tif (calls.size() > 0){\r\n\t\t\t String[] items = new String[calls.size()]; \r\n\t\t\t for (int i = 0; i < items.length; i++) {\r\n\t\t\t\t\t\titems[i] = getString(R.string.label_session, calls.get(i).getCallId());\r\n\t\t\t }\r\n\t\t\t\t\tsetListAdapter(new ArrayAdapter<String>(IPCallSessionsList.this, android.R.layout.simple_list_item_1, items));\r\n\t\t\t\t} else {\r\n\t\t\t\t\tsetListAdapter(null);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch(Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tUtils.showMessageAndExit(IPCallSessionsList.this, getString(R.string.label_api_failed));\r\n\t\t}\r\n }",
"public void populateView() {\r\n populateHead();\r\n ArrayList arrayList = new ArrayList();\r\n arrayList.add(new AccDetailItem(\"Loan Amount\", this.account.totLoanAmt, MiscUtils.getColor(getResources(), this.account.totLoanAmt)));\r\n arrayList.add(new AccDetailItem(\"Interest Rate\", this.account.interestRate));\r\n arrayList.add(new AccDetailItem(\"Repayment Amount\", this.account.repaymentAmt, MiscUtils.getColor(getResources(), this.account.repaymentAmt)));\r\n arrayList.add(new AccDetailItem(\"Start Date\", this.account.startDt));\r\n arrayList.add(new AccDetailItem(\"End Date\", this.account.endDt));\r\n arrayList.add(new AccDetailItem(\"Status\", this.account.loanStatus));\r\n ArrayList arrayList2 = new ArrayList();\r\n arrayList2.add(new AccDetailItem(\"Outstanding Amount\", this.account.formattedOutstandingAmount, ContextCompat.getColor(getContext(), R.color.primary_red)));\r\n arrayList2.add(new AccDetailItem(\"Overdue Amount\", String.valueOf(this.account.overdueAmount), MiscUtils.getColor(getResources(), (double) this.account.overdueAmount)));\r\n arrayList2.add(new AccDetailItem(\"No. of Repayments Overdue\", this.account.overdueCount));\r\n this.list.setAdapter(new AccountDetailItemAdapter(getActivity(), arrayList));\r\n this.list2.setAdapter(new AccountDetailItemAdapter(getActivity(), arrayList2));\r\n MiscUtils.setListViewHeightBasedOnChildren(this.list);\r\n MiscUtils.setListViewHeightBasedOnChildren(this.list2);\r\n }",
"public void plannerShoppingListSetup(){\n //Set the items of the shopping list.\n shoppingList.setItems(shoppingListIngredients);\n //Format the cells of the shopping List ListView\n Callback<ListView<Ingredient>, ListCell<Ingredient>> ingredientsMealFormat =\n new Callback<ListView<Ingredient>, ListCell<Ingredient>>() {\n @Override\n public ListCell<Ingredient> call(ListView<Ingredient> ingredientListView) {\n ListCell<Ingredient> cell = new ListCell<>(){\n @Override\n protected void updateItem(Ingredient ingredient, boolean empty) {\n super.updateItem(ingredient, empty);\n if (empty){\n setText(null);\n } else {\n String quantityName = ingredient.getQuantityName();\n double quantityInGrams = ingredient.getQuantityInGrams();\n double quantityRatio = (quantityInGrams / ingredient.getSingleQuantityInGrams());\n\n DecimalFormat df = new DecimalFormat(\"#.#\");\n DecimalFormat df2 = new DecimalFormat(\"#\");\n\n if (quantityRatio > 1){\n quantityName = quantityName + \"s\";\n }\n\n setText( ingredient.getName() + \" ( \" + df2.format(quantityInGrams) + \" grams / \" +\n df.format(quantityRatio) + \" \" + quantityName + \")\");\n }\n setFont(InterfaceStyling.textFieldFont);\n }\n };\n return cell;\n }\n };\n shoppingList.setCellFactory(ingredientsMealFormat);\n Label emptyLabel = new Label(\"Empty Shopping List\");\n emptyLabel.setFont(InterfaceStyling.textFieldFont);\n //Set the label placeholder for an empty listview.\n shoppingList.setPlaceholder(emptyLabel);\n }",
"private void updateList() {\n\n if(!mDispositiuList.isEmpty()){\n Collections.sort(mDispositiuList, new Comparator<HashMap<String, String>>() {\n\n public int compare(HashMap<String, String> object1,\n HashMap<String, String> object2) {\n return ((String) object1.get(TAG_DEVICENAME)).compareTo((String) object2.get(TAG_DEVICENAME));\n }\n });\n }\n\n ListAdapter adapter = new SimpleAdapter(this,\n mDispositiuList,\n R.layout.dispositiu,\n new String[] { TAG_DEVICENAME, TAG_FLOTA, TAG_VEHICLE },\n new int[] { R.id.nom, R.id.flota, R.id.vehicle });\n\n\n setListAdapter(adapter);\n\n ListView lv = getListView();\n lv.setOnItemClickListener(new OnItemClickListener() {\n @Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n HashMap<String, String> map = (HashMap<String, String>) parent.getItemAtPosition(position);\n\n //Toast.makeText(LlistaFlotaActivity.this, map.get(TAG_DEVICEID), Toast.LENGTH_SHORT).show();\n\n Intent intent = new Intent(LlistaFlotaActivity.this, DispositiuActivity.class);\n intent.putExtra(\"jsonDispositiu\", mDispositiusMapper.get(Integer.parseInt(map.get(TAG_DEVICEID))).toJSON());\n startActivity(intent);\n }\n });\n }",
"private void populateListView() {\n String[] myItems = {\"Blue\", \"green\", \"Purple\", \"red\"};\n\n //creating listviewadapter which is an array for storing the data and linking it according to the\n //custom listview\n\n ArrayAdapter<String> listViewAdapter = new ArrayAdapter<String>(this, R.layout.da_items, myItems);\n //linking the listview with our adapter to present data\n ListView Lv = (ListView)findViewById(R.id.listView_data);\n Lv.setAdapter(listViewAdapter);\n }",
"@Override\n public void onAmountChange(View view, int amount) {\n item.num = amount;\n }",
"private void refreshList()\n\t\t{\n\t\tint cpt = 0;\n\t\tthis.combo.removeAllItems();\n\t\tthis.listPort = meteoPort.findListPortSerie();\n\t\tif (listPort.size() > 0)\n\t\t\t{\n\t\t\tfor(String string:listPort)\n\t\t\t\t{\n\t\t\t\tif (!meteoPort.isStationMeteoAvailable(string, 1000))\n\t\t\t\t\t{\n\t\t\t\t\tcombo.addItem(string);\n\t\t\t\t\tcpt++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tif (cpt > 0)\n\t\t\t\t{\n\t\t\t\tbuttonValider.setEnabled(true);\n\t\t\t\t}\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tbuttonValider.setEnabled(false);\n\t\t\t}\n\t\t}",
"private void updateValue() {\n int minValue = 100; //Minimum value to be calculated, initialized to a large number\n value = 0; //Value reinitialized to 0\n for (Integer i : values) {\n if (i > value && i <= 21) {\n value = i; //Sets value to maximum value less than or equal to 21\n }\n if (i < minValue) {\n minValue = i; //Sets minimum value to lowest value in the list\n }\n }\n if (value == 0) {\n value = minValue; //Sets value to minValue if no values 21 or less\n }\n valueLabel.setText(\"Value: \" + value); //Sets text of value label\n if (value > 21) {\n bust(); //Busts if value greater than 21\n }\n }",
"public void update(Observable o, Object arg) {\n\t\t\n\t\t// for every element in the list of parsed incidents\n\t\tfor (int i = 0; i < parsedIncidents.size(); i++) {\n\t\t\t\n\t\t\t// set the element at that index in the JList model to that element\n\t\t\tjListModel.set(i, parsedIncidents.get(i));\n\t\t\t\n\t\t}\n\t\t\n\t}",
"@Override\n\t\t\tpublic void onRefresh() {\n\t\t\t\tcurPage = 1;\n\t\t\t\tmList.clear();\n\t\t\t\tJiaoYiJiLuExec.getInstance().getTiXianJiLuList(mHandler,\n\t\t\t\t\t\tManagerUtils.getInstance().yjtc.getId(), curPage,\n\t\t\t\t\t\tpageSize, NetworkAsyncCommonDefines.GET_TXJL_LIST_S,\n\t\t\t\t\t\tNetworkAsyncCommonDefines.GET_TXJL_LIST_F);\n\t\t\t}",
"@Override\n public void handle(ActionEvent event) {\n String tf1 = txt.getText();\n String tf2 = txt1.getText();\n String tf3 = txt2.getText();\n String tf4 = txt3.getText();\n String Name = \"Compound Interest savings(Without Contributions)\";\n String hisres1 = tf1+\"\";\n String hisres2 = tf2+\"\";\n String hisres3 = tf3+\"\";\n String hisres4 = tf4+\"\";\n\n listView.getItems().addAll(Name,hisres1,hisres2,hisres3,hisres4,\"\\n\");\n listView.scrollTo(listView.getItems().size() - 1);\n }",
"@Override\n public void refreshList() {\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.upgrade_item_fragment, container, false);\n ButterKnife.bind(this, v);\n TinyDB tinyDB = new TinyDB(getContext());\n\n upgrades = new ArrayList<>();\n reel = new ArrayList<>();\n\n reel = tinyDB.getListObject(\"Rod\", Upgrade.class);\n getData();\n\n x1.setText(\"Current\");\n\n x1.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n TinyDB tinyDB = new TinyDB(getContext());\n ArrayList<Upgrade> rod = tinyDB.getListObject(\"Rod\", Upgrade.class);\n ArrayList<double[]> cost = tinyDB.getListObjectDouble(\"Cost\", double[].class);\n x1.setText(\"Current\");\n x10.setText(\"X10\");\n x100.setText(\"X100\");\n tinyDB.putInt(\"Factor\", 1);\n double[] c = cost.get(0);\n\n for(int i = 0; i < 1; i++) {\n c[0] = rod.get(0).getCost();\n rod.get(0).incrementLevel();\n c[1] = rod.get(1).getCost();\n rod. get(1).incrementLevel();\n c[2] = rod.get(2).getCost();\n rod.get(2).incrementLevel();\n }\n\n cost.add(0, c);\n tinyDB.putListObjectDouble(\"Cost\", cost);\n Log.e(\"A\", \"\" + c[0]);\n Log.e(\"B\", \"\" + c[1]);\n Log.e(\"C\", \"\" + c[2]);\n upgradesAdapter = new UpgradesAdapter(getActivity(), rod);\n setListAdapter(upgradesAdapter);\n }\n });\n x10.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n TinyDB tinyDB = new TinyDB(getContext());\n ArrayList<Upgrade> rod = tinyDB.getListObject(\"Rod\", Upgrade.class);\n ArrayList<double[]> cost = tinyDB.getListObjectDouble(\"Cost\", double[].class);\n double[] c = cost.get(1);\n c[0] = rod.get(0).getCost();\n c[1] = rod.get(1).getCost();\n c[2] = rod.get(2).getCost();\n\n x1.setText(\"X1\");\n x10.setText(\"Current\");\n x100.setText(\"X100\");\n tinyDB.putInt(\"Factor\", 10);\n for(int i = 0; i < 10; i++) {\n c[0] += rod.get(0).getCost();\n rod.get(0).incrementLevel();\n c[1] += rod.get(1).getCost();\n rod.get(1).incrementLevel();\n c[2] += rod.get(2).getCost();\n rod.get(2).incrementLevel();\n }\n cost.add(1, c);\n tinyDB.putListObjectDouble(\"Cost\", cost);\n Log.e(\"A\", \"\" + c[0]);\n Log.e(\"B\", \"\" + c[1]);\n Log.e(\"C\", \"\" + c[2]);\n upgradesAdapter = new UpgradesAdapter(getActivity(), rod);\n setListAdapter(upgradesAdapter);\n }\n });\n x100.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n TinyDB tinyDB = new TinyDB(getContext());\n\n ArrayList<Upgrade> rod = tinyDB.getListObject(\"Rod\", Upgrade.class);\n ArrayList<double[]> cost = tinyDB.getListObjectDouble(\"Cost\", double[].class);\n double[] c = cost.get(2);\n\n x1.setText(\"X1\");\n x10.setText(\"X10\");\n x100.setText(\"Current\");\n tinyDB.putInt(\"Factor\", 100);\n c[0] = rod.get(0).getCost();\n c[1] = rod.get(1).getCost();\n c[2] = rod.get(2).getCost();\n\n for(int i = 0; i < 100; i++) {\n c[0] += rod.get(0).getCost();\n rod.get(0).incrementLevel();\n c[1] += rod.get(1).getCost();\n rod.get(1).incrementLevel();\n c[2] += rod.get(2).getCost();\n rod.get(2).incrementLevel();\n }\n cost.add(2, c);\n tinyDB.putListObjectDouble(\"Cost\", cost);\n Log.e(\"A\", \"\" + c[0]);\n Log.e(\"B\", \"\" + c[1]);\n Log.e(\"C\", \"\" + c[2]);\n// upgradesAdapter = new UpgradesAdapter(getActivity(), rod);\n// setListAdapter(upgradesAdapter);\n upgradesAdapter.notifyDataSetChanged();\n\n\n }\n });\n\n x1.setText(\"Current\");\n x10.setText(\"X10\");\n x100.setText(\"X100\");\n tinyDB.putInt(\"Factor\", 1);\n\n\n return v;\n }",
"void setListData(int list, int data) {\n\t\tm_lists.setField(list, 5, data);\n\t}"
] | [
"0.74513626",
"0.67717725",
"0.67506194",
"0.6599665",
"0.65966755",
"0.6592732",
"0.6501422",
"0.64818776",
"0.64544487",
"0.6430952",
"0.6429277",
"0.62944627",
"0.6256717",
"0.6251804",
"0.624126",
"0.6239784",
"0.6237308",
"0.62193066",
"0.62173253",
"0.62164766",
"0.62084264",
"0.6203612",
"0.618089",
"0.6171519",
"0.6161549",
"0.61602414",
"0.6158553",
"0.61555487",
"0.6110064",
"0.6095685",
"0.60913336",
"0.6087217",
"0.6087184",
"0.6080617",
"0.6051749",
"0.6036258",
"0.60253644",
"0.6010121",
"0.6007672",
"0.5980847",
"0.59673744",
"0.5960031",
"0.5959131",
"0.5936906",
"0.590912",
"0.59029686",
"0.5883456",
"0.58812654",
"0.5863044",
"0.5862533",
"0.58621734",
"0.585938",
"0.58587146",
"0.5858687",
"0.58527184",
"0.5852131",
"0.58479047",
"0.5806921",
"0.5806553",
"0.5791591",
"0.57900727",
"0.5788553",
"0.57862544",
"0.5784411",
"0.57825774",
"0.5782276",
"0.577281",
"0.5761963",
"0.5754229",
"0.5745459",
"0.57399297",
"0.5737523",
"0.5737245",
"0.573704",
"0.5734717",
"0.5716489",
"0.5716406",
"0.5714027",
"0.5710559",
"0.5709699",
"0.5702984",
"0.5701651",
"0.56944674",
"0.56940657",
"0.5693518",
"0.56931823",
"0.5692258",
"0.5691517",
"0.56896794",
"0.5684104",
"0.5676315",
"0.5670322",
"0.5669048",
"0.56679225",
"0.5654185",
"0.56514364",
"0.56509113",
"0.5643019",
"0.5641674",
"0.5636555"
] | 0.624599 | 14 |
update the progress bar | @Override
protected void onProgressUpdate(Integer... progress) {
ProgressBar pbFileIO = (ProgressBar)findViewById(R.id.pbFileIO);
pbFileIO.setProgress(progress[0]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void updateProgressBar() {\n\t\tdouble current = model.scannedCounter;\n\t\tdouble total = model.fileCounter;\n\t\tdouble percentage = (double)(current/total);\n\t\t\n\t\t//Update Progress indicators\n\t\ttxtNumCompleted.setText((int) current + \" of \" + (int) total + \" Completed (\" + Math.round(percentage*100) + \"%)\");\n\t\tprogressBar.setProgress(percentage);\n\t}",
"public static void updateProgressBar() {\r\n mHandler.postDelayed(mUpdateTime, 100);\r\n }",
"@Override\n public void update(final Progress progress) {\n SwingUtilities.invokeLater(new Runnable() {\n\n @Override\n public void run() {\n progressBar.setValue(progress.getIntPercentage());\n progressField.setText(roundToSingleDigit(progress.getPercentage()) + \"%\");\n }\n });\n }",
"private void updateProgress() {\n progressBar.setProgress( (1.0d * currentQuestion) / numQuestions);\n }",
"@Override\n\t\tprotected void onProgressUpdate(Integer... progress) {\n\t\t\tprogressBar.setVisibility(View.VISIBLE);\n\n\t\t\t// updating progress bar value\n\t\t\tprogressBar.setProgress(progress[0]);\n\n\t\t\t// updating percentage value\n\t\t\ttxtPercentage.setText(String.valueOf(progress[0]) + \"%\");\n\t\t}",
"@Override\n protected void onProgressUpdate(Integer... progress) {\n progressBar.setVisibility(View.VISIBLE);\n\n // updating progress bar value\n progressBar.setProgress(progress[0]);\n\n // updating percentage value\n txtPercentage.setText(String.valueOf(progress[0]) + \"%\");\n }",
"@Override\n protected void onProgressUpdate(Integer... values) {\n progressBar.setProgress(values[0]);\n }",
"@Override\n protected void onProgressUpdate(Integer... values) {\n progressBar.setProgress(values[0]);\n }",
"private void updateProgress(final int value) {\n \t\t// update progress bar\n \t\tprogressBar.setValue(value);\n \t\tfinal int previous = 100 * (value - 1) / progressBar.getMaximum();\n \t\tfinal int current = 100 * value / progressBar.getMaximum();\n \t\tif (previous != current) progressBar.setString(\"\" + current + \"%\");\n \n \t\t// redraw calendar graphic\n \t\tprogressFrame.repaint();\n \t}",
"@Override protected void onProgressUpdate(Integer... vals) {\n updateProgressBar(vals[0].intValue());\n }",
"protected void onProgressUpdate(String... progress) {\n\t\t\t\t\t\t// Set progress percentage\n\t\t\t\t\t\tprgDialog.setProgress(Integer.parseInt(progress[0]));\n\t\t\t\t\t}",
"public void updateProgress() {\r\n\t\tfireTableDataChanged();\r\n\t}",
"@Override\n protected void onProgressUpdate(Integer... values) {\n super.onProgressUpdate(values);\n\n\n // Do things like update the progress bar\n }",
"@Override\n protected void onProgressUpdate(Integer... progress) {\n pDialog.setProgress(progress[0]);\n\n // updating percentage value\n //txtPercentage.setText(String.valueOf(progress[0]) + \"%\");\n }",
"@Override\n\tprotected void onProgressUpdate(Integer... values) {\n\t\tint len = progressBar.getProgress() + values[0];\n\t\tprogressBar.setProgress(len);\n\t\tString str = progressBar.getProgress() * 100 / progressBar.getMax()\n\t\t\t\t+ \"%\";\n\t\ttv.setText(\"下载完成\" + str);\n\t\tsuper.onProgressUpdate(values);\n\t}",
"void setProgress(float progress);",
"public void increment() { this.progressBar.setValue(++this.progressValue); }",
"@Override\n protected void onProgressUpdate(Integer... values) {\n barratime.setProgress(values[0]);\n }",
"@Override\n protected void onProgressUpdate(Integer... values) {\n super.onProgressUpdate(values);\n\n progressBar.setProgress(values[0].intValue());\n\n }",
"private void updateProgress(int progress) {\n if (myHost != null) {\n myHost.updateProgress(progress);\n } else {\n System.out.println(\"Progress: \" + progress + \"%\");\n }\n }",
"void setProgress(int progress);",
"void setProgress(int progress);",
"private void updateProgress(int progress) {\n if (myHost != null && progress != previousProgress) {\n myHost.updateProgress(progress);\n }\n previousProgress = progress;\n }",
"public void onProgressUpdate(int numRouleau,String prochain);",
"public void updateProgressMessage() {\n pb.setMax(frames);\n int rendered = getNumFramesRendered(this, projectName);\n pb.setProgress(Math.min(pb.getMax(), rendered));\n int n = pb.getMax();\n int ratio = (rendered * 100) / n;\n String temp = String.format(\"Progress: %d / %d (%d%%)\", rendered, n, ratio);\n progressMessage.setText(temp);\n }",
"protected void onProgressUpdate(Integer... progress) {\n\t\t}",
"private void progressBar()\n {\n int amount = 0;\n for(Movie a:\n baseMovieList)\n if(a.isWatched())\n amount++;\n int fill = 100 / baseMovieList.size() * amount;\n progressBar.setProgress(fill);\n }",
"public void updateProgress(int progress) {\n\t\tif (getView() != null) {\n\t\t\tProgressBar listProgress = (ProgressBar) getView().findViewById(\n\t\t\t\t\tR.id.severity_list_progress);\n\t\t\tlistProgress.setProgress(progress);\n\t\t}\n\t}",
"@Override\r\n\t\tprotected void onProgressUpdate(Integer... values) {\n\t\t\tsuper.onProgressUpdate(values);\r\n\t\t\tsetProgress(values[0]);\r\n\t\t\t\r\n\r\n\t\t}",
"private void updateProgress(String progressLabel, int progress) {\n if (myHost != null) {\n myHost.updateProgress(progressLabel, progress);\n } else {\n System.out.println(progressLabel + \" \" + progress + \"%\");\n }\n }",
"private void updateProgressBar(int currentPoints){\n\n progressBar.setProgress(currentPoints);\n\n switch(currentPoints){\n case 1:\n progressBar.getProgressDrawable().setColorFilter(Color.RED, PorterDuff.Mode.SRC_IN);\n\n break;\n case 2:\n progressBar.getProgressDrawable().setColorFilter(Color.parseColor(\"#FF6600\"), PorterDuff.Mode.SRC_IN);\n\n break;\n case 3:\n progressBar.getProgressDrawable().setColorFilter(Color.parseColor(\"#FFFF66\"), PorterDuff.Mode.SRC_IN);\n\n break;\n case 4:\n progressBar.getProgressDrawable().setColorFilter(Color.GREEN, PorterDuff.Mode.SRC_IN);\n\n break;\n case 5:\n progressBar.getProgressDrawable().setColorFilter(Color.parseColor(\"#2C6700\"), PorterDuff.Mode.SRC_IN);\n\n }\n\n\n\n }",
"@Override\n\t\tprotected void onProgressUpdate(Integer... progress) {\n\t\t\tsuper.onProgressUpdate(progress);\n\n\t\t\tdialog.setProgress(progress[0]);\n\t\t}",
"public void setProgress(int value);",
"private void updateProgress(String progressLabel, int progress) {\n if (myHost != null && ((progress != previousProgress) || \n (!progressLabel.equals(previousProgressLabel)))) {\n myHost.updateProgress(progressLabel, progress);\n }\n previousProgress = progress;\n previousProgressLabel = progressLabel;\n }",
"@Override\n\tpublic void onProgressUpdate() {\n\n\t}",
"private void updateBar() {\n\t\tString resources = String.format(\"Money: $%d\\nAgents: %d\\nMedia reach: %d\\nPopulation unrest: %d\"\n\t\t\t\t, player.getMoney(), player.getAgentNumber(), player.getMediaReach(), player.getUnrestSpread());\n\t\t((TextView) findViewById(R.id.text_resource_display_left)).setText(resources);\n\t\t\n\t\tresources = String.format(\"\\nAgent skill: %.0f%%\\nMedia influence: %.0f%%\\nPopulation care: %.0f%%\"\n\t\t\t\t, player.getAgentSkill(), player.getMediaPerception(), player.getUnrestStrength());\n\t\t((TextView) findViewById(R.id.text_resource_display_right)).setText(resources);\n\t}",
"public void run() {\n\t\t\t\t\tmHandler.post(new Runnable() {\r\n\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\tprogressbar.setProgress(Integer\r\n\t\t\t\t\t\t\t\t\t.parseInt(tvsp.progress));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t}",
"private void updateRunnable() {\n updateSeekBar = new Runnable() {\n @Override\n public void run() {\n playerSeekBar.setProgress(mediaPlayer.getCurrentPosition());\n seekBarHandler.postDelayed(this, 500);\n }\n };\n }",
"private void updateUI() {\n handler_.post(new Runnable() {\n public void run() {\n bar_.setProgress(time_);\n String remTimeStr = \"\" + (maxTime_ - time_);\n timeRemaining_.setText(REM_STRING.replace(\"?\", remTimeStr));\n }\n });\n }",
"private void primarySeekBarProgressUpdater() {\n \tseekBarProgress.setProgress((int)(((float)mediaPlayer.getCurrentPosition()/mediaFileLengthInMilliseconds)*100)); // This math construction give a percentage of \"was playing\"/\"song length\"\n\t\tif (mediaPlayer.isPlaying()) {\n\t\t\tRunnable notification = new Runnable() {\n\t\t public void run() {\n\t\t \tprimarySeekBarProgressUpdater();\n\t\t\t\t}\n\t\t };\n\t\t handler.postDelayed(notification,1000);\n \t}\n }",
"public void update()\n {\n this.lastProgress = this.progress;\n\n if (this.lastProgress >= 1.0F)\n {\n this.func_184322_i();\n this.worldObj.removeTileEntity(this.pos);\n this.invalidate();\n\n if (this.worldObj.getBlockState(this.pos).getBlock() == Blocks.piston_extension)\n {\n this.worldObj.setBlockState(this.pos, this.pistonState, 3);\n this.worldObj.notifyBlockOfStateChange(this.pos, this.pistonState.getBlock());\n }\n }\n else\n {\n this.progress += 0.5F;\n\n if (this.progress >= 1.0F)\n {\n this.progress = 1.0F;\n }\n\n this.func_184322_i();\n }\n }",
"@Override\r\n\tprotected void onProgressUpdate(String... s) {\r\n\t\tactivity.addToGUI(s[0]);\r\n\t}",
"private void primarySeekBarProgressUpdater() {\n seekBarProgress.setProgress((int) (((float) mediaPlayer.getCurrentPosition() / mediaFileLengthInMilliseconds) * 100)); // This math construction give a percentage of \"was playing\"/\"song length\"\n if (mediaPlayer.isPlaying()) {\n Runnable notification = new Runnable() {\n public void run() {\n primarySeekBarProgressUpdater();\n }\n };\n handler.postDelayed(notification, 1000);\n }\n }",
"@Override\n\t\tprotected void onProgressUpdate(Integer... values) {\n\t\t\tloadingView.setProgress(values[0]);\n\t\t}",
"@Override\n public void run() {\n for (int i = 0; i<100 ; i++) {\n pb.setProgress(i/1000.0);\n try {\n Thread.sleep(1000);\n } catch (InterruptedException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }\n }",
"@Override\n\t\t\t\tpublic void onProgress(int progress) {\n\t\t\t\t\tmProgressBar.setProgress(progress);\n\t\t\t\t}",
"public void updateProgress(Land land){\n String wiltedString = \"[ wilted ]\";\n StringBuilder progressBar = new StringBuilder();\n String percentageCompleted = \"\";\n int finalStatus = land.getCurrentStatus();\n\n if (land.getCropName() != null){\n Crop crop = cropDAO.retrieveCrop(land.getCropName());\n double timeToGrow = crop.getTime();\n\n Date plantTime = land.getPlantTime();\n Date finishedTime = land.getFinishedTime();\n Date witherTime = land.getWitherTime();\n Date timeNow = new Date();\n\n int timeAfterWilt = (int) (timeNow.getTime() - witherTime.getTime());\n int timeAfterFinished = (int) (timeNow.getTime() - finishedTime.getTime());\n// double timeElapsed =(double) (timeNow.getTime() - plantTime.getTime());\n double timeElapsed =(double) ((timeNow.getTime() - plantTime.getTime()) / 60000);\n\n if (timeAfterWilt > 0){ //withered\n land.setCurrentStatus(-1);\n finalStatus = -1;\n progressBar = new StringBuilder(wiltedString);\n } else if (timeAfterFinished > 0 ){\n land.setCurrentStatus(2);\n finalStatus = 2;\n progressBar = new StringBuilder(\"[##########]\");\n percentageCompleted = \"100%\";\n } else {\n double percentage = (timeElapsed / timeToGrow )* 100;\n int intPercentage = (int) percentage;\n percentageCompleted = intPercentage + \"%\";\n progressBar = new StringBuilder(\"[\");\n int display = intPercentage/10 ;\n for (int i =1; i<= 10; i++){\n if (i <= display){\n progressBar.append(\"#\");\n } else {\n progressBar.append(\"-\");\n }\n }\n progressBar.append(\"]\");\n }\n }\n\n String finalProgressBar = progressBar + \" \"+ percentageCompleted;\n land.setProgressBar(finalProgressBar);\n\n Connection conn = controller.getConnection();\n PreparedStatement stmt = null;\n String sql = \"UPDATE magnet.land SET currentStatus = ?, progressBar = ? WHERE owner = ? AND plotNumber = ?;\";\n\n try {\n stmt = conn.prepareStatement(sql);\n stmt.setInt(1, finalStatus);\n stmt.setString(2, finalProgressBar);\n stmt.setString(3, land.getOwner());\n stmt.setInt(4, land.getPlotNumber());\n stmt.executeUpdate();\n\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }",
"@Override\n public void onProgress(long downloaded, long total) {\n int progress = (int) (downloaded / total * 100);\n bar.setProgress(progress);\n }",
"private void updateTaskActivityLabel()\r\n {\r\n setLabelValue(\"Tile Downloads \" + myActiveQueryCounter.intValue());\r\n setProgress(myDoneQueryCounter.doubleValue() / myTotalSinceLastAllDoneCounter.doubleValue());\r\n }",
"protected void updateProgress(Progress prog) {\r\n \t// if this is called then ensure the no tasks msg is not also displayed\r\n \tshowNoTaskMsg(false);\r\n \t\r\n\t\tint done = prog.getWork();\r\n\t\tString status = getStatusDesc(prog);\r\n\r\n\t\tfinal ProgressUIControl progressUIControl = findOrCreateUIControl(prog);\r\n\t\tprogressUIControl.showMsg(status);\r\n\t\tprogressUIControl.showPercent(done);\r\n\t\t\r\n\t\tif (prog.isFinished() && !progressUIControl.isFinishNotified) {\r\n\t\t\tLog.i(TAG, \"Job finished:\"+prog.getJobName());\r\n\t\t\tprogressUIControl.isFinishNotified = true;\r\n\t\t\tjobFinished(prog);\r\n\t\t}\r\n }",
"@Override\n\t\tprotected void onProgressUpdate(Object... values) {\n\t\t}",
"@Override\n public void onProgress(long downloaded,\n long total) {\n int progress = (int) (downloaded / total * 100);\n bar.setProgress(progress);\n }",
"public void updateProgress( int pagesPrinted );",
"void setProgress(@FloatRange(from = 0, to = 1) float progress);",
"public void onProgressUpdate(Integer ... value){\n pb.setVisibility(View.VISIBLE);\n pb.setProgress(value[0]);\n }",
"@Override\n\t\t/*\n\t\t * UI线程执行\n\t\t */\n\t\tprotected void onProgressUpdate(Integer... values) {\n\t\t\tsuper.onProgressUpdate(values);\n\t\t\t// 取出发布进度的值\n\t\t\tint value = values[0];\n\t\t\t// 设置给Button\n\t\t\tbtn.setText(\"\" + value);\n\t\t\tpb.setProgress(value);\n\t\t}",
"@Override\n protected void onProgressUpdate(Integer... values) {\n progress.setVisibility(View.VISIBLE);\n progress.setProgress(values[0]);\n super.onProgressUpdate(values);\n }",
"@Override\n protected void onProgressUpdate(Integer... progress) {\n imageProvider.setUploading_status((float) progress[0]);\n // updating progress bar value\n if(progressBar != null) {\n if(progress[0] >= 100 && imageProvider.getUploaded()) {\n progressBar.setVisibility(View.INVISIBLE);\n }\n progressBar.setProgress(progress[0]);\n }\n if(progress[0] >= 100 && haze!= null && imageProvider.getUploaded()){\n haze.setAlpha(0f);\n }\n if(progress[0] >= 100 && refreshImageButton!=null && !imageProvider.getUploaded()){\n refreshImageButton.setVisibility(View.INVISIBLE);\n }\n // updating percentage value\n //txtPercentage.setText(String.valueOf(progress[0]) + \"%\");\n }",
"@Override\n protected void onProgressUpdate(Integer... progress) {\n }",
"@Override\n protected void onProgressUpdate(Integer... progress) {\n }",
"@Override\r\n protected void onProgressUpdate(Integer... progress) {\n }",
"protected void onProgressUpdate(Integer... progress) {\n }",
"public void updateProgress(int remaining, int total) {\n try {\n setProgress.invoke(bossBar, ((double) remaining) / ((double) total));\n } catch (IllegalAccessException | InvocationTargetException ex) {\n Bukkit.getLogger().log(Level.SEVERE, \"An error occurred while updating boss bar progress, are you using Minecraft 1.9 or higher?\", ex);\n }\n }",
"protected void sendProgress() {\n setProgress(getProgress() ^ 1);\n }",
"public void setProgress(int progress) {\n\n this.percent = progress;\n percentdraw = 0;\n start = true;\n anim();\n invalidate();\n }",
"void showProgress();",
"public Searching6() {\r\n try {UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());}\r\n catch (Exception e) {}\r\n initComponents();\r\n progBar = new JProgressBar(0, 100);\r\n jPanel2.add(progBar);\r\n progBar.setBounds(70, 10, 280, 20);\r\n new Thread(new thread1()).start();\r\n\r\n /*for (int i=0; i<=100; i++){ //Progressively increment variable i\r\n progBar.setValue(i); //Set value\r\n progBar.repaint();\r\n }*/\r\n }",
"@Override\n\t\tprotected void onProgressUpdate(String... values) {\n\t\t\tlong total = Long.parseLong(values[0]);\n\t\t\tdialog.setProgress((int) ((total * 100) / lengthOfFile));\n\t\t\tdialog.setMessage((total / (1024 * 1014)) + \"MB/\"\n\t\t\t\t\t+ (lengthOfFile / (1024 * 1024)) + \"MB\");\n\t\t\tsuper.onProgressUpdate(values);\n\t\t}",
"@Override\n protected void onProgressUpdate(Integer... progress) {\n if (mProgressDialog != null) {\n mProgressDialog.setProgress(progress[0]);\n }\n }",
"@Override\n protected void onProgressUpdate(String... values) {\n labelStatus.setText(values[0]);\n }",
"public int updateExamProgressBar(int updateValue) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {\n ObjectAnimator animation = ObjectAnimator.ofInt(mExamProgressBar, \"progress\", updateValue * 10);\n animation.setDuration(300); // 0.5 second\n animation.setInterpolator(new DecelerateInterpolator());\n animation.start();\n } else {\n mExamProgressBar.setProgress(updateValue);\n }\n return updateValue;\n }",
"protected void onProgressUpdate(Integer... progress){\n\t Utils.logThreadSignature(this.tag);\n\t this.reportThreadSignature();\n\n\t //will be called multiple times\n\t //triggered by onPostExecute\n\t Integer i = progress[0];\n\t r.reportBack(tag, \"Progress:\" + i.toString());\n\t pd.setProgress(i);\n }",
"@Override\n protected void onProgressUpdate(Integer... progress) {\n loadingText.setText(loadingHints[random.nextInt(loadingHints.length)]);\n // [... Обновите индикатор хода выполнения, уведомления или другой\n // элемент пользовательского интерфейса ...]\n }",
"@Override\n protected void onProgressUpdate(Integer... progress) {\n //Shows the ProgressDialog and sets the progress/message shown\n progressDialog.show();\n progressDialog.setTitle(\"Uploading\");\n progressDialog.setProgress(progress[0]);\n progressDialog.setMessage(String.valueOf(progress[0]) + \"%\");\n }",
"public void setBar(JProgressBar bar){\n prog = bar;\n }",
"@Override\n\t\t\tpublic void onBufferingUpdate(MediaPlayer mp, int percent) {\n\t\t\t\tLog.d(this.getClass().getName(), \"percent: \" + percent);\n\t\t\t\tprogressBar.setSecondaryProgress(percent);\n\t\t\t}",
"public void progressMade();",
"protected void updateProgress(Integer progress) {\n // Note to self: We don't bother updating the local \"job\" batch data\n batchService.updateBatchJobProgress(jobContext.getInstanceId(), progress);\n }",
"void updateSeekbar(int position, int duration);",
"@Override\n public void onProgressUpdate(Integer... progress)\n {\n _dialog.setProgress(progress[0]);\n }",
"@Override\n\tprotected void onProgressUpdate(Integer... values) {\n\t}",
"public void updateValues() {\n\t\tThread thread = new Thread(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tdo {\n\t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (!mp3player.isPaused() && !mp3player.isStopped()) {\n\t\t\t\t\t\t\t\tcurrTime = System.currentTimeMillis() / 1000;\n\t\t\t\t\t\t\t\tcurrentDuration.setText(secToMin((long) (currTime - startTime + playedTime)));\n\t\t\t\t\t\t\t\tupdateSongProgress(currTime - startTime + playedTime);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(100);\n\t\t\t\t\t} catch (InterruptedException ex) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} while (!playlist.isEmpty());\n\t\t\t}\n\t\t});\n\t\tthread.start();\n\n\t}",
"@Override\n protected void onProgressUpdate(String... progress) {\n }",
"@Override\r\n\tpublic void updateProgress(int arg0) {\n\t\t System.out.println(\"arg0.progress=\" + arg0);\r\n\t\tmHandler.obtainMessage(100, arg0, arg0).sendToTarget();\r\n\t}",
"void onProgress(float progress);",
"@Override\n\tpublic void onBufferingUpdate(MediaPlayer mp, int percent) {\n\t\tseekBarProgress.setSecondaryProgress(percent);\n\t}",
"public void onProgress(int pos);",
"@Override\n\tpublic void updateRunningStatus \n\t\t(final int progress, final String label1, final String label2)\n\t{\n\t\t\n\t\tRunnable doSetRunningStatus = new Runnable()\n\t\t{\n\t\t\t@Override\n\t\t\tpublic void run()\n\t\t\t{\n\t\t\t\tmRunningPanel.updateProgressBar(progress);\n\t\t\t\tmRunningPanel.updateProgressLabel1(label1);\n\t\t\t\tmRunningPanel.updateProgressLabel2(label2);\n\t\t\t}\n\t\t};\n\t\t\n\t\tSwingUtilities.invokeLater(doSetRunningStatus);\n\t\t\n\t}",
"private void updateProgressData(int progressBarId, Integer value) {\n\t\tmProgressPercents[progressBarId] = value;\n\t\tif (sActivity != null) {\n\t\t\tAbstractImportUpdateActivity activity = sActivity.get();\n\t\t\tif (activity != null) {\n\t\t\t\tactivity.updateProgressData(progressBarId, value);\n\t\t\t}\n\t\t}\n\t}",
"public void updateProgress(int tier){\n this.progress.add((this.level*tier));\n this.checkProgress();\n }",
"@Override\n protected void onProgressUpdate(Integer... values) {\n }",
"public void updateProgressBar (int nloops)\n\t{\n\t\t\n\t\tif (nloops < 0) nloops = 0;\n\t\tif (nloops > 1000) nloops = 1000;\n\t\tmProgressBar.setValue(nloops);\n\t\n\t}",
"@Override\n public void onBufferingUpdate(MediaPlayer mp, int percent) {\n seekBarProgress.setSecondaryProgress(percent);\n }",
"private void setUpProgressBar() {\n DatabaseHelper database = new DatabaseHelper(this);\n Cursor cursor = database.getAllDataForScavengerHunt();\n\n int totalLocationCount = 0;\n double visitedCount = 0;\n\n while (cursor.moveToNext()) {\n totalLocationCount++;\n int visited = cursor.getInt(cursor.getColumnIndex(database.COL_VISITED));\n if (visited == 1) visitedCount++;\n }\n\n int progress = (int) (visitedCount / totalLocationCount * 100);\n ProgressBar progressBar = findViewById(R.id.progress);\n TextView progressText = findViewById(R.id.progress_text);\n progressBar.setProgress(progress);\n progressText.setText(\" \" + progress + \"%\");\n }",
"@Override\n public void showProgress() {\n\n }",
"public void setProgress(int progress) {\n \t\t\tsynchronized (this) {\n \t\t\t\tm_progress = progress;\n \t\t\t\tthis.notify();\n \t\t\t}\n \t\t}",
"@Override\n protected void onProgressUpdate(Integer... progress) {\n }",
"public void run() {\r\n ouputProgressModel.setPogressStarted(true);\r\n try {\r\n for (int i = 0; i <= 100; i += 10) {\r\n // pause the thread\r\n Thread.sleep(PROCCESS_SLEEP_LENGTH);\r\n // update the percent value\r\n ouputProgressModel.setPercentComplete(i);\r\n SessionRenderer.render(\"progressExample\");\r\n }\r\n }\r\n catch (InterruptedException e) { }\r\n ouputProgressModel.setPogressStarted(false);\r\n }",
"@Override\n\t\tprotected void onProgressUpdate(Integer... values) {\n\t\t\tsuper.onProgressUpdate(values);\n\t\t}",
"@Override\n\t\tprotected void onProgressUpdate(Integer... values) {\n\t\t\tsuper.onProgressUpdate(values);\n\t\t}"
] | [
"0.85783255",
"0.83360285",
"0.8230385",
"0.80830723",
"0.79651105",
"0.7742066",
"0.7711375",
"0.7711375",
"0.7664675",
"0.7664433",
"0.7582961",
"0.7560532",
"0.7549758",
"0.75328493",
"0.75165164",
"0.7510565",
"0.7502033",
"0.7482632",
"0.7482505",
"0.73731947",
"0.7358442",
"0.7358442",
"0.7299494",
"0.7293029",
"0.7239651",
"0.72200894",
"0.72147894",
"0.71569717",
"0.71517926",
"0.71510196",
"0.71439743",
"0.71413636",
"0.71293104",
"0.7101444",
"0.7098157",
"0.70833415",
"0.7077687",
"0.7069208",
"0.70517194",
"0.7049505",
"0.7045589",
"0.7042917",
"0.7037648",
"0.70268196",
"0.7018807",
"0.7016638",
"0.7013186",
"0.70016617",
"0.69927514",
"0.6986051",
"0.6976084",
"0.6974813",
"0.69716746",
"0.6963164",
"0.6958424",
"0.69580185",
"0.6947026",
"0.69466335",
"0.69436646",
"0.69436646",
"0.69430256",
"0.6941358",
"0.6920641",
"0.6914971",
"0.6914465",
"0.6909824",
"0.6907022",
"0.6901491",
"0.6898173",
"0.6893872",
"0.6878947",
"0.68520206",
"0.68489265",
"0.68424284",
"0.6822065",
"0.6817277",
"0.6813587",
"0.68040884",
"0.67942846",
"0.6783287",
"0.67752427",
"0.6766776",
"0.67374617",
"0.6721922",
"0.67066205",
"0.6700514",
"0.6689452",
"0.66835916",
"0.66822284",
"0.6679222",
"0.6674383",
"0.667369",
"0.66596735",
"0.66543365",
"0.6651008",
"0.66495067",
"0.6644601",
"0.66334414",
"0.66193193",
"0.66193193"
] | 0.72034013 | 27 |
Test get all product method | @Test
public void testGetAllProducts() throws Exception {
when(repository.findAll()).thenReturn(Collections.singletonList(this.product));
assertEquals(Collections.singletonList(this.product), service.getAllProducts());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void testGetAllProduct() throws Exception {\n System.out.println(\"getAllProduct\");\n prs = dao.getAllProduct();\n \n assertArrayEquals(products.toArray(), prs.toArray());\n }",
"@Test\n public void testFindAllProduct() throws Exception {\n // Mock method\n when(productRepository.findAll()).thenReturn(products);\n\n testResponseData(RequestInfo.builder()\n .request(get(PRODUCT_ENDPOINT))\n .token(memberToken)\n .httpStatus(HttpStatus.OK)\n .build());\n }",
"private void getAllProducts() {\n }",
"@Test\n public void selectAll() {\n List<ProductCategory>productCategories=categoryService.selectAll();\n for (ProductCategory productCategory:productCategories\n ) {\n System.out.println(productCategory);\n }\n }",
"@Test\n public void testGetOneProduct() {\n }",
"@Test\n public void testGetProducts() {\n }",
"List<Product> getAllProducts();",
"List<Product> getAllProducts();",
"List<Product> getAllProducts();",
"@Test\n public void testGetAllProducts() throws FileStorageException {\n List<Product> products = dao.getAllProducts();\n \n assertEquals(15, products.size());\n }",
"Product getPProducts();",
"@Test\n public void testGetProductsByPurcher() throws Exception {\n System.out.println(\"getProductsByPurcher\");\n Customer c = new Customer();\n c.setId(1l);\n prs = dao.getProductsByPurcher(c);\n assertTrue(prs.contains(p3));\n assertTrue(prs.size() == 1);\n c.setId(2l);\n prs = dao.getProductsByPurcher(c);\n assertTrue(prs.contains(p1));\n assertTrue(prs.size() == 1);\n \n c.setId(3l);\n prs = dao.getProductsByPurcher(c);\n assertTrue(prs.isEmpty());\n }",
"public void showAllProducts() {\n try {\n System.out.println(Constants.DECOR+\"ALL PRODUCTS IN STORE\"+Constants.DECOR_END);\n List<Product> products = productService.getProducts();\n System.out.println(Constants.PRODUCT_HEADER);\n for (Product product : products) { \n System.out.println((product.getName()).concat(\"\\t\\t\").concat(product.getDescription()).concat(\"\\t\\t\")\n .concat(String.valueOf(product.getId()))\n .concat(\"\\t\\t\").concat(product.getSKU()).concat(\"\\t\").concat(String.valueOf(product.getPrice()))\n .concat(\"\\t\").concat(String.valueOf(product.getMaxPrice())).concat(\"\\t\")\n .concat(String.valueOf(product.getStatus()))\n .concat(\"\\t\").concat(product.getCreated()).concat(\"\\t\\t\").concat(product.getModified())\n .concat(\"\\t\\t\").concat(String.valueOf(product.getUser().getUserId())));\n }\n } catch (ProductException ex) {\n System.out.println(ex);\n }\n }",
"@Test\n public void getAllTest() {\n Mockito.when(this.repo.findAll()).thenReturn(publisherList);\n Iterable<Publisher> resultFromService = this.publisherService.findAll();\n Publisher resultFromIterator = resultFromService.iterator().next();\n assertThat(resultFromIterator.getName()).isEqualTo(\"What The What\");\n Mockito.verify(this.repo, Mockito.times(1)).findAll();\n }",
"private void printAllProducts()\n {\n manager.printAllProducts();\n }",
"@Test\n public void productTest() {\n // TODO: test product\n }",
"@Test\n public void testListProducts() {\n List<Product> allProducts = testDao.listProducts();\n\n // First check the general contents of the list\n assertNotNull(allProducts, \"The list of products must not null\");\n assertEquals(4, allProducts.size(),\"List of products should have 4 products.\");\n \n // Then the specifics\n// assertTrue(testDao.getAllMonsters().contains(firstMonster),\n// \"The list of monsters should include Vladmir.\");\n// assertTrue(testDao.getAllMonsters().contains(secondMonster),\n// \"The list of monsters should include Warwick.\");\n }",
"@Test\n void searchProduct() {\n List<DummyProduct> L1= store.SearchProduct(\"computer\",null,-1,-1);\n assertTrue(L1.get(0).getProductName().equals(\"computer\"));\n\n List<DummyProduct> L2= store.SearchProduct(null,\"Technology\",-1,-1);\n assertTrue(L2.get(0).getCategory().equals(\"Technology\")&&L2.get(1).getCategory().equals(\"Technology\"));\n\n List<DummyProduct> L3= store.SearchProduct(null,null,0,50);\n assertTrue(L3.get(0).getProductName().equals(\"MakeUp\"));\n\n List<DummyProduct> L4= store.SearchProduct(null,\"Fun\",0,50);\n assertTrue(L4.isEmpty());\n }",
"@Override\n public Iterable<Product> findAllProduct() {\n return productRepository.findAll();\n }",
"@Override\r\n\tpublic List prodAllseach() {\n\t\treturn adminDAO.seachProdAll();\r\n\t}",
"public List<Product> getProducts();",
"public List<Product> getProducts();",
"@GetMapping(\"/getproduct\")\n\t\tpublic List<Product> getAllProduct() {\n\t\t\tlogger.info(\"products displayed\");\n\t\t\treturn productService.getAllProduct();\n\t\t}",
"@SuppressWarnings(\"unchecked\")\r\n\t@Override\r\n\tpublic ProductResponseModel getAllProduct() {\n\r\n\t\tProductResponseModel productResponseModel = new ProductResponseModel();\r\n\r\n\t\tMap<String, Object> map = productRepositoryImpl.getAllProduct();\r\n\r\n\t\t// productResponseModel.setCount((long) map.get(\"count\"));\r\n\t\tList<Product> product = (List<Product>) map.get(\"data\");\r\n\t\tList<ProductModel> productList = product.stream().map(p -> new ProductModel(p.getId(), p.getProName(),\r\n\t\t\t\tp.getProPrice(), p.getProQuantity(), p.getProDescription(), p.getProSize()))\r\n\t\t\t\t.collect(Collectors.toList());\r\n\r\n\t\tproductResponseModel.setData(productList);\r\n\r\n\t\treturn productResponseModel;\r\n\t}",
"@Test\n public void GETProductService_ProductCall() {\n givenHeaders().\n when().\n get(_url_prodservice).//.body().prettyPrint();\n then().\n using().defaultParser(Parser.JSON).\n log().ifError().\n statusCode(200).\n body(\"response\", not(isEmptyString()));\n System.out.print(\"GETProductService_ProductCall Test Run Result\");\n }",
"@Override\n\tpublic List<Product> getAllProduct() {\n\t\treturn productRepository.findAll();\n\t}",
"@Override\n\tpublic List<Product> getAllProduct() {\n\t\treturn productRepository.findAll();\n\t}",
"List<Product> retrieveProducts();",
"@Test\n\tpublic void searchForProductLandsOnCorrectProduct() {\n\t}",
"@Test\n public void testGetProductInfo() throws Exception {\n }",
"@Test\n public void testGetProductsByName() throws Exception {\n System.out.println(\"getProductsByName\");\n for (Product p : products) {\n prs = dao.getProductsByName(p.getName());\n assertTrue(prs.size() == 1);\n assertTrue(prs.contains(p));\n \n }\n prs = dao.getProductsByName(nonExisten.getName());\n assertTrue(prs.isEmpty());\n }",
"@GetMapping(\"/allProduct\")\n\tpublic ResponseEntity<Response> getAllProduct(){\n\t\treturn ResponseEntity.status(HttpStatus.OK)\n\t\t\t\t.body(new Response(productService.getProduct(), new Date()));\n\t}",
"@Test\n public void testGetProductsBySaler() throws Exception {\n System.out.println(\"getProductsBySaler\");\n Customer c = new Customer();\n c.setId(1l);\n prs = dao.getProductsBySaler(c);\n assertTrue(prs.contains(p1));\n assertTrue(prs.contains(p2));\n assertTrue(prs.size() == 2);\n\n c.setId(2l);\n prs = dao.getProductsBySaler(c);\n assertTrue(prs.isEmpty());\n \n c.setId(3l);\n prs = dao.getProductsBySaler(c);\n assertTrue(prs.contains(p3));\n assertTrue(prs.size() == 1);\n \n }",
"@Override\n\tpublic List<Products> getAllProduct() {\n\t\treturn dao.getAllProduct();\n\t}",
"@Override\r\n\tpublic List<Producto> getAll() throws Exception {\n\t\treturn productRepository.buscar();\r\n\t}",
"@Test\n void getAllSuccess(){\n\n List<CompositionInstrument> compositionInstruments = genericDao.getAll();\n assertEquals(4, compositionInstruments.size());\n }",
"public List<Product> getAll() {\n\t\treturn productRepository.findAll();\n\n\t}",
"@Test\n public void GETProduct_ProductInventoryCall() {\n\n givenHeaders().\n when().\n get(_url_product).//.body().prettyPrint();\n then().\n using().defaultParser(Parser.JSON).\n log().ifError().\n statusCode(200).\n body(\"response\", not(isEmptyString()));\n System.out.print(\"GETPRODUCT_Inventory Test Run Result\");\n }",
"@Override\r\n public List<Product> findAll() {\r\n return productRepository.findAll();\r\n }",
"@Override\r\n\tpublic List<Product> getallProducts() {\n\t\treturn dao.getallProducts();\r\n\t}",
"public List<Product> findAll();",
"@Override\n public List<ProductDTO> getProducts(Map<String, String> allParams) throws ProductException {\n List<Criterion> criteria = new ArrayList<>();\n int criteriaCounter = 0;\n String order = null;\n\n if (allParams != null) {\n for (Map.Entry<String, String> entry : allParams.entrySet()) {\n // Validate params\n if (!Arrays.stream(avalibleParams).anyMatch(val -> val.equals(entry.getKey())))\n throw new ProductException(ProductException.INVALID_INPUT, ProductException.INVALID_INPUT_MSG);\n\n if (entry.getKey().equals(avalibleParams[0])) { // avalibleParams[0] is \"order\"\n order = entry.getValue();\n } else {\n // Add a criterion\n criteria.add(new Criterion(entry.getValue(), entry.getKey()));\n criteriaCounter++;\n }\n }\n }\n // Params Excess exception\n if (criteriaCounter > 2)\n throw new ProductException(ProductException.PARAMS_EXCESS, ProductException.PARAMS_EXCESS_MSG);\n\n return articleRepository.getProducts(criteria, order);\n }",
"@Test\n public void getAllItem() {\n Item item1 = new Item();\n item1.setName(\"Drill\");\n item1.setDescription(\"Power Tool\");\n item1.setDaily_rate(new BigDecimal(\"24.99\"));\n item1 = service.saveItem(item1);\n\n // Add an Item to the mock database using the Item API method (item2)\n Item item2 = new Item();\n item2.setName(\"Screwdriver\");\n item2.setDescription(\"Hand Tool\");\n item2.setDaily_rate(new BigDecimal(\"4.99\"));\n item2 = service.saveItem(item2);\n\n // Add all the Item's in the mock database to a list of Items using the Item API method\n List<Item> itemList = service.findAllItems();\n\n // Test the getAllItem() API method\n TestCase.assertEquals(2, itemList.size());\n TestCase.assertEquals(item1, itemList.get(0));\n TestCase.assertEquals(item2, itemList.get(1));\n }",
"@Test\n public void testGetAllProductsEmpty() throws Exception {\n when(repository.findAll()).thenReturn(Collections.emptyList());\n\n assertEquals(Collections.emptyList(), service.getAllProducts());\n }",
"List<Product> findAll();",
"List<Product> findAll();",
"List<Product> getProductsList();",
"@Override\r\n\tpublic List<Product> getAllProducts() {\n\t\treturn dao.getAllProducts();\r\n\t}",
"@Test\n public void puedeObtenerProductos() {\n Producto pro1 = new Producto(1, \"mate\", 15.4, 10);\n Producto pro2 = new Producto(2, \"termo\", 20.7, 15);\n List<Producto> productosEncontrados = List.of(pro1, pro2);\n\n\n //Act\n productoRepositoryTest.findAll();\n when(productoServiceTest.listarAll()).thenReturn(productosEncontrados);\n\n //Assert\n verify(productoRepositoryTest).findAll();\n assertEquals(productosEncontrados, productoRepositoryTest.findAll());\n }",
"@Override\r\n\tpublic List<Product> showAll() throws Exception {\n\t\treturn this.dao.showAll();\r\n\t}",
"@CrossOrigin()\r\n @GetMapping(\"/products/all\")\r\n List<ProductEntity> getAllProducts() {\r\n // TODO add error if there are not enough products\r\n return productRepository.findAll();\r\n }",
"@Test\n public void productSpecificationTest() {\n // TODO: test productSpecification\n }",
"@Test\n public void testGetProductsByType() throws Exception {\n System.out.println(\"getProductsByType\");\n \n prs = dao.getProductsByType(p1.getType());\n assertTrue(prs.size() == 2);\n assertTrue(prs.contains(p1));\n assertTrue(prs.contains(p2));\n prs = dao.getProductsByType(p2.getType());\n assertTrue(prs.size() == 2);\n assertTrue(prs.contains(p1));\n assertTrue(prs.contains(p2));\n prs = dao.getProductsByType(p3.getType());\n assertTrue(prs.size() == 1);\n assertTrue(prs.contains(p3));\n \n prs = dao.getProductsByName(nonExisten.getType());\n assertTrue(prs.isEmpty());\n }",
"@GetMapping(\"/sysadm/product\")\n public String showAllProduct() {\n return \"admin/sysadm/productList\";\n }",
"List<Product> getAllProducts() throws PersistenceException;",
"@Override\r\n\tpublic List<Mobile> showAllProduct() {\n\t\tQuery query=entitymanager.createQuery(\"FROM Mobile\");\r\n\t\tList<Mobile> myProd=query.getResultList();\r\n\t\treturn myProd;\r\n\t}",
"@GetMapping(\"/view-all\")\r\n\tpublic List<ProductDetails> viewAllProducts() {\r\n\r\n\t\treturn productUtil.toProductDetailsList(productService.viewAllProducts());\r\n\t}",
"@Test\r\n\tpublic void findAllMaterialCategoryTest() {\r\n\t\t// Your Code Here\r\n\r\n\t}",
"@Override\n\tpublic List<Product> getAll() {\n\t\tQuery query = session.createQuery(\"from Product \");\n\t\t\n\t\treturn query.getResultList();\n\t}",
"@Test\n public void selectAll(){\n }",
"public static void getAssignedProduct(String productId , ITestContext context ){\n\t\t \n\t\t //SET URL\n\t\t customerId= (context.getAttribute(\"customerId\")).toString();//need to add validation for customerId\n\t\t String CONTEXT_PATH=\"mcss/ecommerce/customer/\" +customerId + \"/product/\" + productId;\n\t\t \n\t\t//Execute REST\n\t\t Response response =get( CONTEXT_PATH );\n \n\t\t \n\n\t\t //Validations:\n\t\t ResponseBody body = response.getBody();\n\t\t assertEquals( 200 ,response.getStatusCode(),\"Status Code is not as expected\");\n\t\t assertEquals( \"AC\" ,response.body().path(\"Product.status\"),\"AP status is not correct \");\n\t\t assertEquals( productId ,response.body().path(\"Product.id\"),\"AP status is not correct \");\n\t\t \n\t\t //Product validations \n\t\t assertNotEquals( null, response.body().path(\"Product.serviceId\"), \"ServiceId is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.productOfferingProductSpecID\"), \"productOfferingProductSpecID is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.productTypeX9\"), \"productTypeX9 is null\");//EQ,IPTV\n\t\t assertNotEquals( null, response.body().path(\"Product.hasPendingOrders\"), \"hasPendingOrders is null\");//optional\n\t\t assertNotEquals( null, response.body().path(\"Product.ceaseActionAllowed\"), \"ceaseActionAllowed is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.changeActionAllowed\"), \"changeActionAllowed is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.catalogOfferingId\"), \"catalogOfferingId is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.lineOfBusiness\"), \"lineOfBusiness is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.spoName\"), \"spoName is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.resumeActionAllowed\"), \"resumeActionAllowed is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.catalogItemID\"), \"catalogItemID\");\n\t\t// plan validations only if product is not Equipment for Equipment can be if it has Repeator\n\t\t if ( !(response.body().path(\"Product.productTypeX9\")).equals(\"EQ\") ){\n\t\t assertNotEquals( null, response.body().path(\"Product.plan\"), \"plan is null\"); // optional \n\t\t assertNotEquals( null, response.body().path(\"Product.plan.catalogItemName\"), \"plan.catalogItemName is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.plan.catalogItemImages\"), \"plan.catalogItemImages is null\");//optional\n\t\t assertNotEquals( null, response.body().path(\"Product.plan.planRank\"), \"plan.planRank is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.plan.catalogItemID\"), \"plan.catalogItemID is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.plan.catalogItemDescription\"), \"plan.catalogItemDescription is null\");//optional\n\t\t assertNotEquals( null, response.body().path(\"Product.plan.id\"), \"plan.id is null\");\n\t\t }\n\t\t //services validations \n\t\t assertNotEquals( null, response.body().path(\"Product.services\"), \"services are null!\"); // optional \n\t\t assertNotEquals( 0, response.body().path(\"Product.services.size()\"), \" Services Array is empty !\"); // optional \n\t\t// assertNotEquals( null, ((RestAssuredBased) response.body()).get(\"/Product\").jsonPath().getList(\"Product.services.[0].businessType\"), \"Services.businessType is null!\"); \n\t/*\t assertNotEquals( null, response.body().path(\"Product.services.[0].catalogItemID\"), \"Services.catalogItemID is null!\"); \n\t\t assertNotEquals( null, response.body().path(\"Product.services.[0].catalogItemName\"), \"Services.catalogItemName is null!\"); \n\t\t assertNotEquals( null, response.body().path(\"Product.services.[0].catalogItemDescription\"), \"catalogItemDescription is null!\"); //optional\n\t\t assertNotEquals( null, response.body().path(\"Product.services.[0].initialActivationDate\"), \"Services.initialActivationDate is null!\");// \n\t\t assertNotEquals( null, response.body().path(\"Product.services.[0].id\"), \"Services.id is null!\");// \n\t\t assertNotEquals( null, response.body().path(\"Product.services.[0].serviceType\"), \"Services.serviceType is null!\");// \n\t\t assertNotEquals( null, response.body().path(\"Product.services.[0].status\"), \"Services.status is null!\");// */\n\t\t \n\t\t \n\t\t //Savinq Info \n\t\t /*\n context.setAttribute( \"customerId\", body.path(\"ClientUserContext.customerId\" ));\n context.setAttribute( \"personId\", body.path(\"ClientUserContext.personId\" ));\n context.setAttribute( \"personId\", body.path(\"ClientUserContext.personId\" ));\n context.setAttribute( \"personObjIdX\", body.path(\"ClientUserContext.personObjIdX\" ));\n */\n\t }",
"@GetMapping(\"/productos\")\n @Timed\n public List<Producto> getAllProductos() {\n log.debug(\"REST request to get all Productos\");\n List<Producto> productos = productoRepository.findAll();\n return productos;\n }",
"@GetMapping(\"/findAllProduct\")\n @ResponseBody\n public ResponseEntity<List<ProductEntity>> findAllProduct() {\n List<ProductEntity> productResponse = productService.viewProduct();\n return new ResponseEntity<>(productResponse, HttpStatus.OK);\n }",
"@CrossOrigin(origins = \"http://localhost:5000\")\r\n @GetMapping(\"/allproducts/{page}\")\r\n public Iterable<product> allproducts(@PathVariable(\"page\") int pagenum) {\r\n int pageSize = 2;\r\n \r\n Pageable pageable = PageRequest.of(pagenum,pageSize);\r\n Page<product> allproducts = productrepo.findAll(pageable);\r\n \r\n return productrepo.findAll(pageable);\r\n }",
"List<ProductDto> getProducts();",
"public List<Product> getAllProducts() {\n List<Product> listProduct= productBean.getAllProducts();\n return listProduct;\n }",
"@Test\n public void testFindProductShouldCorrect() throws Exception {\n // Mock method\n when(productRepository.findOne(product.getId())).thenReturn(product);\n\n testResponseData(RequestInfo.builder()\n .request(get(PRODUCT_DETAIL_ENDPOINT, product.getId()))\n .token(memberToken)\n .httpStatus(HttpStatus.OK)\n .build());\n }",
"List<Product> getAllProducts() throws DataBaseException;",
"@Test\r\n\tpublic void findStore() {\n\r\n\t\tRestAssured.baseURI= \"https://api.bestbuy.com/v1/products/6341359/stores.json?\";\r\n\r\n\t\t//\t\tproducts/6341359/stores.json?postalCode=95125&apiKey=qUh3qMK14GdwAs9bO59QRSCJ\r\n\r\n\t\t//\t\tproducts(manufacturer=apple&search=iPhone 11 Pro)?format=json&show=name,regularPrice,salePrice&apiKey=qUh3qMK14GdwAs9bO59QRSCJ\r\n\t\t// products(manufacturer=apple&search=iPhone 11 64GB&inStorePickup=true)+stores(region=RI)?format=json&show=sku,name,stores.storeId,stores.name,stores.address&apiKey=qUh3qMK14GdwAs9bO59QRSCJ\r\n\r\n\t\t// Map<String, String> parametersMap = new HashMap<String, String>();\r\n\t\t//parametersMap.put(\"products\", \"products/6341359/\");\r\n\r\n\r\n\r\n\r\n\t\tResponse response = RestAssured\r\n\t\t\t\t.given()\r\n\t\t\t\t.log().all()\r\n\t\t\t\t.accept(ContentType.JSON)\r\n\t\t\t\t.queryParam(\"postalCode\",\"95125\")\r\n\t\t\t\t.queryParam(\"apiKey\",\"qUh3qMK14GdwAs9bO59QRSCJ\")\r\n\t\t\t\t.get();\r\n\r\n\t\tresponse.prettyPrint();\r\n\r\n\t\tSystem.out.println(\" Response code : \" + response.getStatusCode());\r\n\r\n\t}",
"@Test\n\tpublic void test_get_product_pagination_return_200() throws Exception {\n\t\tPrincipal mockPrincipal = Mockito.mock(Principal.class);\n\t\tMockito.when(mockPrincipal.getName()).thenReturn(\"1\");\n\t\tProductDTO expected = DummyData.getProductDto1();\n\t\tMockHttpServletRequestBuilder mockRequest = MockMvcRequestBuilders.request(HttpMethod.GET, \"/?name=Gucci&brand=gucci&color=blue&priceFrom=400&priceTo=500&sort=name,asc&page=0&size=10\")\n\t\t\t\t.principal(mockPrincipal)\n\t\t\t\t.contentType(MediaType.APPLICATION_JSON)\n\t\t\t\t.accept(MediaType.APPLICATION_JSON);\n\n\t\t// Setup when\n\t\twhen(productService.getProductPage(ArgumentMatchers.any(), ArgumentMatchers.any())).thenReturn(Arrays.asList(expected));\n\t\t\n\t\t// Execute the POST request\n\t\tmockMvc.perform(mockRequest)\n\t\t\t\t.andExpect(status().isOk())\n\t\t\t\t// Validate the response code and content type\n\t\t\t\t.andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON))\n\t\t\t\t// Validate the returned fields\n\t\t\t\t.andExpect(jsonPath(\"$\").isArray())\n\t\t\t\t.andExpect(jsonPath(\"$[0].brand\", Is.is(expected.getBrand())))\n\t\t\t\t.andExpect(jsonPath(\"$[0].color\", Is.is(expected.getColor())))\n\t\t\t\t.andExpect(jsonPath(\"$[0].name\", Is.is(expected.getName()))).andReturn();\n\n\t\t// verify\n\t\tverify(productService).getProductPage(ArgumentMatchers.any(), ArgumentMatchers.any());\n\t}",
"@Test\n\tpublic void testFindProductByGuidWithMoreThanOneReturn() {\n\t\tstubGetBean(ContextIdNames.PRODUCT, ProductImpl.class);\n\n\t\tfinal List<Product> products = new ArrayList<Product>();\n\t\tProduct product = new ProductImpl();\n\t\tproducts.add(product);\n\t\tproducts.add(product);\n\t\tcontext.checking(new Expectations() {\n\t\t\t{\n\t\t\t\tallowing(getMockPersistenceEngine()).retrieveByNamedQuery(with(any(String.class)), with(any(Object[].class)));\n\t\t\t\twill(returnValue(products));\n\t\t\t}\n\t\t});\n\t\ttry {\n\t\t\tthis.importGuidHelper.findProductByGuid(SOME_GUID, false, false, true);\n\t\t\tfail(EP_SERVICE_EXCEPTION_EXPECTED);\n\t\t} catch (EpServiceException e) {\n\t\t\t// succeed!\n\t\t\tassertNotNull(e);\n\t\t}\n\t}",
"@Test\n public void testFindProduct() {\n ShoppingCart instance = new ShoppingCart();\n Product p1 = new Product(\"Galletas\", 1.2);\n Product p2 = new Product(\"Raton\", 85.6);\n \n instance.addItem(p1);\n instance.addItem(p2);\n \n assertTrue(instance.findProduct(\"Galletas\"));\n }",
"@Test\n public void retrieveAllTest() throws ApiException {\n Long productId = null;\n List<GetInterestRateChartsResponse> response = api.retrieveAll(productId);\n\n // TODO: test validations\n }",
"@GetMapping(\"/retrieve\")\n public ResponseEntity<List<Product>> getProdAll(final HttpSession session) {\n log.info(session.getId() + \" : Retrieving all products\");\n return ResponseEntity.status(HttpStatus.OK).body(prodService.getAll());\n }",
"@Test\r\n public void testListAll() {\r\n System.out.println(\"listAll\");\r\n IwRepoDAOMarkLogicImplStud instance = new IwRepoDAOMarkLogicImplStud();\r\n String expResult = \"\";\r\n String result = instance.listAll();\r\n System.out.println(result);\r\n }",
"private static void getListTest() {\n\t\tList<CartVo> list=new CartDao().getList();\r\n\t\t\r\n\t\tfor(CartVo cartVo : list) {\r\n\t\t\tSystem.out.println(cartVo);\r\n\t\t}\r\n\t}",
"@RequestMapping(method = RequestMethod.GET, value = \"/user/getAll\")\n @ApiOperation(value = \"Getting all the products\")\n public Iterable<User> getAll(){\n return userService.getAll();\n }",
"@Test\n public void testGetAllOrders() throws Exception {\n }",
"@Test\n void findAll_API_TEST() throws Exception {\n\n //TEST DATA\n Pet pet_1 = new Pet();\n pet_1.setId(1);\n pet_1.setName(\"John\");\n\n Pet pet_2 = new Pet();\n pet_2.setId(2);\n pet_2.setName(\"John\");\n\n Pet pet_3 = new Pet();\n pet_3.setId(3);\n pet_3.setName(\"John\");\n\n given(petService.findAll()).willReturn(asList(pet_1, pet_2, pet_3));\n mvc.perform(get(\"/owners/*/pets\").accept(MediaType.APPLICATION_JSON))\n .andExpect(status().isOk())\n .andExpect(jsonPath(\"$[0].id\").value(1))\n .andExpect(jsonPath(\"$[1].id\").value(2))\n .andExpect(jsonPath(\"$[2].id\").value(3));\n\n }",
"@Test\n public void others(){\n Item item = itemService.getItem(50);\n System.out.println(item);\n\n }",
"@Test\n public void retriveAllTest() throws SQLException {\n manager = new TableServizioManager(mockDb);\n List<Servizio> lista = manager.retriveAll();\n assertEquals(7,lista.size(),\"It should return a list of length 7\");\n }",
"@Test\n\tpublic void testFindAllProductNoContentFound() {\n\n\t\tMockito.when(productDao.findByProductGroup_ProductGroupId(1)).thenReturn(products);\n\n\t\tResponseEntity<List<Product>> expected = productServiceImpl.getAllProductsByProductGroupId(1);\n\n\t\tAssertions.assertNotSame(expected, ResponseEntity.noContent().build());\n\t}",
"List<CheckoutProduct> findAll();",
"@Test \n\t public void testRetrieveAll(){\n\t\t try{\n\t\t\t List<Users> users = new ArrayList<Users>();\n\t\t\t users.add( BaseData.getUsers());\n\t\t\t\tusers.add(BaseData.getDBUsers());\n\t\t\t\tQuery mockQuery = mock(Query.class);\n\t\t\t\twhen(entityManager.createQuery(Mockito.anyString())).thenReturn(mockQuery);\n\t\t\t\twhen(mockQuery.getResultList()).thenReturn(users);\n\t\t\t\tList<Users> loadedUsers = (List<Users>)userDao.retrieveAll();\n\t\t\t\tassertNotNull(loadedUsers);\n\t\t\t\tassertTrue(loadedUsers.size() > 1);\n\t\t }catch(DataAcessException se){\n\t\t\t logger.error(\"error at service layer while testing retrieveAll:.\",se);\n\t\t }\n\t }",
"@Test\n public void testGetAllUsesOfMetsDocument() throws Exception {\n System.out.println(\"getAllUsesOfMetsDocument\");\n String resourceId = \"id_0015\";\n String items[] = {\"OCR-D-GT-IMG-BIN\", \"OCR-D-GT-IMG-CROP\", \"OCR-D-GT-IMG-DESPEC\", \"OCR-D-GT-IMG-DEWARP\"};\n\n this.mockMvc.perform(get(\"/api/v1/metastore/mets/\" + resourceId + \"/use\"))\n .andDo(print())\n .andExpect(status().isOk())\n .andExpect(MockMvcResultMatchers.jsonPath(\"$\", Matchers.hasSize(4)))\n .andExpect(MockMvcResultMatchers.jsonPath(\"$.[*]\", Matchers.hasItems(items)))\n .andReturn();\n }",
"@Test\n public void getCatalogSalesTest() {\n Integer size = null;\n Integer page = null;\n String order = null;\n // PageResourceCatalogSale response = api.getCatalogSales(size, page, order);\n\n // TODO: test validations\n }",
"private void demoSellProducts()\n {\n System.out.println(\"\\nSelling all the products\\n\");\n System.out.println(\"============================\");\n System.out.println();\n for(int id = 101; id <= 110; id++)\n {\n amount = generator.nextInt(20);\n manager.sellProduct(id, amount);\n }\n \n manager.printAllProducts();\n }",
"@Test\n public void test_all() throws Exception {\n matchInvoke(serviceURL, \"PWDDIC_testSearch_all_req.xml\",\n \"PWDDIC_testSearch_all_res.xml\");\n }",
"@GetMapping(\"/products\")\n\t@HystrixCommand(fallbackMethod = \"getFallBackAllProducts\")\n\tpublic Products getAllProducts(){\n\t\tList<Product> pList=restTemplate.getForObject(\"http://product-service/products\", List.class);\n\t\tProducts p=new Products();\n\t\tp.setProductList(pList);\n\t\treturn p;\n\t}",
"@Test\n public void listProdTags() {\n }",
"@Test\n\t// @Disabled\n\tvoid testViewAllCustomer() {\n\t\tCustomer customer1 = new Customer(1, \"tom\", \"son\", \"951771122\", \"[email protected]\");\n\t\tCustomer customer2 = new Customer(2, \"jerry\", \"lee\", \"951998122\", \"[email protected]\");\n\t\tList<Customer> customerList = new ArrayList<>();\n\t\tcustomerList.add(customer1);\n\t\tcustomerList.add(customer2);\n\t\tMockito.when(custRep.findAll()).thenReturn(customerList);\n\t\tList<Customer> customer = custService.findAllCustomer();\n\t\tassertEquals(2, customer.size());\n\t}",
"@NonNull\n public List<Product> findAll() {\n return productRepository.findAll();\n }",
"@GetMapping(path =\"/products\")\n public ResponseEntity<List<Product>> getProducts() {\n return ResponseEntity.ok(productService.getAll());\n }",
"@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n public List<Product> getProductFindAll() {\n return em.createNamedQuery(\"Product.findAll\", Product.class).getResultList();\n }",
"@Test\n void getAllOrdersSuccess() {\n List<Order> orders = dao.getAllOrders();\n assertEquals(3, orders.size());\n }",
"@Test\n\tvoid testGetAllByName() {\n\t\tList<Plant> plant = service.getAllByName(\"Tulsi\");\n\t\tString name = plant.get(0).getName();\n\t\tassertEquals(\"Tulsi\", name);\n\t}",
"@Test\n\tpublic void testVendorGetAll() {\n\t\tJsonResponse jr = null;\n\t\tjr = vendorCont.getAll();\n\t\tassertNotNull(jr);\n\t}",
"@Test\n public void testJPA3ListAll (){\n Iterable<TruckInfo> trucklist = truckRepo.findAll();\n\n\n\n\n }",
"@Test\r\n public void testA0Get_0args() {\r\n System.out.println(\"get all\");\r\n \r\n UsuarioDao instance = new UsuarioDao();\r\n List<Usuario> expResult = new ArrayList<>();\r\n List<Usuario> result = instance.get();\r\n \r\n assertEquals(expResult, result);\r\n }",
"@Test\n public void getPriceBySeller1(){\n }"
] | [
"0.78353167",
"0.77034056",
"0.7641449",
"0.71475226",
"0.71466684",
"0.6997231",
"0.6984412",
"0.6984412",
"0.6984412",
"0.69556767",
"0.69386786",
"0.68810064",
"0.6846667",
"0.6814431",
"0.6807709",
"0.68067867",
"0.6749895",
"0.6712061",
"0.6704337",
"0.66934323",
"0.6692462",
"0.6692462",
"0.6689678",
"0.6688976",
"0.66863126",
"0.6674648",
"0.6674648",
"0.6671568",
"0.6632004",
"0.66247433",
"0.66061026",
"0.660414",
"0.6604132",
"0.6603618",
"0.6600486",
"0.6582098",
"0.6574724",
"0.6563153",
"0.6554441",
"0.6519997",
"0.650278",
"0.64924383",
"0.64694834",
"0.64448625",
"0.64443755",
"0.64443755",
"0.6431716",
"0.6399345",
"0.6390825",
"0.63886535",
"0.63884604",
"0.6361737",
"0.6358692",
"0.63563144",
"0.6351651",
"0.63471466",
"0.63371885",
"0.6327439",
"0.63245815",
"0.6319611",
"0.6319363",
"0.63180804",
"0.6304495",
"0.6298864",
"0.6268963",
"0.6260568",
"0.62546307",
"0.6253997",
"0.62536013",
"0.6247176",
"0.62315047",
"0.62308145",
"0.6228391",
"0.62272954",
"0.62249625",
"0.62200886",
"0.6218931",
"0.6213546",
"0.6212668",
"0.6212049",
"0.6211129",
"0.62097704",
"0.6208504",
"0.62057745",
"0.6201237",
"0.6200199",
"0.61986446",
"0.61851996",
"0.6180986",
"0.6174633",
"0.6173561",
"0.61725205",
"0.6169141",
"0.61661047",
"0.6157097",
"0.61516625",
"0.6149329",
"0.6145477",
"0.6140547",
"0.6134531"
] | 0.7735288 | 1 |
Test get all product method | @Test
public void testGetAllProductsEmpty() throws Exception {
when(repository.findAll()).thenReturn(Collections.emptyList());
assertEquals(Collections.emptyList(), service.getAllProducts());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void testGetAllProduct() throws Exception {\n System.out.println(\"getAllProduct\");\n prs = dao.getAllProduct();\n \n assertArrayEquals(products.toArray(), prs.toArray());\n }",
"@Test\n public void testGetAllProducts() throws Exception {\n when(repository.findAll()).thenReturn(Collections.singletonList(this.product));\n\n assertEquals(Collections.singletonList(this.product), service.getAllProducts());\n }",
"@Test\n public void testFindAllProduct() throws Exception {\n // Mock method\n when(productRepository.findAll()).thenReturn(products);\n\n testResponseData(RequestInfo.builder()\n .request(get(PRODUCT_ENDPOINT))\n .token(memberToken)\n .httpStatus(HttpStatus.OK)\n .build());\n }",
"private void getAllProducts() {\n }",
"@Test\n public void selectAll() {\n List<ProductCategory>productCategories=categoryService.selectAll();\n for (ProductCategory productCategory:productCategories\n ) {\n System.out.println(productCategory);\n }\n }",
"@Test\n public void testGetOneProduct() {\n }",
"@Test\n public void testGetProducts() {\n }",
"List<Product> getAllProducts();",
"List<Product> getAllProducts();",
"List<Product> getAllProducts();",
"@Test\n public void testGetAllProducts() throws FileStorageException {\n List<Product> products = dao.getAllProducts();\n \n assertEquals(15, products.size());\n }",
"Product getPProducts();",
"@Test\n public void testGetProductsByPurcher() throws Exception {\n System.out.println(\"getProductsByPurcher\");\n Customer c = new Customer();\n c.setId(1l);\n prs = dao.getProductsByPurcher(c);\n assertTrue(prs.contains(p3));\n assertTrue(prs.size() == 1);\n c.setId(2l);\n prs = dao.getProductsByPurcher(c);\n assertTrue(prs.contains(p1));\n assertTrue(prs.size() == 1);\n \n c.setId(3l);\n prs = dao.getProductsByPurcher(c);\n assertTrue(prs.isEmpty());\n }",
"public void showAllProducts() {\n try {\n System.out.println(Constants.DECOR+\"ALL PRODUCTS IN STORE\"+Constants.DECOR_END);\n List<Product> products = productService.getProducts();\n System.out.println(Constants.PRODUCT_HEADER);\n for (Product product : products) { \n System.out.println((product.getName()).concat(\"\\t\\t\").concat(product.getDescription()).concat(\"\\t\\t\")\n .concat(String.valueOf(product.getId()))\n .concat(\"\\t\\t\").concat(product.getSKU()).concat(\"\\t\").concat(String.valueOf(product.getPrice()))\n .concat(\"\\t\").concat(String.valueOf(product.getMaxPrice())).concat(\"\\t\")\n .concat(String.valueOf(product.getStatus()))\n .concat(\"\\t\").concat(product.getCreated()).concat(\"\\t\\t\").concat(product.getModified())\n .concat(\"\\t\\t\").concat(String.valueOf(product.getUser().getUserId())));\n }\n } catch (ProductException ex) {\n System.out.println(ex);\n }\n }",
"@Test\n public void getAllTest() {\n Mockito.when(this.repo.findAll()).thenReturn(publisherList);\n Iterable<Publisher> resultFromService = this.publisherService.findAll();\n Publisher resultFromIterator = resultFromService.iterator().next();\n assertThat(resultFromIterator.getName()).isEqualTo(\"What The What\");\n Mockito.verify(this.repo, Mockito.times(1)).findAll();\n }",
"private void printAllProducts()\n {\n manager.printAllProducts();\n }",
"@Test\n public void productTest() {\n // TODO: test product\n }",
"@Test\n public void testListProducts() {\n List<Product> allProducts = testDao.listProducts();\n\n // First check the general contents of the list\n assertNotNull(allProducts, \"The list of products must not null\");\n assertEquals(4, allProducts.size(),\"List of products should have 4 products.\");\n \n // Then the specifics\n// assertTrue(testDao.getAllMonsters().contains(firstMonster),\n// \"The list of monsters should include Vladmir.\");\n// assertTrue(testDao.getAllMonsters().contains(secondMonster),\n// \"The list of monsters should include Warwick.\");\n }",
"@Test\n void searchProduct() {\n List<DummyProduct> L1= store.SearchProduct(\"computer\",null,-1,-1);\n assertTrue(L1.get(0).getProductName().equals(\"computer\"));\n\n List<DummyProduct> L2= store.SearchProduct(null,\"Technology\",-1,-1);\n assertTrue(L2.get(0).getCategory().equals(\"Technology\")&&L2.get(1).getCategory().equals(\"Technology\"));\n\n List<DummyProduct> L3= store.SearchProduct(null,null,0,50);\n assertTrue(L3.get(0).getProductName().equals(\"MakeUp\"));\n\n List<DummyProduct> L4= store.SearchProduct(null,\"Fun\",0,50);\n assertTrue(L4.isEmpty());\n }",
"@Override\n public Iterable<Product> findAllProduct() {\n return productRepository.findAll();\n }",
"@Override\r\n\tpublic List prodAllseach() {\n\t\treturn adminDAO.seachProdAll();\r\n\t}",
"public List<Product> getProducts();",
"public List<Product> getProducts();",
"@GetMapping(\"/getproduct\")\n\t\tpublic List<Product> getAllProduct() {\n\t\t\tlogger.info(\"products displayed\");\n\t\t\treturn productService.getAllProduct();\n\t\t}",
"@SuppressWarnings(\"unchecked\")\r\n\t@Override\r\n\tpublic ProductResponseModel getAllProduct() {\n\r\n\t\tProductResponseModel productResponseModel = new ProductResponseModel();\r\n\r\n\t\tMap<String, Object> map = productRepositoryImpl.getAllProduct();\r\n\r\n\t\t// productResponseModel.setCount((long) map.get(\"count\"));\r\n\t\tList<Product> product = (List<Product>) map.get(\"data\");\r\n\t\tList<ProductModel> productList = product.stream().map(p -> new ProductModel(p.getId(), p.getProName(),\r\n\t\t\t\tp.getProPrice(), p.getProQuantity(), p.getProDescription(), p.getProSize()))\r\n\t\t\t\t.collect(Collectors.toList());\r\n\r\n\t\tproductResponseModel.setData(productList);\r\n\r\n\t\treturn productResponseModel;\r\n\t}",
"@Test\n public void GETProductService_ProductCall() {\n givenHeaders().\n when().\n get(_url_prodservice).//.body().prettyPrint();\n then().\n using().defaultParser(Parser.JSON).\n log().ifError().\n statusCode(200).\n body(\"response\", not(isEmptyString()));\n System.out.print(\"GETProductService_ProductCall Test Run Result\");\n }",
"@Override\n\tpublic List<Product> getAllProduct() {\n\t\treturn productRepository.findAll();\n\t}",
"@Override\n\tpublic List<Product> getAllProduct() {\n\t\treturn productRepository.findAll();\n\t}",
"List<Product> retrieveProducts();",
"@Test\n\tpublic void searchForProductLandsOnCorrectProduct() {\n\t}",
"@Test\n public void testGetProductInfo() throws Exception {\n }",
"@Test\n public void testGetProductsByName() throws Exception {\n System.out.println(\"getProductsByName\");\n for (Product p : products) {\n prs = dao.getProductsByName(p.getName());\n assertTrue(prs.size() == 1);\n assertTrue(prs.contains(p));\n \n }\n prs = dao.getProductsByName(nonExisten.getName());\n assertTrue(prs.isEmpty());\n }",
"@GetMapping(\"/allProduct\")\n\tpublic ResponseEntity<Response> getAllProduct(){\n\t\treturn ResponseEntity.status(HttpStatus.OK)\n\t\t\t\t.body(new Response(productService.getProduct(), new Date()));\n\t}",
"@Test\n public void testGetProductsBySaler() throws Exception {\n System.out.println(\"getProductsBySaler\");\n Customer c = new Customer();\n c.setId(1l);\n prs = dao.getProductsBySaler(c);\n assertTrue(prs.contains(p1));\n assertTrue(prs.contains(p2));\n assertTrue(prs.size() == 2);\n\n c.setId(2l);\n prs = dao.getProductsBySaler(c);\n assertTrue(prs.isEmpty());\n \n c.setId(3l);\n prs = dao.getProductsBySaler(c);\n assertTrue(prs.contains(p3));\n assertTrue(prs.size() == 1);\n \n }",
"@Override\n\tpublic List<Products> getAllProduct() {\n\t\treturn dao.getAllProduct();\n\t}",
"@Override\r\n\tpublic List<Producto> getAll() throws Exception {\n\t\treturn productRepository.buscar();\r\n\t}",
"@Test\n void getAllSuccess(){\n\n List<CompositionInstrument> compositionInstruments = genericDao.getAll();\n assertEquals(4, compositionInstruments.size());\n }",
"public List<Product> getAll() {\n\t\treturn productRepository.findAll();\n\n\t}",
"@Test\n public void GETProduct_ProductInventoryCall() {\n\n givenHeaders().\n when().\n get(_url_product).//.body().prettyPrint();\n then().\n using().defaultParser(Parser.JSON).\n log().ifError().\n statusCode(200).\n body(\"response\", not(isEmptyString()));\n System.out.print(\"GETPRODUCT_Inventory Test Run Result\");\n }",
"@Override\r\n public List<Product> findAll() {\r\n return productRepository.findAll();\r\n }",
"@Override\r\n\tpublic List<Product> getallProducts() {\n\t\treturn dao.getallProducts();\r\n\t}",
"public List<Product> findAll();",
"@Override\n public List<ProductDTO> getProducts(Map<String, String> allParams) throws ProductException {\n List<Criterion> criteria = new ArrayList<>();\n int criteriaCounter = 0;\n String order = null;\n\n if (allParams != null) {\n for (Map.Entry<String, String> entry : allParams.entrySet()) {\n // Validate params\n if (!Arrays.stream(avalibleParams).anyMatch(val -> val.equals(entry.getKey())))\n throw new ProductException(ProductException.INVALID_INPUT, ProductException.INVALID_INPUT_MSG);\n\n if (entry.getKey().equals(avalibleParams[0])) { // avalibleParams[0] is \"order\"\n order = entry.getValue();\n } else {\n // Add a criterion\n criteria.add(new Criterion(entry.getValue(), entry.getKey()));\n criteriaCounter++;\n }\n }\n }\n // Params Excess exception\n if (criteriaCounter > 2)\n throw new ProductException(ProductException.PARAMS_EXCESS, ProductException.PARAMS_EXCESS_MSG);\n\n return articleRepository.getProducts(criteria, order);\n }",
"@Test\n public void getAllItem() {\n Item item1 = new Item();\n item1.setName(\"Drill\");\n item1.setDescription(\"Power Tool\");\n item1.setDaily_rate(new BigDecimal(\"24.99\"));\n item1 = service.saveItem(item1);\n\n // Add an Item to the mock database using the Item API method (item2)\n Item item2 = new Item();\n item2.setName(\"Screwdriver\");\n item2.setDescription(\"Hand Tool\");\n item2.setDaily_rate(new BigDecimal(\"4.99\"));\n item2 = service.saveItem(item2);\n\n // Add all the Item's in the mock database to a list of Items using the Item API method\n List<Item> itemList = service.findAllItems();\n\n // Test the getAllItem() API method\n TestCase.assertEquals(2, itemList.size());\n TestCase.assertEquals(item1, itemList.get(0));\n TestCase.assertEquals(item2, itemList.get(1));\n }",
"List<Product> findAll();",
"List<Product> findAll();",
"List<Product> getProductsList();",
"@Override\r\n\tpublic List<Product> getAllProducts() {\n\t\treturn dao.getAllProducts();\r\n\t}",
"@Test\n public void puedeObtenerProductos() {\n Producto pro1 = new Producto(1, \"mate\", 15.4, 10);\n Producto pro2 = new Producto(2, \"termo\", 20.7, 15);\n List<Producto> productosEncontrados = List.of(pro1, pro2);\n\n\n //Act\n productoRepositoryTest.findAll();\n when(productoServiceTest.listarAll()).thenReturn(productosEncontrados);\n\n //Assert\n verify(productoRepositoryTest).findAll();\n assertEquals(productosEncontrados, productoRepositoryTest.findAll());\n }",
"@Override\r\n\tpublic List<Product> showAll() throws Exception {\n\t\treturn this.dao.showAll();\r\n\t}",
"@CrossOrigin()\r\n @GetMapping(\"/products/all\")\r\n List<ProductEntity> getAllProducts() {\r\n // TODO add error if there are not enough products\r\n return productRepository.findAll();\r\n }",
"@Test\n public void productSpecificationTest() {\n // TODO: test productSpecification\n }",
"@Test\n public void testGetProductsByType() throws Exception {\n System.out.println(\"getProductsByType\");\n \n prs = dao.getProductsByType(p1.getType());\n assertTrue(prs.size() == 2);\n assertTrue(prs.contains(p1));\n assertTrue(prs.contains(p2));\n prs = dao.getProductsByType(p2.getType());\n assertTrue(prs.size() == 2);\n assertTrue(prs.contains(p1));\n assertTrue(prs.contains(p2));\n prs = dao.getProductsByType(p3.getType());\n assertTrue(prs.size() == 1);\n assertTrue(prs.contains(p3));\n \n prs = dao.getProductsByName(nonExisten.getType());\n assertTrue(prs.isEmpty());\n }",
"@GetMapping(\"/sysadm/product\")\n public String showAllProduct() {\n return \"admin/sysadm/productList\";\n }",
"List<Product> getAllProducts() throws PersistenceException;",
"@Override\r\n\tpublic List<Mobile> showAllProduct() {\n\t\tQuery query=entitymanager.createQuery(\"FROM Mobile\");\r\n\t\tList<Mobile> myProd=query.getResultList();\r\n\t\treturn myProd;\r\n\t}",
"@GetMapping(\"/view-all\")\r\n\tpublic List<ProductDetails> viewAllProducts() {\r\n\r\n\t\treturn productUtil.toProductDetailsList(productService.viewAllProducts());\r\n\t}",
"@Test\r\n\tpublic void findAllMaterialCategoryTest() {\r\n\t\t// Your Code Here\r\n\r\n\t}",
"@Override\n\tpublic List<Product> getAll() {\n\t\tQuery query = session.createQuery(\"from Product \");\n\t\t\n\t\treturn query.getResultList();\n\t}",
"@Test\n public void selectAll(){\n }",
"public static void getAssignedProduct(String productId , ITestContext context ){\n\t\t \n\t\t //SET URL\n\t\t customerId= (context.getAttribute(\"customerId\")).toString();//need to add validation for customerId\n\t\t String CONTEXT_PATH=\"mcss/ecommerce/customer/\" +customerId + \"/product/\" + productId;\n\t\t \n\t\t//Execute REST\n\t\t Response response =get( CONTEXT_PATH );\n \n\t\t \n\n\t\t //Validations:\n\t\t ResponseBody body = response.getBody();\n\t\t assertEquals( 200 ,response.getStatusCode(),\"Status Code is not as expected\");\n\t\t assertEquals( \"AC\" ,response.body().path(\"Product.status\"),\"AP status is not correct \");\n\t\t assertEquals( productId ,response.body().path(\"Product.id\"),\"AP status is not correct \");\n\t\t \n\t\t //Product validations \n\t\t assertNotEquals( null, response.body().path(\"Product.serviceId\"), \"ServiceId is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.productOfferingProductSpecID\"), \"productOfferingProductSpecID is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.productTypeX9\"), \"productTypeX9 is null\");//EQ,IPTV\n\t\t assertNotEquals( null, response.body().path(\"Product.hasPendingOrders\"), \"hasPendingOrders is null\");//optional\n\t\t assertNotEquals( null, response.body().path(\"Product.ceaseActionAllowed\"), \"ceaseActionAllowed is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.changeActionAllowed\"), \"changeActionAllowed is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.catalogOfferingId\"), \"catalogOfferingId is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.lineOfBusiness\"), \"lineOfBusiness is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.spoName\"), \"spoName is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.resumeActionAllowed\"), \"resumeActionAllowed is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.catalogItemID\"), \"catalogItemID\");\n\t\t// plan validations only if product is not Equipment for Equipment can be if it has Repeator\n\t\t if ( !(response.body().path(\"Product.productTypeX9\")).equals(\"EQ\") ){\n\t\t assertNotEquals( null, response.body().path(\"Product.plan\"), \"plan is null\"); // optional \n\t\t assertNotEquals( null, response.body().path(\"Product.plan.catalogItemName\"), \"plan.catalogItemName is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.plan.catalogItemImages\"), \"plan.catalogItemImages is null\");//optional\n\t\t assertNotEquals( null, response.body().path(\"Product.plan.planRank\"), \"plan.planRank is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.plan.catalogItemID\"), \"plan.catalogItemID is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.plan.catalogItemDescription\"), \"plan.catalogItemDescription is null\");//optional\n\t\t assertNotEquals( null, response.body().path(\"Product.plan.id\"), \"plan.id is null\");\n\t\t }\n\t\t //services validations \n\t\t assertNotEquals( null, response.body().path(\"Product.services\"), \"services are null!\"); // optional \n\t\t assertNotEquals( 0, response.body().path(\"Product.services.size()\"), \" Services Array is empty !\"); // optional \n\t\t// assertNotEquals( null, ((RestAssuredBased) response.body()).get(\"/Product\").jsonPath().getList(\"Product.services.[0].businessType\"), \"Services.businessType is null!\"); \n\t/*\t assertNotEquals( null, response.body().path(\"Product.services.[0].catalogItemID\"), \"Services.catalogItemID is null!\"); \n\t\t assertNotEquals( null, response.body().path(\"Product.services.[0].catalogItemName\"), \"Services.catalogItemName is null!\"); \n\t\t assertNotEquals( null, response.body().path(\"Product.services.[0].catalogItemDescription\"), \"catalogItemDescription is null!\"); //optional\n\t\t assertNotEquals( null, response.body().path(\"Product.services.[0].initialActivationDate\"), \"Services.initialActivationDate is null!\");// \n\t\t assertNotEquals( null, response.body().path(\"Product.services.[0].id\"), \"Services.id is null!\");// \n\t\t assertNotEquals( null, response.body().path(\"Product.services.[0].serviceType\"), \"Services.serviceType is null!\");// \n\t\t assertNotEquals( null, response.body().path(\"Product.services.[0].status\"), \"Services.status is null!\");// */\n\t\t \n\t\t \n\t\t //Savinq Info \n\t\t /*\n context.setAttribute( \"customerId\", body.path(\"ClientUserContext.customerId\" ));\n context.setAttribute( \"personId\", body.path(\"ClientUserContext.personId\" ));\n context.setAttribute( \"personId\", body.path(\"ClientUserContext.personId\" ));\n context.setAttribute( \"personObjIdX\", body.path(\"ClientUserContext.personObjIdX\" ));\n */\n\t }",
"@GetMapping(\"/productos\")\n @Timed\n public List<Producto> getAllProductos() {\n log.debug(\"REST request to get all Productos\");\n List<Producto> productos = productoRepository.findAll();\n return productos;\n }",
"@GetMapping(\"/findAllProduct\")\n @ResponseBody\n public ResponseEntity<List<ProductEntity>> findAllProduct() {\n List<ProductEntity> productResponse = productService.viewProduct();\n return new ResponseEntity<>(productResponse, HttpStatus.OK);\n }",
"@CrossOrigin(origins = \"http://localhost:5000\")\r\n @GetMapping(\"/allproducts/{page}\")\r\n public Iterable<product> allproducts(@PathVariable(\"page\") int pagenum) {\r\n int pageSize = 2;\r\n \r\n Pageable pageable = PageRequest.of(pagenum,pageSize);\r\n Page<product> allproducts = productrepo.findAll(pageable);\r\n \r\n return productrepo.findAll(pageable);\r\n }",
"List<ProductDto> getProducts();",
"public List<Product> getAllProducts() {\n List<Product> listProduct= productBean.getAllProducts();\n return listProduct;\n }",
"@Test\n public void testFindProductShouldCorrect() throws Exception {\n // Mock method\n when(productRepository.findOne(product.getId())).thenReturn(product);\n\n testResponseData(RequestInfo.builder()\n .request(get(PRODUCT_DETAIL_ENDPOINT, product.getId()))\n .token(memberToken)\n .httpStatus(HttpStatus.OK)\n .build());\n }",
"List<Product> getAllProducts() throws DataBaseException;",
"@Test\r\n\tpublic void findStore() {\n\r\n\t\tRestAssured.baseURI= \"https://api.bestbuy.com/v1/products/6341359/stores.json?\";\r\n\r\n\t\t//\t\tproducts/6341359/stores.json?postalCode=95125&apiKey=qUh3qMK14GdwAs9bO59QRSCJ\r\n\r\n\t\t//\t\tproducts(manufacturer=apple&search=iPhone 11 Pro)?format=json&show=name,regularPrice,salePrice&apiKey=qUh3qMK14GdwAs9bO59QRSCJ\r\n\t\t// products(manufacturer=apple&search=iPhone 11 64GB&inStorePickup=true)+stores(region=RI)?format=json&show=sku,name,stores.storeId,stores.name,stores.address&apiKey=qUh3qMK14GdwAs9bO59QRSCJ\r\n\r\n\t\t// Map<String, String> parametersMap = new HashMap<String, String>();\r\n\t\t//parametersMap.put(\"products\", \"products/6341359/\");\r\n\r\n\r\n\r\n\r\n\t\tResponse response = RestAssured\r\n\t\t\t\t.given()\r\n\t\t\t\t.log().all()\r\n\t\t\t\t.accept(ContentType.JSON)\r\n\t\t\t\t.queryParam(\"postalCode\",\"95125\")\r\n\t\t\t\t.queryParam(\"apiKey\",\"qUh3qMK14GdwAs9bO59QRSCJ\")\r\n\t\t\t\t.get();\r\n\r\n\t\tresponse.prettyPrint();\r\n\r\n\t\tSystem.out.println(\" Response code : \" + response.getStatusCode());\r\n\r\n\t}",
"@Test\n\tpublic void test_get_product_pagination_return_200() throws Exception {\n\t\tPrincipal mockPrincipal = Mockito.mock(Principal.class);\n\t\tMockito.when(mockPrincipal.getName()).thenReturn(\"1\");\n\t\tProductDTO expected = DummyData.getProductDto1();\n\t\tMockHttpServletRequestBuilder mockRequest = MockMvcRequestBuilders.request(HttpMethod.GET, \"/?name=Gucci&brand=gucci&color=blue&priceFrom=400&priceTo=500&sort=name,asc&page=0&size=10\")\n\t\t\t\t.principal(mockPrincipal)\n\t\t\t\t.contentType(MediaType.APPLICATION_JSON)\n\t\t\t\t.accept(MediaType.APPLICATION_JSON);\n\n\t\t// Setup when\n\t\twhen(productService.getProductPage(ArgumentMatchers.any(), ArgumentMatchers.any())).thenReturn(Arrays.asList(expected));\n\t\t\n\t\t// Execute the POST request\n\t\tmockMvc.perform(mockRequest)\n\t\t\t\t.andExpect(status().isOk())\n\t\t\t\t// Validate the response code and content type\n\t\t\t\t.andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON))\n\t\t\t\t// Validate the returned fields\n\t\t\t\t.andExpect(jsonPath(\"$\").isArray())\n\t\t\t\t.andExpect(jsonPath(\"$[0].brand\", Is.is(expected.getBrand())))\n\t\t\t\t.andExpect(jsonPath(\"$[0].color\", Is.is(expected.getColor())))\n\t\t\t\t.andExpect(jsonPath(\"$[0].name\", Is.is(expected.getName()))).andReturn();\n\n\t\t// verify\n\t\tverify(productService).getProductPage(ArgumentMatchers.any(), ArgumentMatchers.any());\n\t}",
"@Test\n\tpublic void testFindProductByGuidWithMoreThanOneReturn() {\n\t\tstubGetBean(ContextIdNames.PRODUCT, ProductImpl.class);\n\n\t\tfinal List<Product> products = new ArrayList<Product>();\n\t\tProduct product = new ProductImpl();\n\t\tproducts.add(product);\n\t\tproducts.add(product);\n\t\tcontext.checking(new Expectations() {\n\t\t\t{\n\t\t\t\tallowing(getMockPersistenceEngine()).retrieveByNamedQuery(with(any(String.class)), with(any(Object[].class)));\n\t\t\t\twill(returnValue(products));\n\t\t\t}\n\t\t});\n\t\ttry {\n\t\t\tthis.importGuidHelper.findProductByGuid(SOME_GUID, false, false, true);\n\t\t\tfail(EP_SERVICE_EXCEPTION_EXPECTED);\n\t\t} catch (EpServiceException e) {\n\t\t\t// succeed!\n\t\t\tassertNotNull(e);\n\t\t}\n\t}",
"@Test\n public void testFindProduct() {\n ShoppingCart instance = new ShoppingCart();\n Product p1 = new Product(\"Galletas\", 1.2);\n Product p2 = new Product(\"Raton\", 85.6);\n \n instance.addItem(p1);\n instance.addItem(p2);\n \n assertTrue(instance.findProduct(\"Galletas\"));\n }",
"@Test\n public void retrieveAllTest() throws ApiException {\n Long productId = null;\n List<GetInterestRateChartsResponse> response = api.retrieveAll(productId);\n\n // TODO: test validations\n }",
"@GetMapping(\"/retrieve\")\n public ResponseEntity<List<Product>> getProdAll(final HttpSession session) {\n log.info(session.getId() + \" : Retrieving all products\");\n return ResponseEntity.status(HttpStatus.OK).body(prodService.getAll());\n }",
"@Test\r\n public void testListAll() {\r\n System.out.println(\"listAll\");\r\n IwRepoDAOMarkLogicImplStud instance = new IwRepoDAOMarkLogicImplStud();\r\n String expResult = \"\";\r\n String result = instance.listAll();\r\n System.out.println(result);\r\n }",
"private static void getListTest() {\n\t\tList<CartVo> list=new CartDao().getList();\r\n\t\t\r\n\t\tfor(CartVo cartVo : list) {\r\n\t\t\tSystem.out.println(cartVo);\r\n\t\t}\r\n\t}",
"@RequestMapping(method = RequestMethod.GET, value = \"/user/getAll\")\n @ApiOperation(value = \"Getting all the products\")\n public Iterable<User> getAll(){\n return userService.getAll();\n }",
"@Test\n public void testGetAllOrders() throws Exception {\n }",
"@Test\n void findAll_API_TEST() throws Exception {\n\n //TEST DATA\n Pet pet_1 = new Pet();\n pet_1.setId(1);\n pet_1.setName(\"John\");\n\n Pet pet_2 = new Pet();\n pet_2.setId(2);\n pet_2.setName(\"John\");\n\n Pet pet_3 = new Pet();\n pet_3.setId(3);\n pet_3.setName(\"John\");\n\n given(petService.findAll()).willReturn(asList(pet_1, pet_2, pet_3));\n mvc.perform(get(\"/owners/*/pets\").accept(MediaType.APPLICATION_JSON))\n .andExpect(status().isOk())\n .andExpect(jsonPath(\"$[0].id\").value(1))\n .andExpect(jsonPath(\"$[1].id\").value(2))\n .andExpect(jsonPath(\"$[2].id\").value(3));\n\n }",
"@Test\n public void others(){\n Item item = itemService.getItem(50);\n System.out.println(item);\n\n }",
"@Test\n public void retriveAllTest() throws SQLException {\n manager = new TableServizioManager(mockDb);\n List<Servizio> lista = manager.retriveAll();\n assertEquals(7,lista.size(),\"It should return a list of length 7\");\n }",
"@Test\n\tpublic void testFindAllProductNoContentFound() {\n\n\t\tMockito.when(productDao.findByProductGroup_ProductGroupId(1)).thenReturn(products);\n\n\t\tResponseEntity<List<Product>> expected = productServiceImpl.getAllProductsByProductGroupId(1);\n\n\t\tAssertions.assertNotSame(expected, ResponseEntity.noContent().build());\n\t}",
"List<CheckoutProduct> findAll();",
"@Test \n\t public void testRetrieveAll(){\n\t\t try{\n\t\t\t List<Users> users = new ArrayList<Users>();\n\t\t\t users.add( BaseData.getUsers());\n\t\t\t\tusers.add(BaseData.getDBUsers());\n\t\t\t\tQuery mockQuery = mock(Query.class);\n\t\t\t\twhen(entityManager.createQuery(Mockito.anyString())).thenReturn(mockQuery);\n\t\t\t\twhen(mockQuery.getResultList()).thenReturn(users);\n\t\t\t\tList<Users> loadedUsers = (List<Users>)userDao.retrieveAll();\n\t\t\t\tassertNotNull(loadedUsers);\n\t\t\t\tassertTrue(loadedUsers.size() > 1);\n\t\t }catch(DataAcessException se){\n\t\t\t logger.error(\"error at service layer while testing retrieveAll:.\",se);\n\t\t }\n\t }",
"@Test\n public void testGetAllUsesOfMetsDocument() throws Exception {\n System.out.println(\"getAllUsesOfMetsDocument\");\n String resourceId = \"id_0015\";\n String items[] = {\"OCR-D-GT-IMG-BIN\", \"OCR-D-GT-IMG-CROP\", \"OCR-D-GT-IMG-DESPEC\", \"OCR-D-GT-IMG-DEWARP\"};\n\n this.mockMvc.perform(get(\"/api/v1/metastore/mets/\" + resourceId + \"/use\"))\n .andDo(print())\n .andExpect(status().isOk())\n .andExpect(MockMvcResultMatchers.jsonPath(\"$\", Matchers.hasSize(4)))\n .andExpect(MockMvcResultMatchers.jsonPath(\"$.[*]\", Matchers.hasItems(items)))\n .andReturn();\n }",
"@Test\n public void getCatalogSalesTest() {\n Integer size = null;\n Integer page = null;\n String order = null;\n // PageResourceCatalogSale response = api.getCatalogSales(size, page, order);\n\n // TODO: test validations\n }",
"private void demoSellProducts()\n {\n System.out.println(\"\\nSelling all the products\\n\");\n System.out.println(\"============================\");\n System.out.println();\n for(int id = 101; id <= 110; id++)\n {\n amount = generator.nextInt(20);\n manager.sellProduct(id, amount);\n }\n \n manager.printAllProducts();\n }",
"@Test\n public void test_all() throws Exception {\n matchInvoke(serviceURL, \"PWDDIC_testSearch_all_req.xml\",\n \"PWDDIC_testSearch_all_res.xml\");\n }",
"@GetMapping(\"/products\")\n\t@HystrixCommand(fallbackMethod = \"getFallBackAllProducts\")\n\tpublic Products getAllProducts(){\n\t\tList<Product> pList=restTemplate.getForObject(\"http://product-service/products\", List.class);\n\t\tProducts p=new Products();\n\t\tp.setProductList(pList);\n\t\treturn p;\n\t}",
"@Test\n public void listProdTags() {\n }",
"@Test\n\t// @Disabled\n\tvoid testViewAllCustomer() {\n\t\tCustomer customer1 = new Customer(1, \"tom\", \"son\", \"951771122\", \"[email protected]\");\n\t\tCustomer customer2 = new Customer(2, \"jerry\", \"lee\", \"951998122\", \"[email protected]\");\n\t\tList<Customer> customerList = new ArrayList<>();\n\t\tcustomerList.add(customer1);\n\t\tcustomerList.add(customer2);\n\t\tMockito.when(custRep.findAll()).thenReturn(customerList);\n\t\tList<Customer> customer = custService.findAllCustomer();\n\t\tassertEquals(2, customer.size());\n\t}",
"@NonNull\n public List<Product> findAll() {\n return productRepository.findAll();\n }",
"@GetMapping(path =\"/products\")\n public ResponseEntity<List<Product>> getProducts() {\n return ResponseEntity.ok(productService.getAll());\n }",
"@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n public List<Product> getProductFindAll() {\n return em.createNamedQuery(\"Product.findAll\", Product.class).getResultList();\n }",
"@Test\n void getAllOrdersSuccess() {\n List<Order> orders = dao.getAllOrders();\n assertEquals(3, orders.size());\n }",
"@Test\n\tvoid testGetAllByName() {\n\t\tList<Plant> plant = service.getAllByName(\"Tulsi\");\n\t\tString name = plant.get(0).getName();\n\t\tassertEquals(\"Tulsi\", name);\n\t}",
"@Test\n\tpublic void testVendorGetAll() {\n\t\tJsonResponse jr = null;\n\t\tjr = vendorCont.getAll();\n\t\tassertNotNull(jr);\n\t}",
"@Test\n public void testJPA3ListAll (){\n Iterable<TruckInfo> trucklist = truckRepo.findAll();\n\n\n\n\n }",
"@Test\r\n public void testA0Get_0args() {\r\n System.out.println(\"get all\");\r\n \r\n UsuarioDao instance = new UsuarioDao();\r\n List<Usuario> expResult = new ArrayList<>();\r\n List<Usuario> result = instance.get();\r\n \r\n assertEquals(expResult, result);\r\n }",
"@Test\n public void getPriceBySeller1(){\n }"
] | [
"0.78353167",
"0.7735288",
"0.77034056",
"0.7641449",
"0.71475226",
"0.71466684",
"0.6997231",
"0.6984412",
"0.6984412",
"0.6984412",
"0.69556767",
"0.69386786",
"0.68810064",
"0.6846667",
"0.6814431",
"0.6807709",
"0.68067867",
"0.6749895",
"0.6712061",
"0.6704337",
"0.66934323",
"0.6692462",
"0.6692462",
"0.6689678",
"0.6688976",
"0.66863126",
"0.6674648",
"0.6674648",
"0.6671568",
"0.6632004",
"0.66247433",
"0.66061026",
"0.660414",
"0.6604132",
"0.6603618",
"0.6600486",
"0.6582098",
"0.6574724",
"0.6563153",
"0.6554441",
"0.6519997",
"0.650278",
"0.64924383",
"0.64694834",
"0.64443755",
"0.64443755",
"0.6431716",
"0.6399345",
"0.6390825",
"0.63886535",
"0.63884604",
"0.6361737",
"0.6358692",
"0.63563144",
"0.6351651",
"0.63471466",
"0.63371885",
"0.6327439",
"0.63245815",
"0.6319611",
"0.6319363",
"0.63180804",
"0.6304495",
"0.6298864",
"0.6268963",
"0.6260568",
"0.62546307",
"0.6253997",
"0.62536013",
"0.6247176",
"0.62315047",
"0.62308145",
"0.6228391",
"0.62272954",
"0.62249625",
"0.62200886",
"0.6218931",
"0.6213546",
"0.6212668",
"0.6212049",
"0.6211129",
"0.62097704",
"0.6208504",
"0.62057745",
"0.6201237",
"0.6200199",
"0.61986446",
"0.61851996",
"0.6180986",
"0.6174633",
"0.6173561",
"0.61725205",
"0.6169141",
"0.61661047",
"0.6157097",
"0.61516625",
"0.6149329",
"0.6145477",
"0.6140547",
"0.6134531"
] | 0.64448625 | 44 |
Test get product by key | @Test
public void testGetByKey() throws Exception {
when(repository.findByKey(this.product.getKey())).thenReturn(Optional.of(this.product));
assertEquals(this.product, service.getByKey(this.product.getKey()));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"int getProductKey();",
"@Test\n public void testFindProduct() {\n ShoppingCart instance = new ShoppingCart();\n Product p1 = new Product(\"Galletas\", 1.2);\n Product p2 = new Product(\"Raton\", 85.6);\n \n instance.addItem(p1);\n instance.addItem(p2);\n \n assertTrue(instance.findProduct(\"Galletas\"));\n }",
"@Test(expected = ProductNotFoundException.class)\n public void TestProductNotFoundException() throws ProductNotFoundException {\n HashMap<Character, Product> productList = new HashMap<Character, Product>();\n Product product = new Product('A', 20, 2, 1);\n productList.put(product.getName(), product);\n\n product = new Product('B', 50, 5, 3);\n productList.put(product.getName(), product);\n\n product = new Product('C', 30, 3, 2);\n productList.put(product.getName(), product);\n\n com.jama.domain.Supermarket supermarket = new com.jama.domain.Supermarket(productList);\n\n int totalPrice = supermarket.checkout(\"BCABBACBCBX\");\n assertEquals(\"Total prices are not equal.\", new Integer(230), new Integer(totalPrice));\n }",
"@Test\n\tpublic void searchForProductLandsOnCorrectProduct() {\n\t}",
"@Test\n public void TestABC() {\n HashMap<Character, Product> productList = new HashMap<Character, Product>();\n Product product = new Product('A', 20);\n productList.put(product.getName(), product);\n\n product = new Product('B', 50, 5, 3);\n productList.put(product.getName(), product);\n\n product = new Product('C', 30);\n productList.put(product.getName(), product);\n\n com.jama.domain.Supermarket supermarket = new com.jama.domain.Supermarket(productList);\n\n try {\n int totalPrice = supermarket.checkout(\"ABC\");\n assertEquals(\"Total prices are not equal.\", new Integer(100), new Integer(totalPrice));\n }\n catch (Exception e)\n {\n fail(e.getMessage());\n }\n }",
"@Test\n public void testGetByKeyEmpty() throws Exception {\n thrown.expect(ProductNotFoundException.class);\n thrown.expectMessage(\"Product with key \" + this.product.getKey() + \" not found!\");\n\n when(repository.findByKey(this.product.getKey())).thenReturn(Optional.empty());\n service.getByKey(this.product.getKey());\n }",
"@Test\n public void testGetOneProduct() {\n }",
"@Override\r\n\tpublic List<Product> search(String key) {\n\tProductExample example = new ProductExample();\r\n\texample.createCriteria().andNameLike(\"%\"+key+\"%\");\r\n\texample.setOrderByClause(\"id desc\");\r\n\tList<Product> list = productMapper.selectByExample(example);\r\n\tsetAll(list);\r\n\treturn list;\r\n\t\t}",
"@Test\n public void TestABBACBBABABBACBBAB() {\n HashMap<Character, Product> productList = new HashMap<Character, Product>();\n Product product = new Product('A', 20);\n productList.put(product.getName(), product);\n\n product = new Product('B', 50, 5, 3);\n productList.put(product.getName(), product);\n\n product = new Product('C', 30);\n productList.put(product.getName(), product);\n\n com.jama.domain.Supermarket supermarket = new com.jama.domain.Supermarket(productList);\n\n try {\n int totalPrice = supermarket.checkout(\"ABBACBBABABBACBBAB\");\n assertEquals(\"Total prices does not equal.\", new Integer(480), new Integer(totalPrice));\n }\n catch (Exception e)\n {\n fail(e.getMessage());\n }\n }",
"Object getProduct();",
"CafeProduct getProductById(final Integer productId);",
"@Test\n public void testFindProductShouldCorrect() throws Exception {\n // Mock method\n when(productRepository.findOne(product.getId())).thenReturn(product);\n\n testResponseData(RequestInfo.builder()\n .request(get(PRODUCT_DETAIL_ENDPOINT, product.getId()))\n .token(memberToken)\n .httpStatus(HttpStatus.OK)\n .build());\n }",
"@Test\n void searchProduct() {\n List<DummyProduct> L1= store.SearchProduct(\"computer\",null,-1,-1);\n assertTrue(L1.get(0).getProductName().equals(\"computer\"));\n\n List<DummyProduct> L2= store.SearchProduct(null,\"Technology\",-1,-1);\n assertTrue(L2.get(0).getCategory().equals(\"Technology\")&&L2.get(1).getCategory().equals(\"Technology\"));\n\n List<DummyProduct> L3= store.SearchProduct(null,null,0,50);\n assertTrue(L3.get(0).getProductName().equals(\"MakeUp\"));\n\n List<DummyProduct> L4= store.SearchProduct(null,\"Fun\",0,50);\n assertTrue(L4.isEmpty());\n }",
"public Product getProductInfo(int pid) {\nfor (ProductStockPair pair : productCatalog) {\nif (pair.product.id == pid) {\nreturn pair.product;\n}\n}\nreturn null;\n}",
"public Product get(String id);",
"@Test\n public void TestABBACBBAB() {\n HashMap<Character, Product> productList = new HashMap<Character, Product>();\n Product product = new Product('A', 20);\n productList.put(product.getName(), product);\n\n product = new Product('B', 50, 5, 3);\n productList.put(product.getName(), product);\n\n product = new Product('C', 30);\n productList.put(product.getName(), product);\n\n com.jama.domain.Supermarket supermarket = new com.jama.domain.Supermarket(productList);\n\n try {\n int totalPrice = supermarket.checkout(\"ABBACBBAB\");\n assertEquals(\"Total prices does not equal.\", new Integer(240), new Integer(totalPrice));\n }\n catch (Exception e)\n {\n fail(e.getMessage());\n }\n }",
"@Test\n public void testGetProduct() {\n String testString = \"Plank\";\n Product testProduct = dao.getProduct(testString);\n \n assertEquals(testString, testProduct.getName());\n }",
"@Test\n\tpublic void testFindProductByGuidWithOneReturn() {\n\t\tstubGetBean(ContextIdNames.PRODUCT, ProductImpl.class);\n\n\t\tfinal List<Product> products = new ArrayList<Product>();\n\t\tProduct product = new ProductImpl();\n\t\tproducts.add(product);\n\t\tcontext.checking(new Expectations() {\n\t\t\t{\n\t\t\t\tallowing(getMockPersistenceEngine()).retrieveByNamedQuery(with(any(String.class)), with(any(Object[].class)));\n\t\t\t\twill(returnValue(products));\n\t\t\t}\n\t\t});\n\t\tassertSame(product, this.importGuidHelper.findProductByGuid(SOME_GUID, true, true, true));\n\t}",
"String getProduct();",
"@Test\n public void testGetProductsByPurcher() throws Exception {\n System.out.println(\"getProductsByPurcher\");\n Customer c = new Customer();\n c.setId(1l);\n prs = dao.getProductsByPurcher(c);\n assertTrue(prs.contains(p3));\n assertTrue(prs.size() == 1);\n c.setId(2l);\n prs = dao.getProductsByPurcher(c);\n assertTrue(prs.contains(p1));\n assertTrue(prs.size() == 1);\n \n c.setId(3l);\n prs = dao.getProductsByPurcher(c);\n assertTrue(prs.isEmpty());\n }",
"public static void getAssignedProduct(String productId , ITestContext context ){\n\t\t \n\t\t //SET URL\n\t\t customerId= (context.getAttribute(\"customerId\")).toString();//need to add validation for customerId\n\t\t String CONTEXT_PATH=\"mcss/ecommerce/customer/\" +customerId + \"/product/\" + productId;\n\t\t \n\t\t//Execute REST\n\t\t Response response =get( CONTEXT_PATH );\n \n\t\t \n\n\t\t //Validations:\n\t\t ResponseBody body = response.getBody();\n\t\t assertEquals( 200 ,response.getStatusCode(),\"Status Code is not as expected\");\n\t\t assertEquals( \"AC\" ,response.body().path(\"Product.status\"),\"AP status is not correct \");\n\t\t assertEquals( productId ,response.body().path(\"Product.id\"),\"AP status is not correct \");\n\t\t \n\t\t //Product validations \n\t\t assertNotEquals( null, response.body().path(\"Product.serviceId\"), \"ServiceId is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.productOfferingProductSpecID\"), \"productOfferingProductSpecID is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.productTypeX9\"), \"productTypeX9 is null\");//EQ,IPTV\n\t\t assertNotEquals( null, response.body().path(\"Product.hasPendingOrders\"), \"hasPendingOrders is null\");//optional\n\t\t assertNotEquals( null, response.body().path(\"Product.ceaseActionAllowed\"), \"ceaseActionAllowed is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.changeActionAllowed\"), \"changeActionAllowed is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.catalogOfferingId\"), \"catalogOfferingId is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.lineOfBusiness\"), \"lineOfBusiness is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.spoName\"), \"spoName is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.resumeActionAllowed\"), \"resumeActionAllowed is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.catalogItemID\"), \"catalogItemID\");\n\t\t// plan validations only if product is not Equipment for Equipment can be if it has Repeator\n\t\t if ( !(response.body().path(\"Product.productTypeX9\")).equals(\"EQ\") ){\n\t\t assertNotEquals( null, response.body().path(\"Product.plan\"), \"plan is null\"); // optional \n\t\t assertNotEquals( null, response.body().path(\"Product.plan.catalogItemName\"), \"plan.catalogItemName is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.plan.catalogItemImages\"), \"plan.catalogItemImages is null\");//optional\n\t\t assertNotEquals( null, response.body().path(\"Product.plan.planRank\"), \"plan.planRank is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.plan.catalogItemID\"), \"plan.catalogItemID is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.plan.catalogItemDescription\"), \"plan.catalogItemDescription is null\");//optional\n\t\t assertNotEquals( null, response.body().path(\"Product.plan.id\"), \"plan.id is null\");\n\t\t }\n\t\t //services validations \n\t\t assertNotEquals( null, response.body().path(\"Product.services\"), \"services are null!\"); // optional \n\t\t assertNotEquals( 0, response.body().path(\"Product.services.size()\"), \" Services Array is empty !\"); // optional \n\t\t// assertNotEquals( null, ((RestAssuredBased) response.body()).get(\"/Product\").jsonPath().getList(\"Product.services.[0].businessType\"), \"Services.businessType is null!\"); \n\t/*\t assertNotEquals( null, response.body().path(\"Product.services.[0].catalogItemID\"), \"Services.catalogItemID is null!\"); \n\t\t assertNotEquals( null, response.body().path(\"Product.services.[0].catalogItemName\"), \"Services.catalogItemName is null!\"); \n\t\t assertNotEquals( null, response.body().path(\"Product.services.[0].catalogItemDescription\"), \"catalogItemDescription is null!\"); //optional\n\t\t assertNotEquals( null, response.body().path(\"Product.services.[0].initialActivationDate\"), \"Services.initialActivationDate is null!\");// \n\t\t assertNotEquals( null, response.body().path(\"Product.services.[0].id\"), \"Services.id is null!\");// \n\t\t assertNotEquals( null, response.body().path(\"Product.services.[0].serviceType\"), \"Services.serviceType is null!\");// \n\t\t assertNotEquals( null, response.body().path(\"Product.services.[0].status\"), \"Services.status is null!\");// */\n\t\t \n\t\t \n\t\t //Savinq Info \n\t\t /*\n context.setAttribute( \"customerId\", body.path(\"ClientUserContext.customerId\" ));\n context.setAttribute( \"personId\", body.path(\"ClientUserContext.personId\" ));\n context.setAttribute( \"personId\", body.path(\"ClientUserContext.personId\" ));\n context.setAttribute( \"personObjIdX\", body.path(\"ClientUserContext.personObjIdX\" ));\n */\n\t }",
"public Optional<Product> getProduct(String productId);",
"Product getProductById(Integer productId);",
"Product getProductById(Integer productId);",
"@Test\n public void GETProductService_ProductCall() {\n givenHeaders().\n when().\n get(_url_prodservice).//.body().prettyPrint();\n then().\n using().defaultParser(Parser.JSON).\n log().ifError().\n statusCode(200).\n body(\"response\", not(isEmptyString()));\n System.out.print(\"GETProductService_ProductCall Test Run Result\");\n }",
"Product getProductById(Integer productID);",
"@Test\n public void getProductDetailTest() throws ApiException {\n String productId = null;\n ResponseBankingProduct response = api.getProductDetail(productId);\n\n // TODO: test validations\n }",
"@Test\n public void GETProduct_ProductInventoryCall() {\n\n givenHeaders().\n when().\n get(_url_product).//.body().prettyPrint();\n then().\n using().defaultParser(Parser.JSON).\n log().ifError().\n statusCode(200).\n body(\"response\", not(isEmptyString()));\n System.out.print(\"GETPRODUCT_Inventory Test Run Result\");\n }",
"@Override\n\t@Transactional(readOnly=true)\n\tpublic ProductDTO findBySearchkeyAndVisibleTrue(String searchkey) {\n\t\tlog.debug(\"Request to get Product by searchkey : {}\", searchkey);\n Product product = productRepository.findBySearchkeyIgnoreCaseAndVisibleTrue( searchkey);\n return productMapper.toDto(product);\n\t}",
"@Test\n public void testGetProductInfo() throws Exception {\n }",
"Product getProductByID(Long id);",
"@Test\n\tpublic void testFindProductByGuidWithMoreThanOneReturn() {\n\t\tstubGetBean(ContextIdNames.PRODUCT, ProductImpl.class);\n\n\t\tfinal List<Product> products = new ArrayList<Product>();\n\t\tProduct product = new ProductImpl();\n\t\tproducts.add(product);\n\t\tproducts.add(product);\n\t\tcontext.checking(new Expectations() {\n\t\t\t{\n\t\t\t\tallowing(getMockPersistenceEngine()).retrieveByNamedQuery(with(any(String.class)), with(any(Object[].class)));\n\t\t\t\twill(returnValue(products));\n\t\t\t}\n\t\t});\n\t\ttry {\n\t\t\tthis.importGuidHelper.findProductByGuid(SOME_GUID, false, false, true);\n\t\t\tfail(EP_SERVICE_EXCEPTION_EXPECTED);\n\t\t} catch (EpServiceException e) {\n\t\t\t// succeed!\n\t\t\tassertNotNull(e);\n\t\t}\n\t}",
"@Override\r\n public final Product findProduct(final String prodId) throws MandatoryEntryException,NotFoundInDatabaseException {\n ExceptionTest.stringMandatoryEntryTest(prodId);\r\n// if (prodId == null || prodId.length() == 0) {\r\n// System.out.println(\"Sorry, FakeDatabase.findProduct method has \"\r\n// + \"illegal argument\");\r\n// return null; // end method prematurely after log to console\r\n// }\r\n\r\n Product product = null;\r\n for (Product p : products) {\r\n if (prodId.equals(p.getProdId())) {\r\n product = p;\r\n break;\r\n }\r\n }\r\n// ExceptionTest.objectMandatoryEntryTest(product, ExceptionSource.DATABASE);\r\n ExceptionTest.objectNotFoundInDatabaseTest(product);\r\n// if (product==null){\r\n// System.out.println(\"Product not found in the database.\");\r\n// \r\n// }\r\n return product;\r\n }",
"public Product getProductFromId(Integer prodId) throws BackendException;",
"@Test\n\tpublic void testFindProductSkuByGuidWithOneReturn() {\n\t\tfinal List<ProductSku> productSkus = new ArrayList<ProductSku>();\n\t\tProductSku productSku = new ProductSkuImpl();\n\t\tproductSkus.add(productSku);\n\t\tcontext.checking(new Expectations() {\n\t\t\t{\n\t\t\t\tallowing(getMockPersistenceEngine()).retrieveByNamedQuery(with(any(String.class)), with(any(Object[].class)));\n\t\t\t\twill(returnValue(productSkus));\n\t\t\t}\n\t\t});\n\t\tassertSame(productSku, this.importGuidHelper.findProductSkuByGuid(SOME_GUID));\n\t}",
"@Test\n public void testGetProductsByName() throws Exception {\n System.out.println(\"getProductsByName\");\n for (Product p : products) {\n prs = dao.getProductsByName(p.getName());\n assertTrue(prs.size() == 1);\n assertTrue(prs.contains(p));\n \n }\n prs = dao.getProductsByName(nonExisten.getName());\n assertTrue(prs.isEmpty());\n }",
"Product getProductByProductName(String productName);",
"@Override\n public Product findProductById(String productId)\n {\n\t\t// if the productID is not valid then it will throw the Exception\n\t\t\n \t Product pro=ProductStore.map.get(productId);\n \t if(pro==null)\n \t {\n \t\t throw new InValidIdException(\"Incorrect Id \");\n \t }\n \t \n \t // if the productId is valid it will return Product\n \t else\n \t\t return pro;\n }",
"@Test\n public void testHappyPath() {\n\n final ProductImpl aProduct = new ProductImpl();\n jobEntry.setType(aProduct.getClass());\n jobEntry.setGuid(A_GUID);\n\n context.checking(new Expectations() {\n {\n oneOf(cache).retrieve(A_GUID, aProduct.getClass());\n will(returnValue(aProduct));\n }\n });\n final Persistable sourceObject = jobEntry.getSourceObject();\n assertEquals(\"persistent object should be a product\", aProduct, sourceObject);\n\n }",
"@Test\n public void TestBCABBACBCB() {\n HashMap<Character, Product> productList = new HashMap<Character, Product>();\n Product product = new Product('A', 20, 2, 1);\n productList.put(product.getName(), product);\n\n product = new Product('B', 50, 5, 3);\n productList.put(product.getName(), product);\n\n product = new Product('C', 30, 3, 2);\n productList.put(product.getName(), product);\n\n com.jama.domain.Supermarket supermarket = new com.jama.domain.Supermarket(productList);\n\n try {\n int totalPrice = supermarket.checkout(\"BCABBACBCB\");\n assertEquals(\"Total prices are not equal.\", new Integer(230), new Integer(totalPrice));\n }\n catch (Exception e)\n {\n fail(e.getMessage());\n }\n }",
"@Test\n public void getProductDetailTest() throws ApiException {\n String productId = null;\n \n ResponseBankingProductById response = api.getProductDetail( productId );\n response.toString();\n // TODO: test validations\n }",
"Product getProductById(Serializable productId);",
"@Test\n public void verifyAppleOfferApplied() {\n \tProduct product = new Product(\"Apple\", 0.2);\n \tBasket basket = new Basket();\n \tbasket.getProducts().put(product, 5);\n \tassertTrue(\"Have to get the price of 3 items = 0.6 ==> \", \n \t\t\tDouble.compare(calculator.calculatePrice(basket), 0.6) == 0);\n }",
"@Test\n public void testGetProductsByType() throws Exception {\n System.out.println(\"getProductsByType\");\n \n prs = dao.getProductsByType(p1.getType());\n assertTrue(prs.size() == 2);\n assertTrue(prs.contains(p1));\n assertTrue(prs.contains(p2));\n prs = dao.getProductsByType(p2.getType());\n assertTrue(prs.size() == 2);\n assertTrue(prs.contains(p1));\n assertTrue(prs.contains(p2));\n prs = dao.getProductsByType(p3.getType());\n assertTrue(prs.size() == 1);\n assertTrue(prs.contains(p3));\n \n prs = dao.getProductsByName(nonExisten.getType());\n assertTrue(prs.isEmpty());\n }",
"@Test\r\n\tpublic void findStore() {\n\r\n\t\tRestAssured.baseURI= \"https://api.bestbuy.com/v1/products/6341359/stores.json?\";\r\n\r\n\t\t//\t\tproducts/6341359/stores.json?postalCode=95125&apiKey=qUh3qMK14GdwAs9bO59QRSCJ\r\n\r\n\t\t//\t\tproducts(manufacturer=apple&search=iPhone 11 Pro)?format=json&show=name,regularPrice,salePrice&apiKey=qUh3qMK14GdwAs9bO59QRSCJ\r\n\t\t// products(manufacturer=apple&search=iPhone 11 64GB&inStorePickup=true)+stores(region=RI)?format=json&show=sku,name,stores.storeId,stores.name,stores.address&apiKey=qUh3qMK14GdwAs9bO59QRSCJ\r\n\r\n\t\t// Map<String, String> parametersMap = new HashMap<String, String>();\r\n\t\t//parametersMap.put(\"products\", \"products/6341359/\");\r\n\r\n\r\n\r\n\r\n\t\tResponse response = RestAssured\r\n\t\t\t\t.given()\r\n\t\t\t\t.log().all()\r\n\t\t\t\t.accept(ContentType.JSON)\r\n\t\t\t\t.queryParam(\"postalCode\",\"95125\")\r\n\t\t\t\t.queryParam(\"apiKey\",\"qUh3qMK14GdwAs9bO59QRSCJ\")\r\n\t\t\t\t.get();\r\n\r\n\t\tresponse.prettyPrint();\r\n\r\n\t\tSystem.out.println(\" Response code : \" + response.getStatusCode());\r\n\r\n\t}",
"@Test\n public void productTest() {\n // TODO: test product\n }",
"@SuppressWarnings(\"unchecked\")\n@Test\n public void testProductSelection() {\n\t \n\t\tRestAssured.baseURI = baseURL;\n\t\tRequestSpecification request = RestAssured.given();\n\t\t\n\t\t\n\t\trequest.header(\"Content-Type\", \"application/json\");\n\t\t\n\n\t\tJSONObject jobj = new JSONObject();\n\t\t\n\t\tjobj.put(\"product_id\",\"56c815cc56685df2014df1fb\"); //Fetching the product ID from the Login API response\n\t\t\n\t\trequest.body(jobj.toJSONString());\n\n\t\tResponse resp = request.post(\"/product_selection\");\n\t\t\n\t\t\n\t\tint statusCode = resp.getStatusCode();\n\t\tAssert.assertEquals(statusCode,200, \"Status Code is not 200\");\n }",
"@Test\n\tpublic void test_get_product_by_id_return_200() throws Exception {\n\t\tPrincipal mockPrincipal = Mockito.mock(Principal.class);\n\t\tMockito.when(mockPrincipal.getName()).thenReturn(\"1\");\n\t\tProductDTO expected = DummyData.getProductDto1();\n\t\tMockHttpServletRequestBuilder mockRequest = MockMvcRequestBuilders.request(HttpMethod.GET, \"/1\")\n\t\t\t\t.principal(mockPrincipal)\n\t\t\t\t.contentType(MediaType.APPLICATION_JSON)\n\t\t\t\t.accept(MediaType.APPLICATION_JSON);\n\n\t\t// Setup when\n\t\twhen(productService.findProductById(1l)).thenReturn(expected);\n\t\t\n\t\t// Execute the POST request\n\t\tmockMvc.perform(mockRequest)\n\t\t\t\t.andExpect(status().isOk())\n\t\t\t\t// Validate the response code and content type\n\t\t\t\t.andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON))\n\t\t\t\t// Validate the returned fields\n\t\t\t\t.andExpect(jsonPath(\"$.brand\", Is.is(expected.getBrand())))\n\t\t\t\t.andExpect(jsonPath(\"$.color\", Is.is(expected.getColor())))\n\t\t\t\t.andExpect(jsonPath(\"$.name\", Is.is(expected.getName()))).andReturn();\n\n\t\t// verify\n\t\tverify(productService).findProductById(ArgumentMatchers.any());\n\t}",
"@Test\n\tpublic void testFindProductByProductIdSuccess() {\n\n\t\tMockito.when(productDao.findById(1)).thenReturn(Optional.of(product));\n\n\t\tResponseEntity<Product> expected = productServiceImpl.findProductByProductId(1);\n\n\t\tAssertions.assertEquals(expected, ResponseEntity.ok(product));\n\t}",
"Product getProductDetails(int idproduct) throws DataBaseException;",
"private void search(String product) {\n // ..\n }",
"@Test\n public void testGetProductsBySaler() throws Exception {\n System.out.println(\"getProductsBySaler\");\n Customer c = new Customer();\n c.setId(1l);\n prs = dao.getProductsBySaler(c);\n assertTrue(prs.contains(p1));\n assertTrue(prs.contains(p2));\n assertTrue(prs.size() == 2);\n\n c.setId(2l);\n prs = dao.getProductsBySaler(c);\n assertTrue(prs.isEmpty());\n \n c.setId(3l);\n prs = dao.getProductsBySaler(c);\n assertTrue(prs.contains(p3));\n assertTrue(prs.size() == 1);\n \n }",
"@Test\n public void testGetKey()\n { \n assertThat(m_SUT.getKey(), is(\"test key\"));\n }",
"@Test\n\tpublic void testFindProductSkuByGuidWithMoreThanOneReturn() {\n\t\tfinal List<ProductSku> productSkus = new ArrayList<ProductSku>();\n\t\tProductSku productSku = new ProductSkuImpl();\n\t\tproductSkus.add(productSku);\n\t\tproductSkus.add(productSku);\n\t\tcontext.checking(new Expectations() {\n\t\t\t{\n\t\t\t\tallowing(getMockPersistenceEngine()).retrieveByNamedQuery(with(any(String.class)), with(any(Object[].class)));\n\t\t\t\twill(returnValue(productSkus));\n\t\t\t}\n\t\t});\n\t\ttry {\n\t\t\tthis.importGuidHelper.findProductSkuByGuid(SOME_GUID);\n\t\t\tfail(EP_SERVICE_EXCEPTION_EXPECTED);\n\t\t} catch (EpServiceException e) {\n\t\t\t// succeed!\n\t\t\tassertNotNull(e);\n\t\t}\n\t}",
"Product getProductByName(String name) throws EntityNotFoundException;",
"public abstract boolean lookup(Key key);",
"public V getCarta(K key);",
"@DirtiesDatabase\n\t@Test\n\tpublic void testGetImageMapProductCode() {\n\t\tProduct product = createProduct();\n\t\t\n\t\tImageMap imageMap = service.getImageMapByCode(product.getCode());\n\t\tSet<String> imageKeys = imageMap.getImageKeys();\n\t\tassertEquals(\"There should be 3 image keys\", 3, imageKeys.size());\n\t\tassertTrue(\"There should be images for English\", imageMap.hasImages(Locale.ENGLISH));\n\t\tassertTrue(\"There should be images for French Canadian\", imageMap.hasImages(Locale.CANADA_FRENCH));\n\t\tassertTrue(\"There should be images for even German, since we do have a default image!\", imageMap.hasImages(Locale.GERMAN));\n\t\t\n\t\tassertEquals(\"The image for the thumbnail should point to thumbnail.jpg\", \"thumbnail.jpg\", imageMap.getImagePath(\"thumbnail\", Locale.ENGLISH));\n\t\t\n\t\tassertEquals(\"There should be a default image\", \"defaultImage.jpg\", imageMap.getImagePath(\"defaultImage\", Locale.ENGLISH));\n\t\tassertEquals(\"The more specific image should be found\", \"mainImageCanada.jpg\", imageMap.getImagePath(\"mainImage\", new Locale(\"en\", \"CA\")));\n\t}",
"@Test\n public void verifyWatermelonOfferApplied() {\n \tProduct product = new Product(\"Watermelon\", 0.8);\n \tBasket basket = new Basket();\n \tbasket.getProducts().put(product, 7);\n \tassertTrue(\"Have to get the price of 7 items = 4 ==> \", \n \t\t\tDouble.compare(calculator.calculatePrice(basket), 4) == 0);\n }",
"@Test\n public void testAddProductToShoppingCart_whenValidRequest_thenReturnAddedProduct() throws NotFoundException {\n Customer customerShoppingCartTest = customerStepsTest.createCustomerTest();\n Product productShoppingCartTest = productStepsTest.createProductTest();\n\n AddProductToShoppingCartRequest requestAddShoppingCartTest = new AddProductToShoppingCartRequest();\n requestAddShoppingCartTest.setCustomerId(customerShoppingCartTest.getId());\n requestAddShoppingCartTest.setProductId(productShoppingCartTest.getId());\n\n shoppingCartServiceTest.addProductToShoppingCart(requestAddShoppingCartTest);\n\n ShoppingCartDTO productRetrievedFromShoppingCartTest = shoppingCartServiceTest.getProductFromShoppingCart(customerShoppingCartTest.getId());\n\n assertThat(productRetrievedFromShoppingCartTest, notNullValue());\n assertThat(productRetrievedFromShoppingCartTest.getCustomer(), notNullValue());\n assertThat(productRetrievedFromShoppingCartTest.getCustomer().getId(), is(customerShoppingCartTest.getId()));\n assertThat(productRetrievedFromShoppingCartTest.getCustomer().getCustomerFirstName(), is(customerShoppingCartTest.getCustomerFirstName()));\n assertThat(productRetrievedFromShoppingCartTest.getCustomer().getCustomerLastName(), is(customerShoppingCartTest.getCustomerLastName()));\n assertThat(productRetrievedFromShoppingCartTest.getCustomer().getCustomerAddress(), is(customerShoppingCartTest.getCustomerAddress()));\n\n assertThat(productRetrievedFromShoppingCartTest.getProducts(), notNullValue());\n assertThat(productRetrievedFromShoppingCartTest.getProducts(), hasSize(1));\n\n ProductDTO firstProductFromShoppingChart = productRetrievedFromShoppingCartTest.getProducts().iterator().next();\n\n assertThat(firstProductFromShoppingChart, notNullValue());\n assertThat(firstProductFromShoppingChart.getName(), is(productShoppingCartTest.getName()));\n assertThat(firstProductFromShoppingChart.getQuantity(), is(productShoppingCartTest.getQuantity()));\n assertThat(firstProductFromShoppingChart.getPrice(), is(productShoppingCartTest.getPrice()));\n assertThat(firstProductFromShoppingChart.getImagePath(), is(productShoppingCartTest.getImagePath()));\n assertThat(firstProductFromShoppingChart.getProductDescription(), is(productShoppingCartTest.getProductDescription()));\n assertThat(firstProductFromShoppingChart.getProductRate(), is(productShoppingCartTest.getProductRate()));\n }",
"@Test\n public void testGetGameInfo() throws Exception {\n System.out.println(\"getGameInfo\");\n int pubID = 1;\n int prodID = 2;\n String name = \"Name\";\n int age = 12;\n String desc = \"This is my description\";\n int runtime = 12;\n String genre = \"Action\";\n double price = 22.22;\n JSONObject gameJSON = new JSONObject();\n gameJSON.put(\"productID\", prodID);\n gameJSON.put(\"name\", name);\n gameJSON.put(\"price\", price);\n gameJSON.put(\"ageRating\", age);\n gameJSON.put(\"description\", desc);\n gameJSON.put(\"minimumSpecs\", \"Min specs\");\n gameJSON.put(\"genre\", genre);\n gameJSON.put(\"publisherID\", pubID);\n StoreListing result = GameStorePageInfoFactory.getGameInfo(gameJSON);\n assertEquals(prodID, result.getProductID());\n assertEquals(name, result.getName());\n }",
"@Test\n public void testFindAllProduct() throws Exception {\n // Mock method\n when(productRepository.findAll()).thenReturn(products);\n\n testResponseData(RequestInfo.builder()\n .request(get(PRODUCT_ENDPOINT))\n .token(memberToken)\n .httpStatus(HttpStatus.OK)\n .build());\n }",
"protected abstract Object _get(String key);",
"@Test\n\tpublic void getProductDetails() throws Exception {\n\n\t\tMockito.when(productService.getProductInfo(Mockito.anyLong())).thenReturn(mockProduct);\n\n\t\tRequestBuilder requestBuilder = MockMvcRequestBuilders.get(\"/products/\" + productID)\n\t\t\t\t.accept(MediaType.APPLICATION_JSON);\n\n\t\tMvcResult result = mockMvc.perform(requestBuilder).andReturn();\n\n\t\tSystem.out.println(result.getResponse());\n\n\t\tJSONAssert.assertEquals(expected, result.getResponse().getContentAsString(), true);\n\t\tSystem.out.println(\"UnitTestSuccessful\");\n\t}",
"public void testGet() {\n System.out.println(\"get\");\n String key = \"\";\n int modo= 0;\n ObjectTempSwapWizard instance = new ObjectTempSwapWizard(modo);\n Object expResult = null;\n Object result = instance.get(key);\n assertEquals(expResult, result);\n }",
"DescribeProductResult describeProduct(DescribeProductRequest describeProductRequest);",
"public Object getObject(String key);",
"public void retrieveProductFromDatabase(){\r\n // retrieve product from the database here\r\n System.out.println(\"Product Retrieved using ID --> \" + this.productId);\r\n \r\n }",
"String getTheirProductId();",
"String getProductId();",
"@Test\n public void testFindProductByID_1() throws Exception {\n System.out.println(\"findProductByID_1\");\n String id = \"1\";\n Database instance = new Database();\n instance.addProduct(1, new Product(1.0, \"\", 1));\n try{\n assertEquals(instance.findProductByID(id), new Product(1.0, \"\", 1));\n }catch(AssertionError e){\n fail(\"testFindProductByID_1 failed\");\n }\n }",
"Product findProductById(Long id);",
"@Test\n public void testFindProductShouldThrowNotFoundWhenProductIdNotFound() throws Exception {\n when(productRepository.findOne(product.getId())).thenReturn(null);\n\n testResponseData(RequestInfo.builder()\n .request(get(PRODUCT_DETAIL_ENDPOINT, product.getId()))\n .token(memberToken)\n .httpStatus(HttpStatus.NOT_FOUND)\n .build());\n }",
"ProductPurchaseItem getProductPurchaseItemPerId(long sprcId);",
"@Test\n public void productSpecificationTest() {\n // TODO: test productSpecification\n }",
"static BigDecimal Find(String productId){\n\n\t\tBigDecimal price=null;\n\n\t\tLong key=Long.parseLong(productId);\n\n\t\tif(!productListOnID.containsKey(key)){\n\t\t\tprice=new BigDecimal(\"0\");\n\t\t}else{\n\n\t\t\tdxm116130Product product=productListOnID.get(key);\n\t\t\tprice=product.getProductPrice();\n\n\t\t}\n\t\t\n\t\treturn price;\n\n\n\t}",
"@Test\n\tpublic void findPricingPrice() throws Exception{\n\t\tmvc.perform(get(new URI(\"/services/price?vehicleId=2\"))\n\t\t\t\t.accept(MediaType.APPLICATION_JSON_UTF8))\n\t\t\t\t.andExpect(status().isOk())\n\t\t\t\t.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))\n\t\t\t\t.andExpect(jsonPath(\"vehicleId\",is(2)));\n\t}",
"@Test\n public void testGetProductsIdAction() throws ClientException, IOException, ProcessingException {\n CloudResponse response = this.actions.getProductsIdAction(\"{id}\");\n List<Integer> expectedResults = Arrays.asList(200, 400, 404);\n LOG.info(\"Got status {}\", response.getStatusLine());\n Assert.assertTrue(expectedResults.contains(response.getStatusLine().getStatusCode()));\n\n if(response.getStatusLine().getStatusCode() == 200) {\n this.actions.checkResponseJSONSchema(\"#/definitions/Product\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 400) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 404) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n \n }",
"@DirtiesDatabase\n\t@Test\n\tpublic void testGetImageMapProduct() {\n\t\tProduct product = createProduct();\n\t\t\n\t\tImageMap imageMap = service.getImageMap(product);\n\t\tSet<String> imageKeys = imageMap.getImageKeys();\n\t\tassertEquals(\"There should be 3 image keys\", 3, imageKeys.size());\n\t\tassertEquals(\"There should be 3 keys for English\", 3, imageMap.getImageKeys(Locale.ENGLISH).size());\n\t\tassertEquals(\"There should be 3 keys for English Canadian\", 3, imageMap.getImageKeys(new Locale(\"en\", \"CA\")).size());\n\t\tassertEquals(\"There should be 2 keys for French Canadian\", 2, imageMap.getImageKeys(Locale.CANADA_FRENCH).size());\n\t\tassertEquals(\"There should be 1 key for other languages\", 1, imageMap.getImageKeys(Locale.GERMAN).size());\n\t\t\n\t\tassertTrue(\"There should be images for English\", imageMap.hasImages(Locale.ENGLISH));\n\t\tassertTrue(\"There should be images for French Canadian\", imageMap.hasImages(Locale.CANADA_FRENCH));\n\t\tassertTrue(\"There should be images for even German, since we do have a default image!\", imageMap.hasImages(Locale.GERMAN));\n\t\t\n\t\tassertEquals(\"The image for the thumbnail should point to thumbnail.jpg\", \"thumbnail.jpg\", imageMap.getImagePath(\"thumbnail\", Locale.ENGLISH));\n\n\t\tassertEquals(\"There should be a default image\", \"defaultImage.jpg\", imageMap.getImagePath(\"defaultImage\", Locale.ENGLISH));\n\t\tassertEquals(\"The english image should be found\", \"mainImage.jpg\", imageMap.getImagePath(\"mainImage\", Locale.ENGLISH));\n\t\tassertEquals(\"The more specific image should be found\", \"mainImageCanada.jpg\", imageMap.getImagePath(\"mainImage\", new Locale(\"en\", \"CA\")));\n\t\tassertEquals(\"There should be fallback if an image doesn't exist for a specific locale/country\", \"mainImage.jpg\",\n\t\t\t\timageMap.getImagePath(\"mainImage\", new Locale(\"en\", \"AU\")));\n\t}",
"public abstract T get(String key);",
"@Test\n public void testGetProducts() {\n }",
"List getKeyBy(PaymentTradeExample example);",
"@Test \n\tpublic void testGetAllKeysFromKeyTable() throws SQLException\n\t{\n\t\tnew PowerTool(\"asdf\", 5, 5, \"PowerTooldescription\", true);\n\t\tArrayList<Integer> results = DatabaseGateway.getAllKeysFromKeyTable();\n\t\tassertTrue(results.contains(1));\n\t\n\t}",
"public Inventory searchForItem (TheGroceryStore g, Inventory i, String key);",
"public List<Product> getProducts(String key, String value) throws IOException {\n ProductRequest productRequest = new ProductRequest();\n productRequest.addParam(key,value);\n return parseResults(executeRequest(productRequest), Product.class);\n }",
"public K buscarCartas(K key);",
"public void testFindByKey() throws SQLException, ClassNotFoundException {\r\n\t\t// create an instance to be test\r\n\t\tDate d = Date.valueOf(\"2017-01-01\");\r\n\t\tService ser = new Service(\"employee\", 1, \"variation\", \"note\", d, d, 1, 1);\r\n\t\tmodelDS.insert(ser); \r\n\t\tint id = -1;\r\n\t\tLinkedList<Service> list = modelDS.findAll();\r\n\t\tfor (Service a : list) {\r\n\t\t\tif (a.equals(ser))\r\n\t\t\t\tid = a.getId();\r\n\t\t}\r\n\r\n\t\t// method to test\r\n\t\tService service = modelDS.findByKey(id);\r\n\r\n\t\t// database extrapolation\r\n\t\tPreparedStatement ps = connection.prepareStatement(\"SELECT * FROM \" + TABLE_NAME + \" WHERE id = ?\");\r\n\t\tps.setInt(1, id);\r\n\t\tResultSet rs = ps.executeQuery();\r\n\t\tService expected = null;\r\n\t\twhile (rs.next()) {\r\n\t\t\texpected = new Service();\r\n\t\t\texpected.setId(rs.getInt(\"id\"));\r\n\t\t\texpected.setEmployee(rs.getString(\"employee\"));\r\n\t\t\texpected.setQuantity(rs.getInt(\"quantity\"));\r\n\t\t\texpected.setVariation(rs.getString(\"variation\"));\r\n\t\t\texpected.setNote(rs.getString(\"note\"));\r\n\t\t\texpected.setReceiptDate(rs.getDate(\"receipt_date\"));\r\n\t\t\texpected.setReturnDate(rs.getDate(\"return_date\"));\r\n\t\t\texpected.setArticleId(rs.getInt(\"article_id\"));\r\n\t\t\texpected.setCustomerId(rs.getInt(\"customer_id\"));\r\n\t\t}\r\n\r\n\t\t// compare database result with the method tested\r\n\t\tassertNotNull(expected);\r\n\t\tassertNotNull(service);\r\n\t\tassertEquals(expected, service);\r\n\r\n\t\tmodelDS.remove(expected.getId()); // return to the initial state of the\r\n\t\t\t\t\t\t\t\t\t\t\t// database before test\r\n\t}",
"@Order(2)\n\t@Test\n\tpublic void Attempt_GetItemByIdSuccess()\n\t{\n\t\tint iD = 1;\n\t\tboolean owned = false;\n\t\tItem test_Item = is.getItemByID(iD, owned);\n\t\tassertTrue(test_Item != null);\n\t}",
"static void searchProductDB() {\n\n int productID = Validate.readInt(ASK_PRODUCTID); // store product ID of user entry\n\n\n productDB.findProduct(productID); // use user entry as parameter for the findProduct method and if found will print details of product\n\n }",
"protected int queryPrice(int id, String key) {\n Trace.info(\"RM::queryCarsPrice(\" + id + \", \" + key + \") called\" );\n ReservableItem curObj = (ReservableItem) readData( id, key);\n int value = 0; \n if ( curObj != null ) {\n value = curObj.getPrice();\n } // else\n Trace.info(\"RM::queryCarsPrice(\" + id + \", \" + key + \") returns cost=$\" + value );\n return value; \n }",
"public int getStock(int pid) {\nfor (ProductStockPair pair : productCatalog) {\nif (pair.product.id == pid) {\nreturn pair.stock;\n}\n}\nreturn -1;\n}",
"public boolean hasProduct(ProductBarcode code);",
"public String getProductId();",
"@GetMapping(\"/products/{id}\")\n\tpublic Product getOneProduct(@PathVariable(\"id\") int id) {\n\t\t//enhanced for loop \n\t\tfor (Product product : products) {\n\t\t\tif (product.getId() == id) {\n\t\t\t\treturn product;\n\t\t\t}\n\t\t}\n\t\tthrow new ProductNotFoundException() ;\n\t}",
"@Test\n public void testCreateProductShouldCorrect() throws Exception {\n when(productRepository.existsByName(productRequest.getName())).thenReturn(false);\n when(productRepository.save(any(Product.class))).thenReturn(product);\n\n testResponseData(RequestInfo.builder()\n .request(post(PRODUCT_ENDPOINT))\n .token(adminToken)\n .body(productRequest)\n .httpStatus(HttpStatus.OK)\n .build());\n }",
"Object get(String key);",
"Object get(String key);",
"public QueryRequestAccelerator getRecordFromCache(Product product) {\n \n QueryRequestAccelerator record = null;\n String key = AcceleratorRecordFactory.getInstance().getKey(product);\n \n String value = RedisCacheManager.getInstance().get(key);\n if ((value == null) || (value.isEmpty())) {\n LOGGER.warn(\"Input key [ \"\n + key \n + \" ] does not exist in the cache.\");\n }\n else {\n \n record = JSONSerializer.getInstance()\n .deserializeToQueryRequestAccelerator(value);\n if (LOGGER.isDebugEnabled()){ \n LOGGER.debug(\"Key => [ \"\n + key \n + \" ], value => [ \"\n + value\n + \" ].\");\n }\n }\n \n return record;\n }",
"public interface ProductAPI {\n\tProduct create(final String key);\n\n\tCollection<Product> listAll();\n\n\tProduct getByKey(final String productId);\n}",
"@Test\n void showStoreHistorySuccess() {\n Integer productID1 = store.getProductID(\"computer\");\n tradingSystem.AddProductToCart(EconnID,storeID, productID1,5);\n tradingSystem.subscriberPurchase(EuserId, EconnID, \"123456\",\"4\",\"2022\",\"123\",\"123456\",\"Rager\",\"Beer Sheva\",\"Israel\",\"123\");\n List<DummyShoppingHistory> list = store.ShowStoreHistory();\n assertEquals(list.size(), 1);\n assertTrue(list.get(0).getProducts().get(0).getProductName().equals(\"computer\"));\n }"
] | [
"0.66447175",
"0.65897316",
"0.65484303",
"0.65166545",
"0.64171875",
"0.6399943",
"0.63438296",
"0.6314026",
"0.6305564",
"0.62794054",
"0.62566996",
"0.62354624",
"0.6220097",
"0.6185286",
"0.6159886",
"0.61516577",
"0.6133351",
"0.6094932",
"0.6093844",
"0.6074958",
"0.6066862",
"0.6061151",
"0.6032184",
"0.6032184",
"0.60174626",
"0.597683",
"0.59729683",
"0.59656185",
"0.59535795",
"0.5946993",
"0.5930479",
"0.5921428",
"0.59200555",
"0.5909294",
"0.5888835",
"0.5884238",
"0.5880563",
"0.5879838",
"0.58621645",
"0.5851621",
"0.58480954",
"0.5844901",
"0.5838952",
"0.5833831",
"0.5830273",
"0.5826805",
"0.5825992",
"0.5822578",
"0.5794962",
"0.57760394",
"0.5774297",
"0.5766888",
"0.57630986",
"0.57464945",
"0.57345504",
"0.57326424",
"0.5731301",
"0.57042193",
"0.5698631",
"0.56952727",
"0.56750226",
"0.5672528",
"0.5672219",
"0.566438",
"0.5660506",
"0.565341",
"0.5650455",
"0.5649755",
"0.56390357",
"0.56336606",
"0.56305337",
"0.5611323",
"0.5609022",
"0.56082475",
"0.55771786",
"0.5568146",
"0.55625653",
"0.5561343",
"0.5558143",
"0.5552987",
"0.5548326",
"0.55449504",
"0.55348414",
"0.553132",
"0.55193377",
"0.5518623",
"0.5517988",
"0.5513439",
"0.55116796",
"0.5509259",
"0.5503121",
"0.55025536",
"0.5501229",
"0.5499927",
"0.54966843",
"0.54956615",
"0.54956615",
"0.5488041",
"0.54841566",
"0.5479952"
] | 0.7748314 | 0 |
Test get product by key empty | @Test
public void testGetByKeyEmpty() throws Exception {
thrown.expect(ProductNotFoundException.class);
thrown.expectMessage("Product with key " + this.product.getKey() + " not found!");
when(repository.findByKey(this.product.getKey())).thenReturn(Optional.empty());
service.getByKey(this.product.getKey());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void testGetByKey() throws Exception {\n when(repository.findByKey(this.product.getKey())).thenReturn(Optional.of(this.product));\n\n assertEquals(this.product, service.getByKey(this.product.getKey()));\n }",
"@Test(expected = ProductNotFoundException.class)\n public void TestProductNotFoundException() throws ProductNotFoundException {\n HashMap<Character, Product> productList = new HashMap<Character, Product>();\n Product product = new Product('A', 20, 2, 1);\n productList.put(product.getName(), product);\n\n product = new Product('B', 50, 5, 3);\n productList.put(product.getName(), product);\n\n product = new Product('C', 30, 3, 2);\n productList.put(product.getName(), product);\n\n com.jama.domain.Supermarket supermarket = new com.jama.domain.Supermarket(productList);\n\n int totalPrice = supermarket.checkout(\"BCABBACBCBX\");\n assertEquals(\"Total prices are not equal.\", new Integer(230), new Integer(totalPrice));\n }",
"@Test\n void searchProduct() {\n List<DummyProduct> L1= store.SearchProduct(\"computer\",null,-1,-1);\n assertTrue(L1.get(0).getProductName().equals(\"computer\"));\n\n List<DummyProduct> L2= store.SearchProduct(null,\"Technology\",-1,-1);\n assertTrue(L2.get(0).getCategory().equals(\"Technology\")&&L2.get(1).getCategory().equals(\"Technology\"));\n\n List<DummyProduct> L3= store.SearchProduct(null,null,0,50);\n assertTrue(L3.get(0).getProductName().equals(\"MakeUp\"));\n\n List<DummyProduct> L4= store.SearchProduct(null,\"Fun\",0,50);\n assertTrue(L4.isEmpty());\n }",
"@Test\n public void verifyNoOfferApplied() {\n \tProduct product = new Product(\"Watermelon\", 0.8);\n \tProduct product2 = new Product(\"Apple\", 0.2);\n \tProduct product3 = new Product(\"Orange\", 0.5);\n \tBasket basket = new Basket();\n \tbasket.getProducts().put(product, 2);\n \tbasket.getProducts().put(product2, 1);\n \tbasket.getProducts().put(product3, 5);\n \tassertTrue(\"Have to get the price of 8 items = 4.3 ==> \", (calculator.calculatePrice(basket) - 4.3) < 0.0001);\n }",
"@Test\n\tpublic void testFindProductByGuidWithNullReturn() {\n\t\tstubGetBean(ContextIdNames.PRODUCT, ProductImpl.class);\n\t\tcontext.checking(new Expectations() {\n\t\t\t{\n\t\t\n\t\t\t\tallowing(getMockPersistenceEngine()).retrieveByNamedQuery(with(any(String.class)), with(any(Object[].class)));\n\t\t\t\twill(returnValue(Collections.emptyList()));\n\t\t\t}\n\t\t});\n\t\tassertNull(this.importGuidHelper.findProductByGuid(NON_EXIST_GUID, true, true, true));\n\t}",
"public boolean hasProduct() {\n return product_ != null;\n }",
"@Test\n\tpublic void testFindProductSkuByGuidWithNullReturn() {\n\t\tcontext.checking(new Expectations() {\n\t\t\t{\n\t\t\t\tallowing(getMockPersistenceEngine()).retrieveByNamedQuery(with(any(String.class)), with(any(Object[].class)));\n\t\t\t\twill(returnValue(Collections.emptyList()));\n\t\t\t}\n\t\t});\n\t\tassertNull(this.importGuidHelper.findProductSkuByGuid(NON_EXIST_GUID));\n\t}",
"@Test\n public void testGetProductsByName() throws Exception {\n System.out.println(\"getProductsByName\");\n for (Product p : products) {\n prs = dao.getProductsByName(p.getName());\n assertTrue(prs.size() == 1);\n assertTrue(prs.contains(p));\n \n }\n prs = dao.getProductsByName(nonExisten.getName());\n assertTrue(prs.isEmpty());\n }",
"@Test\n public void testEmpty() {\n \n ShoppingCart instance = new ShoppingCart();\n Product p1 = new Product(\"Galletas\", 1.2);\n Product p2 = new Product(\"Raton\", 85.6);\n Product p3 = new Product(\"Teclado\", 5.5);\n Product p4 = new Product(\"Monitor 4K\", 550.6);\n \n instance.addItem(p1);\n instance.addItem(p2);\n instance.addItem(p3);\n instance.addItem(p4);\n \n try{\n \n instance.empty();\n \n } catch(Exception e){\n \n }\n \n assertEquals(instance.getItemCount(), 0, 0.0);\n \n }",
"@Test\n public void testIsEmpty() {\n ShoppingCart instance = new ShoppingCart();\n Product p1 = new Product(\"Galletas\", 1.2);\n Product p2 = new Product(\"Raton\", 85.6);\n \n instance.addItem(p1);\n instance.addItem(p2);\n \n instance.empty();\n \n assertTrue(instance.isEmpty());\n \n instance.addItem(p1);\n instance.addItem(p2);\n \n try {\n instance.removeItem(p1);\n instance.removeItem(p2);\n } catch (ProductNotFoundException ex) {\n Logger.getLogger(ShoppingCartTest.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n assertTrue(instance.isEmpty());\n \n \n }",
"@Test\n\tpublic void equalsNullItemType() {\n\t\tProductScanImageURIKey key1 = this.getDefaultKey();\n\t\tProductScanImageURIKey key2 = this.getDefaultKey();\n\t\tkey1.setId(LONG_ZERO);\n\t\tboolean equals = key1.equals(key2);\n\t\tAssert.assertFalse(equals);\n\t}",
"@Test\n public void testGetProductsByPurcher() throws Exception {\n System.out.println(\"getProductsByPurcher\");\n Customer c = new Customer();\n c.setId(1l);\n prs = dao.getProductsByPurcher(c);\n assertTrue(prs.contains(p3));\n assertTrue(prs.size() == 1);\n c.setId(2l);\n prs = dao.getProductsByPurcher(c);\n assertTrue(prs.contains(p1));\n assertTrue(prs.size() == 1);\n \n c.setId(3l);\n prs = dao.getProductsByPurcher(c);\n assertTrue(prs.isEmpty());\n }",
"@Test\n\tpublic void testGetProductForConfigIdNull()\n\t{\n\t\tfinal String pCode = \"123\";\n\t\tclassUnderTest.setConfigIdForProduct(pCode, configId);\n\t\tassertNull(classUnderTest.getProductForConfigId(null));\n\t}",
"@Test\n\tpublic void testFindAllProductNoContentFound() {\n\n\t\tMockito.when(productDao.findByProductGroup_ProductGroupId(1)).thenReturn(products);\n\n\t\tResponseEntity<List<Product>> expected = productServiceImpl.getAllProductsByProductGroupId(1);\n\n\t\tAssertions.assertNotSame(expected, ResponseEntity.noContent().build());\n\t}",
"public Optional<Product> getProduct(String productId);",
"@Test\n public void whenNoPricesForVendor_ThenAnEmptyResponseIsReturned() {\n getByInstrumentId(\"unknown\").isEqualTo(new Price[] {});\n }",
"List<ItemPriceDTO> findAllWhereProductIsNull();",
"@Test\n public void deleteProduct_onProductLookup_productNotFound() {\n molecularSampleRepository.delete(testMolecularSample.getUuid());\n assertNull(entityManager.find(Product.class, testMolecularSample.getId()));\n }",
"@Test\n public void TestABC() {\n HashMap<Character, Product> productList = new HashMap<Character, Product>();\n Product product = new Product('A', 20);\n productList.put(product.getName(), product);\n\n product = new Product('B', 50, 5, 3);\n productList.put(product.getName(), product);\n\n product = new Product('C', 30);\n productList.put(product.getName(), product);\n\n com.jama.domain.Supermarket supermarket = new com.jama.domain.Supermarket(productList);\n\n try {\n int totalPrice = supermarket.checkout(\"ABC\");\n assertEquals(\"Total prices are not equal.\", new Integer(100), new Integer(totalPrice));\n }\n catch (Exception e)\n {\n fail(e.getMessage());\n }\n }",
"@Test\n\tpublic void searchForProductLandsOnCorrectProduct() {\n\t}",
"@Test\n public void TestABBACBBABABBACBBAB() {\n HashMap<Character, Product> productList = new HashMap<Character, Product>();\n Product product = new Product('A', 20);\n productList.put(product.getName(), product);\n\n product = new Product('B', 50, 5, 3);\n productList.put(product.getName(), product);\n\n product = new Product('C', 30);\n productList.put(product.getName(), product);\n\n com.jama.domain.Supermarket supermarket = new com.jama.domain.Supermarket(productList);\n\n try {\n int totalPrice = supermarket.checkout(\"ABBACBBABABBACBBAB\");\n assertEquals(\"Total prices does not equal.\", new Integer(480), new Integer(totalPrice));\n }\n catch (Exception e)\n {\n fail(e.getMessage());\n }\n }",
"@Test\n\t\tpublic void testEmptyTheCart() {\n\t\t\tProduct hamburger = new Product(\"burger\", 10);\n\t\t\t\n\t\t\tcart.addItem(phone);\n\t\t\tcart.addItem(hamburger);\n\t\t\t\n\t\t\t// 3.Get rid of all items in the cart\n\t\t\tcart.empty();\n\t\t\t\n\t\t\t// 4. Check num items in cart === E = 0\n\t\t\tassertEquals(0, cart.getItemCount());\n\t\t}",
"@Test\n public void testGetAllProductsEmpty() throws Exception {\n when(repository.findAll()).thenReturn(Collections.emptyList());\n\n assertEquals(Collections.emptyList(), service.getAllProducts());\n }",
"@Test\n public void testFindProductShouldThrowNotFoundWhenProductIdNotFound() throws Exception {\n when(productRepository.findOne(product.getId())).thenReturn(null);\n\n testResponseData(RequestInfo.builder()\n .request(get(PRODUCT_DETAIL_ENDPOINT, product.getId()))\n .token(memberToken)\n .httpStatus(HttpStatus.NOT_FOUND)\n .build());\n }",
"public boolean hasProduct() {\n return productBuilder_ != null || product_ != null;\n }",
"public ArrayList<Product> getMissingProduct(){\r\n\t\tString sql=\"SELECT Barcode FROM ProductTable WHERE (Quantity_In_Store+Quantity_In_storeroom)<=\"\r\n\t\t\t\t+ \"(Average_Sales_Per_Day*Delivery_Time)\";\r\n\t\tArrayList<Product> products = new ArrayList<>();\r\n\t\t try (Connection conn = this.connect();\r\n\t Statement stmt = conn.createStatement();\r\n\t ResultSet rs = stmt.executeQuery(sql)){\r\n\t\t\t while(rs.next()){\r\n\t\t\t\t products.add(getProductByID(rs.getInt(\"Barcode\")));\r\n\t\t\t }\r\n\t\t }\r\n\t\t catch (SQLException e) {\r\n\t\t\t System.out.println(\"getMissingProduct: \"+e.getMessage());\r\n\t\t\t return null;\r\n\t\t }\r\n\t\treturn products;\r\n\t}",
"@Test\n public void GETProductService_ProductCall() {\n givenHeaders().\n when().\n get(_url_prodservice).//.body().prettyPrint();\n then().\n using().defaultParser(Parser.JSON).\n log().ifError().\n statusCode(200).\n body(\"response\", not(isEmptyString()));\n System.out.print(\"GETProductService_ProductCall Test Run Result\");\n }",
"@Test\n public void testGetProductsByType() throws Exception {\n System.out.println(\"getProductsByType\");\n \n prs = dao.getProductsByType(p1.getType());\n assertTrue(prs.size() == 2);\n assertTrue(prs.contains(p1));\n assertTrue(prs.contains(p2));\n prs = dao.getProductsByType(p2.getType());\n assertTrue(prs.size() == 2);\n assertTrue(prs.contains(p1));\n assertTrue(prs.contains(p2));\n prs = dao.getProductsByType(p3.getType());\n assertTrue(prs.size() == 1);\n assertTrue(prs.contains(p3));\n \n prs = dao.getProductsByName(nonExisten.getType());\n assertTrue(prs.isEmpty());\n }",
"@Test\n\tpublic void testFindProductByGuidWithOneReturn() {\n\t\tstubGetBean(ContextIdNames.PRODUCT, ProductImpl.class);\n\n\t\tfinal List<Product> products = new ArrayList<Product>();\n\t\tProduct product = new ProductImpl();\n\t\tproducts.add(product);\n\t\tcontext.checking(new Expectations() {\n\t\t\t{\n\t\t\t\tallowing(getMockPersistenceEngine()).retrieveByNamedQuery(with(any(String.class)), with(any(Object[].class)));\n\t\t\t\twill(returnValue(products));\n\t\t\t}\n\t\t});\n\t\tassertSame(product, this.importGuidHelper.findProductByGuid(SOME_GUID, true, true, true));\n\t}",
"@Test\n public void TestABBACBBAB() {\n HashMap<Character, Product> productList = new HashMap<Character, Product>();\n Product product = new Product('A', 20);\n productList.put(product.getName(), product);\n\n product = new Product('B', 50, 5, 3);\n productList.put(product.getName(), product);\n\n product = new Product('C', 30);\n productList.put(product.getName(), product);\n\n com.jama.domain.Supermarket supermarket = new com.jama.domain.Supermarket(productList);\n\n try {\n int totalPrice = supermarket.checkout(\"ABBACBBAB\");\n assertEquals(\"Total prices does not equal.\", new Integer(240), new Integer(totalPrice));\n }\n catch (Exception e)\n {\n fail(e.getMessage());\n }\n }",
"@Test\n\tpublic void testFindProductByGuidWithMoreThanOneReturn() {\n\t\tstubGetBean(ContextIdNames.PRODUCT, ProductImpl.class);\n\n\t\tfinal List<Product> products = new ArrayList<Product>();\n\t\tProduct product = new ProductImpl();\n\t\tproducts.add(product);\n\t\tproducts.add(product);\n\t\tcontext.checking(new Expectations() {\n\t\t\t{\n\t\t\t\tallowing(getMockPersistenceEngine()).retrieveByNamedQuery(with(any(String.class)), with(any(Object[].class)));\n\t\t\t\twill(returnValue(products));\n\t\t\t}\n\t\t});\n\t\ttry {\n\t\t\tthis.importGuidHelper.findProductByGuid(SOME_GUID, false, false, true);\n\t\t\tfail(EP_SERVICE_EXCEPTION_EXPECTED);\n\t\t} catch (EpServiceException e) {\n\t\t\t// succeed!\n\t\t\tassertNotNull(e);\n\t\t}\n\t}",
"public Product getProductInfo(int pid) {\nfor (ProductStockPair pair : productCatalog) {\nif (pair.product.id == pid) {\nreturn pair.product;\n}\n}\nreturn null;\n}",
"@Test\n public void findProductExcludingRelationships() {\n Product product = productRepository.findProductExcludingRelationships(3l);\n Assert.assertTrue(null != product);\n Assert.assertTrue(null != product.getProductId());\n LOGGER.debug(\" *** RESULT *** {}\", product.toString());\n //String json = Util.toJson(product);\n // Assert.assertTrue(null != json);\n //LOGGER.debug(\" *** RESULT *** {}\", json);\n }",
"@Test\n\tpublic void equalsNull() {\n\t\tProductScanImageURIKey key = this.getDefaultKey();\n\t\tboolean equals = key.equals(null);\n\t\tAssert.assertFalse(equals);\n\t}",
"@Test\n public void testAssocOneWithNullAssoc() {\n\n Database server = DB.getDefault();\n\n final ProductConfiguration pc = new ProductConfiguration();\n pc.setName(\"PC1\");\n server.save(pc);\n\n CalculationResult r = new CalculationResult();\n final Double charge = 100.0;\n r.setCharge(charge);\n r.setProductConfiguration(pc);\n r.setGroupConfiguration(null);\n server.save(r);\n }",
"@Test\n public void testFindProduct() {\n ShoppingCart instance = new ShoppingCart();\n Product p1 = new Product(\"Galletas\", 1.2);\n Product p2 = new Product(\"Raton\", 85.6);\n \n instance.addItem(p1);\n instance.addItem(p2);\n \n assertTrue(instance.findProduct(\"Galletas\"));\n }",
"@Test\n\tpublic void testFindProductByProductIdFailure() {\n\n\t\tMockito.when(productDao.findById(1)).thenReturn(Optional.of(product));\n\n\t\tResponseEntity<Product> expected = productServiceImpl.findProductByProductId(1);\n\n\t\tAssertions.assertNotSame(expected, ResponseEntity.noContent().build());\n\t}",
"@Test\n public void testGetOneProduct() {\n }",
"@Test\n public void testStoreProductWithExistingNameShouldFail() {\n when(repository().queryByPredicates(any(Predicate.class))).thenAnswer(env -> productMock);\n\n // when\n org.jboss.pnc.dto.Product productDTO = org.jboss.pnc.dto.Product.builder()\n .name(productMock.getName())\n .abbreviation(\"test\")\n .build();\n\n // then\n assertThatThrownBy(() -> provider.store(productDTO)).isInstanceOf(ConflictedEntryException.class);\n }",
"Object get(Object key) throws NullPointerException;",
"@Test\n public void verifyWatermelonOfferApplied() {\n \tProduct product = new Product(\"Watermelon\", 0.8);\n \tBasket basket = new Basket();\n \tbasket.getProducts().put(product, 7);\n \tassertTrue(\"Have to get the price of 7 items = 4 ==> \", \n \t\t\tDouble.compare(calculator.calculatePrice(basket), 4) == 0);\n }",
"@Test\n public void GETProduct_ProductInventoryCall() {\n\n givenHeaders().\n when().\n get(_url_product).//.body().prettyPrint();\n then().\n using().defaultParser(Parser.JSON).\n log().ifError().\n statusCode(200).\n body(\"response\", not(isEmptyString()));\n System.out.print(\"GETPRODUCT_Inventory Test Run Result\");\n }",
"@Test\n\tpublic void testFindProductSkuByGuidWithOneReturn() {\n\t\tfinal List<ProductSku> productSkus = new ArrayList<ProductSku>();\n\t\tProductSku productSku = new ProductSkuImpl();\n\t\tproductSkus.add(productSku);\n\t\tcontext.checking(new Expectations() {\n\t\t\t{\n\t\t\t\tallowing(getMockPersistenceEngine()).retrieveByNamedQuery(with(any(String.class)), with(any(Object[].class)));\n\t\t\t\twill(returnValue(productSkus));\n\t\t\t}\n\t\t});\n\t\tassertSame(productSku, this.importGuidHelper.findProductSkuByGuid(SOME_GUID));\n\t}",
"@Test\n\tpublic void testAddNullProduct() throws ApiException {\n\n\t\tOrderItemPojo order_item = getOrderItemPojo(null,5);\n\t\tList<OrderItemPojo> lis = new ArrayList<OrderItemPojo>();\n\t\tlis.add(order_item);\n\n\t\ttry {\n\t\t\torder_service.add(lis);\n\t\t\tfail(\"ApiException did not occur\");\n\t\t} catch (ApiException e) {\n\t\t\tassertEquals(e.getMessage(), \"Product with this id does not exist\");\n\t\t}\n\n\t}",
"public void testGetObjectSpecificationWithEmptyKey() throws Exception {\r\n root.addChild(createObject(\"key:identifier\", TYPE_OBJECT));\r\n\r\n specificationFactory = new ConfigurationObjectSpecificationFactory(root);\r\n\r\n try {\r\n specificationFactory.getObjectSpecification(\"\", \"identifier\");\r\n fail(\"IllegalArgumentException is expected.\");\r\n } catch (IllegalArgumentException e) {\r\n // ok\r\n }\r\n }",
"@Test\n public void testGetProductsBySaler() throws Exception {\n System.out.println(\"getProductsBySaler\");\n Customer c = new Customer();\n c.setId(1l);\n prs = dao.getProductsBySaler(c);\n assertTrue(prs.contains(p1));\n assertTrue(prs.contains(p2));\n assertTrue(prs.size() == 2);\n\n c.setId(2l);\n prs = dao.getProductsBySaler(c);\n assertTrue(prs.isEmpty());\n \n c.setId(3l);\n prs = dao.getProductsBySaler(c);\n assertTrue(prs.contains(p3));\n assertTrue(prs.size() == 1);\n \n }",
"@Override\r\n\tpublic Optional<Producto> getOne(Producto entity) throws Exception {\n\t\treturn null;\r\n\t}",
"Object getProduct();",
"@Test\n\tpublic void testFindProductSkuByGuidWithMoreThanOneReturn() {\n\t\tfinal List<ProductSku> productSkus = new ArrayList<ProductSku>();\n\t\tProductSku productSku = new ProductSkuImpl();\n\t\tproductSkus.add(productSku);\n\t\tproductSkus.add(productSku);\n\t\tcontext.checking(new Expectations() {\n\t\t\t{\n\t\t\t\tallowing(getMockPersistenceEngine()).retrieveByNamedQuery(with(any(String.class)), with(any(Object[].class)));\n\t\t\t\twill(returnValue(productSkus));\n\t\t\t}\n\t\t});\n\t\ttry {\n\t\t\tthis.importGuidHelper.findProductSkuByGuid(SOME_GUID);\n\t\t\tfail(EP_SERVICE_EXCEPTION_EXPECTED);\n\t\t} catch (EpServiceException e) {\n\t\t\t// succeed!\n\t\t\tassertNotNull(e);\n\t\t}\n\t}",
"public static void getAssignedProduct(String productId , ITestContext context ){\n\t\t \n\t\t //SET URL\n\t\t customerId= (context.getAttribute(\"customerId\")).toString();//need to add validation for customerId\n\t\t String CONTEXT_PATH=\"mcss/ecommerce/customer/\" +customerId + \"/product/\" + productId;\n\t\t \n\t\t//Execute REST\n\t\t Response response =get( CONTEXT_PATH );\n \n\t\t \n\n\t\t //Validations:\n\t\t ResponseBody body = response.getBody();\n\t\t assertEquals( 200 ,response.getStatusCode(),\"Status Code is not as expected\");\n\t\t assertEquals( \"AC\" ,response.body().path(\"Product.status\"),\"AP status is not correct \");\n\t\t assertEquals( productId ,response.body().path(\"Product.id\"),\"AP status is not correct \");\n\t\t \n\t\t //Product validations \n\t\t assertNotEquals( null, response.body().path(\"Product.serviceId\"), \"ServiceId is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.productOfferingProductSpecID\"), \"productOfferingProductSpecID is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.productTypeX9\"), \"productTypeX9 is null\");//EQ,IPTV\n\t\t assertNotEquals( null, response.body().path(\"Product.hasPendingOrders\"), \"hasPendingOrders is null\");//optional\n\t\t assertNotEquals( null, response.body().path(\"Product.ceaseActionAllowed\"), \"ceaseActionAllowed is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.changeActionAllowed\"), \"changeActionAllowed is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.catalogOfferingId\"), \"catalogOfferingId is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.lineOfBusiness\"), \"lineOfBusiness is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.spoName\"), \"spoName is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.resumeActionAllowed\"), \"resumeActionAllowed is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.catalogItemID\"), \"catalogItemID\");\n\t\t// plan validations only if product is not Equipment for Equipment can be if it has Repeator\n\t\t if ( !(response.body().path(\"Product.productTypeX9\")).equals(\"EQ\") ){\n\t\t assertNotEquals( null, response.body().path(\"Product.plan\"), \"plan is null\"); // optional \n\t\t assertNotEquals( null, response.body().path(\"Product.plan.catalogItemName\"), \"plan.catalogItemName is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.plan.catalogItemImages\"), \"plan.catalogItemImages is null\");//optional\n\t\t assertNotEquals( null, response.body().path(\"Product.plan.planRank\"), \"plan.planRank is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.plan.catalogItemID\"), \"plan.catalogItemID is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.plan.catalogItemDescription\"), \"plan.catalogItemDescription is null\");//optional\n\t\t assertNotEquals( null, response.body().path(\"Product.plan.id\"), \"plan.id is null\");\n\t\t }\n\t\t //services validations \n\t\t assertNotEquals( null, response.body().path(\"Product.services\"), \"services are null!\"); // optional \n\t\t assertNotEquals( 0, response.body().path(\"Product.services.size()\"), \" Services Array is empty !\"); // optional \n\t\t// assertNotEquals( null, ((RestAssuredBased) response.body()).get(\"/Product\").jsonPath().getList(\"Product.services.[0].businessType\"), \"Services.businessType is null!\"); \n\t/*\t assertNotEquals( null, response.body().path(\"Product.services.[0].catalogItemID\"), \"Services.catalogItemID is null!\"); \n\t\t assertNotEquals( null, response.body().path(\"Product.services.[0].catalogItemName\"), \"Services.catalogItemName is null!\"); \n\t\t assertNotEquals( null, response.body().path(\"Product.services.[0].catalogItemDescription\"), \"catalogItemDescription is null!\"); //optional\n\t\t assertNotEquals( null, response.body().path(\"Product.services.[0].initialActivationDate\"), \"Services.initialActivationDate is null!\");// \n\t\t assertNotEquals( null, response.body().path(\"Product.services.[0].id\"), \"Services.id is null!\");// \n\t\t assertNotEquals( null, response.body().path(\"Product.services.[0].serviceType\"), \"Services.serviceType is null!\");// \n\t\t assertNotEquals( null, response.body().path(\"Product.services.[0].status\"), \"Services.status is null!\");// */\n\t\t \n\t\t \n\t\t //Savinq Info \n\t\t /*\n context.setAttribute( \"customerId\", body.path(\"ClientUserContext.customerId\" ));\n context.setAttribute( \"personId\", body.path(\"ClientUserContext.personId\" ));\n context.setAttribute( \"personId\", body.path(\"ClientUserContext.personId\" ));\n context.setAttribute( \"personObjIdX\", body.path(\"ClientUserContext.personObjIdX\" ));\n */\n\t }",
"@Override\r\n public final Product findProduct(final String prodId) throws MandatoryEntryException,NotFoundInDatabaseException {\n ExceptionTest.stringMandatoryEntryTest(prodId);\r\n// if (prodId == null || prodId.length() == 0) {\r\n// System.out.println(\"Sorry, FakeDatabase.findProduct method has \"\r\n// + \"illegal argument\");\r\n// return null; // end method prematurely after log to console\r\n// }\r\n\r\n Product product = null;\r\n for (Product p : products) {\r\n if (prodId.equals(p.getProdId())) {\r\n product = p;\r\n break;\r\n }\r\n }\r\n// ExceptionTest.objectMandatoryEntryTest(product, ExceptionSource.DATABASE);\r\n ExceptionTest.objectNotFoundInDatabaseTest(product);\r\n// if (product==null){\r\n// System.out.println(\"Product not found in the database.\");\r\n// \r\n// }\r\n return product;\r\n }",
"public Product Product() {\n return null;\n }",
"@Override\r\n\tpublic List<Product> search(String key) {\n\tProductExample example = new ProductExample();\r\n\texample.createCriteria().andNameLike(\"%\"+key+\"%\");\r\n\texample.setOrderByClause(\"id desc\");\r\n\tList<Product> list = productMapper.selectByExample(example);\r\n\tsetAll(list);\r\n\treturn list;\r\n\t\t}",
"int getProductKey();",
"@Test\n public void testHappyPath() {\n\n final ProductImpl aProduct = new ProductImpl();\n jobEntry.setType(aProduct.getClass());\n jobEntry.setGuid(A_GUID);\n\n context.checking(new Expectations() {\n {\n oneOf(cache).retrieve(A_GUID, aProduct.getClass());\n will(returnValue(aProduct));\n }\n });\n final Persistable sourceObject = jobEntry.getSourceObject();\n assertEquals(\"persistent object should be a product\", aProduct, sourceObject);\n\n }",
"@Test\n\tpublic void testNotExistingProductsSearchTyped() {\n\t\tEntityManager em = emf.createEntityManager();\n\t\tList<Stock> result = null;\n\t\tem.getTransaction().begin();\n\t\ttry {\n\t\t\t// Search for mutiple stocks.\n\t\t\tTypedQuery<Stock> query = em.createNamedQuery(\"Stock.getStockByProductId\", Stock.class);\n\t\t\tresult = query.setParameter(\"productId\", \"HZ-1000\").getResultList();\n\t\t\tassertEquals(\n\t\t\t\t\t\"Search via typed query for not existing mutiple stocks: Stocks exists in database\",\n\t\t\t\t\t0, result.size());\n\t\t} finally {\n\t\t\tem.close();\n\t\t}\n\t}",
"@Override\n public List<ProductDTO> getProducts(Map<String, String> allParams) throws ProductException {\n List<Criterion> criteria = new ArrayList<>();\n int criteriaCounter = 0;\n String order = null;\n\n if (allParams != null) {\n for (Map.Entry<String, String> entry : allParams.entrySet()) {\n // Validate params\n if (!Arrays.stream(avalibleParams).anyMatch(val -> val.equals(entry.getKey())))\n throw new ProductException(ProductException.INVALID_INPUT, ProductException.INVALID_INPUT_MSG);\n\n if (entry.getKey().equals(avalibleParams[0])) { // avalibleParams[0] is \"order\"\n order = entry.getValue();\n } else {\n // Add a criterion\n criteria.add(new Criterion(entry.getValue(), entry.getKey()));\n criteriaCounter++;\n }\n }\n }\n // Params Excess exception\n if (criteriaCounter > 2)\n throw new ProductException(ProductException.PARAMS_EXCESS, ProductException.PARAMS_EXCESS_MSG);\n\n return articleRepository.getProducts(criteria, order);\n }",
"@Test\n public void testGetAllProducts() throws Exception {\n when(repository.findAll()).thenReturn(Collections.singletonList(this.product));\n\n assertEquals(Collections.singletonList(this.product), service.getAllProducts());\n }",
"private void defaultProductCategoryShouldNotBeFound(String filter) throws Exception {\n restProductCategoryMockMvc.perform(get(\"/api/product-categories?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))\n .andExpect(jsonPath(\"$\").isArray())\n .andExpect(jsonPath(\"$\").isEmpty());\n\n // Check, that the count call also returns 0\n restProductCategoryMockMvc.perform(get(\"/api/product-categories/count?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))\n .andExpect(content().string(\"0\"));\n }",
"@Override\n\t@Transactional(readOnly=true)\n\tpublic ProductDTO findBySearchkeyAndVisibleTrue(String searchkey) {\n\t\tlog.debug(\"Request to get Product by searchkey : {}\", searchkey);\n Product product = productRepository.findBySearchkeyIgnoreCaseAndVisibleTrue( searchkey);\n return productMapper.toDto(product);\n\t}",
"private void defaultFillingGapsTestItemShouldNotBeFound(String filter) throws Exception {\n restFillingGapsTestItemMockMvc.perform(get(\"/api/filling-gaps-test-items?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))\n .andExpect(jsonPath(\"$\").isArray())\n .andExpect(jsonPath(\"$\").isEmpty());\n }",
"@Test\n public void verifyAppleOfferApplied() {\n \tProduct product = new Product(\"Apple\", 0.2);\n \tBasket basket = new Basket();\n \tbasket.getProducts().put(product, 5);\n \tassertTrue(\"Have to get the price of 3 items = 0.6 ==> \", \n \t\t\tDouble.compare(calculator.calculatePrice(basket), 0.6) == 0);\n }",
"public int removeProduct(String product) {\n Collection<String> collection = shoppingBasket.keySet();\n\n for (String key : collection) {\n if (key != null) {\n if (product.equals(key) == true) {\n // нашли наше значение равное ключу\n shoppingBasket.remove(product);\n return 1;\n } else {\n return 0;\n }\n }\n }\n return 0;\n }",
"@Test(expected = NullReferenceException.class)\n public void setProductIsNull() throws NullReferenceException {\n cartItem.setProduct(null);\n }",
"public void testGetObjectSpecificationWithNullKey() throws Exception {\r\n root.addChild(createObject(\"key:identifier\", TYPE_OBJECT));\r\n\r\n specificationFactory = new ConfigurationObjectSpecificationFactory(root);\r\n\r\n try {\r\n specificationFactory.getObjectSpecification(null, \"identifier\");\r\n fail(\"IllegalArgumentException is expected.\");\r\n } catch (IllegalArgumentException e) {\r\n // ok\r\n }\r\n }",
"public boolean tryGetInputProduct() {\n Product product = self.getInputBuffer().tryRemoveProduct();\n if (product != null) {\n self.setCurrentProduct(product);\n syncUpdateWithCheck(false);\n return true;\n }\n waitStepWithCheck();\n return false;\n }",
"@Test\n\tpublic void testOrderWithoutShoppingCart() {\n\t\ttry {\n\t\t\tassertEquals(orderService.order(order), null);\n\t\t} catch (OrderException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"@Test\n public void getIngredient_ReturnsNull(){\n assertEquals(\"getIngredient - Returns Null\", null, testDatabase.getIngredient(Integer.MAX_VALUE));\n }",
"@Test(expected = IllegalArgumentException.class)\n public void testMultiLookupEmptySpecFails() {\n ctx.bucket().lookupIn(key);\n }",
"@Test\n public void testGetNoResult()\n {\n IHBaseTable table = new HBaseTable(MockHTable.create());\n\n Get get = new Get(Bytes.toBytes(\"totallyArbitraryRowKey\"));\n Result result = table.get(get);\n Assert.assertTrue(result.isEmpty());\n }",
"@Test\r\n\tpublic void testEmptyContents() throws Exception {\n\t\tassertThat(this.basket.getContents().count(), is(0L));\r\n\t}",
"@Test\n public void TestBCABBACBCB() {\n HashMap<Character, Product> productList = new HashMap<Character, Product>();\n Product product = new Product('A', 20, 2, 1);\n productList.put(product.getName(), product);\n\n product = new Product('B', 50, 5, 3);\n productList.put(product.getName(), product);\n\n product = new Product('C', 30, 3, 2);\n productList.put(product.getName(), product);\n\n com.jama.domain.Supermarket supermarket = new com.jama.domain.Supermarket(productList);\n\n try {\n int totalPrice = supermarket.checkout(\"BCABBACBCB\");\n assertEquals(\"Total prices are not equal.\", new Integer(230), new Integer(totalPrice));\n }\n catch (Exception e)\n {\n fail(e.getMessage());\n }\n }",
"@Test\n void testFindAllByNotCrypto() {\n long size = service.findAll().stream().filter(item -> !item.getCrypto()).count();\n assertEquals(size, service.findAllByNotCrypto().size());\n }",
"public Boolean hasNextProduct() {\n\t\treturn getProducts().size() > 0;\n\t}",
"@Test\n void canNotDeleteTest() {\n Product product = new Product(\"Apple\", 10, 4);\n shoppingCart.addProducts(product.getName(), product.getPrice(), product.getQuantity());\n //when deletes five apples\n boolean result = shoppingCart.deleteProducts(product.getName(), 5);\n //then apples are not deleted\n int appleNb = shoppingCart.getQuantityOfProduct(\"Apple\");\n assertFalse(result);\n assertEquals(4, appleNb);\n }",
"@Override\n public Product findProductById(String productId)\n {\n\t\t// if the productID is not valid then it will throw the Exception\n\t\t\n \t Product pro=ProductStore.map.get(productId);\n \t if(pro==null)\n \t {\n \t\t throw new InValidIdException(\"Incorrect Id \");\n \t }\n \t \n \t // if the productId is valid it will return Product\n \t else\n \t\t return pro;\n }",
"@Test\n public void testDeleteProductShouldThrowNotFoundWhenProductNotFound() throws Exception {\n // Mock method\n when(productRepository.findOne(product.getId())).thenReturn(null);\n\n testResponseData(RequestInfo.builder()\n .request(delete(PRODUCT_DETAIL_ENDPOINT, product.getId()))\n .token(adminToken)\n .httpStatus(HttpStatus.NOT_FOUND)\n .build());\n }",
"public boolean hasProduct(ProductBarcode code);",
"@Override\n public Product getItem(String id) throws NoSuchElementException {\n for (Product product : coupons) {\n if (product.getId() == id)\n return product;\n else\n throw new NoSuchElementException();\n }\n return null;\n }",
"@Test\n public void testAddProductToShoppingCart_whenValidRequest_thenReturnAddedProduct() throws NotFoundException {\n Customer customerShoppingCartTest = customerStepsTest.createCustomerTest();\n Product productShoppingCartTest = productStepsTest.createProductTest();\n\n AddProductToShoppingCartRequest requestAddShoppingCartTest = new AddProductToShoppingCartRequest();\n requestAddShoppingCartTest.setCustomerId(customerShoppingCartTest.getId());\n requestAddShoppingCartTest.setProductId(productShoppingCartTest.getId());\n\n shoppingCartServiceTest.addProductToShoppingCart(requestAddShoppingCartTest);\n\n ShoppingCartDTO productRetrievedFromShoppingCartTest = shoppingCartServiceTest.getProductFromShoppingCart(customerShoppingCartTest.getId());\n\n assertThat(productRetrievedFromShoppingCartTest, notNullValue());\n assertThat(productRetrievedFromShoppingCartTest.getCustomer(), notNullValue());\n assertThat(productRetrievedFromShoppingCartTest.getCustomer().getId(), is(customerShoppingCartTest.getId()));\n assertThat(productRetrievedFromShoppingCartTest.getCustomer().getCustomerFirstName(), is(customerShoppingCartTest.getCustomerFirstName()));\n assertThat(productRetrievedFromShoppingCartTest.getCustomer().getCustomerLastName(), is(customerShoppingCartTest.getCustomerLastName()));\n assertThat(productRetrievedFromShoppingCartTest.getCustomer().getCustomerAddress(), is(customerShoppingCartTest.getCustomerAddress()));\n\n assertThat(productRetrievedFromShoppingCartTest.getProducts(), notNullValue());\n assertThat(productRetrievedFromShoppingCartTest.getProducts(), hasSize(1));\n\n ProductDTO firstProductFromShoppingChart = productRetrievedFromShoppingCartTest.getProducts().iterator().next();\n\n assertThat(firstProductFromShoppingChart, notNullValue());\n assertThat(firstProductFromShoppingChart.getName(), is(productShoppingCartTest.getName()));\n assertThat(firstProductFromShoppingChart.getQuantity(), is(productShoppingCartTest.getQuantity()));\n assertThat(firstProductFromShoppingChart.getPrice(), is(productShoppingCartTest.getPrice()));\n assertThat(firstProductFromShoppingChart.getImagePath(), is(productShoppingCartTest.getImagePath()));\n assertThat(firstProductFromShoppingChart.getProductDescription(), is(productShoppingCartTest.getProductDescription()));\n assertThat(firstProductFromShoppingChart.getProductRate(), is(productShoppingCartTest.getProductRate()));\n }",
"public boolean isEmpty() {\n return keyList.size() == 0;\n }",
"@Test\r\n\tpublic void testMakePurchase_empty_slot() {\r\n\t\tassertEquals(false, vendMachine.makePurchase(\"D\"));\r\n\t}",
"boolean hasQuantity();",
"@Test\n public void testFindProductShouldCorrect() throws Exception {\n // Mock method\n when(productRepository.findOne(product.getId())).thenReturn(product);\n\n testResponseData(RequestInfo.builder()\n .request(get(PRODUCT_DETAIL_ENDPOINT, product.getId()))\n .token(memberToken)\n .httpStatus(HttpStatus.OK)\n .build());\n }",
"boolean containsKey(Object key) throws NullPointerException;",
"@Test\n\tpublic void testFindProductByProductIdSuccess() {\n\n\t\tMockito.when(productDao.findById(1)).thenReturn(Optional.of(product));\n\n\t\tResponseEntity<Product> expected = productServiceImpl.findProductByProductId(1);\n\n\t\tAssertions.assertEquals(expected, ResponseEntity.ok(product));\n\t}",
"@Test\n public void testGetAllProduct() throws Exception {\n System.out.println(\"getAllProduct\");\n prs = dao.getAllProduct();\n \n assertArrayEquals(products.toArray(), prs.toArray());\n }",
"private void defaultKpiShouldNotBeFound(String filter) throws Exception {\n restKpiMockMvc\n .perform(get(ENTITY_API_URL + \"?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))\n .andExpect(jsonPath(\"$\").isArray())\n .andExpect(jsonPath(\"$\").isEmpty());\n\n // Check, that the count call also returns 0\n restKpiMockMvc\n .perform(get(ENTITY_API_URL + \"/count?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))\n .andExpect(content().string(\"0\"));\n }",
"@Test\n\tpublic void equalsNullIdBoth() {\n\t\tProductScanImageURIKey key1 = this.getDefaultKey();\n\t\tkey1.setId(LONG_ZERO);\n\t\tProductScanImageURIKey key2 = this.getDefaultKey();\n\t\tkey2.setId(LONG_ZERO);\n\t\tboolean equals = key1.equals(key2);\n\t\tAssert.assertTrue(equals);\n\t}",
"@Test\n\tpublic void hashCodeNullID() {\n\t\tProductScanImageURIKey key1 = this.getDefaultKey();\n\t\tProductScanImageURIKey key2 = this.getDefaultKey();\n\t\tkey1.setId(LONG_ZERO);\n\t\tAssert.assertNotEquals(key1.hashCode(), key2.hashCode());\n\t}",
"private void createEmptyOrGetProduct(final String gtin, final String language, final boolean\n useEnrichment, final boolean promptForLogin, final Runnable onPostSuccess) {\n Product product = new Product(gtin);\n product.setLanguage(language);\n ProductService.createProduct(sequentialClient, product, new PLYCompletion<Product>() {\n @Override\n public void onSuccess(Product result) {\n Log.d(\"CreateProductCallback\", \"New product with GTIN \" + gtin + \" (\" + language + \") \" +\n \"created\");\n }\n\n @Override\n public void onPostSuccess(Product result) {\n dbProduct = result;\n if (useEnrichment) {\n fillEmptyFields(result);\n }\n if (onPostSuccess != null) {\n onPostSuccess.run();\n }\n }\n\n @Override\n public void onError(PLYAndroid.QueryError error) {\n Log.d(\"CreateProductCallback\", error.getMessage());\n if (error.hasInternalErrorCode(PLYStatusCodes.NOT_INSERTED_DUPLICATE_FOUND_CODE)) {\n // product has already been created - retrieve it\n ProductService.getProductForGtin(sequentialClient, gtin, language, false, null, new\n PLYCompletion<Product>() {\n @Override\n public void onSuccess(Product result) {\n Log.d(\"GetProductCallback\", \"Got product with GTIN \" + gtin + \" (\" + language +\n \")\");\n }\n\n @Override\n public void onPostSuccess(Product result) {\n dbProduct = result;\n if (useEnrichment) {\n fillEmptyFields(result);\n }\n if (onPostSuccess != null) {\n onPostSuccess.run();\n }\n }\n\n @Override\n public void onError(PLYAndroid.QueryError error) {\n Log.d(\"GetProductCallback\", error.getMessage());\n SnackbarUtil.make(getActivity(), getView(), error.getMessage(), Snackbar\n .LENGTH_LONG).show();\n }\n\n @Override\n public boolean promptForLogin() {\n return promptForLogin;\n }\n });\n }\n }\n\n @Override\n public boolean promptForLogin() {\n return promptForLogin;\n }\n });\n }",
"String getProduct();",
"@Test\n public void getProductDetailTest() throws ApiException {\n String productId = null;\n \n ResponseBankingProductById response = api.getProductDetail( productId );\n response.toString();\n // TODO: test validations\n }",
"public boolean addProduct(Product p) {\n// products.add(p);\n boolean prodExists = false;\n for(Product prod: products){\n if(prod.getId() == p.getId()){\n prodExists = true;\n break;\n }\n }\n if(!prodExists){\n products.add(p);\n return true;\n }\n return false;\n }",
"@Test\n public void testUpdateProductShouldSuccessWhenProductNotUpdateName() throws Exception {\n product.setName(productRequest.getName());\n when(productRepository.findOne(product.getId())).thenReturn(product);\n when(productRepository.save(product)).thenReturn(product);\n\n Map<String, Object> jsonMap = new HashMap<>();\n jsonMap.put(\"$.url\", productRequest.getUrl());\n testResponseData(RequestInfo.builder()\n .request(put(PRODUCT_DETAIL_ENDPOINT, product.getId()))\n .token(adminToken)\n .body(productRequest)\n .httpStatus(HttpStatus.OK)\n .jsonMap(jsonMap)\n .build());\n }",
"@Test\n public void sucheKategorienNull() throws Exception {\n System.out.println(\"suche Kategorien Null\");\n SaalKey saal = null;\n List<Kategorie> expResult = null;\n List<Kategorie> result = SaalHelper.sucheKategorien(saal);\n assertEquals(expResult, result);\n \n }",
"@Test\n public void getProductDetailTest() throws ApiException {\n String productId = null;\n ResponseBankingProduct response = api.getProductDetail(productId);\n\n // TODO: test validations\n }",
"CafeProduct getProductById(final Integer productId);",
"private Product getProductInCartCorrespondentTo(Product product) throws NoSuchProductException {\n Product productInCart = null;\n int index;\n try {\n index = getCategoryIndex(product.getCategory().name());\n } catch (NoSuchCategoryException e) {\n index = categoryNames.indexOf(Category.OTHER.name());\n }\n List<Product> list = shoppingCart.get(index);\n for (Product listProduct : list) {\n if (listProduct.equals(product))\n productInCart = listProduct;\n }\n if (productInCart == null)\n throw new NoSuchProductException();\n return productInCart;\n }",
"@Override\r\n\tpublic Product getProduct(String id) {\n\t\treturn null;\r\n\t}"
] | [
"0.72810507",
"0.6336856",
"0.63116515",
"0.6250027",
"0.6227852",
"0.622218",
"0.61679065",
"0.6116013",
"0.611243",
"0.6062983",
"0.6062823",
"0.6055878",
"0.5942935",
"0.5931793",
"0.5930841",
"0.59250164",
"0.580813",
"0.57873267",
"0.5780964",
"0.57698095",
"0.576151",
"0.5756687",
"0.5751104",
"0.57500905",
"0.5733993",
"0.57338333",
"0.5680157",
"0.5670077",
"0.56374484",
"0.56274635",
"0.5617037",
"0.56036323",
"0.5602893",
"0.5591899",
"0.5564213",
"0.556201",
"0.55518496",
"0.5548658",
"0.55338407",
"0.55167717",
"0.55151856",
"0.5508534",
"0.54905254",
"0.5488968",
"0.5485748",
"0.54841304",
"0.5477438",
"0.5471978",
"0.54574525",
"0.5446381",
"0.5438302",
"0.5431294",
"0.54219526",
"0.5409429",
"0.5403885",
"0.54031795",
"0.539851",
"0.5396832",
"0.5394627",
"0.5377383",
"0.5371175",
"0.5365893",
"0.53645384",
"0.5363047",
"0.53573626",
"0.53466046",
"0.53344166",
"0.53338456",
"0.53327954",
"0.53316873",
"0.5328115",
"0.532745",
"0.53265375",
"0.53238547",
"0.53205454",
"0.5311219",
"0.53095675",
"0.5306869",
"0.5305254",
"0.530366",
"0.5300436",
"0.5294266",
"0.5292848",
"0.5287601",
"0.5287515",
"0.52758497",
"0.5251405",
"0.5243896",
"0.52375925",
"0.5234596",
"0.5231167",
"0.52290297",
"0.5226012",
"0.52239674",
"0.520918",
"0.517521",
"0.5165888",
"0.5157037",
"0.51568544",
"0.51528305"
] | 0.7671421 | 0 |
Test delete when the product is added to an event | @Test
public void testDeleteProductAddedToEvent() throws Exception {
thrown.expect(ProductAlreadyLinkedException.class);
thrown.expectMessage("Product is already added to an Event");
this.product.setLinked(true);
service.delete(this.product);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void testDeleteProductShouldCorrect() throws Exception {\n // Mock method\n when(productRepository.findOne(product.getId())).thenReturn(product);\n doNothing().when(productRepository).delete(product);\n\n testResponseData(RequestInfo.builder()\n .request(delete(PRODUCT_DETAIL_ENDPOINT, product.getId()))\n .token(adminToken)\n .httpStatus(HttpStatus.OK)\n .build());\n }",
"@Test\n\tpublic void testDeleteEvent() {\n\t\tEvent event = new Event();\n\t\ttry {\n\t\t\trequest.setParameter(\"eventId\",\"1001\");\n\t\t\trequest.setParameter(\"sessionId\",\"10001\");\n\t\t\tcontroller.deleteEvent(request, response);\n\t\t\tevent = eventDao.getEvent(1001, 10001);\n\t\t\tassertEquals(0,event.getEventid());\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\n}",
"@Test\n void deleteTest() {\n Product product = new Product(\"Apple\", 10, 4);\n shoppingCart.addProducts(product.getName(), product.getPrice(), product.getQuantity());\n //when deletes two apples\n boolean result = shoppingCart.deleteProducts(product.getName(), 2);\n //then basket contains two apples\n int appleNb = shoppingCart.getQuantityOfProduct(\"Apple\");\n assertTrue(result);\n assertEquals(2, appleNb);\n }",
"@Test\n public void testRemoveProduct() {\n }",
"@Test\n void canNotDeleteTest() {\n Product product = new Product(\"Apple\", 10, 4);\n shoppingCart.addProducts(product.getName(), product.getPrice(), product.getQuantity());\n //when deletes five apples\n boolean result = shoppingCart.deleteProducts(product.getName(), 5);\n //then apples are not deleted\n int appleNb = shoppingCart.getQuantityOfProduct(\"Apple\");\n assertFalse(result);\n assertEquals(4, appleNb);\n }",
"@Test\r\n\tvoid testdeleteProductFromCart() throws Exception\r\n\t{\r\n\t\tCart cart=new Cart();\r\n\t\tcart.setProductId(1001);\r\n\t\tcartdao.addProductToCart(cart);\r\n\t\tList<Cart> l=cartdao.findAllProductsInCart();\r\n\t\tcart=cartdao.deleteProductByIdInCart(1001);\r\n\t\tassertEquals(1,l.size());\r\n\t}",
"@Test\r\n\tpublic void deleteProductDetails() {\r\n\t\tRestAssured.baseURI = \"http://localhost:9000/products\";\r\n\t\tRequestSpecification request = RestAssured.given();\r\n\t\tJSONObject requestParams = new JSONObject();\r\n\t\trequestParams.put(\"name\", \"Almond\");\r\n\t\trequest.header(\"Content-Type\", \"application/json\");\r\n\t\trequest.body(requestParams.toString());\r\n\t\tResponse response = request.delete(\"/7\");\r\n\t\tSystem.out.println(\"DELETE Responce Body ----->\" + response.asString());\r\n\t\tint statusCode = response.getStatusCode();\r\n\t\tAssert.assertEquals(statusCode, 200);\r\n\r\n\t}",
"@Test\n public void removeAlreadyDELETED() throws BusinessException {\n final ProductService productService = new ProductService();\n\n final Long pProductId = 1L;\n\n new Expectations() {\n\n {\n\n Deencapsulation.setField(productService, \"productDAO\", mockProductDAO);\n\n ProductBO productBO = new ProductBO();\n productBO.setStatus(Status.DELETED);\n mockProductDAO.get(1L);\n times = 1;\n returns(productBO);\n }\n };\n\n productService.remove(pProductId);\n }",
"@Test\n public void testSaveAndRemoveProduct() throws Exception {\n System.out.println(\"saveProduct\");\n dao.saveProduct(nonExisten);\n prs = dao.getAllProduct();\n products.add(nonExisten);\n assertArrayEquals(products.toArray(), prs.toArray());\n products.remove(nonExisten);\n dao.removeProduct(nonExisten);\n prs = dao.getAllProduct();\n assertArrayEquals(products.toArray(), prs.toArray());\n }",
"@Test\n void deletePermanentlyTest() {\n Product product = new Product(\"Apple\", 10, 4);\n shoppingCart.addProducts(product.getName(), product.getPrice(), product.getQuantity());\n //when deletes four apples\n boolean result = shoppingCart.deleteProducts(product.getName(), 4);\n //then basket does not contain any apple\n int appleNb = shoppingCart.getQuantityOfProduct(\"Apple\");\n assertTrue(result);\n assertEquals(0, appleNb);\n }",
"@Test\n public void foodDeletedGoesAway() throws Exception {\n createFood();\n // locate the food item\n\n // delete the food item\n\n // check that food item no longer locatable\n\n }",
"int deleteByExample(EventDetail eventDetail);",
"@Test\n public void deleteProduct_onProductLookup_productNotFound() {\n molecularSampleRepository.delete(testMolecularSample.getUuid());\n assertNull(entityManager.find(Product.class, testMolecularSample.getId()));\n }",
"@Test\n public void testDeleteProductShouldThrowNotFoundWhenProductNotFound() throws Exception {\n // Mock method\n when(productRepository.findOne(product.getId())).thenReturn(null);\n\n testResponseData(RequestInfo.builder()\n .request(delete(PRODUCT_DETAIL_ENDPOINT, product.getId()))\n .token(adminToken)\n .httpStatus(HttpStatus.NOT_FOUND)\n .build());\n }",
"public void deleteProduct(Supplier entity) {\n\t\t\r\n\t}",
"@Test\r\n\tpublic void remove_items() {\r\n//Go to http://www.automationpractice.com\r\n//Mouse hover on product one\r\n//Click 'Add to Cart'\r\n//Click 'Continue shopping' button\r\n//Verify Cart has text '1 Product'\r\n//Mouse hover over 'Cart 1 product' button\r\n//Verify product listed\r\n//Now mouse hover on another product\r\n//click 'Add to cart' button\r\n//Click on Porceed to checkout\r\n//Mouse hover over 'Cart 2 product' button\r\n//Verify 2 product listed now\r\n//click 'X'button for first product\r\n//Verify 1 product deleted and other remain\r\n\r\n\t}",
"public void deleteProduct() {\n deleteButton.click();\n testClass.waitTillElementIsVisible(emptyShoppingCart);\n Assert.assertEquals(\n \"Message is not the same as expected\",\n MESSAGE_EMPTY_SHOPPING_CART,\n emptyShoppingCart.getText());\n }",
"int deleteByExample(EventExample example);",
"public void deleteProduct(Product product_1) {\n\r\n\t}",
"@Override\r\n public void deleteEvent(EventBean event) throws BusinessLogicException{\n }",
"@Test\n void deleteSuccess() {\n\n UserDOA userDao = new UserDOA();\n User user = userDao.getById(1);\n String orderDescription = \"February Large Test-Tshirt Delete\";\n\n Order newOrder = new Order(orderDescription, user, \"February\");\n user.addOrder(newOrder);\n\n dao.delete(newOrder);\n List<Order> orders = dao.getByPropertyLike(\"description\", \"February Large Test-Tshirt Delete\");\n assertEquals(0, orders.size());\n }",
"@Test\n public void testRemoveItem() throws Exception {\n \n System.out.println(\"RemoveItem\");\n \n /*ShoppingCart instance = new ShoppingCart();\n Product p1 = new Product(\"Galletas\", 1.2);\n Product p2 = new Product(\"Raton\", 85.6);\n Product p3 = new Product(\"Teclado\", 5.5);\n Product p4 = new Product(\"Monitor 4K\", 550.6);\n \n instance.addItem(p1);\n instance.addItem(p2);\n instance.addItem(p3);\n instance.addItem(p4);\n \n try{\n \n instance.removeItem(p1);\n \n } catch(Exception e){\n \n fail(\"No existe\");\n \n }*/\n \n /*---------------------------------------------*/\n \n ShoppingCart instance = new ShoppingCart();\n Product p1 = new Product(\"Galletas\", 1.2);\n \n instance.addItem(p1);\n \n try{\n \n instance.removeItem(p1);\n \n } catch(Exception e){\n \n assertTrue(instance.isEmpty());\n \n }\n \n }",
"void deleteEvent(Long id);",
"@Override\r\n\tpublic int deleteProduct(Product product) {\n\t\treturn 0;\r\n\t}",
"@Test\r\n public void testDeleteRecipe() {\r\n coffeeMaker.addRecipe(recipe1);\r\n assertEquals(recipe1.getName(), coffeeMaker.deleteRecipe(0));\r\n assertNull(coffeeMaker.deleteRecipe(0)); // Test already delete recipe\r\n }",
"@Override\n\tpublic void deleteProduct(int product_id) {\n\n\t}",
"@Test\n public void testRemovePositive() throws Exception{\n Item item = new Item();\n item.setName(\"item\");\n item.setType(ItemTypes.ALCOHOLIC_BEVERAGE);\n itemDao.create(item);\n\n Assert.assertTrue(itemDao.delete(item.getName()));\n Assert.assertNull(itemDao.read(item.getName()));\n }",
"void delete(Product product) throws IllegalArgumentException;",
"public void handleDeleteProducts()\n {\n Product productToDelete = getProductToModify();\n\n if (productToDelete != null)\n {\n // Ask user for confirmation to remove the product from product table\n Alert alert = new Alert(Alert.AlertType.CONFIRMATION);\n alert.setTitle(\"Confirmation\");\n alert.setHeaderText(\"Delete Confirmation\");\n alert.setContentText(\"Are you sure you want to delete this product?\");\n ButtonType confirm = new ButtonType(\"Yes\", ButtonBar.ButtonData.YES);\n ButtonType deny = new ButtonType(\"No\", ButtonBar.ButtonData.NO);\n ButtonType cancel = new ButtonType(\"Cancel\", ButtonBar.ButtonData.CANCEL_CLOSE);\n alert.getButtonTypes().setAll(confirm, deny, cancel);\n alert.showAndWait().ifPresent(type ->{\n if (type == confirm)\n {\n // User cannot delete products with associated parts\n if (productToDelete.getAllAssociatedParts().size() > 0)\n {\n Alert alert2 = new Alert(Alert.AlertType.ERROR);\n alert2.setTitle(\"Action is Forbidden!\");\n alert2.setHeaderText(\"Action is Forbidden!\");\n alert2.setContentText(\"Products with associated parts cannot be deleted!\\n \" +\n \"Please remove associated parts from product and try again!\");\n alert2.show();\n }\n else\n {\n // delete the product\n inventory.deleteProduct(productToDelete);\n updateProducts();\n productTable.getSelectionModel().clearSelection();\n }\n }\n });\n }\n else\n {\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Input Invalid\");\n alert.setHeaderText(\"No product was selected!\");\n alert.setContentText(\"Please select a product to delete from the part table!\");\n alert.show();\n }\n this.productTable.getSelectionModel().clearSelection();\n }",
"@Test\n void deleteItem() {\n }",
"@FXML\n\tpublic void deleteProduct(ActionEvent event) {\n\t\tif (!txtDeleteProductName.getText().equals(\"\")) {\n\t\t\ttry {\n\n\t\t\t\tList<Product> productToDelete = restaurant.findSameProduct(txtDeleteProductName.getText());\n\t\t\t\tboolean delete = restaurant.deleteProduct(txtDeleteProductName.getText());\n\t\t\t\tif (delete == true) {\n\t\t\t\t\tfor (int i = 0; i < productOptions.size(); i++) {\n\t\t\t\t\t\tfor (int j = 0; j < productToDelete.size(); j++) {\n\t\t\t\t\t\t\tif (productOptions.get(i) != null && productOptions.get(i)\n\t\t\t\t\t\t\t\t\t.equalsIgnoreCase(productToDelete.get(j).getReferenceId())) {\n\t\t\t\t\t\t\t\tproductOptions.remove(productToDelete.get(j).getReferenceId());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\ttxtDeleteProductName.setText(\"\");\n\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\tDialog<String> dialog = createDialog();\n\t\t\t\tdialog.setContentText(\"No se pudo guardar la actualización de los productos\");\n\t\t\t\tdialog.setTitle(\"Error guardar datos\");\n\t\t\t\tdialog.show();\n\t\t\t}\n\t\t} else {\n\t\t\tDialog<String> dialog = createDialog();\n\t\t\tdialog.setContentText(\"Los campos deben ser llenados\");\n\t\t\tdialog.setTitle(\"Error, Campo sin datos\");\n\t\t\tdialog.show();\n\t\t}\n\t}",
"@Test\n public void testRemoveEventConvinienceMethodWithCustomEventProvider() {\n calendar.setEventProvider(new ContainerEventProvider(new com.vaadin.v7.data.util.BeanItemContainer<BasicEvent>(BasicEvent.class)));\n // Start and end dates to query for\n java.util.Calendar cal = getInstance();\n Date start = cal.getTime();\n cal.add(MONTH, 1);\n Date end = cal.getTime();\n // Ensure no events\n Assert.assertEquals(0, calendar.getEvents(start, end).size());\n // Add an event\n BasicEvent event = new BasicEvent(\"Test\", \"Test\", start);\n calendar.addEvent(event);\n // Ensure event exists\n List<CalendarEvent> events = calendar.getEvents(start, end);\n Assert.assertEquals(1, events.size());\n // Remove event\n calendar.removeEvent(event);\n // Ensure no events\n Assert.assertEquals(0, calendar.getEvents(start, end).size());\n }",
"void deleteProduct(Integer productId);",
"@FXML\n\t private void deleteProduct (ActionEvent actionEvent) throws SQLException, ClassNotFoundException {\n\t try {\n\t ProductDAO.deleteProdWithId(prodIdText.getText());\n\t resultArea.setText(\"Product deleted! Product id: \" + prodIdText.getText() + \"\\n\");\n\t } catch (SQLException e) {\n\t resultArea.setText(\"Problem occurred while deleting product \" + e);\n\t throw e;\n\t }\n\t }",
"@Test\n public void deleteIngredient_Deletes(){\n int returned = testDatabase.addIngredient(ingredient);\n testDatabase.deleteIngredient(returned);\n assertEquals(\"deleteIngredient - Deletes From Database\",null, testDatabase.getIngredient(returned));\n }",
"public void Deleteproduct(Product objproduct) {\n\t\t\n\t}",
"@Test\n public void testDeleteItem() throws Exception {\n\n Tracker tracker = new Tracker();\n\n String action = \"0\";\n String yes = \"y\";\n String no = \"n\";\n\n // add first item\n\n String name1 = \"task1\";\n String desc1 = \"desc1\";\n String create1 = \"3724\";\n\n Input input1 = new StubInput(new String[]{action, name1, desc1, create1, yes});\n new StartUI(input1).init(tracker);\n\n // add second item\n\n String name2 = \"task2\";\n String desc2 = \"desc2\";\n String create2 = \"97689\";\n\n Input input2 = new StubInput(new String[]{action, name2, desc2, create2, yes});\n new StartUI(input2).init(tracker);\n\n // get first item id\n\n String id = \"\";\n\n Filter filter = new FilterByName(name1);\n Item[] result = tracker.findBy(filter);\n for (Item item : result) {\n if (item !=null && item.getName().equals(name1)) {\n id = item.getId();\n break;\n }\n }\n\n // delete first item\n\n String action2 = \"2\";\n\n Input input3 = new StubInput(new String[]{action2, id, yes});\n new StartUI(input3).init(tracker);\n\n Assert.assertNull(tracker.findById(id));\n }",
"public void verifyProduct() throws Throwable{\r\n\t\twdlib.waitForElement(getProductText());\r\n\t\t\r\n\t\tif(!getProductText().getText().equals(\"None Included\"))\r\n\t\t{\r\n\t\t\tReporter.log(getProductText().getText()+\" was deleted\",true);\r\n\t\t\tdeleteProduct();\r\n\t\t}\r\n\t\t\r\n\t}",
"void deleteProduct(int productId) throws ProductException;",
"@Test\n\tpublic void testDelete(){\n\t}",
"@Test\n\tpublic void testDeleteCart() {\n\t}",
"@FXML\n\tprivate void deleteButtonAction(ActionEvent clickEvent) {\n\t\t\n\t\tPart deletePartFromProduct = partListProductTable.getSelectionModel().getSelectedItem();\n\t\t\n\t\tif (deletePartFromProduct != null) {\n\t\t\t\n\t\t\tAlert alert = new Alert(Alert.AlertType.CONFIRMATION, \"Pressing OK will remove the part from the product.\\n\\n\" + \"Are you sure you want to remove the part?\");\n\t\t\n\t\t\tOptional<ButtonType> result = alert.showAndWait();\n\t\t\n\t\t\tif (result.isPresent() && result.get() == ButtonType.OK) {\n\t\t\t\n\t\t\t\tdummyList.remove(deletePartFromProduct);\n\n\t\t\t}\n\t\t}\n\t}",
"void deleteProduct(Long id);",
"@Test\n public void remove() throws BusinessException {\n final ProductService productService = new ProductService();\n\n final Long pProductId = 1L;\n\n new Expectations() {\n\n {\n\n Deencapsulation.setField(productService, \"productDAO\", mockProductDAO);\n\n PartialUserBO writer = new PartialUserBO();\n writer.setId(1L);\n ProductBO product = new ProductBO();\n product.setId(1L);\n\n Date now = new Date();\n\n ProductBO productBO = new ProductBO();\n productBO.setId(1L);\n productBO.setStatus(Status.CREATED);\n\n mockProductDAO.get(1L);\n times = 1;\n returns(productBO);\n\n ProductBO productBOExpected = new ProductBO();\n productBOExpected.setId(1L);\n productBOExpected.setStatus(Status.DELETED);\n\n mockProductDAO.update(with(productBOExpected, new ProductBOMatcher(productBOExpected)));\n }\n };\n\n productService.remove(pProductId);\n }",
"private void delete() {\n\t\tComponents.questionDialog().message(\"Are you sure?\").callback(answeredYes -> {\n\n\t\t\t// if confirmed, delete the current product PropertyBox\n\t\t\tdatastore.delete(TARGET, viewForm.getValue());\n\t\t\t// Notify the user\n\t\t\tNotification.show(\"Product deleted\", Type.TRAY_NOTIFICATION);\n\n\t\t\t// navigate back\n\t\t\tViewNavigator.require().navigateBack();\n\n\t\t}).open();\n\t}",
"@Test\n public void myMetingList_deleteAction_shouldRemoveItem() {\n // Given : We remove the element at position 1\n onView(ViewMatchers.withId(R.id.recyclerview)).check(withItemCount(ITEMS_COUNT));\n // When perform a click on a delete icon\n onView(ViewMatchers.withId(R.id.recyclerview))\n .perform(RecyclerViewActions.actionOnItemAtPosition(1, new DeleteViewAction()));\n // Then : the number of element is 1\n onView(ViewMatchers.withId(R.id.recyclerview)).check(withItemCount(ITEMS_COUNT-1));\n }",
"public void deleteProduct()\n {\n ObservableList<Product> productRowSelected;\n productRowSelected = productTableView.getSelectionModel().getSelectedItems();\n int index = productTableView.getSelectionModel().getFocusedIndex();\n Product product = productTableView.getItems().get(index);\n if(productRowSelected.isEmpty())\n {\n alert.setAlertType(Alert.AlertType.ERROR);\n alert.setContentText(\"Please select the Product you want to delete.\");\n alert.show();\n } else if (!product.getAllAssociatedParts().isEmpty())\n {\n alert.setAlertType(Alert.AlertType.ERROR);\n alert.setContentText(\"This Product still has a Part associated with it. \\n\" +\n \"Please modify the Product and remove the Part.\");\n alert.show();\n } else {\n alert.setAlertType(Alert.AlertType.CONFIRMATION);\n alert.setContentText(\"Are you sure you want to delete this Product?\");\n alert.showAndWait();\n ButtonType result = alert.getResult();\n if(result == ButtonType.OK)\n {\n Inventory.deleteProduct(product);\n }\n }\n }",
"@Override\n\tpublic void doDelete(String product) throws SQLException {\n\t\t\n\t}",
"@Test\n public void deleteRecipeIngredient_Deletes(){\n int returnedRecipe = testDatabase.addRecipe(testRecipe);\n int returnedIngredient = testDatabase.addRecipeIngredient(recipeIngredient);\n testDatabase.deleteRecipeIngredients(returnedIngredient);\n ArrayList<RecipeIngredient> allIngredients = testDatabase.getAllRecipeIngredients(returnedRecipe);\n boolean deleted = true;\n if(allIngredients != null){\n for(int i = 0; i < allIngredients.size(); i++){\n if(allIngredients.get(i).getIngredientID() == returnedIngredient){\n deleted = false;\n }\n }\n }\n assertEquals(\"deleteRecipeIngredient - Deletes From Database\", true, deleted);\n }",
"@Test\n public void deleteRecipe_Deletes(){\n int returned = testDatabase.addRecipe(testRecipe);\n testDatabase.deleteRecipe(returned);\n assertEquals(\"deleteRecipe - Deletes From Database\", null, testDatabase.getRecipe(returned));\n }",
"private boolean deleteProduct(String code, String name , String brand , String price , String quantity) {\n DatabaseReference dR = FirebaseDatabase.getInstance().getReference().child(code);\n\n //removing artist\n Information information = new Information(code, name ,brand ,price ,quantity);\n dR.removeValue((DatabaseReference.CompletionListener) information);\n\n //getting the tracks reference for the specified artist\n //DatabaseReference drTracks = FirebaseDatabase.getInstance().getReference(\"tracks\").child(id);\n\n //removing all tracks\n //drTracks.removeValue();\n Toast.makeText(getApplicationContext(), \"product Deleted\", Toast.LENGTH_LONG).show();\n\n return true;\n }",
"public void onActionDeleteProduct(ActionEvent actionEvent) throws IOException {\r\n\r\n try {\r\n Alert alert = new Alert(Alert.AlertType.CONFIRMATION, \"Are you sure you want to delete the selected item?\");\r\n\r\n Optional<ButtonType> result = alert.showAndWait();\r\n if (result.isPresent() && result.get() == ButtonType.OK) {\r\n\r\n if (productsTableView.getSelectionModel().getSelectedItem() != null) {\r\n Product product = productsTableView.getSelectionModel().getSelectedItem();\r\n if (product.getAllAssociatedParts().size() == 0) {\r\n\r\n Inventory.deleteProduct(productsTableView.getSelectionModel().getSelectedItem());\r\n Parent root = FXMLLoader.load(getClass().getResource(\"/View_Controller/mainScreen.fxml\"));\r\n Stage stage = (Stage) ((Node) actionEvent.getSource()).getScene().getWindow();\r\n Scene scene = new Scene(root, 1062, 498);\r\n stage.setTitle(\"Main Screen\");\r\n stage.setScene(scene);\r\n stage.show();\r\n } else {\r\n Alert alert2 = new Alert(Alert.AlertType.ERROR);\r\n alert2.setContentText(\"Products with associated parts cannot be deleted.\");\r\n alert2.showAndWait();\r\n }\r\n }\r\n else {\r\n Alert alert3 = new Alert(Alert.AlertType.ERROR);\r\n alert3.setContentText(\"Click on an item to delete.\");\r\n alert3.showAndWait();\r\n }\r\n }\r\n }\r\n catch (NullPointerException n) {\r\n //ignore\r\n }\r\n }",
"private static void deleteTest(int no) {\n\t\tboolean result=new CartDao().delete(no);\r\n\t\tif(!result) System.out.println(\"deleteTest fail\");\r\n\t}",
"@Test\r\n public void testDelete() {\r\n assertTrue(false);\r\n }",
"public void deleteProduct(Product product) throws BackendException;",
"@Test\n public void deleteEspecieTest() throws BusinessLogicException {\n EspecieEntity entity = especieData.get(1);\n System.out.println(entity.getId());\n System.out.println(entity.getRazas().size());\n especieLogic.deleteEspecie(entity.getId());\n EspecieEntity deleted = em.find(EspecieEntity.class, entity.getId());\n Assert.assertTrue(deleted.getDeleted());\n }",
"@Override\r\n\tpublic boolean deleteProduct(ProductDAO product) {\n\t\treturn false;\r\n\t}",
"void removeProduct(Product product);",
"public void deleteEvent() {\r\n database.eventDao().delete(event.uid);\r\n finish();\r\n }",
"public void deleteByEventId(Long eventId) {\n\r\n\t}",
"public void testDelete() {\n TDelete_Return[] Basket_delete_out = basketService.delete(new String[] { BasketPath });\n assertNoError(Basket_delete_out[0].getError());\n }",
"@Test\n void removeItem() {\n\n }",
"@Override\r\n\tpublic void fireModelDeleteProduct(String msg) {\n\t\t\r\n\t}",
"@Test\n void removeItem() {\n }",
"boolean beforeDelete(T resource, boolean sendDataToAmazon);",
"@Test \r\n\tpublic void testSacarProductoDelPedidoSinStock(){\n\t\tventaAD.agregarProductoSinStock(pre1, 1);\r\n\t\tventaAD.sacarProductosDelLosPedidosSinStock(pre1, 1);\r\n\t\tassertEquals(ventaAD.getProductosSinStock().size(), 0);\r\n\t\t\r\n\t}",
"@Test\n public void deleteRecipeIngredient_ReturnsTrue(){\n int returned = testDatabase.addRecipe(testRecipe);\n assertEquals(\"deleteRecipeIngredient - Returns True\",true, testDatabase.deleteRecipeIngredients(returned));\n }",
"@Test\n\tvoid testDeletePlant() {\n\t\tList<Plant> plant = service.deletePlant(50);\n\t\tassertFalse(plant.isEmpty());\n\t}",
"@Test\n public void deleteTarjetaPrepagoTest() throws BusinessLogicException \n {\n TarjetaPrepagoEntity entity = data.get(2);\n tarjetaPrepagoLogic.deleteTarjetaPrepago(entity.getId());\n TarjetaPrepagoEntity deleted = em.find(TarjetaPrepagoEntity.class, entity.getId());\n Assert.assertNull(deleted);\n }",
"@Test\n public void testCreateProductShouldCorrect() throws Exception {\n when(productRepository.existsByName(productRequest.getName())).thenReturn(false);\n when(productRepository.save(any(Product.class))).thenReturn(product);\n\n testResponseData(RequestInfo.builder()\n .request(post(PRODUCT_ENDPOINT))\n .token(adminToken)\n .body(productRequest)\n .httpStatus(HttpStatus.OK)\n .build());\n }",
"@FXML\r\n void onActionDeletePart(ActionEvent event) {\r\n\r\n Part part = TableView2.getSelectionModel().getSelectedItem();\r\n if(part == null)\r\n return;\r\n\r\n //EXCEPTION SET 2 REQUIREMENT\r\n Alert alert = new Alert(Alert.AlertType.CONFIRMATION);\r\n alert.setHeaderText(\"You are about to delete the product you have selected!\");\r\n alert.setContentText(\"Are you sure you wish to continue?\");\r\n\r\n Optional<ButtonType> result = alert.showAndWait();\r\n if (result.get() == ButtonType.OK){\r\n product.deleteAssociatedPart(part.getId());\r\n }\r\n }",
"@Test(expected = BusinessException.class)\n public void removeArchived() throws BusinessException {\n final ProductService productService = new ProductService();\n\n final Long pProductId = 1L;\n\n new Expectations() {\n\n {\n\n Deencapsulation.setField(productService, \"productDAO\", mockProductDAO);\n\n ProductBO productBO = new ProductBO();\n productBO.setStatus(Status.ARCHIVED);\n mockProductDAO.get(1L);\n times = 1;\n returns(productBO);\n }\n };\n\n productService.remove(pProductId);\n }",
"public void clickDeleteProductandApply()throws Exception{\r\n SearchPageFactory pageFactory = new SearchPageFactory(driver);\r\n clickElement(pageFactory.wishListItemDeleteButton,Constant.explicitTime);\r\n clickElement(pageFactory.wishListItemDeleteOkButton,Constant.explicitTime);\r\n }",
"@Test\n public void removeTest() {\n reservation3.setId(14L);\n reservationService.remove(reservation3);\n Mockito.verify(reservationDao, Mockito.times(1)).remove(reservation3);\n }",
"@Override\r\n\tpublic void excluir(Evento evento) {\n\t\trepository.delete(evento);\r\n\t}",
"@Test\n public void testHandleBtnExcluir() throws Exception {\n }",
"@Test\n\tpublic void testProcessInventoryUpdateOrderAdjustmentRemoveSku() {\n\t\tfinal Inventory inventory = new InventoryImpl();\n\t\tinventory.setUidPk(INVENTORY_UID_1000);\n\t\tinventory.setQuantityOnHand(QUANTITY_ONHAND);\n\t\tinventory.setWarehouseUid(WAREHOUSE_UID);\n\t\tfinal ProductSku productSku = new ProductSkuImpl();\n\t\tproductSku.setSkuCode(SKU_CODE);\n\t\tfinal ProductImpl product = new ProductImpl();\n\t\tproduct.setAvailabilityCriteria(AvailabilityCriteria.AVAILABLE_WHEN_IN_STOCK);\n\t\tproductSku.setProduct(product);\n\n\t\tinventory.setSkuCode(productSku.getSkuCode());\n\n\t\tfinal Order order = new OrderImpl();\n\t\torder.setUidPk(ORDER_UID_2000);\n\n\t\tfinal InventoryJournalRollupImpl ijRollup = new InventoryJournalRollupImpl();\n\t\tijRollup.setAllocatedQuantityDelta(QUANTITY_10);\n\n\n\t\tcontext.checking(new Expectations() {\n\t\t\t{\n\t\t\t\tInventoryJournalImpl inventoryJournal = new InventoryJournalImpl();\n\t\t\t\toneOf(beanFactory).getBean(INVENTORY_JOURNAL); will(returnValue(inventoryJournal));\n\t\t\t\tallowing(beanFactory).getBean(EXECUTION_RESULT); will(returnValue(new InventoryExecutionResultImpl()));\n\n\t\t\t\tallowing(inventoryDao).getInventory(SKU_CODE, WAREHOUSE_UID); will(returnValue(inventory));\n\t\t\t\tallowing(inventoryJournalDao).getRollup(inventoryKey); will(returnValue(ijRollup));\n\t\t\t\toneOf(inventoryJournalDao).saveOrUpdate(inventoryJournal); will(returnValue(new InventoryJournalImpl()));\n\t\t\t}\n\t\t});\n\t\tproductInventoryManagementService.processInventoryUpdate(\n\t\t\t\tproductSku, 1,\tInventoryEventType.STOCK_ALLOCATE, EVENT_ORIGINATOR_TESTER,\tQUANTITY_10, order, null);\n\n\t\tInventoryDto inventoryDto = productInventoryManagementService.getInventory(inventory.getSkuCode(), inventory.getWarehouseUid());\n\n\t\tassertEquals(inventoryDto.getQuantityOnHand(), QUANTITY_ONHAND);\n\t\tassertEquals(inventoryDto.getAvailableQuantityInStock(), QUANTITY_ONHAND - QUANTITY_10);\n\t\tassertEquals(inventoryDto.getAllocatedQuantity(), QUANTITY_10);\n\n\t\tfinal Inventory inventory2 = assembler.assembleDomainFromDto(inventoryDto);\n\t\tfinal InventoryJournalRollupImpl ijRollup2 = new InventoryJournalRollupImpl();\n\t\tijRollup2.setAllocatedQuantityDelta(QUANTITY_NEG_10);\n\n\t\tfinal InventoryDao inventoryDao2 = context.mock(InventoryDao.class, INVENTORY_DAO2);\n\t\tfinal InventoryJournalDao inventoryJournalDao2 = context.mock(InventoryJournalDao.class, INVENTORY_JOURNAL_DAO2);\n\n\t\tjournalingInventoryStrategy.setInventoryDao(inventoryDao2);\n\t\tjournalingInventoryStrategy.setInventoryJournalDao(inventoryJournalDao2);\n\n\t\tcontext.checking(new Expectations() {\n\t\t\t{\n\t\t\t\tInventoryJournalImpl inventoryJournal = new InventoryJournalImpl();\n\t\t\t\toneOf(beanFactory).getBean(INVENTORY_JOURNAL); will(returnValue(inventoryJournal));\n\t\t\t\tallowing(beanFactory).getBean(EXECUTION_RESULT); will(returnValue(new InventoryExecutionResultImpl()));\n\t\t\t\tallowing(inventoryDao2).getInventory(SKU_CODE, WAREHOUSE_UID); will(returnValue(inventory2));\n\t\t\t\tallowing(inventoryJournalDao2).getRollup(inventoryKey); will(returnValue(ijRollup2));\n\t\t\t\toneOf(inventoryJournalDao2).saveOrUpdate(inventoryJournal); will(returnValue(new InventoryJournalImpl()));\n\t\t\t}\n\t\t});\n\n\t\tproductInventoryManagementService.processInventoryUpdate(\n\t\t\t\tproductSku, WAREHOUSE_UID,\tInventoryEventType.STOCK_DEALLOCATE, EVENT_ORIGINATOR_TESTER, QUANTITY_10, order, null);\n\n\t\tinventoryDto = productInventoryManagementService.getInventory(inventory2.getSkuCode(), inventory2.getWarehouseUid());\n\t\tassertEquals(QUANTITY_ONHAND, inventoryDto.getQuantityOnHand());\n\t\tassertEquals(QUANTITY_ONHAND, inventoryDto.getAvailableQuantityInStock());\n\t\tassertEquals(QUANTITY_0, inventoryDto.getAllocatedQuantity());\n\t}",
"@Command(\"delete\")\n @NotifyChange({\"events\", \"selectedEvent\"})\n public void delete() {\n if(this.selectedEvent != null) {\n eventDao.delete(this.selectedEvent);\n this.selectedEvent = null;\n }\n }",
"@FXML private void handleAddProdDelete(ActionEvent event) {\n Part partDeleting = fxidAddProdSelectedParts.getSelectionModel().getSelectedItem();\n \n if (partDeleting != null) {\n //Display Confirm Box\n Alert confirmDelete = new Alert(Alert.AlertType.CONFIRMATION);\n confirmDelete.setHeaderText(\"Are you sure?\");\n confirmDelete.setContentText(\"Are you sure you want to remove the \" + partDeleting.getName() + \" part?\");\n Optional<ButtonType> result = confirmDelete.showAndWait();\n //If they click OK\n if (result.get() == ButtonType.OK) {\n //Delete the part.\n partToSave.remove(partDeleting);\n //Refresh the list view.\n fxidAddProdSelectedParts.setItems(partToSave);\n\n Alert successDelete = new Alert(Alert.AlertType.CONFIRMATION);\n successDelete.setHeaderText(\"Confirmation\");\n successDelete.setContentText(partDeleting.getName() + \" has been removed from product.\");\n successDelete.showAndWait();\n }\n } \n }",
"@Test\n public void deletion() {\n repo.addDocument(\"test1\", \"{\\\"test\\\":1}\", \"arthur\", \"test version 1\", false);\n repo.addDocument(\"test1\", \"{\\\"test\\\":2}\", \"arthur\", \"this is version 2\", false);\n repo.removeDocument(\"test1\", \"arthur\", \"removal\");\n\n String result = repo.getDocument(\"test1\");\n assertTrue(result == null);\n\n }",
"@Test\n\tpublic void deleteOrderLineProduct() {\n\t\t// TODO: JUnit - Populate test inputs for operation: deleteOrderLineProduct \n\t\tInteger orderline_id_1 = 0;\n\t\tInteger related_product_id = 0;\n\t\tOrderLine response = null;\n\t\tresponse = service.deleteOrderLineProduct(orderline_id_1, related_product_id);\n\t\t// TODO: JUnit - Add assertions to test outputs of operation: deleteOrderLineProduct\n\t}",
"@Test\n public void deleteItem() {\n Item item = new Item();\n item.setName(\"Drill\");\n item.setDescription(\"Power Tool\");\n item.setDaily_rate(new BigDecimal(\"24.99\"));\n item = service.saveItem(item);\n\n // Delete the Item from the database using the Item API method\n service.removeItem(item.getItem_id());\n\n // Test the deleteItem() method\n verify(itemDao, times(1)).deleteItem(integerArgumentCaptor.getValue());\n TestCase.assertEquals(item.getItem_id(), integerArgumentCaptor.getValue().intValue());\n }",
"@Test\n public void deleteIngredient_ReturnsTrue(){\n int returned = testDatabase.addIngredient(ingredient);\n assertEquals(\"deleteIngredient - Returns True\",true, testDatabase.deleteIngredient(returned));\n }",
"void deleteEvent(ReadOnlyEvent target) throws EventNotFoundException;",
"@Override\n\tpublic int deleteEventFromEventSignUpDAO(EventSignUp e) {\n\t\treturn 0;\n\t}",
"@Test\n public void triggeredForCatalogItemTest() {\n // TODO: test triggeredForCatalogItem\n }",
"@Test\n public void deleteOrderTest() {\n Long orderId = 10L;\n api.deleteOrder(orderId);\n\n verify(exactly(1), deleteRequestedFor(urlEqualTo(\"/store/order/10\")));\n }",
"@Override\n\tpublic int delete(ProductDTO dto) {\n\t\treturn 0;\n\t}",
"@Test\n public void testCreateUpdateDeleteEntity() throws Exception {\n final Olingo4AppAPITest.TestOlingo4ResponseHandler<ClientEntity> entryHandler = new Olingo4AppAPITest.TestOlingo4ResponseHandler<>();\n Olingo4AppAPITest.olingoApp.create(Olingo4AppAPITest.edm, Olingo4AppAPITest.PEOPLE, null, createEntity(), entryHandler);\n ClientEntity createdEntity = entryHandler.await();\n Olingo4AppAPITest.LOG.info(\"Created Entity: {}\", Olingo4AppAPITest.prettyPrint(createdEntity));\n final Olingo4AppAPITest.TestOlingo4ResponseHandler<HttpStatusCode> statusHandler = new Olingo4AppAPITest.TestOlingo4ResponseHandler<>();\n ClientEntity updateEntity = createEntity();\n updateEntity.getProperties().add(objFactory.newPrimitiveProperty(\"MiddleName\", objFactory.newPrimitiveValueBuilder().buildString(\"Middle\")));\n Olingo4AppAPITest.olingoApp.update(Olingo4AppAPITest.edm, Olingo4AppAPITest.TEST_CREATE_PEOPLE, null, updateEntity, statusHandler);\n statusHandler.await();\n statusHandler.reset();\n updateEntity = createEntity();\n updateEntity.getProperties().add(objFactory.newPrimitiveProperty(\"MiddleName\", objFactory.newPrimitiveValueBuilder().buildString(\"Middle Patched\")));\n Olingo4AppAPITest.olingoApp.patch(Olingo4AppAPITest.edm, Olingo4AppAPITest.TEST_CREATE_PEOPLE, null, updateEntity, statusHandler);\n statusHandler.await();\n entryHandler.reset();\n Olingo4AppAPITest.olingoApp.read(Olingo4AppAPITest.edm, Olingo4AppAPITest.TEST_CREATE_PEOPLE, null, null, entryHandler);\n ClientEntity updatedEntity = entryHandler.await();\n Olingo4AppAPITest.LOG.info(\"Updated Entity successfully: {}\", Olingo4AppAPITest.prettyPrint(updatedEntity));\n statusHandler.reset();\n Olingo4AppAPITest.olingoApp.delete(Olingo4AppAPITest.TEST_CREATE_PEOPLE, null, statusHandler);\n HttpStatusCode statusCode = statusHandler.await();\n Olingo4AppAPITest.LOG.info(\"Deletion of Entity was successful: {}: {}\", statusCode.getStatusCode(), statusCode.getInfo());\n try {\n Olingo4AppAPITest.LOG.info(\"Verify Delete Entity\");\n entryHandler.reset();\n Olingo4AppAPITest.olingoApp.read(Olingo4AppAPITest.edm, Olingo4AppAPITest.TEST_CREATE_PEOPLE, null, null, entryHandler);\n entryHandler.await();\n Assert.fail(\"Entity not deleted!\");\n } catch (Exception e) {\n Olingo4AppAPITest.LOG.info(\"Deleted entity not found: {}\", e.getMessage());\n }\n }",
"@Test\r\n public void testDeleteNonExistRecipe() {\r\n assertNull(coffeeMaker.deleteRecipe(1)); // Test do not exist recipe\r\n }",
"@Test\r\n\tvoid testAppointmentServiceClassDeleteAppointment() {\r\n\t\tAppointmentService appointmentService = new AppointmentService();\r\n\t\tAppointment temp = new Appointment(\"23456\", new Date(), \"This is a description\");\r\n\t\tappointmentService.addAppointment(temp);\r\n\t\tappointmentService.deleteAppointment(\"23456\");\r\n\t\tassertFalse(appointmentService.getAppointments().containsValue(temp));\r\n\t}",
"@Test\r\n\tvoid DeleteProductByID() throws SQLException {\r\n\t\tString IDExistentInDB = \"d228b297-f4a2-4a91-823d-317c3926def8\";\r\n\r\n\t\tProductRepository repo = new ProductRepository();\r\n\t\tint productDelete = repo.deleteProduct(IDExistentInDB);\r\n\r\n\t\tAssertions.assertEquals(1, productDelete, \"The Product has not been deleted\");\r\n\t}",
"@Test\n\tpublic void updateProductTest2() throws Exception {\n Attribute attr1 = ProductAttributeGenerator.generate(Generator.randomString(6, Generator.AlphaChars), \"Date\", \"AdminEntered\", \"Datetime\", false, false, true);\n Attribute createdAttr = AttributeFactory.addAttribute(apiContext, attr1, HttpStatus.SC_CREATED);\n \n\t\t\n\t //update product type\n ProductType myPT = ProductTypeGenerator.generate(createdAttr, Generator.randomString(5, Generator.AlphaChars));\n ProductType createdPT = ProductTypeFactory.addProductType(apiContext, DataViewMode.Live, myPT, HttpStatus.SC_CREATED);\n \n Product myProduct = ProductGenerator.generate(createdPT);\n List<ProductPropertyValue> salePriceDateValue = new ArrayList<ProductPropertyValue>();\n ProductPropertyValue salePriceValue = new ProductPropertyValue();\n DateTime date = DateTime.now();\n salePriceValue.setValue(date);\n salePriceDateValue.add(salePriceValue);\n myProduct.getProperties().get(myProduct.getProperties().size()-1).setValues(salePriceDateValue);\n Product createdProduct = ProductFactory.addProduct(apiContext, DataViewMode.Live, myProduct, HttpStatus.SC_CREATED);\n\t}",
"@Override\n\tpublic void delete(Recipe entity) {\n\t\t\n\t}",
"@Test\n public void testRemoveAnOrder() {\n OrderOperations instance = new OrderOperations();\n int orderNumber = 1;\n String date = \"03251970\";\n String customerName = \"Barack\";\n String state = \"MI\";\n String productType = \"Wood\";\n double area = 700;\n ApplicationContext ctx = new ClassPathXmlApplicationContext(\"applicationContext.xml\");\n DAOInterface testInterface = (DAOInterface) ctx.getBean(\"productionMode\");\n String productInfo, taxes;\n try {\n productInfo = testInterface.readFromDisk(\"productType.txt\");\n } catch (FileNotFoundException e) {\n productInfo = \"\";\n }\n\n try {\n taxes = testInterface.readFromDisk(\"taxes.txt\");\n } catch (FileNotFoundException e) {\n taxes = \"\";\n }\n instance.addOrder(customerName, date, state, productType, area, taxes, productInfo);\n assertEquals(instance.getOrderMap().get(date).size(), 1);\n instance.removeAnOrder(date, orderNumber, \"y\");\n assertEquals(instance.getOrderMap().get(date).size(), 0);\n \n }",
"@Test\n void delete() {\n }",
"@Test\n void delete() {\n }",
"@Test\n public void deleteEmpleadoTest() {\n \n try{ \n EmpleadoEntity entity = data.get(3);\n empleadoLogic.deleteEmpleado(entity.getId());\n EmpleadoEntity deleted = em.find(EmpleadoEntity.class, entity.getId());\n Assert.assertNull(deleted);\n \n }catch(BusinessLogicException b){\n Assert.fail();\n }\n }",
"public void buttonDelete(ActionEvent event) {\n\t\tObservableList<Player> allProduct, SinglePlayer;\n\t\tallProduct = tableview.getItems();\n\t\tSinglePlayer = tableview.getSelectionModel().getSelectedItems();\n\t\tSinglePlayer.forEach(allProduct::remove);\n\t}",
"void deleteProduct(Product product) throws ServiceException;"
] | [
"0.69519454",
"0.6876556",
"0.6837106",
"0.6810867",
"0.6581527",
"0.6581084",
"0.649542",
"0.6474175",
"0.6469474",
"0.6452925",
"0.6398238",
"0.6397354",
"0.63369435",
"0.6334244",
"0.63256127",
"0.6321053",
"0.6306126",
"0.6303876",
"0.62893015",
"0.6288236",
"0.6250406",
"0.62460804",
"0.6245686",
"0.62386405",
"0.6229829",
"0.6210445",
"0.6204649",
"0.6198683",
"0.6187122",
"0.61806005",
"0.61783546",
"0.6167677",
"0.61544114",
"0.61235243",
"0.6116597",
"0.6113719",
"0.6109082",
"0.60855794",
"0.606159",
"0.6058398",
"0.60576093",
"0.60463774",
"0.6042425",
"0.60292846",
"0.602763",
"0.6018017",
"0.6016776",
"0.5997819",
"0.59939337",
"0.599303",
"0.5981713",
"0.5981604",
"0.59779257",
"0.59525925",
"0.594676",
"0.5944941",
"0.593357",
"0.59209627",
"0.5909951",
"0.5904047",
"0.5903268",
"0.5902431",
"0.5901811",
"0.5886489",
"0.58851534",
"0.58845556",
"0.58839905",
"0.588277",
"0.5872973",
"0.5871143",
"0.58673424",
"0.5861915",
"0.5861165",
"0.5856858",
"0.5851215",
"0.5851043",
"0.58460164",
"0.58458066",
"0.5845649",
"0.58439004",
"0.5843639",
"0.58305585",
"0.5828973",
"0.58109385",
"0.5810186",
"0.58065176",
"0.5804891",
"0.5800424",
"0.5793293",
"0.5785061",
"0.5784062",
"0.5779185",
"0.57687986",
"0.57684946",
"0.57678",
"0.5767783",
"0.5767783",
"0.57572067",
"0.5756616",
"0.57554924"
] | 0.8053939 | 0 |
Insere a pessoa na lista e em seguida serializa | @Override
public boolean inserir(Pessoa p) {
try {
pessoa.getPessoas().add(p);
serializar(arquivo2Serializado, pessoa);
} catch (Exception ex) {
Logger.getLogger(PessoaDAO.class.getName()).log(Level.SEVERE, null, ex);
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void crearPoblacion() {\n\t\tif(this.terminales == null || this.funciones == null) {\n\t\t\tSystem.out.println(\"Error. Los terminales y las funciones tienen que estar inicializados\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tpoblacion = new ArrayList<>();\n\t\tfor(int i = 0; i < this.numIndividuos; i++) {\n\t\t\tIndividuo ind = new Individuo();\n\t\t\tind.crearIndividuoAleatorio(this.profundidad, this.terminales, this.funciones);\n\t\t\tthis.poblacion.add(ind);\n\t\t}\n\t}",
"public void createDespesaDetalhe(ArrayList<PagamentoDespesasDetalhe> listaDespesasInseridas, int idDespesa) throws Exception {\n\r\n for(int i=0; i < listaDespesasInseridas.size(); i++){\r\n \r\n open(); //abre conexão com o banco de dados\r\n\r\n //define comando para o banco de dados\r\n stmt = con.prepareStatement(\"INSERT INTO pagamentoDespesasDetalhe(valor, dataPagamento, status, idDespesas, idFormaPagamento) VALUES (?,?,?,?,?)\");\r\n\r\n //atribui os valores das marcações do comando acima \r\n stmt.setFloat(1, listaDespesasInseridas.get(i).getValor());\r\n stmt.setString(2, listaDespesasInseridas.get(i).getDataPagamento());\r\n stmt.setInt(3, listaDespesasInseridas.get(i).getStatus());\r\n stmt.setInt(4, idDespesa);\r\n stmt.setInt(5, listaDespesasInseridas.get(i).getIdFormaPagamento());\r\n\r\n stmt.execute();//executa insert no banco de dados\r\n\r\n close();//fecha conexão com o banco de dados\r\n \r\n } \r\n\r\n }",
"public ListaDuplamenteEncadeada(){\r\n\t\t\r\n\t}",
"@Override\n\tpublic WriteResult insertNewDocCollection(List<Object> lista) {\n\t\treturn null;\n\t}",
"private final void inicializarListas() {\r\n\t\t//Cargo la Lista de orden menos uno\r\n\t\tIterator<Character> it = Constantes.LISTA_CHARSET_LATIN.iterator();\r\n\t\tCharacter letra;\r\n\t\twhile (it.hasNext()) {\r\n\t\t\tletra = it.next();\r\n\t\t\tthis.contextoOrdenMenosUno.crearCharEnContexto(letra);\r\n\t\t}\r\n\t\t\r\n\t\tthis.contextoOrdenMenosUno.crearCharEnContexto(Constantes.EOF);\r\n\t\t\r\n\t\tthis.contextoOrdenMenosUno.actualizarProbabilidades();\r\n\t\t\r\n\t\t//Cargo las listas de ordenes desde 0 al orden definido en la configuración\r\n\t\tOrden ordenContexto;\r\n\t\tfor (int i = 0; i <= this.orden; i++) {\r\n\t\t\tordenContexto = new Orden();\r\n\t\t\tthis.listaOrdenes.add(ordenContexto);\r\n\t\t}\r\n\t}",
"void inPut(ArrayList<SanPham> list);",
"private void insertar(ArrayList<Estado> hijos) {\r\n\t\tfor (Estado p : hijos) { // Añado hijos a nodos abiertos\r\n\t\t\tabiertos.add(p);\r\n\t\t\tif (abiertos.size() > estados_abiertos)\r\n\t\t\t\testados_abiertos = abiertos.size(); // Variable para contar el numero maximo de estados abiertos\r\n\t\t}\r\n\t}",
"public void guardar(ArrayList<T> lista, String nombre) {\n try {\n fos = new FileOutputStream(nombre);\n oos = new ObjectOutputStream(fos);\n oos.writeObject(new ArrayList<>(lista));\n oos.close();\n fos.close();\n } catch (FileNotFoundException e) {\n System.err.println(\"ERROR: \" + e.getLocalizedMessage());\n } catch (IOException e) {\n System.err.println(\"ERROR: \" + e.getLocalizedMessage());\n }\n }",
"public void AddReliquias(){\n DLList reliquias = new DLList();\n reliquias.insertarInicio(NombreReliquia); \n }",
"public void inseriPessoa() throws IOException {\n\t\tString r;\n\t\tvetPessoas[nPessoas] = new Pessoa();\n\t\tSystem.out.println(\"Inseri o nome \");\n\t\tr = EntradaTeclado.leString();\n\t\tvetPessoas[nPessoas].setNome(r);\n\t\t\n\t\tSystem.out.println(\"Inseri o Cpf \");\n\t\tr = EntradaTeclado.leString();\n\t\tthis.vetPessoas[this.nPessoas].setCpf(r);\n\t\t\n\t\tSystem.out.println(\"Inseri o Endereco \");\n\t\tr = EntradaTeclado.leString();\n\t\tthis.vetPessoas[this.nPessoas].setEndereco(r);\n\t\t\n\t\tSystem.out.println(\"Inseri o Email \");\n\t\tr = EntradaTeclado.leString();\n\t\tthis.vetPessoas[this.nPessoas].setEmail(r);\n\t\t\n\t\tSystem.out.println(\"Inseri o Data de Nascimento fomanto (dd/mm/aaaa)\");\n\t\tr = EntradaTeclado.leString();\n\t\tthis.vetPessoas[this.nPessoas].setDataNascimento(r);\n\t\t\n\t\tSystem.out.println(\"Inseri o Estado Civil \");\n\t\tr = EntradaTeclado.leString();\n\t\tthis.vetPessoas[this.nPessoas].setEstadoCivil(r);\n\t\t\n\t\tthis.nPessoas+=1;\n\t}",
"@Override\r\n\tpublic void inserOrder(Good_ordVO good_ordVO, List<PointgoodsVO> list) {\n\t\t\r\n\t}",
"public abstract ObjectId[] prenota(List<T> listToAdd, ObjectId idVolo) throws FlightNotFoundException, SeatsSoldOutException;",
"public void salvaElezione(ArrayList<Elezione> elezioni) {\n\t\t\t\n\t\t\tDB db = getDB();\n\t\t\tMap<Integer, Elezione> map = db.getTreeMap(\"elezione\");\n\t\t\tmap.clear();\n\t\t\tint contatore = 0;\n\t\t\tfor (Elezione lista : elezioni) {\n\t\t\t\tmap.put(contatore++, lista);\n\t\t\t}\n\t\t\t\n\t\t\tdb.commit(); // commit dopo le modifiche\n\t\t\t\n\t\t}",
"private void carregarPacienteAtivoList() {\n\t\tthis.setPacienteList(new ArrayList<Paciente>());\n\t\tthis.getPacienteList().addAll(this.getPacienteDAO().getPacienteAtivoList());\n\t}",
"private void caricaLista() {\n /** variabili e costanti locali di lavoro */\n ArrayList unaLista = null;\n CampoDati unCampoDati = null;\n CDBLinkato unCampoDBLinkato = null;\n //@todo da cancellare\n try { // prova ad eseguire il codice\n /* recupera il campo DB specializzato */\n unCampoDBLinkato = (CDBLinkato)unCampoParente.getCampoDB();\n\n /* recupera la lista dal campo DB */\n unaLista = unCampoDBLinkato.caricaLista();\n\n /* recupera il campo dati */\n unCampoDati = unCampoParente.getCampoDati();\n\n /* registra i valori nel modello dei dati del campo */\n if (unaLista != null) {\n unCampoDati.setValoriInterni(unaLista);\n// unCampoDatiElenco.regolaElementiAggiuntivi();\n } /* fine del blocco if */\n\n } catch (Exception unErrore) { // intercetta l'errore\n /* mostra il messaggio di errore */\n Errore.crea(unErrore);\n } /* fine del blocco try-catch */\n\n }",
"public void trancribirPistas() {\r\n\t\t\r\n\t\tfor (int x = 0; x<manejadorArchivos.getPistas().size();x++) {\r\n\t\t\t\r\n\t\t\tpistas.add(manejadorArchivos.getPistas().get(x));\t\r\n\t\t}\r\n\t}",
"private void insertData() {\n PodamFactory factory = new PodamFactoryImpl();\n for (int i = 0; i < 3; i++) {\n VueltasConDemoraEnOficinaEntity entity = factory.manufacturePojo(VueltasConDemoraEnOficinaEntity.class);\n \n em.persist(entity);\n data.add(entity);\n }\n }",
"private void insertData() {\n PodamFactory factory = new PodamFactoryImpl();\n for (int i = 0; i < 3; i++) {\n ViajeroEntity entity = factory.manufacturePojo(ViajeroEntity.class);\n\n em.persist(entity);\n data.add(entity);\n }\n }",
"private void enlistar(ArrayList<Caracter> caracteres){\n for (int i = 0; i < caracteres.size(); i++) {\n insertaOrdenado(new NodoCaracter((Caracter) caracteres.get(i)));\n }\n }",
"public void inicializaEntradas(){\n\t\tentrada = TipoMotivoEntradaEnum.getList();\n\t\tentrada.remove(0);\n\t}",
"private void inicializarUsuarios(){\n usuarios = new ArrayList<Usuario>();\n Administrador admin=new Administrador();\n admin.setCodigo(1);\n admin.setApellidos(\"Alcaide Gomez\");\n admin.setNombre(\"Juan Carlos\");\n admin.setDni(\"31000518Z\");\n admin.setPassword(\"admin\");\n admin.setCorreo(\"[email protected]\");\n admin.setDireccion(\"Sebastian Garrido 54\");\n admin.setNacimiento(new Date(1991, 12, 29));\n admin.setNacionalidad(\"España\");\n admin.setCentro(\"Centro\");\n admin.setSexo(\"Varon\");\n admin.setDespacho(\"301\");\n usuarios.add(admin);\n \n JefeServicio js=new JefeServicio();\n js.setCodigo(2);\n js.setApellidos(\"Gutierrez Cazorla\");\n js.setNombre(\"Ruben\");\n js.setDni(\"75895329k\");\n js.setPassword(\"admin\");\n js.setCorreo(\"[email protected]\");\n js.setDireccion(\"Sebastian Garrido 54\");\n js.setNacimiento(new Date(1991, 12, 29));\n js.setNacionalidad(\"España\");\n js.setCentro(\"Centro\");\n js.setSexo(\"Varon\");\n js.setDespacho(\"301\");\n \n usuarios.add(js);\n \n \n Ciudadano c =new Ciudadano();\n c.setCodigo(3);\n c.setApellidos(\"Moreno\");\n c.setNombre(\"Maria\");\n c.setDni(\"123\");\n c.setPassword(\"123\");\n c.setCorreo(\"[email protected]\");\n c.setDireccion(\"Sebastian Garrido 54\");\n c.setNacimiento(new Date(1992, 01, 12));\n c.setCentro(\"Teatinos\");\n c.setNacionalidad(\"España\");\n c.setSexo(\"Mujer\");\n c.setTelefono(\"999\");\n usuarios.add(c);\n \n //--Administrativos--\n Administrativo a =new Administrativo();\n a.setCodigo(4);\n a.setApellidos(\"Fernández\");\n a.setNombre(\"Salva\");\n a.setDni(\"1234\");\n a.setPassword(\"1234\");\n a.setCorreo(\"[email protected]\");\n a.setDireccion(\"Sebastian Garrido 54\");\n a.setNacimiento(new Date(1991, 9, 29));\n a.setNacionalidad(\"España\");\n a.setSexo(\"Hombre\");\n a.setCentro(\"Centro\");\n usuarios.add(a);\n \n Tecnico tec=new Tecnico();\n tec.setCodigo(5);\n tec.setApellidos(\"Alcaide Gomez\");\n tec.setNombre(\"Juan Carlos\");\n tec.setDni(\"tecnico\");\n tec.setPassword(\"tecnico\");\n tec.setCorreo(\"[email protected]\");\n tec.setDireccion(\"Sebastian Garrido 54\");\n tec.setNacimiento(new Date(1991, 12, 29));\n tec.setNacionalidad(\"España\");\n tec.setCentro(\"Centro\");\n tec.setSexo(\"Varon\");\n tec.setDespacho(\"301\");\n tec.setTelefono(\"664671040\");\n tec.setEspecialidad(\"Maltrato\");\n tec.setTfijo(957375546);\n \n usuarios.add(tec);\n \n }",
"public void guardaLlista() throws IOException {\n ctrl_Persistencia.guardaLlista(\"@../../Dades/\"+list.getNomLlista()+\".llista\",list);\n }",
"public void listar(){\r\n // Verifica si la lista contiene elementoa.\r\n if (!esVacia()) {\r\n // Crea una copia de la lista.\r\n Nodo aux = inicio;\r\n // Posicion de los elementos de la lista.\r\n int i = 0;\r\n // Recorre la lista hasta el final.\r\n while(aux != null){\r\n // Imprime en pantalla el valor del nodo.\r\n System.out.print(i + \".[ \" + aux.getValor() + \" ]\" + \" -> \");\r\n // Avanza al siguiente nodo.\r\n aux = aux.getSiguiente();\r\n // Incrementa el contador de la posión.\r\n i++;\r\n }\r\n }\r\n }",
"private void insertFromFile(ArrayList<String> obj){\r\n\t\tsetIdString(obj.get(1));\t\r\n\t\tsetLogin(obj.get(2));\r\n\t\tsetSenha(obj.get(3));\r\n\t\tsetImei(obj.get(4));\r\n\t\tsetMac(obj.get(5));\r\n\t\tString date = Util.convertDateToDateStr(Util.getCurrentDateTime());\t\r\n\t\tsetUltimaAlteracao(date);\t\t\t\r\n\t}",
"@Override\n\tpublic void writeToParcel(Parcel dest, int flags) {\n\t\tdest.writeList(lista);\n\t}",
"public static void inserir(Estoque estoque){\r\n lerXml();//le o XML e preenche a lista de estoque\r\n //pega o ultimo estoque cadastrado\r\n int ultimaPosicao = lista.size()-1;\r\n if(ultimaPosicao >= 0){ //se a lista não estiver vazia\r\n Estoque ultimoEstoque = lista.get(ultimaPosicao);\r\n estoque.setNumCompra(ultimoEstoque.getNumCompra()+1);\r\n }else{\r\n // se não tem niguem na lista, o ncompra é 1\r\n estoque.setNumCompra(1);\r\n }\r\n lista.add(estoque);//adiciona um estoque pro final da lista\r\n salvarXml();//atualiza o XML com o que tem na lista\r\n \r\n \r\n \r\n }",
"@Override\n\tpublic void crearNuevaPoblacion() {\n\t\t/* Nos quedamos con los mejores individuos. Del resto, cruzamos la mitad, los mejores,\n\t\t * y el resto los borramos.*/\n\t\tList<IIndividuo> poblacion2 = new ArrayList<>();\n\t\tint numFijos = (int) (poblacion.size()/2);\n\t\t/* Incluimos el 50%, los mejores */\n\t\tpoblacion2.addAll(this.poblacion.subList(0, numFijos));\n\t\t\n\t\t/* De los mejores, mezclamos la primera mitad \n\t\t * con todos, juntandolos de forma aleatoria */\n\t\tList<IIndividuo> temp = poblacion.subList(0, numFijos+1);\n\t\tfor(int i = 0; i < temp.size()/2; i++) {\n\t\t\tint j;\n\t\t\tdo {\n\t\t\t\tj = Individuo.aleatNum(0, temp.size()-1);\n\t\t\t}while(j != i);\n\t\t\t\n\t\t\ttry {\n\t\t\t\tpoblacion2.addAll(cruce(temp.get(i), temp.get(j)));\n\t\t\t} catch (CruceNuloException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t\t//this.poblacion.clear();\n\t\tthis.poblacion = poblacion2;\n\t}",
"public void save() {\n super.storageSave(listPedidosAssistencia.toArray());\n }",
"public Adaptador_Puntuaciones(ArrayList<Puntuacion> puntuaciones) {\n listaPuntuaciones = puntuaciones;\n }",
"private List<ItemListaIntegracaoDTO> montarListaInstituicaoIdInstituicaoDTO(List<InstituicaoCooperativaSCIDTO> lista) {\n\t\tList<ItemListaIntegracaoDTO> listaVO = new ArrayList<ItemListaIntegracaoDTO>();\n\n\t\tfor(InstituicaoCooperativaSCIDTO instituicao:lista){\n\t\t\tString cooperativa = instituicao.getNumCooperativa().toString();\n\t\t\tif(instituicao.getNumCooperativa() == 300) {\n\t\t\t\tcooperativa = \"0300\";\n\t\t\t}\n\t\t\tItemListaIntegracaoDTO item = new ItemListaIntegracaoDTO(instituicao.getIdInstituicao().toString(), cooperativa + \" - \" + instituicao.getNome());\n\t\t\tlistaVO.add(item);\n\t\t}\n\t\t\n\t\tCollections.sort(listaVO, new Comparator<ItemListaIntegracaoDTO>() {\n\t\t\tpublic int compare(ItemListaIntegracaoDTO o1, ItemListaIntegracaoDTO o2){\n\t\t\t\t\treturn o1.getCodListaItem().compareTo(o2.getCodListaItem());\n\t\t\t\t} \n\t\t});\n\t\t\n\t\treturn listaVO;\t\t\n\t}",
"@Test\n public void insertarAerolineaEnArrayList() {\n int tamanio = AerolineasControlador.listaAerolineas.size();\n Aerolinea aerolinea = new Aerolinea(\"47FS\",\"Air Europa\",\"70\",\"MAdrid\",\"4672339U\");\n AerolineasControlador.listaAerolineas.add(aerolinea);\n assertEquals(tamanio + 1,AerolineasControlador.listaAerolineas.size());\n }",
"public int persisteInformacionArrayQuries(List<String> listQuriesToPersistence, String idProceso);",
"private void insertData() {\n compra = factory.manufacturePojo(CompraVentaEntity.class);\n compra.setId(1L);\n compra.setQuejasReclamos(new ArrayList<>());\n em.persist(compra);\n\n for (int i = 0; i < 3; i++) {\n QuejasReclamosEntity entity = factory.manufacturePojo(QuejasReclamosEntity.class);\n entity.setCompraVenta(compra);\n em.persist(entity);\n data.add(entity);\n compra.getQuejasReclamos().add(entity);\n }\n }",
"public Listas_simplemente_enlazada(){\r\n inicio=null; // este constructor me va servir para apuntar el elemento\r\n fin=null;\r\n }",
"private void inicializarcomponentes() {\n Comunes.cargarJList(jListBecas, becasFacade.getTodasBecasVigentes());\n \n }",
"public List<Tipo_Exa> addTipoExaSP(Tipo_Exa tipo_Exa);",
"public void addPrimero(Object obj) {\n if (cabeza == null) { //Si la cabeza es nula, entoces se creará un nuevo nodo donde le pasaremos el valor de obj\n cabeza = new Nodo(obj);\n } else { //Si no es nula, signifa que el valor que se ingrese, pasara a ser la nueva cabeza\n Nodo temp = cabeza; //Metemos la cabeza en un nodo temporal\n Nodo nuevo = new Nodo(obj); //Creamos un nuevo nodo, que no está enlazado\n nuevo.enlazarSiguiente(temp); //Y el nuevo nodo lo enlazamos a el nodo Temp, que contenia el valor anterior de la otra cabeza\n cabeza = nuevo; //Y ahora le decimos que la cabeza sera nuevo\n }\n size++; //Cada vez que agreguemos un nuevo nodo el tamaño de nuestra lista tendra que aumentar\n }",
"public void obrniListu() {\n if (prvi != null && prvi.veza != null) {\n Element preth = null;\n Element tek = prvi;\n \n while (tek != null) {\n Element sled = tek.veza;\n \n tek.veza = preth;\n preth = tek;\n tek = sled;\n }\n prvi = preth;\n }\n }",
"@Override\n\tpublic void insertar() {\n\t\t\n\t}",
"public ComandosJuego() //constructor\n\t{\n\t\tlista = new ArrayList<String>();\n\t}",
"@Override\n\tpublic <T> void insertMany(List<T> list) throws Exception {\n\t\t\n\t}",
"public void addSavedFragment(ArrayList<JSONObject> myList) throws JSONException {\n\n jArr = new JSONArray();\n for(int i = 0; i < myList.size(); i++) {\n JSONObject x = myList.get(i);\n System.out.println(\"the string is = \" + x.toString());\n jArr.put(x);\n }\n addFragments(jArr, false);\n\n }",
"private void insertData() {\n\n cliente = factory.manufacturePojo(ClienteEntity.class);\n em.persist(cliente);\n for (int i = 0; i < 3; i++) {\n FormaPagoEntity formaPagoEntity = factory.manufacturePojo(FormaPagoEntity.class);\n formaPagoEntity.setCliente(cliente);\n em.persist(formaPagoEntity);\n data.add(formaPagoEntity);\n }\n }",
"public void skratiListu() {\n if (!jePrazna()) {\n int n = Svetovid.in.readInt(\"Unesite broj elemenata za skracivanje: \");\n obrniListu(); //Zato sto se trazi odsecanje poslednjih n elemenata\n while (prvi != null && n > 0) {\n prvi = prvi.veza;\n n--;\n }\n obrniListu(); //Vraca listu u prvobitni redosled\n }\n }",
"public void insereFinal(String elemento) {\n No novoNo = new No(elemento, null);\n No temp = ini;\n \n //Caso a lista esteja vazia\n if (temp == null){\n ini = novoNo;\n } else {\n //Caminha ate o ultimo No, dentre todos os nos dessa listaa\n while (temp.getProx() != null) {\n temp = temp.getProx();\n }\n\n //Se chegou ate o ultimo no, adicionar o elemento desejado\n temp.setProx(novoNo);\n }\n }",
"public void listar(){\n if (!esVacia()) {\n // Crea una copia de la lista.\n NodoEmpleado aux = inicio;\n // Posicion de los elementos de la lista.\n int i = 0;\n System.out.print(\"-> \");\n // Recorre la lista hasta llegar nuevamente al incio de la lista.\n do{\n // Imprime en pantalla el valor del nodo.\n System.out.print(i + \".[ \" + aux.getEmpleado() + \" ]\" + \" -> \");\n // Avanza al siguiente nodo.\n aux = aux.getSiguiente();\n // Incrementa el contador de la posi�n.\n i++;\n }while(aux != inicio);\n }\n }",
"public void insere(Pessoa pessoa){\n\t\tdb.save(pessoa);\n\t}",
"public void inicializarListaMascotas()\n {\n //creamos un arreglo de objetos y le cargamos datos\n mascotas = new ArrayList<>();\n mascotas.add(new Mascota(R.drawable.elefante,\"Elefantin\",0));\n mascotas.add(new Mascota(R.drawable.conejo,\"Conejo\",0));\n mascotas.add(new Mascota(R.drawable.tortuga,\"Tortuga\",0));\n mascotas.add(new Mascota(R.drawable.caballo,\"Caballo\",0));\n mascotas.add(new Mascota(R.drawable.rana,\"Rana\",0));\n }",
"public ListaPracownikow() {\n generujPracownikow();\n //dodajPracownika();\n }",
"private void insertData() \n {\n for (int i = 0; i < 3; i++) {\n TarjetaPrepagoEntity entity = factory.manufacturePojo(TarjetaPrepagoEntity.class);\n em.persist(entity);\n data.add(entity);\n }\n for(int i = 0; i < 3; i++)\n {\n PagoEntity pagos = factory.manufacturePojo(PagoEntity.class);\n em.persist(pagos);\n pagosData.add(pagos);\n\n }\n \n data.get(2).setSaldo(0.0);\n data.get(2).setPuntos(0.0);\n \n double valor = (Math.random()+1) *100;\n data.get(0).setSaldo(valor);\n data.get(0).setPuntos(valor); \n data.get(1).setSaldo(valor);\n data.get(1).setPuntos(valor);\n \n }",
"public void addDataFromDBToList(ArrayList<SingleParty> partiesList){\n SingleParty p=new SingleParty();\n partiesList.add(p);\n partiesList.add(p);\n partiesList.add(p);\n partiesList.add(p);\n partiesList.add(p);\n partiesList.add(p);\n\n }",
"public ListaPalabras() {\n\n //pos=0;\n }",
"public void addPedidoDetalle(biz.belcorp.www.canonico.ffvv.vender.TPedidoDetalle param){\n if (localPedidoDetalle == null){\n localPedidoDetalle = new biz.belcorp.www.canonico.ffvv.vender.TPedidoDetalle[]{};\n }\n\n \n\n java.util.List list =\n org.apache.axis2.databinding.utils.ConverterUtil.toList(localPedidoDetalle);\n list.add(param);\n this.localPedidoDetalle =\n (biz.belcorp.www.canonico.ffvv.vender.TPedidoDetalle[])list.toArray(\n new biz.belcorp.www.canonico.ffvv.vender.TPedidoDetalle[list.size()]);\n\n }",
"public static void guardarDatos(ArrayList<Enlace> lista_enlaces) {\n\t\tSession sesion = sf.openSession();\r\n\t\tTransaction t = sesion.beginTransaction();\r\n\t\tfor (Enlace enlace : lista_enlaces) {\r\n\t\t\tsesion.save(enlace);\r\n\t\t}\r\n\t\tt.commit();\r\n\r\n\t}",
"protected void uploadSottoPagine() {\n LinkedHashMap<String, LinkedHashMap<String, List<String>>> mappa;\n int numVoci = 0;\n\n for (String key : lista.getSottoPagine().keySet()) {\n mappa = lista.getSottoPagine().get(key);\n numVoci = lista.getMappaLista().getDimParagrafo(key);\n incipitSottopagina = elaboraIncipitSpecificoSottopagina(key);\n listaCorrelate = listaVociCorrelate();\n appContext.getBean(UploadSottoPagina.class, soggetto, key, mappa, typeDidascalia, numVoci, usaParagrafoSize, incipitSottopagina, usaNote, usaVociCorrelate, listaCorrelate);\n }// end of for cycle\n }",
"private void insertData() {\n for (int i = 0; i < 3; i++) {\n PodamFactory factory = new PodamFactoryImpl();\n VisitaEntity entity = factory.manufacturePojo(VisitaEntity.class);\n em.persist(entity);\n data.add(entity);\n }\n }",
"@Override\n\tpublic void adicionar(T obj) throws ExcecaoDeListaCheia, ExcecaoDeParticipanteJaExistente {\n\t\tif (tamanho < capacidade) {\n\t\t\tfor (int i = 0; i < tamanho; i++) {\n\t\t\t\tif (obj.toString().equals(elementosDaLista[i].toString())) {\n\t\t\t\t\tthrow new ExcecaoDeParticipanteJaExistente();\n\t\t\t\t}\n\t\t\t}\n\t\t\telementosDaLista[tamanho] = obj;\n\t\t\ttamanho++;\n\t\t} else {\n\t\t\tthrow new ExcecaoDeListaCheia();\n\t\t}\n\t}",
"private void insertData() {\r\n \r\n TeatroEntity teatro = factory.manufacturePojo(TeatroEntity.class);\r\n em.persist(teatro);\r\n FuncionEntity funcion = factory.manufacturePojo(FuncionEntity.class);\r\n List<FuncionEntity> lista = new ArrayList();\r\n lista.add(funcion);\r\n em.persist(funcion);\r\n for (int i = 0; i < 3; i++) \r\n {\r\n SalaEntity sala = factory.manufacturePojo(SalaEntity.class);\r\n sala.setTeatro(teatro);\r\n sala.setFuncion(lista);\r\n em.persist(sala);\r\n data.add(sala);\r\n }\r\n for (int i = 0; i < 3; i++) \r\n {\r\n SalaEntity sala = factory.manufacturePojo(SalaEntity.class);\r\n sala.setTeatro(teatro);\r\n em.persist(sala);\r\n sfdata.add(sala);\r\n }\r\n \r\n }",
"@PostConstruct\n\tprivate void init() {\n\t\tEntrada entr = new Entrada(\n\t\t\t\tnew Persona(\"Manuel\",\"Jimenex\",\"52422\",\"100000\",\"Cra 340\"),\n\t\t\t\t(new PreFactura(1l,new Date())), itemsService.lista());\n\t\t\n\t\tlistaEntrada.add(entr);\n\t}",
"private void insertData() {\r\n PodamFactory factory = new PodamFactoryImpl();\r\n for (int i = 0; i < 3; i++) {\r\n MonitoriaEntity entity = factory.manufacturePojo(MonitoriaEntity.class);\r\n\r\n em.persist(entity);\r\n data.add(entity);\r\n }\r\n }",
"private List<ItemListaIntegracaoDTO> montarListaInstituicaoDTO(List<InstituicaoCooperativaSCIDTO> lista) {\n\t\tList<ItemListaIntegracaoDTO> listaVO = new ArrayList<ItemListaIntegracaoDTO>();\n\n\t\tfor(InstituicaoCooperativaSCIDTO instituicao:lista){\n\t\t\tItemListaIntegracaoDTO item = new ItemListaIntegracaoDTO(instituicao.getNumCooperativa().toString(), instituicao.getNumCooperativa() + \" - \" + instituicao.getNome());\n\t\t\tlistaVO.add(item);\n\t\t}\n\t\t\n\t\tCollections.sort(listaVO, new Comparator<ItemListaIntegracaoDTO>() {\n\t\t\tpublic int compare(ItemListaIntegracaoDTO o1, ItemListaIntegracaoDTO o2){\n\t\t\t\t\treturn o1.getCodListaItem().compareTo(o2.getCodListaItem());\n\t\t\t\t} \n\t\t});\n\t\t\n\t\treturn listaVO;\t\t\n\t}",
"private static void cadastroProduto() {\n\n\t\tString nome = Entrada(\"PRODUTO\");\n\t\tdouble PrecoComprado = Double.parseDouble(Entrada(\"VALOR COMPRA\"));\n\t\tdouble precoVenda = Double.parseDouble(Entrada(\"VALOR VENDA\"));\n String informacaoProduto = Entrada(\"INFORMAÇÃO DO PRODUTO\");\n String informacaoTecnicas = Entrada(\"INFORMAÇÕES TÉCNICAS\");\n\n\t\tProduto produto = new Produto(nome, PrecoComprado, precoVenda, informacaoProduto,informacaoTecnicas);\n\n\t\tListaDProduto.add(produto);\n\n\t}",
"@Before(value = \"@createList\", order = 1)\n public void createList() {\n String endpoint = EnvironmentTrello.getInstance().getBaseUrl() + \"/lists/\";\n JSONObject json = new JSONObject();\n json.put(\"name\", \"testList\");\n json.put(\"idBoard\", context.getDataCollection(\"board\").get(\"id\"));\n RequestManager.setRequestSpec(AuthenticationUtils.getLoggedReqSpec());\n Response response = RequestManager.post(endpoint, json.toString());\n context.saveDataCollection(\"list\", response.jsonPath().getMap(\"\"));\n }",
"public void agregarAlInicio(String valor){\r\n // Define un nuevo nodo.\r\n Nodo nuevo = new Nodo();\r\n // Agrega al valor al nodo.\r\n nuevo.setValor(valor);\r\n // Consulta si la lista esta vacia.\r\n if (esVacia()) {\r\n // Inicializa la lista agregando como inicio al nuevo nodo.\r\n inicio = nuevo;\r\n // Caso contrario va agregando los nodos al inicio de la lista.\r\n } else{\r\n // Une el nuevo nodo con la lista existente.\r\n nuevo.setSiguiente(inicio);\r\n // Renombra al nuevo nodo como el inicio de la lista.\r\n inicio = nuevo;\r\n }\r\n // Incrementa el contador de tamaño de la lista.\r\n tamanio++;\r\n }",
"public LlistaPistes() {\n _llistaPistes = new ArrayList();\n }",
"void registrarArticulosMigracion(Integer codigoCompania, String namefile, Date fechaEjecucion, List<? extends MigrarDatosProcesoVentaDTO> listaDatosArchivoFTP) throws SICException, ParseException;",
"public void setPacchetti(List<Pacchetto> pacchetti);",
"public void adicionar(Integer no,ListaDuplamenteEncadeada lista){\r\n\t\tListaDuplamenteEncadeada temp = new ListaDuplamenteEncadeada();\r\n\t\ttemp.setDado(no);\r\n\t\ttemp.setProximoNo(lista.getProximoNo());\r\n\t\tlista.setProximoNo(temp);\r\n\t\tlista.setNumElementos(lista.getNumElementos()+1);\r\n\t}",
"@Override\n public ArrayList<String> Crear(){\n setVida(3500);\n Creado.add(0, Integer.toString(getVida()));\n Creado.add(1,\"150\");\n Creado.add(2,\"100\");\n Creado.add(3,\"70\");\n return Creado;\n }",
"protected ProvinciaList() {\n\t\tsuper();\n\t\t// TODO Auto-generated constructor stub\n\t}",
"public void add(List<InstituicaoEnsino> list)\r\n\t\t\tthrows InsertException, EntityNotFoundException {\r\n\t\tfor (InstituicaoEnsino inst : list) {\r\n\t\t\tif (get(inst) == null) {\r\n\t\t\t\tadd(inst);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private void insertData() {\n\n for (int i = 0; i < 3; i++) {\n ProveedorEntity proveedor = factory.manufacturePojo(ProveedorEntity.class);\n BonoEntity entity = factory.manufacturePojo(BonoEntity.class);\n int noOfDays = 8;\n Date dateOfOrder = new Date();\n Calendar calendar = Calendar.getInstance();\n calendar.setTime(dateOfOrder);\n calendar.add(Calendar.DAY_OF_YEAR, noOfDays);\n Date date = calendar.getTime();\n entity.setExpira(date);\n noOfDays = 1;\n calendar = Calendar.getInstance();\n calendar.setTime(dateOfOrder);\n calendar.add(Calendar.DAY_OF_YEAR, noOfDays);\n date = calendar.getTime();\n entity.setAplicaDesde(date);\n entity.setProveedor(proveedor);\n em.persist(entity);\n ArrayList lista=new ArrayList<>();\n lista.add(entity);\n proveedor.setBonos(lista);\n em.persist(proveedor);\n pData.add(proveedor);\n data.add(entity); \n }\n }",
"@Override\n\tpublic List<Baidu> savaList(List<Baidu> bl) {\n\t\tbaiduDao.save(bl);\n\t\treturn bl;\n\t}",
"public void setProdPainel(List<Tb_Prod_Painel_PromoBeans> lpb) throws SQLException {\r\n try (Connection conexao = new ConexaoLocalDBMySql().getConnect()) {\r\n String sql = \"insert into tb_prod_painel_promo(codigo,descricao,unid,valor1,valor2,oferta,terminal,painel) values \"; \r\n String sql2 = null;\r\n for (Tb_Prod_Painel_PromoBeans pb : lpb) { \r\n String sql3 = \"('\" +pb.getCodigo()+ \"','\" +pb.getDescricao() + \"','\" + pb.getUnid() + \"','\" + pb.getValor1() + \"','\" + pb.getValor2() + \"',\"\r\n + \"\" + pb.getOferta() + \",\" + pb.getTerminal() + \",\" + pb.getPainel() + \") \"; \r\n if (sql2==null) { \r\n sql2=sql+sql3;\r\n }else{ \r\n sql2=sql2+\",\"+sql3;\r\n }\r\n } \r\n PreparedStatement pstm = conexao.prepareStatement(sql2);\r\n pstm.execute();\r\n pstm.close();\r\n conexao.close();\r\n }\r\n }",
"@Test\n public void testSetListaExposicoes() {\n System.out.println(\"setListaExposicoes\");\n List<Exposicao> listaExposicoes = new ArrayList<>();\n listaExposicoes.add(new Exposicao());\n RegistoExposicoes instance = new RegistoExposicoes();\n instance.setListaExposicoes(listaExposicoes);\n assertEquals(instance.getListaExposicoes(), listaExposicoes);\n }",
"private void insertData() {\r\n PodamFactory factory = new PodamFactoryImpl();\r\n for (int i = 0; i < 3; i++) {\r\n UsuarioEntity entity = factory.manufacturePojo(UsuarioEntity.class);\r\n em.persist(entity);\r\n dataUsuario.add(entity);\r\n }\r\n for (int i = 0; i < 3; i++) {\r\n CarritoDeComprasEntity entity = factory.manufacturePojo(CarritoDeComprasEntity.class);\r\n if (i == 0 ){\r\n entity.setUsuario(dataUsuario.get(0));\r\n }\r\n em.persist(entity);\r\n data.add(entity);\r\n }\r\n }",
"public void agregarListHijos(Persona hijo){\n Persona ite;\n\n if(hijos_Ambos.nextHijo==null && used==true){\n hijos_Ambos.nextHijo = hijo;\n\n }else{\n ite=hijos_Ambos.nextHijo;\n while(ite.nextHijo!=null){\n ite=ite.nextHijo;\n }\n ite.nextHijo=hijo;\n } \n\n }",
"@Override\n\tpublic void insert(WareInListPO po) throws RemoteException {\n\t\tFile Arrivalfile = new File(\"TxtData/warein.txt\");\n\t\tif (po == null) {\n\t\t\tSystem.out.println(\"WAREINLIST IS NOTHING\");\n\t\t}\n\t\tif (po != null) {\n\t\t\ttry {\n\t\t\t\tOutputStreamWriter itemWriter = new OutputStreamWriter(new FileOutputStream(Arrivalfile, true),\n\t\t\t\t\t\t\"UTF-8\");\n\t\t\t\titemWriter.write(po.getId() + \"\");\n\t\t\t\titemWriter.write(\":\");\n\t\t\t\titemWriter.write(po.getTime() + \"\");\n\t\t\t\titemWriter.write(\":\");\n\t\t\t\titemWriter.write(po.getDestination().toString());\n\t\t\t\titemWriter.write(\":\");\n\t\t\t\titemWriter.write(po.getPlace().getQu() + \"\");\n\t\t\t\titemWriter.write(\"-\");\n\t\t\t\titemWriter.write(po.getPlace().getPai() + \"\");\n\t\t\t\titemWriter.write(\"-\");\n\t\t\t\titemWriter.write(po.getPlace().getJia() + \"\");\n\t\t\t\titemWriter.write(\"-\");\n\t\t\t\titemWriter.write(po.getPlace().getWei() + \"\");\n\t\t\t\titemWriter.write(\":\");\n\t\t\t\titemWriter.write(po.getState().toString());\n\t\t\t\titemWriter.write(\":\");\n\t\t\t\titemWriter.write(po.getTranscenterid() + \"\");\n\t\t\t\titemWriter.write(\":\");\n\t\t\t\titemWriter.write(po.getVehicle().toString());\n\t\t\t\titemWriter.write(\"\\r\\n\");\n\t\t\t\titemWriter.close();\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"public void memorizzaListaElettorale(ArrayList<Lista> listaelettorale) {\n\n\t\tDB db = getDB();\n\t\tMap<Integer, Lista> map = db.getTreeMap(\"liste\");\n\t\t//pulisco\n\t\tmap.clear();\n\t\t\n\t\tint contatore = 0;\n\t\t//inserisco la lista delle liste elettorali\n\t\tfor (Lista lista : listaelettorale) {\n\t\t\tmap.put(contatore++, lista);\n\t\t}\n\t\tdb.commit(); //commit \n\n\t}",
"public MapperDeSalidaExcepcionFormat() {\n super();\n listaMappeo = new LinkedList();\n }",
"public static void SerializarCadastro(List ArrayAlunos) {\n\n XStream xstream = new XStream(new DomDriver()); //Classe responsavel pela serialização xml\n\n OutputStream outputStream = null;\n\n xstream.alias(\"Cadastro\", List.class);\n xstream.alias(\"aluno\", Aluno.class);\n //File file = new File(\"/home/david/Documentos\",\"CadastroAluno.xml\" );\n File file = new File(\"XML/CadastroAluno.xml\");\n\n try {\n outputStream = new FileOutputStream(file);\n Writer writer = new OutputStreamWriter(outputStream, \"UTF-8\");\n xstream.toXML(ArrayAlunos, writer);\n } catch (IOException ex) {\n //Logger.getLogger(SerializaAluno.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n\n\n\n\n }",
"public void inseriEmpresa() throws IOException {\n\t\tString r;\n\t\tthis.vetEmpreas[this.nEmpresas] = new Empresa();\n\t\t\n\t\tSystem.out.println(\"Inseri o nome \");\n\t\tr = EntradaTeclado.leString();\n\t\tthis.vetEmpreas[this.nEmpresas].setNome(r);\n\n\t\tSystem.out.println(\"Inseri o CNPJ \");\n\t\tr = EntradaTeclado.leString();\n\t\tthis.vetEmpreas[this.nEmpresas].setCnpj(r);\n\t\t\n\t\tSystem.out.println(\"Inseri o endereco \");\n\t\tr = EntradaTeclado.leString();\n\t\tthis.vetEmpreas[this.nEmpresas].setEndereco(r);\n\t\t\n\t\tSystem.out.println(\"Inseri o email \");\n\t\tr = EntradaTeclado.leString();\n\t\tthis.vetEmpreas[this.nEmpresas].setEmail(r);\n\t\t\n\t\tSystem.out.println(\"Inseri InscricaoEstadual \");\n\t\tr = EntradaTeclado.leString();\n\t\tthis.vetEmpreas[this.nEmpresas].setInscricaoEstadual(r);\n\t\t\n\t\tSystem.out.println(\"Inseri Razao Social \");\n\t\tr = EntradaTeclado.leString();\n\t\tthis.vetEmpreas[this.nEmpresas].setRazaoSocial(r);\n\t\t\n\t\tthis.nEmpresas +=1;\n\t}",
"protected void creaPagine() {\n Pagina pag;\n Pannello pan;\n\n try { // prova ad eseguire il codice\n\n /* crea la pagina e aggiunge campi e pannelli */\n pag = this.addPagina(\"generale\");\n\n pan = PannelloFactory.orizzontale(this);\n pan.add(Cam.data);\n pan.add(Cam.importo.get());\n pan.add(Cam.note.get());\n pag.add(pan);\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n }// fine del blocco try-catch\n\n }",
"private void insertData() {\n PodamFactory factory = new PodamFactoryImpl();\n for (int i = 0; i < 3; i++) {\n ServicioEntity entity = factory.manufacturePojo(ServicioEntity.class);\n em.persist(entity);\n dataServicio.add(entity);\n }\n for (int i = 0; i < 3; i++) {\n QuejaEntity entity = factory.manufacturePojo(QuejaEntity.class);\n if (i == 0) {\n entity.setServicio(dataServicio.get(0));\n }\n em.persist(entity);\n data.add(entity);\n }\n }",
"private void storePotList(){\n String tempName;\n int tempWeight;\n SharedPreferences preferences = getSharedPreferences(SHAREDPREF_SET, MODE_PRIVATE);\n SharedPreferences.Editor editor = preferences.edit();\n int sizeOfPotList = potList.countPots();\n editor.putInt(SHAREDPREF_ITEM_POTLIST_SIZE, sizeOfPotList);\n for(int i = 0; i < potList.countPots();i++){\n tempWeight = (potList.getPot(i).getWeightInG());\n tempName = (potList.getPot(i).getName());\n editor.putString(SHAREDPREF_ITEM_POTLIST_NAME+i, tempName);\n editor.putInt(SHAREDPREF_ITEM_POTLIST_WEIGHT+i, tempWeight);\n }\n editor.commit();\n }",
"public void inserirLigas() throws SQLException {\n observableListLigas = FXCollections.observableArrayList(ligas);\n selecionarLiga.setItems(observableListLigas);\n \n }",
"public void writeIDs() {\n try {\n FileOutputStream fileOut = new FileOutputStream(\"temp/ids.ser\");\n ObjectOutputStream out = new ObjectOutputStream(fileOut);\n out.writeObject(ids);\n out.close();\n fileOut.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }",
"public void insererEnTeteDeListe(Personne personne) {\n\t\tElement ancienPremier= premier;\n\t\tpremier= new Element(personne,ancienPremier);\n\t\t nbElt ++;\n\t}",
"public ListaEncadeada() {\n\n this.ini = null;\n\n }",
"public static void criaListaCandidatos() {\n\t\tScanner sc = new Scanner(System.in);\t\n\t\tString id, numCandidatos, nomePessoa, nomeLista, tipoLista;\n\t\tArrayList<Pessoa> listaCandidatos = new ArrayList<>();\n\t\tint check = 0, num, i;\n\t\t\n\t\tSystem.out.println(\"\\nInsira o id da eleicao a qual pretende adicionar uma lista de candidatos:\");\n\t\tid = sc.nextLine();\n\n\t\tdo {\n\t\t\tSystem.out.println(\"\\nInsira numero de elementos (Min. 2):\");\n\t\t\tnumCandidatos = sc.nextLine();\n\t\t\tif(verificarNumeros(numCandidatos)) {\n\t\t\t\tif (Integer.parseInt(numCandidatos) >= 2) {\n\t\t\t\t\tcheck = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"\\nO numero so pode conter digitos\");\n\t\t\t}\n\t\t}while(check==0);\n\t\tnum = Integer.parseInt(numCandidatos);\n\t\tcheck = 0;\n\t\t\n\t\tdo {\n\t\t\tSystem.out.println(\"\\nInsira o nome da lista:\");\n\t\t\tnomeLista = sc.nextLine();\n\t\t\tif(verificarLetras(nomeLista) && nomeLista.length()>0) {\n\t\t\t\tcheck = 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"\\nO nome apenas pode conter letras\");\n\t\t\t}\n\t\t}while(check==0);\n\t\t\n\t\tcheck = 0;\n\t\t\n\t\tdo {\n\t\t\tSystem.out.println(\"\\nEm que tipo se insere a lista?\\n(1) Estudantes (2) Funcionarios (3) Docentes\");\n\t\t\ttipoLista = sc.nextLine();\n\t\t\tif(verificarNumeros(tipoLista)) {\n\t\t\t\tif ( (tipoLista.equals(\"1\")) || (tipoLista.equals(\"2\")) || (tipoLista.equals(\"3\")) ) {\n\t\t\t\t\tcheck = 1;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.println(\"\\nA opcao so pode conter digitos de 1 a 3\");\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"\\nA opcao so pode conter digitos\");\n\t\t\t}\n\t\t}while(check==0);\n\t\t\n\t\tcheck = 0;\n\t\t\n\t\tdo {\n\t\t\tSystem.out.println(\"\\nInsira o nome do presidente:\");\n\t\t\tnomePessoa = sc.nextLine();\n\t\t\tif(verificarLetras(nomePessoa) && nomePessoa.length()>0) {\n\t\t\t\tcheck = 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"\\nO nome apenas pode conter letras\");\n\t\t\t}\n\t\t}while(check==0);\n\t\tPessoa p = new Pessoa(nomePessoa);\n\t\tlistaCandidatos.add(p);\t\n\t\tnum--;\n\t\t\n\t\tcheck = 0;\n\t\t\n\t\tdo {\n\t\t\tSystem.out.println(\"\\nInsira o nome do vice-presidente:\");\n\t\t\tnomePessoa = sc.nextLine();\n\t\t\tif(verificarLetras(nomePessoa) && nomePessoa.length()>0) {\n\t\t\t\tcheck = 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"\\nO nome apenas pode conter letras\");\n\t\t\t}\n\t\t}while(check==0);\n\t\tPessoa novap = new Pessoa(nomePessoa);\n\t\tlistaCandidatos.add(novap);\t\n\t\tnum--;\n\t\t\n\t\tcheck = 0;\n\t\t\n\t\tfor (i=0; i<num;i++) {\n\t\t\tdo {\n\t\t\t\tSystem.out.println(\"\\nInsira o nome do elemento seguinte:\");\n\t\t\t\tnomePessoa = sc.nextLine();\n\t\t\t\tif(verificarLetras(nomePessoa) && nomePessoa.length()>0) {\n\t\t\t\t\tcheck = 1;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.println(\"\\nO nome apenas pode conter letras\");\n\t\t\t\t}\n\t\t\t}while(check==0);\n\t\t\tPessoa novaPessoa = new Pessoa(nomePessoa);\n\t\t\tlistaCandidatos.add(novaPessoa);\n\t\t\tcheck = 0;\n\t\t}\n\t\t\n\t\tString msgServer = \"\";\n\t\t\n\t\tcheck = 0;\n\t\tint tries = 0;\n\t\tdo {\n\t\t\ttry {\n\t\t\t\tmsgServer = rmiserver.criaLista(id, tipoLista, nomeLista, listaCandidatos);\n\t\t\t\tSystem.out.println(msgServer);\n\t\t\t\tSystem.out.println(\"\\n\");\n\t\t\t\tcheck = 1;\n\t\t\t} catch (RemoteException e1) {\n\t\t\t\t// Tratamento da Excepcao da chamada RMI alteraFac\n\t\t\t\tif(tries == 0) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(6000);\n\t\t\t\t\t\t//faz novo lookup\n\t\t\t\t\t\trmiserver = (RMI_S_I) Naming.lookup(\"rmi://\"+registryIP+\":\"+registryPort+\"/rmi\");\n\t\t\t\t\t\trmiserver.subscribeConsola((ADMIN_C_I)consola);\n\t\t\t\t\t\ttries = 0;\n\t\t\t\t\t} catch (RemoteException | InterruptedException | MalformedURLException | NotBoundException e) {\n\t\t\t\t\t\t// FailOver falhou\n\t\t\t\t\t\ttries++;\n\t\t\t\t\t}\n\t\t\t\t}else if(tries > 0 && tries < 24) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(1000);\n\t\t\t\t\t\t//faz novo lookup\n\t\t\t\t\t\trmiserver = (RMI_S_I) Naming.lookup(\"rmi://\"+registryIP+\":\"+registryPort+\"/rmi\");\n\t\t\t\t\t\trmiserver.subscribeConsola((ADMIN_C_I)consola);\n\t\t\t\t\t\ttries = 0;\n\t\t\t\t\t} catch (RemoteException | InterruptedException | MalformedURLException | NotBoundException e) {\n\t\t\t\t\t\t// FailOver falhou\n\t\t\t\t\t\ttries++;\n\t\t\t\t\t}\n\t\t\t\t}else if(tries >= 24) {\n\t\t\t\t\tSystem.out.println(\"Impossivel realizar a operacao devido a falha tecnica (Servidores RMI desligados).\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}while(check==0);\n\t\tcheck = 0;\n\t}",
"public static void insertarDatos(ArrayList<Producto> lista_productos) {\n\t\tfor (Producto producto : lista_productos) {\r\n\t\t\tDocument doc = new Document();\r\n\t\t\tdoc.put(\"nombre\", producto.getNombre());\r\n\t\t\tdoc.put(\"descripcion\", producto.getDescripcion());\r\n\t\t\tdoc.put(\"precio\", producto.getPrecio());\r\n\t\t\tcoleccion.insertOne(doc);\r\n\t\t}\r\n\t}",
"public void transcribir() \r\n\t{\r\n\t\tpalabras = new ArrayList<List<CruciCasillas>>();\r\n\t\tmanejadorArchivos = new CruciSerializacion();\r\n\t\tint contador = 0;\r\n\t\t\r\n\t\tmanejadorArchivos.leer(\"src/Archivos/crucigrama.txt\");\r\n\t\t\r\n\t\tfor(int x = 0;x<manejadorArchivos.getPalabras().size();x++){\r\n\t\t\t\r\n\t\t\tcontador++;\r\n\t\t\t\r\n\t\t\tif (contador == 4) {\r\n\t\t\t\r\n\t\t\t\tList<CruciCasillas> generico = new ArrayList<CruciCasillas>();\r\n\t\t\t\t\r\n\t\t\t\tfor(int y = 0; y < manejadorArchivos.getPalabras().get(x).length();y++)\r\n\t\t\t\t{\r\n\t\t\t\t\t\tgenerico.add(new CruciCasillas(manejadorArchivos.getPalabras().get(x).charAt(y)));\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (y == (manejadorArchivos.getPalabras().get(x).length() - 1)) \r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tpalabras.add(generico);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tcontador = 0;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\r\n\t}",
"public void insert(List<Event> eventsList);",
"@Override\r\n\tpublic void insertPrestito(Prestito p) {\n\t\t\r\n\t}",
"public Lista(){\n inicio=null;\n fin=null;\n }",
"public void memorizzaVoto(ArrayList<Voto> voti) {\n\n\t\tDB db = getDB();\n\t\tMap<Integer, Voto> map = db.getTreeMap(\"voti\");\n\t\t\n\t\t//pulisco\n\t\tmap.clear();\n\t\t\n\t\tint contatore = 0;\n\t\t\n\t\t//inserisco i voti\n\t\tfor (Voto voto : voti) {\n\t\t\t\n\t\t\tmap.put(contatore++, voto);\n\t\t}\n\t\t\n\t\tdb.commit(); //commit\n\n\t}",
"@Override\n\tpublic boolean doInsertList(List<SysUser> b) throws Exception {\n\t\treturn false;\n\t}",
"public void createListData()\n {\n List<SinhVien> listSinhvien=new ArrayList<>();\n for(int i=0;i<10;i++){\n SinhVien sv=new SinhVien(i+\"\",\"123\",\"0123\",i+1.0f);\n listSinhvien.add(sv);\n }\n PresenterImplDangXuat.onLoadSucess(listSinhvien);\n }",
"public void ajouterJoueur(String[] data){\n\t\tJoueur j = new Joueur(data);\n\t\tListJoueur.add(j);\n\t}",
"public void HordaHardcodeada() {\n\t\t\n\t\tObjetoDelJuego c = mapa.AgregarEnemigo();\n\t\tlistaDeEnemigos.add( (Enemigo) c );\n\t\t\n\t}"
] | [
"0.6361699",
"0.6279124",
"0.62534124",
"0.60211414",
"0.5985645",
"0.5922929",
"0.59180665",
"0.59060955",
"0.59008455",
"0.5866918",
"0.5857605",
"0.5838506",
"0.58318454",
"0.5823327",
"0.5821497",
"0.58203995",
"0.58164644",
"0.5810302",
"0.5801764",
"0.57908565",
"0.5789152",
"0.5785457",
"0.5776261",
"0.57683825",
"0.5764857",
"0.5749423",
"0.5743247",
"0.5740371",
"0.57377064",
"0.5736585",
"0.57363087",
"0.5708548",
"0.57057244",
"0.57030743",
"0.5686023",
"0.56803215",
"0.5678002",
"0.5672884",
"0.56611913",
"0.5656476",
"0.56491494",
"0.5644467",
"0.56315345",
"0.5628875",
"0.5622426",
"0.56163466",
"0.561163",
"0.560798",
"0.560375",
"0.5602271",
"0.5574412",
"0.55702746",
"0.5568329",
"0.5566933",
"0.5565913",
"0.556394",
"0.55624765",
"0.5562312",
"0.5554452",
"0.55518216",
"0.5550515",
"0.5539306",
"0.5537879",
"0.5537688",
"0.55305743",
"0.55301654",
"0.5527336",
"0.5525167",
"0.55202323",
"0.5516458",
"0.55033374",
"0.54964864",
"0.5494542",
"0.5491533",
"0.5487108",
"0.5486808",
"0.5485934",
"0.5484483",
"0.5480986",
"0.5475671",
"0.54728305",
"0.5464304",
"0.5452381",
"0.544127",
"0.5440785",
"0.54400444",
"0.5435298",
"0.54342175",
"0.54238945",
"0.54235995",
"0.5417979",
"0.5417207",
"0.54167074",
"0.5415508",
"0.5411881",
"0.5409503",
"0.54080766",
"0.54022616",
"0.5393575",
"0.5379096"
] | 0.6017512 | 4 |
Busca por um nome de uma pessoa cadastrada | @Override
public Pessoa buscar(int id) {
try {
for (Pessoa p : pessoa.getPessoas()){
if(p.getCodPessoa()== id){
return p;
}
}
} catch (Exception ex) {
Logger.getLogger(AnimalDAO.class.getName()).log(Level.SEVERE, null, ex);
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void pesquisarNome() {\n\t\tSystem.out.println(this.nomePesquisa);\n\t\tthis.alunos = this.alunoDao.listarNome(this.nomePesquisa);\n\t\tthis.quantPesquisada = this.alunos.size();\n\t}",
"public String lerNome() {\n\t\treturn JOptionPane.showInputDialog(\"Digite seu Nome:\");\n\t\t// janela de entrada\n\t}",
"private void filterPerName(EntityManager em) {\n System.out.println(\"Please enter the name: \");\n Scanner sc = new Scanner(System.in);\n //Debug : String name = \"Sel\";\n\n String name = sc.nextLine();\n\n TypedQuery<Permesso> query = em.createQuery(\"select p from com.hamid.entity.Permesso p where p.nome like '%\"+ name\n + \"%'\" , Permesso.class);\n\n List<Permesso> perList = query.getResultList();\n\n for (Permesso p : perList) {\n System.out.println(p.getNome());\n }\n }",
"private void enviarRequisicaoPerguntarNome() {\n try {\n String nome = NomeDialogo.nomeDialogo(null, \"Informe o nome do jogador\", \"Digite o nome do jogador:\", true);\n if (servidor.verificarNomeJogador(nome)) {\n nomeJogador = nome;\n comunicacaoServico.criandoNome(this, nome, \"text\");\n servidor.adicionarJogador(nome);\n servidor.atualizarLugares();\n } else {\n JanelaAlerta.janelaAlerta(null, \"Este nome já existe/inválido!\", null);\n enviarRequisicaoPerguntarNome();\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"public Vendedor buscarVendedorPorNome(String nome);",
"String getPrimeiroNome();",
"public String getNomeAluno( int posicao)\n\t{\n\t\treturn gradeNomes[posicao];\n\t}",
"@Override\n\tpublic Contato buscaContatoNome(String nome) {\n\t\treturn null;\n\t}",
"public List<Usuario> buscaUsuarioNome(String nome) {\r\n\t\tList<Usuario> retorno = new LinkedList<Usuario>();\r\n\r\n\t\tfor (Usuario usuario : listaDeUsuarios) {\r\n\t\t\tif (usuario.getNome().equals(nome)) {\r\n\t\t\t\tretorno.add(usuario);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn retorno;\r\n\t}",
"public List<Contato> getContatosByName(String nome) throws SQLException {\n QueryBuilder<Contato, Integer> queryBuilder =\n contatoDao.queryBuilder();\n // the 'password' field must be equal to \"qwerty\"\n queryBuilder.where().like(\"(nome || sobrenome)\", \"%\"+nome+\"%\");\n // prepare our sql statement\n PreparedQuery<Contato> preparedQuery = queryBuilder.prepare();\n // query for all accounts that have \"qwerty\" as a password\n List<Contato> contatos = contatoDao.query(preparedQuery);\n\n return contatos;\n }",
"Professor procurarNome(String nome) throws ProfessorNomeNExisteException;",
"public void nomeAluno(String na) {\n\t\tnomeAluno = na; \n\t}",
"void cadastrar(String nome, String cpf, String endereco, String email, String senha)throws ProfessorJaCadastradoException;",
"public void asignarNombre(String name);",
"String getUltimoNome();",
"String getNome();",
"public Assunto buscar(String nome){\r\n EntityManager em = PersistenceUtil.getEntityManager();\r\n Query query = em.createQuery(\"SELECT a FROM Assunto a WHERE a.nome =:nome\");\r\n query.setParameter(\"nome\", nome);\r\n \r\n List<Assunto> assunto = query.getResultList();\r\n if(assunto != null && assunto.size() > 0)\r\n return assunto.get(0);\r\n return null;\r\n }",
"private String ricavaNome(String itemSelected){\n int i = 0;\n String schema;\n \n while(itemSelected.charAt(i) != '.'){\n i++;\n }\n \n schema = itemSelected.substring(i+1);\n \n return schema;\n }",
"private String checkName(String name){\n\n if(name.isBlank()){\n name = \"guest\";\n }\n int i = 1;\n if(users.contains(name)) {\n while (users.contains(name + i)) {\n i++;\n }\n name+=i;\n }\n return name;\n }",
"public void alterarDadosCadastraisNomeInvalido(String nome) {\n\t\tAlterarDadosCadastraisPage alterarDadosCadastraisPage = new AlterarDadosCadastraisPage(driver);\n\t\talterarDadosCadastraisPage.getInputNome().clear();\n\t\talterarDadosCadastraisPage.getInputNome().sendKeys(nome);\n\t\talterarDadosCadastraisPage.getButtonSalvar().click();\n\t}",
"public String getNomePessoa() {\n\t\treturn nomePessoa;\n\t}",
"public void setNombreCompleto(String nombreCompleto);",
"private static String digitarNombre() {\n\t\tString nombre;\n\t\tSystem.out.println(\"Digite el nombre del socio: \");\n\t\tnombre = teclado.next();\n\t\treturn nombre;\n\t}",
"public void setNomeAluno(String nome, int posicao)\n\t{\n\t\tif( (posicao > numAlunos) || posicao < 0 )\n\t\t{\n\t\t\tSystem.out.printf(\"Posição %d incorreta\", posicao);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tgradeNomes[posicao] = nome;\n\t\t}\n\t}",
"public void setNome(String nomeAeroporto)\n {\n this.nome = nomeAeroporto;\n }",
"public void setName(String name) {\n\t\tthis.nome = name;\n\t}",
"public java.lang.String exibeMapeamento (java.lang.String nome) {\r\n return this._delegate.exibeMapeamento(nome);\r\n }",
"public List<Usuario> buscarPorNombre(String nombre) throws SQLException {\n PreparedStatement preSt = connection.prepareStatement(USUARIOS_POR_NOMBRE);\n preSt.setString(1, \"%\" + nombre + \"%\");\n ResultSet result = preSt.executeQuery();\n\n List<Usuario> usuario = new LinkedList<>();\n\n while (result.next()) {\n usuario.add(new Usuario(\n result.getInt(Usuario.USUARIO_ID_DB_NAME),\n result.getString(Usuario.NOMBRE_DB_NAME),\n result.getString(Usuario.PROFESION_DB_NAME),\n result.getString(Usuario.PASSWORD_DB_NAME)\n ));\n }\n System.out.println(\"Usuarios: \" + usuario.size());\n return usuario;\n }",
"public void buscarPessoa(){\n\t\tstrCelular = CareFunctions.limpaStrFone(strCelular);\n\t\t System.out.println(\"Preparar \" + strCelular);//\n\t\t \n\t\tif (strCelular.trim().length() > 0){\n\t\t\tSystem.out.println(\"Buscar \" + strCelular);//\n\t\t\tList<Usuario> lstusuario = usuarioDAO.listPorcelular(strCelular);\n\t\t\tSystem.out.println(\"Buscou \" + lstusuario.size());\n\t\t\tsetBooIdentifiquese(false);\n\t\t\tif (lstusuario.size() > 0){\n\t\t\t\tusuario = lstusuario.get(0);\n\t\t\t\tsetBooSelecionouUsuario(true);\n\t\t\t}else{\n\t\t\t\tsetBooSelecionouUsuario(false);\t\t\t\t\n\t\t\t\tsetBooCadastrandose(true);\n\t\t\t\tusuario = new Usuario();\n\t\t\t\tusuario.setUsu_celular(strCelular);\n\t\t\t}\n\t\t\tFacesContext.getCurrentInstance().addMessage(\n\t\t\t\t\tnull,\n\t\t\t\t\tnew FacesMessage(FacesMessage.SEVERITY_INFO,\n\t\t\t\t\t\t\t\"Ahoe\", \"Bem Vindo\"));\t\n\t\t}else{\n\t\t\tSystem.out.println(\"Buscar \" + strCelular);//\n\t\t\tFacesContext.getCurrentInstance().addMessage(\n\t\t\t\t\tnull,\n\t\t\t\t\tnew FacesMessage(FacesMessage.SEVERITY_INFO,\n\t\t\t\t\t\t\t\"Você deve informar o Celular\", \"Não foi possível pesquisar\"));\t\t\t\n\t\t}\n\t}",
"protected String getNomeComQuemDividir(Map<String, Pizza> nomesPizzasFavoritas){\n\t\treturn \"Renata\";\r\n\t}",
"@Override\n\tpublic String findOneByName(final String nombreParametro) {\n\t\tString valor = Constante.SPATIU;\n\t\tif (propriedadesRepository.findOneByName(nombreParametro) != null) {\n\t\t\tvalor = propriedadesRepository.findOneByName(nombreParametro).getValue();\n\t\t}\n\n\t\treturn valor;\n\t}",
"public void cargarNombre() {\n\n System.out.println(\"Indique nombre del alumno\");\n nombre = leer.next();\n nombres.add(nombre);\n\n }",
"public List<Veterinario> pesquisar(String nomeOuCpf) throws ClassNotFoundException, SQLException{ \n VeterinarioDAO dao = new VeterinarioDAO();\n if (!nomeOuCpf.equals(\"\"))\n return dao.listar(\"(nome = '\" + nomeOuCpf + \"' or cpf = '\" + nomeOuCpf + \"') and ativo = true\");\n else\n return dao.listar(\"ativo = true\");\n }",
"public String getNome(){\n return preferencias.getString(CHAVE_NOME, null);\n }",
"public void calcularNomina()\n {\n \n System.out.print('\\u000C');\n int nuevoEmpleado = 1;\n while (nuevoEmpleado == 1)\n {\n System.out.println(\"El nombre del empleado es: \"+nombre);\n System.out.println(\"El salario munsual del empleado es: $\"+salario);\n System.out.println(\"Los días laborados por el empleado es: \"+dia);\n long totalSalario = calcularTotalSalario();\n System.out.println(\"El total del salario es: $\"+totalSalario);\n long totalConDevengado = devengadoClase.calcularTotalConDevengado(totalSalario);\n System.out.println(\"El total devengado es: $\"+totalConDevengado);\n long totalDeducido = deducidoClase.calcularTotalDeducido(totalConDevengado);\n System.out.println(\"El total deducido es: $\"+totalDeducido);\n long totalPagar = totalConDevengado - totalDeducido;\n System.out.println(\"El total a pagar al trabajdor es: $\"+ totalPagar);\n \n System.out.println(\"Desea registrar la nomina de otro empleado 1(si)/2(no): \");\n nuevoEmpleado = teclado.nextInt();\n \n ingresarDatos();\n }\n \n \n }",
"@Override\n\t\t\tpublic String toString() {\n\t\t\t\treturn nome;\n\t\t\t}",
"private static String getRegattaName() {\n\t\tString name = \"\";\n\n\t\tSystem.out.println(\"\\nPlease enter a name for the regatta...\");\n\t\tdo {\n\t\t\tSystem.out.print(\">>\\t\");\n\t\t\tname = keyboard.nextLine().trim();\n\t\t\tif(\"exit\".equals(name)) goodbye();\n\t\t} while(!isValidRegattaName(name) || name.length() == 0);\n\n\t\treturn name;\n\t}",
"public void setName(String name)\r\n\t{\r\n\t\tthis.nome = nome;\r\n\t}",
"public void setNome(String nome) {\r\n this.nome = nome;\r\n }",
"public void setNome(String nome) {\r\n this.nome = nome;\r\n }",
"public void setNome(String pNome){\n this.nome = pNome;\n }",
"public void setNome(String nome) {\n this.nome = nome;\n }",
"public void setNome(String nome) {\n this.nome = nome;\n }",
"public void setNome(String nome) {\n this.nome = nome;\n }",
"private static void search_by_name() {\r\n\t\ttry (// Creates a connection and statement object\r\n\t\t\t\tConnection conn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/PoisedPMS\",\"poisedpms\",\"poisedpms\");\r\n\t\t\t\t\r\n\t\t\t\tStatement stmt = conn.createStatement();\r\n\t\t\t\t\r\n\t\t\t){\r\n\t\t\tScanner input = new Scanner(System.in);\r\n\t\t\r\n\t\t\tSystem.out.println(\"Project Name: \");\r\n\t\t\tString project_name = input.nextLine();\r\n\t\t\r\n\t\t\tString strSelectProject = String.format(\"SELECT * FROM projects INNER JOIN project_statuses ON \"\r\n\t\t\t\t\t+ \"projects.project_id = project_statuses.project_id;\");\r\n\t\t\tResultSet project_rset = stmt.executeQuery(strSelectProject);\r\n\t\t\t\r\n\t\t\tfetch_all_project_info(stmt, project_name, project_rset);\r\n\t\t/**\r\n\t\t * @exception If entered project name cannot be found in the projects table then an SQLException is thrown\r\n\t\t */\t\t\r\n\t\t} catch ( SQLException ex ) {\r\n\t\t\tex . printStackTrace ();\r\n\t\t}\r\n\t}",
"public void getName(ArrayList<String> document) {\r\n name = \"\";\r\n int atIndex = address.indexOf('@');\r\n String username = address.substring(0, atIndex);\r\n for(int i = 0; i < document.size(); i++)\r\n {\r\n String[] words = document.get(i).split(\" \");\r\n for(int j = 0; j < words.length; j++)\r\n {\r\n if(username.contains(words[j].toLowerCase()))\r\n {\r\n name = document.get(i);\r\n break;\r\n }\r\n }\r\n if(!name.equals(\"\"))\r\n {\r\n break;\r\n }\r\n } \r\n }",
"public List<Filme> buscarPeloNome(String nome) {\n EntityManager gerenciador = JPAUtil.getGerenciador();\r\n\r\n //Criando a consulta ao BD\r\n TypedQuery<Filme> consulta = gerenciador.createQuery(\r\n \"Select f from Filme f where f.nome like :nome\",\r\n Filme.class);\r\n\r\n //Substituindo o parametro :nome pelo valor da variavel n\r\n consulta.setParameter(\"nome\", nome + \"%\");\r\n\r\n //Retornar os dados\r\n return consulta.getResultList();\r\n\r\n }",
"public void actualizarNombrePoder(){\n\t\tString name = ( game.getCurrentSorpresa() == null )?\"No hay sorpresa\":game.getCurrentSorpresa().getClass().getName();\n\t\tn2.setText(name.replace(\"aplicacion.\",\"\"));\n\t}",
"public Identificador(String name) {\r\n this.name = name;\r\n }",
"public void setNome(String nome) {\r\n\t\tthis.nome = nome;\r\n\t}",
"public int searchByName(String nome)\n{\n\tfor(int i=0;i<a.Size();i++)\n\t{\n\t\tif (a.getCategoria(i).getNome().equals(nome)) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}",
"public String getNombreCompleto();",
"public void setNome(String nome){\r\n this.nome = nome;\r\n }",
"public Agenda(String nome) {\n\t\tthis.nome = nome;\n\t\tthis.compromisso = new ArrayList<>();\n\t}",
"public void inserirContato() {\n\t\tSystem.out.println(\"Digite o nome do novo contato: \");\n\t\tString contato = scanner.nextLine();\n\t\tlistaDeContatos.add(contato);\n\t}",
"public void updateName() {\n try {\n userFound = clientefacadelocal.find(this.idcliente);\n if (userFound != null) {\n userFound.setNombre(objcliente.getNombre());\n clientefacadelocal.edit(userFound);\n objcliente = new Cliente();\n mensaje = \"sia\";\n } else {\n mensaje = \"noa\";\n System.out.println(\"Usuario No Encontrado\");\n }\n } catch (Exception e) {\n mensaje = \"noa\";\n System.out.println(\"El error al actualizar el nombre es \" + e);\n }\n }",
"public void setNome(String nome) {\n\t\tthis.nome = nome;\n\t}",
"public void setNome(String nome) {\n\t\tthis.nome = nome;\n\t}",
"public void setNome(String nome) {\n\t\tthis.nome = nome;\n\t}",
"public void setNome(String nome) {\n\t\tthis.nome = nome;\n\t}",
"public void setNome (String nome) {\r\n\t\tthis.nome=nome;\r\n\t}",
"private String getTextCount(int conut, String name) {\n for (int i = 0; i < conut; i++) {\r\n name = name + \" \";\r\n }\r\n return name;\r\n }",
"public void setNome(String nome) {\r\n\t\t// QUALIFICADOR = THIS\r\n\t\tthis.nome = nome;\r\n\t}",
"String getPname();",
"public Etiqueta buscador(String nombreEtiqueta){\n for(int i = 0;i < listaEtiquetas.size();i++){\n if(this.listaEtiquetas.get(i).getEtiqueta().equals(nombreEtiqueta)){ //Si coincide el nombre de la etiqueta, se retorna\n return this.listaEtiquetas.get(i);\n }\n }\n return null;\n }",
"public static void criaPessoa() {\n\t\tScanner sc = new Scanner(System.in);\t\t\n\t\tString nome, pwd, dep, ntlf, morada, nCC, data, tipo;\n\t\tint check = 0;\n\t\t\n\t\tdo {\n\t\t\tSystem.out.println(\"\\nInsira o nome:\");\n\t\t\tnome = sc.nextLine();\n\t\t\tif(verificarLetras(nome) && nome.length()>0) {\n\t\t\t\tcheck = 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"\\nO nome apenas pode conter letras\");\n\t\t\t}\n\t\t}while(check==0);\n\t\t\n\t\tcheck = 0;\n\t\t\n\t\tdo {\n\t\t\tSystem.out.println(\"\\nInsira a profissao:\\n(1)Estudante\\n(2)Funcionario\\n(3)Docente\");\n\t\t\ttipo = sc.nextLine();\n\t\t\tif(tipo.equals(\"1\") || tipo.equals(\"2\") || tipo.equals(\"3\")) {\n\t\t\t\tcheck = 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"\\nA opcao so pode conter digitos de 1 a 3\");\n\t\t\t}\n\t\t}while(check==0);\n\t\t\n\t\tcheck = 0;\n\t\t\n\t\tdo {\n\t\t\tSystem.out.println(\"\\nInsira o nome do departamento:\");\n\t\t\tdep = sc.nextLine();\n\t\t\tif(verificarLetras(dep) && dep.length()>0) {\n\t\t\t\tcheck = 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"\\nO nome apenas pode conter letras\");\n\t\t\t}\n\t\t}while(check==0);\n\t\t\n\t\tcheck = 0;\n\t\t\n\t\tdo {\n\t\t\tSystem.out.println(\"Insira o numero de contacto:\\n\");\n\t\t\tntlf = sc.nextLine();\n\t\t\tif(verificarNumeros(ntlf) && ntlf.length()<= 9) {\n\t\t\t\tif (Integer.parseInt(ntlf) > 0) {\n\t\t\t\t\tcheck = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"\\nO numero de contacto apenas pode conter 9 digitos\");\n\t\t\t}\n\t\t}while(check==0);\n\t\t\t\n\t\tcheck = 0;\n\t\t\n\t\tSystem.out.println(\"\\nInsira a morada:\");\n\t\tmorada = sc.nextLine();\n\t\t\n\t\tdo {\n\t\t\tSystem.out.println(\"Insira o numero do cartao de cidadao:\\n\");\n\t\t\tnCC = sc.nextLine();\n\t\t\tif(verificarNumeros(nCC) && nCC.length()<= 9) {\n\t\t\t\tif (Integer.parseInt(nCC) > 0) {\n\t\t\t\t\tcheck = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"\\nO numero do CC apenas pode conter 9 digitos\");\n\t\t\t}\n\t\t}while(check==0);\n\t\t\n\t\tSystem.out.println(\"Insira a validade do cartao de cidadao (DD/MM/AAAA):\\n\");\n\t\tdata = sc.nextLine();\n\n\t\tSystem.out.println(\">>>\\nELEITOR:\\nPor favor insira aqui a sua password:\\n\");\n\t\tpwd = sc.nextLine();\n\t\t\n\t\tString msgServer = \"\";\n\t\t\n\t\tcheck = 0;\n\t\tint tries = 0;\n\t\tdo {\n\t\t\ttry {\n\t\t\t\tmsgServer = rmiserver.registarPessoa(Integer.parseInt(tipo), nome, pwd, dep, ntlf, morada, nCC, data);\n\t\t\t\tSystem.out.println(msgServer);\n\t\t\t\tSystem.out.println(\"\\n\");\n\t\t\t\tcheck = 1;\n\t\t\t} catch (RemoteException e1) {\n\t\t\t\t// Tratamento da Excepcao da chamada RMI devolveEleicoes\n\t\t\t\tif(tries == 0) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(6000);\n\t\t\t\t\t\t//faz novo lookup\n\t\t\t\t\t\trmiserver = (RMI_S_I) Naming.lookup(\"rmi://\"+registryIP+\":\"+registryPort+\"/rmi\");\n\t\t\t\t\t\trmiserver.subscribeConsola((ADMIN_C_I)consola);\n\t\t\t\t\t\ttries = 0;\n\t\t\t\t\t} catch (RemoteException | InterruptedException | MalformedURLException | NotBoundException e) {\n\t\t\t\t\t\t// FailOver falhou\n\t\t\t\t\t\ttries++;\n\t\t\t\t\t}\n\t\t\t\t}else if(tries > 0 && tries < 24) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(1000);\n\t\t\t\t\t\t//faz novo lookup\n\t\t\t\t\t\trmiserver = (RMI_S_I) Naming.lookup(\"rmi://\"+registryIP+\":\"+registryPort+\"/rmi\");\n\t\t\t\t\t\trmiserver.subscribeConsola((ADMIN_C_I)consola);\n\t\t\t\t\t\ttries = 0;\n\t\t\t\t\t} catch (RemoteException | InterruptedException | MalformedURLException | NotBoundException e) {\n\t\t\t\t\t\t// FailOver falhou\n\t\t\t\t\t\ttries++;\n\t\t\t\t\t}\n\t\t\t\t}else if(tries >= 24) {\n\t\t\t\t\tSystem.out.println(\"Impossivel realizar a operacao devido a falha tecnica (Servidores RMI desligados).\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}while(check==0);\n\t}",
"public static void main(String[] args) {\n Scanner leitor = new Scanner(System.in);\n String primeiroNome = leitor.next();\n String segundoNome = leitor.next();\n\n primeiroNome = segundoNome+\" \"+primeiroNome;\n segundoNome = \"\";\n\n System.out.println(primeiroNome +\" \"+ segundoNome);\n }",
"public String selectName()\n {\n JOptionPane nameSelector = new JOptionPane();\n String name = nameSelector.showInputDialog(\"What is this trainer's name?\");\n return name;\n }",
"@Override\n public String toString() {\n return nome + placa;\n }",
"@Override\n public Collection<Curso> findByNameCurso(String Name) throws Exception {\n Collection<Curso> retValue = new ArrayList();\n Connection c = null;\n PreparedStatement pstmt = null;\n ResultSet rs = null;\n\n try {\n c = DBUtils.getConnection();\n pstmt = c.prepareStatement(\"SELECT c.idcurso, c.idprofesor, p.nombre as nombreprofesor, c.nombrecurso, c.claveprofesor,\"\n + \" c.clavealumno from curso c, persona p\\n\" +\n \"where c.idprofesor = p.id and UPPER(c.nombrecurso) like UPPER(?)\");\n pstmt.setString(1, Name);\n\n rs = pstmt.executeQuery();\n\n while (rs.next()) { \n retValue.add(new Curso(rs.getInt(\"idcurso\"), rs.getString(\"nombrecurso\"),rs.getInt(\"idprofesor\"), rs.getString(\"nombreprofesor\"),rs.getString(\"claveprofesor\"), rs.getString(\"clavealumno\")));\n }\n// } else {\n// retValue = new Curso(0,null,null,0,null);\n// }\n\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n try {\n if (rs != null) {\n rs.close();\n }\n if (pstmt != null) {\n pstmt.close();\n }\n DBUtils.closeConnection(c);\n } catch (SQLException ex) {\n Logger.getLogger(JdbcCursoRepository.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n return retValue;\n }",
"List<T> buscarTodosComNomeLower();",
"@Override\n\tpublic ArrayList<String> partecipantiListaElettorale(String nome) {\n\t\tDB db = getDB();\n\t\tMap<Integer, Lista> map = db.getTreeMap(\"liste\");\n\n\t\tSet<Integer> keys = map.keySet();\n\t\tfor (int key : keys) {\n\t\t\tif (map.get(key).getNomeLista().equals(nome)) {\n\t\t\t\treturn map.get(key).getComponenti();\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}",
"public List<Produto> consultarProdutoPorParteNome(String nome) {\n\t\t\tQuery q = manager.query();\n\t\t\tq.constrain(Produto.class);\n\t\t\tq.descend(\"nome\").constrain(nome).like();\n\t\t\tList<Produto> result = q.execute(); \n\t\t\treturn result;\n\t\t}",
"String getSurname();",
"public int buscaCorJogador(List<Jogador> lista ,String a) {\n\t\tfor(int k = 0;k<lista.size();k++) {\n\t\t\tif(lista.get(k).getCor().toUpperCase().equals(a.toUpperCase())) {\n\t\t\t\treturn k;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\n\t\t\n\t}",
"public void setNomeAzienda(String nomeAzienda) {\r\n\t\tthis.nomeAzienda = nomeAzienda;\r\n\t}",
"String getCidade();",
"private int contar(String nombre) {\n int c = 0;\n for (Nodo<Integer, Reservacion> th1 : this.th) {\n if (th1 != null && th1.value.Cliente().equals(nombre)) {\n c++;\n }\n }\n return c;\n }",
"public String nome() {\n\t\treturn this.nome;\n\t}",
"public void findByName() {\n String name = view.input(message_get_name);\n if (name != null){\n try{\n List<Customer> list = model.findByName(name);\n if(list!=null)\n if(list.isEmpty())\n view.showMessage(not_found_name);\n else\n view.showTable(list);\n else\n view.showMessage(not_found_error);\n }catch(Exception e){\n view.showMessage(incorrect_data_error);\n }\n } \n }",
"public void setNomeCodifica(String nomeCodifica){\n\t\tsetTipoCodifica(new TipoCodifica(nomeCodifica));\n\t}",
"public String listarSensores(){\r\n String str = \"\";\r\n for(PacienteNuvem x:pacientes){//Para cada paciente do sistema ele armazena uma string com os padroes do protocolo de comunicação\r\n str += x.getNick()+\"-\"+x.getNome()+\"#\";\r\n }\r\n return str;\r\n }",
"void setNome(String nome);",
"String getCognome();",
"public List<Funcionario> buscaPorNome(String nome) {\r\n session = HibernateConexao.getSession();\r\n session.beginTransaction().begin();\r\n// Query query=session.createSQLQuery(sqlBuscaPorNome).setParameter(\"nome\", nome);\r\n List list = session.createCriteria(classe).add(Restrictions.like(\"nome\", \"%\" + nome + \"%\")).list();\r\n session.close();\r\n return list;\r\n }",
"String getPreferredName();",
"public static void main(String[] args) {\n\r\n\r\n Scanner scan = new Scanner(System.in);\r\n String word = scan.next();\r\n String separator = scan.next();\r\n int count = scan.nextInt();\r\n\r\n\r\n String name = \"\";\r\n for (int i = 1; i <= count; i++) {\r\n\r\n name = name +word + separator ;\r\n\r\n if (i == count) {\r\n\r\n System.out.print(name.substring(0, name.length()-separator.length() ));\r\n } else {\r\n continue;\r\n }\r\n\r\n }\r\n }",
"String getName( String name );",
"public Fruitore(String nomeUtente)\r\n\t{\r\n\t\tthis.nomeUtente = nomeUtente;\r\n\t}",
"public String getNome();",
"public String inseriscinome()\n {\n String nome;\n \n do\n {\n System.out.println(\"--Inserisci il nome utente--\");\n nome=input.nextLine();\n }\n while(nome.isEmpty());\n \n return nome;\n }",
"public String getNome()\r\n\t{\r\n\t\treturn nome;\r\n\t}",
"public String getNome()\r\n\t{\r\n\t\treturn nome;\r\n\t}",
"@Override\r\n\tpublic int buscarIndice(String nomeEmpresa) {\n\t\treturn 0;\r\n\t}",
"public void listarNominasEmpleadoProfundidad(int idMecanico) throws BusinessException;",
"private void setNomeProfessor(String novoNome)\n\t{\n\t\tthis.nomeProfessor = novoNome;\n\t}",
"public List<FilmeAtor> buscarFilmesAtoresPeloNomeFilmeOuNomeAtor(String nomeFilmeOuAtor) {\n EntityManager gerenciador = JPAUtil.getGerenciador();\r\n\r\n //Criando a consulta ao BD\r\n TypedQuery<FilmeAtor> consulta = gerenciador.createQuery(\r\n \"SELECT new dados.dto.FilmeAtor(f, a) FROM Filme f JOIN f.atores a WHERE f.nome like :nomeFilme or a.nome like :nomeAtor\",\r\n FilmeAtor.class);\r\n\r\n consulta.setParameter(\"nomeFilme\", nomeFilmeOuAtor + \"%\");\r\n consulta.setParameter(\"nomeAtor\", nomeFilmeOuAtor + \"%\");\r\n \r\n return consulta.getResultList();\r\n\r\n }",
"public cABCEmpleados(String nombre) {\r\n this._Nombre = nombre;\r\n }",
"@Override\n\t\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\t\tuserName = (String) JOptionPane.showInputDialog(frame,\"Digite o nome:\");\n\t\t\t\t\t}",
"private String[] getNomeArquivosCaixa(File ordem) throws IOException\n\t{\n\t\tCollection arquivos = new LinkedList();\n\t\tFileReader \t\tfReader \t= new FileReader(ordem);\n\t\tBufferedReader \tbuffReader \t= new BufferedReader(fReader);\n\t\tString patternNomArqCaixa = getPropriedade(\"ordemVoucher.patternArquivosCaixa\");\n\t\tString linha=null;\n\t\twhile ( (linha=buffReader.readLine()) != null )\n\t\t\t/* Verifica se o pattern dos nomes de arquivos foi encontrado */\n\t\t\tif (linha.indexOf(patternNomArqCaixa) > -1)\n\t\t\t{\n\t\t\t\t/* Faz o split da linha que contem diferentes campos separados por \",\"\n\t\t\t\t * Utiliza a classe abaixo devido a maquina da Tecnomen possuir\n\t\t\t\t * a versao 1.3 do Java\n\t\t\t\t */\n\t\t\t\t//String campos[] = linha.split(\",\");\n\t\t\t\tStringTokenizer strToken = new StringTokenizer(linha,\",\");\n\t\t\t\tString campos[] = new String[strToken.countTokens()];\n\t\t\t\tfor (int i=0; i < campos.length; i++)\n\t\t\t\t\tcampos[i] = strToken.nextToken();\n\n\t\t\t\t/* O primeiro campo e o nome do arquivo */\n\t\t\t\tarquivos.add(campos[0]);\n\t\t\t}\n\n\t\tbuffReader.close();\n\t\tfReader.close();\n\t\treturn (String[])arquivos.toArray(new String[0]);\n\t}",
"List<Menu> listarMenuPorUsuario(String nombre);"
] | [
"0.6452094",
"0.6385538",
"0.6345649",
"0.62783533",
"0.60947824",
"0.60817695",
"0.6010619",
"0.600129",
"0.59904164",
"0.59386575",
"0.5930306",
"0.59180975",
"0.5910581",
"0.5902152",
"0.58829135",
"0.58149403",
"0.5764271",
"0.5756464",
"0.57524335",
"0.5693116",
"0.5688362",
"0.5683489",
"0.5637103",
"0.56228215",
"0.56214577",
"0.5619663",
"0.56165946",
"0.56131095",
"0.5605939",
"0.560542",
"0.55945224",
"0.5594288",
"0.5561529",
"0.5558693",
"0.5556196",
"0.5542448",
"0.5539476",
"0.55268776",
"0.55129796",
"0.55129796",
"0.55124307",
"0.55114233",
"0.55114233",
"0.55114233",
"0.5506186",
"0.5500937",
"0.5495468",
"0.5495384",
"0.548815",
"0.5470699",
"0.5462472",
"0.5461413",
"0.546061",
"0.54537237",
"0.5452739",
"0.544587",
"0.5442115",
"0.5442115",
"0.5442115",
"0.5442115",
"0.5442099",
"0.54339737",
"0.5425956",
"0.5425333",
"0.5407663",
"0.53991544",
"0.5397055",
"0.53945976",
"0.5394016",
"0.5385892",
"0.53818035",
"0.53817403",
"0.5370643",
"0.5370406",
"0.53682816",
"0.53664887",
"0.53648293",
"0.53597695",
"0.5358282",
"0.53566796",
"0.5343626",
"0.5335719",
"0.53264886",
"0.53122944",
"0.5312",
"0.53005147",
"0.5297943",
"0.5292466",
"0.52900225",
"0.5278236",
"0.527393",
"0.52709085",
"0.52709085",
"0.5265805",
"0.5255628",
"0.5247807",
"0.5245739",
"0.5245169",
"0.5242632",
"0.52398854",
"0.52259505"
] | 0.0 | -1 |
Find acccount by email | @PostMapping("/findByEmail")
public Account findAccountByEmail(@RequestBody String email) {
return getService().findByEmail(email);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"long countUserByEmail(String email);",
"long countByExample(EmailCriteria example);",
"long countByExample(mailIdentifyExample example);",
"public int getEmailAmount(String email);",
"public static synchronized int checkCred(String email){\n\t\t\tConnection connection;\n\t\t\tint count = 1;\n\t\t \tPreparedStatement statement = null;\n\t\t\tString preparedSQL = \"Select Count(*) From credential Where Email = ?\";\n\t\t\t\n\t\t try{\n\t\t \tconnection = DBConnector.getConnection();\n\t\t \tstatement = connection.prepareStatement(preparedSQL);\n\t\t \tstatement.setString(1,email);\n\t\t\t\tResultSet rs = statement.executeQuery();\n\t\t\t\twhile(rs.next()){\n\t\t\t\t\tcount = rs.getInt(1);\n\t\t\t\t}\t\n\t\t\t\trs.close();\n\t\t\t\tstatement.close();\n\t\t\t\tconnection.close();\n\t\t\t}\n\t\t catch (SQLException ex){\n\t\t\t\tSystem.out.println(\"Error: \" + ex);\n\t\t\t\tSystem.out.println(\"Query: \" + statement.toString());\n\t\t\t\t\n\t\t\t}\n\t\t\treturn count;\n\t\t}",
"private static void lookupAccount(String email) {\n\t\t\n\t}",
"Coach findByEmail(String email);",
"public int getEmailAmount(String email, int id);",
"@Override\n\tpublic int countByEmailAddress(String emailAddress)\n\t\tthrows SystemException {\n\t\tFinderPath finderPath = FINDER_PATH_COUNT_BY_EMAILADDRESS;\n\n\t\tObject[] finderArgs = new Object[] { emailAddress };\n\n\t\tLong count = (Long)FinderCacheUtil.getResult(finderPath, finderArgs,\n\t\t\t\tthis);\n\n\t\tif (count == null) {\n\t\t\tStringBundler query = new StringBundler(2);\n\n\t\t\tquery.append(_SQL_COUNT_CANDIDATE_WHERE);\n\n\t\t\tboolean bindEmailAddress = false;\n\n\t\t\tif (emailAddress == null) {\n\t\t\t\tquery.append(_FINDER_COLUMN_EMAILADDRESS_EMAILADDRESS_1);\n\t\t\t}\n\t\t\telse if (emailAddress.equals(StringPool.BLANK)) {\n\t\t\t\tquery.append(_FINDER_COLUMN_EMAILADDRESS_EMAILADDRESS_3);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tbindEmailAddress = true;\n\n\t\t\t\tquery.append(_FINDER_COLUMN_EMAILADDRESS_EMAILADDRESS_2);\n\t\t\t}\n\n\t\t\tString sql = query.toString();\n\n\t\t\tSession session = null;\n\n\t\t\ttry {\n\t\t\t\tsession = openSession();\n\n\t\t\t\tQuery q = session.createQuery(sql);\n\n\t\t\t\tQueryPos qPos = QueryPos.getInstance(q);\n\n\t\t\t\tif (bindEmailAddress) {\n\t\t\t\t\tqPos.add(emailAddress);\n\t\t\t\t}\n\n\t\t\t\tcount = (Long)q.uniqueResult();\n\n\t\t\t\tFinderCacheUtil.putResult(finderPath, finderArgs, count);\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tFinderCacheUtil.removeResult(finderPath, finderArgs);\n\n\t\t\t\tthrow processException(e);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tcloseSession(session);\n\t\t\t}\n\t\t}\n\n\t\treturn count.intValue();\n\t}",
"@Override\r\n\tpublic int emailcheck(String email) {\n\t\treturn dao.idcheck(email);\r\n\t}",
"public int duplicateEmail(String email) {\n\t\treturn sqlSessionTemplate.selectOne(\"memberInfo.checkEmail\", email);\r\n\t}",
"public int getContactIdByEmail(String email) {\r\n\t\tHttpGet request = new HttpGet(QueryId(email));\r\n credential(request);\r\n try {\r\n \tString jsonResponse = connectionHttp.ConnectionResponse(request); \t \r\n \t\tObjectMapper om = new ObjectMapper();\r\n \t\tJsonNode nodes = om.readTree(jsonResponse).get(PropertiesReader.stringElements());\r\n \t\treturn nodes.get(0).get(\"id\").asInt();\r\n }catch (ClientProtocolException e) {\r\n \treturn 0;\r\n }catch (IOException e) {\r\n \treturn 0;\r\n\t\t}catch (NullPointerException e) {\r\n \treturn 0;\r\n\t\t}\r\n\t}",
"public static synchronized int getUserIDByEmail(String email){\n\t\t\n\t\t\tint user_ID = 0;\n\t\t\tConnection connection;\n\t\t \tPreparedStatement statement = null;\n\t\t\tString preparedSQL = \"Select User_ID From credential Where Email = ?\";\n\t\t\t\n\t\t try{\n\t\t \tconnection = DBConnector.getConnection();\n\t\t \tstatement = connection.prepareStatement(preparedSQL);\n\t\t \tstatement.setString(1, email);\n\t\t\t\tResultSet rs = statement.executeQuery();\n\t\t\t\twhile(rs.next()){\n\t\t\t\t\tuser_ID = rs.getInt(1);\n\t\t\t\t}\t\n\t\t\t\trs.close();\t\t\n\t\t\t\tstatement.close();\n\t\t\t\tconnection.close();\n\t\t\t\t\n\t\t\t}\n\t\t catch (SQLException ex){\n\t\t\t\tSystem.out.println(\"Error: \" + ex);\n\t\t\t\tSystem.out.println(\"Query: \" + statement.toString());\n\t\t\t\tuser_ID=0;\n\t\t\t}\n\t\t\treturn user_ID;\n\t\t\t\n\t}",
"boolean existsByEmail(String email);",
"Account findByEmail(String email);",
"public boolean findEmail(String email);",
"@Override\n\tpublic int countByemailReqBfcInfo(boolean inStage, String email) {\n\t\tFinderPath finderPath = FINDER_PATH_COUNT_BY_EMAILREQBFCINFO;\n\n\t\tObject[] finderArgs = new Object[] { inStage, email };\n\n\t\tLong count = (Long)finderCache.getResult(finderPath, finderArgs, this);\n\n\t\tif (count == null) {\n\t\t\tStringBundler query = new StringBundler(3);\n\n\t\t\tquery.append(_SQL_COUNT_LOCALRICHINFO_WHERE);\n\n\t\t\tquery.append(_FINDER_COLUMN_EMAILREQBFCINFO_INSTAGE_2);\n\n\t\t\tboolean bindEmail = false;\n\n\t\t\tif (email == null) {\n\t\t\t\tquery.append(_FINDER_COLUMN_EMAILREQBFCINFO_EMAIL_1);\n\t\t\t}\n\t\t\telse if (email.equals(StringPool.BLANK)) {\n\t\t\t\tquery.append(_FINDER_COLUMN_EMAILREQBFCINFO_EMAIL_3);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tbindEmail = true;\n\n\t\t\t\tquery.append(_FINDER_COLUMN_EMAILREQBFCINFO_EMAIL_2);\n\t\t\t}\n\n\t\t\tString sql = query.toString();\n\n\t\t\tSession session = null;\n\n\t\t\ttry {\n\t\t\t\tsession = openSession();\n\n\t\t\t\tQuery q = session.createQuery(sql);\n\n\t\t\t\tQueryPos qPos = QueryPos.getInstance(q);\n\n\t\t\t\tqPos.add(inStage);\n\n\t\t\t\tif (bindEmail) {\n\t\t\t\t\tqPos.add(email);\n\t\t\t\t}\n\n\t\t\t\tcount = (Long)q.uniqueResult();\n\n\t\t\t\tfinderCache.putResult(finderPath, finderArgs, count);\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tfinderCache.removeResult(finderPath, finderArgs);\n\n\t\t\t\tthrow processException(e);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tcloseSession(session);\n\t\t\t}\n\t\t}\n\n\t\treturn count.intValue();\n\t}",
"Collection lookupTransactions(String email);",
"long countUserByExternalId(String externalId);",
"@Test\n void countByTelephone() {\n int a = sysUserMapper.countByMail(\"[email protected]\", 1);\n System.out.println(a);\n }",
"public Token getTokenByEmail(String email)throws Exception;",
"@Override\n\tpublic UserVO searchEmail(String email) throws Exception {\n\t\treturn dao.searchEmail(email);\n\t}",
"public boolean existsByEmail(String email);",
"public boolean existsByEmail(String email);",
"public User_info search_User_info(String email) {\n\t\t\t\tSystem.out.println(user_loginDao.searchId(email));\r\n\t\t\t\treturn user_infoDao.search_User(user_loginDao.findUserByEmail(email).getId());\r\n\t}",
"public Boolean existsByEmail(String email);",
"boolean emailExistant(String email, int id) throws BusinessException;",
"@Query(value=\"SELECT COUNT(id) FROM Ticket t where client_email= (select email from User where email= :email) AND status=:status\")\n\tint findAllByClientbyStatusCount(@Param(\"email\") String client, @Param(\"status\") String status);",
"public String findEmail(String email) {\n\t\tString sql=\"select email from SCOTT.USERS where USERNAME='\"+email+\"'\";\n\t\t\n\t\t Dbobj dj=new Dbobj();\n\t\t JdbcUtils jdbcu=new JdbcUtils();\n\t\t dj=jdbcu.executeQuery(sql);\n\t\t ResultSet rs=dj.getRs(); \n\t\t System.out.println(\"\"+sql);\t\n\t\t String t=\"\";\n\t\t try {\n\t\t\twhile(rs.next())\n\t\t\t\t{\n\t\t\t\t\tt=rs.getString(1);\n\t\t\t\t}\n\t\t} catch (NumberFormatException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t\n\t\t \n\t\t\n\t\treturn t;\n\t\t\n\t}",
"@Override\r\n\tpublic int getIdByEmail(String email) {\n\t\treturn 0;\r\n\t}",
"@Override\n public Client findClientByEmail(String email) {\n Client client = null;\n\n try (Session session = HibernateUtil.getSessionFactory().openSession()) {\n CriteriaBuilder cb = session.getCriteriaBuilder();\n CriteriaQuery cr = cb.createQuery(Client.class);\n Root root = cr.from(Client.class);\n cr.select(root);\n Query query = session.createQuery(cr);\n List<Client> results = query.getResultList();\n\n\n\n for (Client clt : results) {\n if (clt.getEmail().equals(email)) client = clt;\n }\n\n if (client==null) return null;\n\n\n\n /*\n Add accounts to List<Accounts> for client with specific parameters\n */\n String hql = \"FROM Account WHERE client_id = :paramId\";\n Query queryAccounts = session.createQuery(hql);\n queryAccounts.setParameter(\"paramId\", client.getId());\n List<Account> accounts = ((org.hibernate.query.Query) queryAccounts).list();\n client.setAccounts(accounts);\n }\n return client;\n }",
"@Override\n\tpublic int getSpaceAvaiable(String email) {\n\t\tint i = searchIndex(email);\n\t\tint space = 0;\n\t\tif (i >= 0)\n\t\t\tspace = users[i].getAvailableSpace();\n\t\treturn space;\n\t}",
"public int getCustomerIdFromEmail(String email) {\n return database.getCustomerIdFromEmail(email);\n }",
"public User existsProfile(String email) {\n StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();\n StrictMode.setThreadPolicy(policy);\n\n SuperBooleanBuilder query = new SuperBooleanBuilder();\n query.put(\"email\", email);\n Search search = new Search.Builder(query.toString())\n .addIndex(INDEX_NAME)\n .addType(User.class.toString())\n .build();\n\n User result = null;\n try {\n result = client.execute(search).getSourceAsObject(User.class);\n } catch (IOException e1) {\n e1.printStackTrace();\n }\n return result;\n }",
"public List<BarrioCovid> readAll(String email);",
"@Override\n public String getSearchIDFromDB(String email) {\n String sql = \"select SEARCH_ID from SEARCH a inner join customer c on \" +\n \"a.CUSTOMER_ID = c.CUSTOMER_ID where \" +\n \"c.EMAIL = '\" + email + \"' \" +\n \"order by a.CREATE_DATE desc\";\n Map<String, Object> result = jdbcTemplate.queryForMap(sql);\n return result.get(\"SEARCH_ID\").toString();\n }",
"boolean emailTaken(String email) throws SQLException {\n\t\tpst=con.prepareStatement(\"SELECT * FROM utilisateur WHERE email=?;\");\n\t\tpst.setString(1, email);\n\t\t\n\t\trs = pst.executeQuery();\n\t\treturn (rs.next());\n\t}",
"boolean checkEmailExist(String email){\n boolean isEmailExists = false;\n dbConnection();\n try{\n stmt = con.prepareStatement(\"SELECT * FROM users ORDER BY email\");\n rs = stmt.executeQuery();\n while(rs.next()){\n String checkEmail = rs.getString(\"email\");\n if(checkEmail.equals(email)){\n isEmailExists = true;\n }\n }\n }\n catch(Exception e){\n e.printStackTrace();\n }\n return isEmailExists;\n }",
"public Utente retriveByEmail(String email) {\n\t\t\n\t\tTypedQuery<Utente> query = em.createNamedQuery(Utente.FIND_BY_Email, Utente.class);\n query.setParameter(\"email\", email); //parameters by name \n return query.getSingleResult();\n\t}",
"public boolean emailAlreadyUsed(String email){\n \n StringBuilder query = new StringBuilder();\n \n query.append(\"SELECT id FROM userr WHERE email ='\");\n query.append(email);\n query.append(\"';\");\n \n try{\n PreparedStatement sql = conn.prepareStatement(query.toString());\n ResultSet results = sql.executeQuery();\n\n while (results.next()){\n return true;\n } \n\n\n } catch (SQLException e){\n e.printStackTrace();\n }\n \n return false;\n \n }",
"long countUserByLogin(String login);",
"boolean isEmailExist(String email);",
"public static boolean checkUserEmail(String email)\n\t{\n\t\tSearchResponse response = client.prepareSearch(\"projektzespolowy\")\n\t\t\t\t.setTypes(\"user\")\n\t\t\t\t.setSearchType(SearchType.DFS_QUERY_THEN_FETCH)\n\t\t\t\t.setQuery(QueryBuilders.matchPhraseQuery(\"EMAIL\", email))\n\t\t\t\t.setSize(0).setFrom(0)\n\t\t\t\t.execute()\n\t\t\t\t.actionGet();\n\t\t\n\t\tif(response.getHits().getTotalHits() > 0)\n\t\t\treturn false;\n\t\telse \n\t\t\treturn true;\n\t}",
"@Override\r\n\tpublic String findByEmail(String emailId) {\r\n\t\tAppAccountEntity entity = appAccRepository.findByEmail(emailId);\r\n\t\treturn (entity == null) ? \"Unique\" : \"Duplicate\";\r\n\t}",
"List<ClientName> findNameByEmail(String email);",
"User getUserByEmail(String email);",
"String getLoginapifailhitcount();",
"public static String emailValid(String email){\n return \"select u_email from users having u_email = '\" + email + \"'\";\n }",
"User getUserByEmail(final String email);",
"public static long getNumeroTentativiLogin(String email) {\n\t\tRequestContent rp = new RequestContent();\n\t\trp.parameters = new Object[] { email };\n\t\trp.type = RequestType.GET_LOGIN_ATTEMPTS_NUMBER;\n\t\tReceiveContent rpp = sendReceive(rp);\n\t\tlong getNumeroTentativiLogin = (long) rpp.parameters[0];\n\t\treturn getNumeroTentativiLogin;\n\t}",
"public Customer getCustomerByEmail(String email) throws Exception\r\n { \r\n\t //String searchClause = email.toLowerCase();\r\n\t //String qryString = \"from City where LOWER(cityName) LIKE :param\";\r\n\t String qryString = \"from Customer where LOWER(email) = :param\";\r\n\t \t \r\n\t EntityManager em = emf.createEntityManager();\r\n\t Query qry = em.createQuery(qryString);\r\n\t qry.setParameter(\"param\", email.toLowerCase());//binding parameter to mitigate SQL Injection attacks\r\n\t \r\n\t /*List<City> citiestList = qry.setMaxResults(maxRowsToDisplay)\r\n\t\t\t \t\t\t\t\t\t\t\t.getResultList();*/\r\n\t \r\n\t logger.info(\"-------------qry.toString() \"+qry.toString());\r\n\t \r\n\t List<Customer> customerList = qry.getResultList();\r\n\t \r\n\t if(customerList == null || customerList.size() == 0)\r\n\t {\r\n\t\t return null;\r\n\t }\t \t \r\n\t \r\n\t return customerList.get(0);\r\n }",
"long countByExample(LoginRecordDOExample example);",
"int countByExample(OrgMemberRecordExample example);",
"List<Member> findByEmail(String email);",
"int countByExample(CusBankAccountExample example);",
"public int numUniqueEmails(String[] emails) {\n\t\tSet<String> s = new HashSet<>(); // Using a Set to take advantage it can't have dups.\n\t\t// nested loop approach. n emails, m characters each. O(n*m)\n\t\tfor (String email: emails) { // outer loop through n email\n\t\t\tchar[] emailChars = email.toCharArray();\n\t\t\tStringBuffer localName = new StringBuffer();\n\t\t\tString domainName = \"\";\n\t\t\tboolean parsingLocal = true;\n\t\t\t\n\t\t\tfor (int i = 0; i < emailChars.length; i++ ) { // inner loop m letters\n\t\t\t\tif ( emailChars[i] == '@') { // first time I see a @, switch to parsing domain\n\t\t\t\t\tdomainName = email.substring(i, email.length());\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (emailChars[i] == '.') // skip\n\t\t\t\t\tcontinue;\n\t\t\t\tif (emailChars[i] == '+')\n\t\t\t\t\tparsingLocal = false;\n\t\t\t\t\n\t\t\t\tif (parsingLocal)\n\t\t\t\t\tlocalName.append(emailChars[i]);\n\t\t\t\t\n\t\t\t}\n\t\t\ts.add(localName.toString()+domainName);\n\t\t}\n\t\t//System.out.println(s.toString());\n\t\treturn s.size();\n\n\t}",
"int countByExample(CxBasStaffExample example);",
"Responsable getCredentialByEmail(String email) throws ServiceException;",
"public static UserEntity search(String email) {\n\t\tDatastoreService datastore = DatastoreServiceFactory\n\t\t\t\t.getDatastoreService();\n\n\t\tQuery gaeQuery = new Query(\"users\");\n\t\tPreparedQuery pq = datastore.prepare(gaeQuery);\n\t\t\n\t\tfor (Entity entity : pq.asIterable()) {\n\t\t\t \n\t\t\tif (entity.getProperty(\"email\").toString().equals(email)) {\n\t\t\t\tUserEntity returnedUser = new UserEntity(entity.getProperty(\n\t\t\t\t\t\t\"name\").toString(), entity.getProperty(\"email\")\n\t\t\t\t\t\t.toString());\n\t\t\t\treturnedUser.setId(entity.getKey().getId());\n\t\t\t\treturn returnedUser;\n\t\t\t }\nelse{\n\t\t\t\t\n }\n\t\t}\n\n\t\treturn null;\n\t}",
"@Override\n\tpublic Account findByRegisteredEmail(String email) {\n\t\treturn m_managementDao.findByRegisteredEmail(email);\n\t}",
"public User getUserByEmail(String email);",
"public User getUserByEmail(String email);",
"private Account findAccount(String name, String email) throws AccountNotFoundException {\n for (Account current: accounts) {\n if (name.equals(current.getName()) && email.equals(current.getEmail())) {\n return current;\n }\n }\n throw new AccountNotFoundException();\n }",
"Optional<Account> findByEmail(@Param(\"email\") String email);",
"int getAccountCount(final long accountID);",
"public Usuario buscar(String email) {\n Usuario Usuario=null;\n //percorre toda a lista e checa se o Usuario existe\n for(Usuario u:listaUse){\n if (u.getEmail().equals(email) ){\n Usuario = u;\n return Usuario;\n }\n }\n return Usuario;\n }",
"public Customer retrieveCustomerByEmail(String email) throws CustomerNotFoundException;",
"public int getValidUserEmail(Validation v) {\r\n\r\n\t\t\r\n\t\tint a=0;\r\n\t\tString query=\"select * from user_registration where user_name='\"+v.getUsername() +\"' and email='\"+v.getEmail()+\"'\";\r\n\t\t\r\n\t\tRowMapper<Validation> rowMapper=new RowMapper<Validation>() {\r\n\r\n\t\t\tpublic Validation mapRow(ResultSet rs, int row) throws SQLException {\r\n\t\t\t\t Validation v=new Validation();\r\n\t\t\t\t v.setUsername(rs.getString(\"user_name\"));\r\n\t\t\t\t v.setPassword(rs.getString(\"email\"));\r\n\t\t\treturn v;\r\n\t\t\t}\r\n\t\t};\r\n\t\tList<Validation> list=jdbctemplate.query(query, rowMapper);\r\n\t\t a=list.size()>0?1:0; \r\n\t\treturn a;\r\n\t}",
"@Override\r\n\tpublic int checkEmailDup(String email) {\n\t\treturn mDAO.checkEmailDup(sqlSession, email);\r\n\t}",
"@Query(value=\"SELECT COUNT(id) FROM Ticket t where worker_email= (select email from User where email= :email) AND status=:status\")\n\tint findAllByWorkerbyStatusCount(@Param(\"email\") String worker, @Param(\"status\") String status);",
"public void searchByEmail() {\n System.out.println(\"enter email to get that person details:\");\n Scanner sc = new Scanner(System.in);\n String email = sc.nextLine();\n Iterator itr = list.iterator();\n while (itr.hasNext()) {\n Contact person = (Contact) itr.next();\n if (email.equals(person.getEmail())) {\n List streamList = list.stream().filter(n -> n.getEmail().contains(email)).collect(Collectors.toList());\n System.out.println(streamList);\n }\n }\n }",
"int countByExample(AdminUserCriteria example);",
"int countByExample(AdminUserCriteria example);",
"@Override\n\tpublic int getUserId(String email) throws DatabaseException, DataNotFoundException {\n\t\tConnection con = DbUtil.getConnection();\n\t\tStudentRegistrationValidationDaoi studentRegistrationValidationDaoi=new StudentRegistrationValidationDaoimpl();\n\t\tint value=studentRegistrationValidationDaoi.getUserId(email, con);\n\t\tDbUtil.closeConnection(con);\n\t\treturn value;\n\t}",
"public void countAcc()\n {\n \tint count=0;\n response=RestAssured.get(\"http://18.222.188.206:3333/accounts\");\n ID=response.jsonPath().getList(\"id\");\n for(int i=0;i<=ID.size();i++)\n {\n count++;\n }\n System.out.println(\"The total number of accounts present in this page=\"+count);\n }",
"Customer findByEmail(String email);",
"public CheckEmailResponse checkemail(ResetPasswordRequest resetpwdreq) {\n\t\tdatasource = getDataSource();\n\t\tjdbcTemplate = new JdbcTemplate(datasource);\n\t\t// get reg emailid from db\n\t\tlogger.info(\"In checkemail Method==========\");\n\t\t// Response object\n\t\tCheckEmailResponse obj = new CheckEmailResponse();\n\t\tString sql = \"select count(1) from user where emailid = ? \";\n\t\tint result = jdbcTemplate.queryForObject(sql, new Object[] { resetpwdreq.getEmailid() }, Integer.class);\n\t\tlogger.info(\"Result Query :\" + result);\n\t\tif (result > 0) {\n\t\t\tobj.setStatus(true);\n\t\t\tobj.setMessage(\"EMAIL EXIST\");\n\t\t\treturn obj;\n\t\t} else {\n\t\t\tobj.setStatus(false);\n\t\t\tobj.setMessage(\"EMAIL DOES NOT EXIST\");\n\t\t\treturn obj;\n\t\t}\n\n\t}",
"@Override\r\n\tpublic AccountDTO getAccount(String email) {\n\t\treturn accountDao.getAccount(email);\r\n\t}",
"public boolean existeEmail(String email) {\n Conexion c = new Conexion();\n PreparedStatement ps = null;\n ResultSet rs = null;\n String sql = \"SELECT email FROM usuario WHERE usuario.email = ?\";\n try {\n ps = c.getConexion().prepareStatement(sql);\n ps.setString(1, email);\n rs = ps.executeQuery();\n if (rs.next()) {\n return true;\n }\n } catch (SQLException ex) {\n System.out.println(ex.getMessage());\n } catch (Exception ex) {\n System.out.println(ex.getMessage());\n } finally {\n try {\n ps.close();\n rs.close();\n c.cerrarConexion();\n } catch (Exception ex) {\n }\n }\n return false;\n }",
"public static boolean isAccountActive(String email){\n Connection connect = null;\n ResultSet set = null;\n String isAccountActiveSQL = \"SELECT active FROM users WHERE email = ?\";\n\n // Check If Account is Active Try Block:\n try {\n // Set Connection:\n connect = DBConfig.getConnection();\n // Prepare Statement:\n PreparedStatement statement = connect.prepareStatement(isAccountActiveSQL);\n // Set Parameters:\n statement.setString(1, email);\n // Execute Statement:\n set = statement.executeQuery();\n // Check For Result Set:\n while (set.next()){\n // Check Value:\n if(set.getInt(\"active\") == 1) {\n return true;\n }\n // End Of Check Value.\n }\n // End Of Check For Result Set.\n\n }catch(SQLException e){\n e.printStackTrace();\n }\n // End Of Check If Account is Active Try Block:\n\n return false;\n }",
"public static void searchEmail(Contact[] myContacts, String find)\n {\n int high = myContacts.length;\n int low = -1;\n int probe;\n while(high - low > 1)\n {\n probe = (high+low)/2;\n if(myContacts[probe].getEmail().compareTo(find) > 0)\n {\n high = probe;\n }\n else\n {\n low = probe;\n if(myContacts[probe].getEmail().compareTo(find) == 0)\n {\n break;\n }\n }\n }\n System.out.println(\"Find results: \");\n if((low>=0)&&(myContacts[low].getEmail().compareTo(find) == 0))\n {\n findMoreEmails(myContacts, low, find);\n }\n else\n {\n System.out.println(\"There are no listings for \"+find);\n }\n }",
"int getUserCount();",
"int getUserCount();",
"@Override\n\tpublic Contato buscaContatoEmail(String email) {\n\t\treturn this.dao.buscarPorEmail(email);\n\t}",
"public String findDocuments(String email){\n\t\tJSONObject retorno = new JSONObject();\n\t\tJSONArray emails = new JSONArray();\n\t\tMongoDatabase db = con.getDataBase();\n\t\tMongoCollection<Document> coll = db.getCollection(\"registeredDocuments\");\n\t\tFindIterable<Document> result = coll.find(new Document(\"email\",email));\n\n\t\tif(result.first() != null){\n\t\t\tfor(Document documento : result){\n\t\t\t\tJSONObject obj = new JSONObject();\n\t\t\t\tobj.put(\"email\", documento.get(\"description\"));\n\t\t\t\tobj.put(\"lostDocument\", documento.get(\"lostDocument\"));\n\t\t\t\tobj.put(\"dateRegistration\", documento.get(\"dateRegistration\"));\n\t\t\t\temails.put(obj);\n\t\t\t}\n\t\t\tretorno.put(\"msg\",false);\n\t\t\tretorno.put(\"results\", emails);\n\t\t}else{\n\t\t\tretorno.put(\"msg\",true);\n\t\t}\n\t\treturn retorno.toString();\n\t}",
"int countByExample(AccuseInfoExample example);",
"@Override\n public String getCustomerIDFromDB(String email) {\n String sql = \"select CUSTOMER_ID from CUSTOMER where \" +\n \"EMAIL = '\" + email + \"' \";\n Map<String, Object> result = jdbcTemplate.queryForMap(sql);\n return result.get(\"CUSTOMER_ID\").toString();\n }",
"public long getEmailID(String email) {\n SQLiteDatabase db_read = ClientBaseOpenHelper.getHelper(mContext).getReadableDatabase();\n Cursor cursor = null;\n long emailID = 0;\n\n try {\n cursor = db_read.query(ClientBaseOpenHelper.TABLE_EMAILS, new String[]{BaseColumns._ID},\n ClientBaseOpenHelper.EMAIL + \"='\" + email + \"'\", null, null, null, null);\n while (cursor.moveToNext()) {\n emailID = cursor.getLong(cursor.getColumnIndex(BaseColumns._ID));\n }\n return emailID;\n\n } catch (Exception e) {\n Log.e(TAG, e.getMessage());\n return emailID;\n\n } finally {\n if (cursor != null && !cursor.isClosed()) {\n cursor.close();\n }\n if (db_read != null && db_read.isOpen()) {\n db_read.close();\n }\n if (ClientBaseOpenHelper.getHelper(mContext) != null) {\n ClientBaseOpenHelper.getHelper(mContext).close();\n }\n }\n }",
"long countByExample(AliUserInfoDOExample example);",
"public int searchRowsCount(SearchCriteria cri);",
"public void getAccount( String email ){\r\n\r\n Map<String, String> params = new HashMap<>();\r\n params.put(\"email\", email);\r\n String url = API_DOMAIN + ACCOUNT_EXT;\r\n this.makeVolleyRequest( url, params );\r\n }",
"public static void incNumeroTentativiLogin(String email) {\n\t\tRequestContent rp = new RequestContent();\n\t\trp.parameters = new Object[] { email };\n\t\trp.type = RequestType.INCREMENT_LOGIN_ATTEMPTS;\n\t\tsend(rp);\n\t}",
"@Override\n\tpublic boolean userExists(String email) {\n\t\treturn (searchIndex(email) >= 0);\n\t}",
"@SuppressWarnings(\"unchecked\")\r\n\t@Override\r\n\tpublic List<Mentor> getMentorsByEmail(String email) throws Exception {\r\n\t\tlogger.info(\"inside getMentorsByEmail()\");\r\n\t\tlogger.info(\"email ==>\" + email);\r\n\t\tList<Mentor> mentorList = null;\r\n\t\tString qry = \"Select Object(c) from mentor c where c.email LIKE :email\";\r\n\t\tQuery query = entityManager.createQuery(qry);\r\n\t\tquery.setParameter(\"email\", email);\r\n\t\ttry {\r\n\t\t\tmentorList = query.getResultList();\r\n\t\t} catch (Exception e) {\r\n\t\t\tlogger.error(\"Error while reteriving classified\", e);\r\n\t\t\tthrow e;\r\n\t\t}\r\n\t\tlogger.info(\"No of mentor for the \" + email + \" is ==>\"\r\n\t\t\t\t+ mentorList.size());\r\n\t\treturn mentorList;\r\n\t}",
"long countByExample(BankUserInfoExample example);",
"public Entreprise rechercheEntrepriseemail(String email) throws EntrepriseInconnueException {\n\t\tEntreprise E = (Entreprise) em.createQuery(\"from Entreprise e where e.adressemail like :name\").setParameter(\"name\", email).getSingleResult();\n\t\tif(E==null)\n\t\t\tthrow new EntrepriseInconnueException();\n\t\telse\n\t\t\treturn E;\n\t}",
"public String checkLastLogin(Object email) {\n\t\ttry {\n\t\t\tList<WebElement> list = LoginGooglePOM.alreadyLogged();\n\t\t\tSystem.out.println(\"already logged users are:--\" + list);\n\n\t\t\tfor (WebElement webElement : list) {\n\t\t\t\tif (webElement.getText().contains(email.toString())) {\n\t\t\t\t\twebElement.click();\n\t\t\t\t\treturn \"Yes\";\n\t\t\t\t}\n\n\t\t\t}\n\t\t\treturn \"No\";\n\t\t} catch (Exception e) {\n\t\t\treturn \"No\";\n\t\t}\n\t}",
"boolean checkEmailExistsForClient(String email) throws RuntimeException;",
"public boolean checaExisteEmail(String email){\r\n\t\tfor (Usuario UsuarioTemp : listaDeUsuarios) {\r\n\t\t\tif(UsuarioTemp.getEmail().equals(email)){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\treturn false;\r\n\t}",
"int getContactAddressCount();"
] | [
"0.7582953",
"0.7051364",
"0.6691928",
"0.6686234",
"0.6668885",
"0.6440322",
"0.6350423",
"0.6323846",
"0.61478984",
"0.6073987",
"0.604199",
"0.60294557",
"0.60010374",
"0.5993344",
"0.598033",
"0.59739333",
"0.5963259",
"0.59317243",
"0.58836913",
"0.58786863",
"0.58742005",
"0.5869243",
"0.58512086",
"0.58512086",
"0.5825106",
"0.57915705",
"0.5790442",
"0.57754105",
"0.57317233",
"0.5730544",
"0.5720026",
"0.5719367",
"0.5718071",
"0.57083935",
"0.56901467",
"0.56805843",
"0.56686354",
"0.56370986",
"0.56274295",
"0.56268126",
"0.5598933",
"0.55918205",
"0.55917484",
"0.55796224",
"0.5570465",
"0.5557558",
"0.55562633",
"0.55547124",
"0.5553795",
"0.5547468",
"0.5534129",
"0.55315596",
"0.5530531",
"0.55293125",
"0.55268455",
"0.5509047",
"0.5500175",
"0.5496622",
"0.54948735",
"0.5486734",
"0.54812473",
"0.54812473",
"0.54793894",
"0.54760456",
"0.5474449",
"0.5472201",
"0.54669034",
"0.5461083",
"0.54569674",
"0.54407513",
"0.544073",
"0.54391044",
"0.54391044",
"0.5411413",
"0.5410609",
"0.54082716",
"0.5400537",
"0.53904325",
"0.5382544",
"0.53785753",
"0.5372788",
"0.5372638",
"0.5372638",
"0.5370406",
"0.5367687",
"0.53639925",
"0.53635055",
"0.53502476",
"0.53500164",
"0.5342471",
"0.53278476",
"0.53218114",
"0.5320167",
"0.531741",
"0.531655",
"0.5315919",
"0.53132147",
"0.5304213",
"0.52982473",
"0.52981627"
] | 0.5622962 | 40 |
find account by username | @GetMapping("/findByUsername/{username}")
public Account getAccountByUsername(@PathVariable String username) {
return getService().findByUsername(username);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Account findByUsername(String username);",
"public AgtUser findUserByName(String username);",
"public CarerAccount getAccountWithUsername(String search){\n\t\tCarerAccount item = null;\n\n\t\tint count = 0;\n for (int i = 0; i < CarerAccounts.size(); ++i) {\n if (CarerAccounts.get(i).getUsername().equals(search)){\n\t\t\t\tcount++;\n item = CarerAccounts.get(i);\n\t\t\t}\n\t\t}\n\t\treturn item;\n\t}",
"List<Account> findByUsername(String username);",
"@Override\n\tpublic Account findByUsername(String username) {\n\t\ttry {\n\t\t\treturn accountRepository.findByUsername(username);\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t\treturn null;\n\t}",
"public SecurityUser findByName(String username);",
"public Account getAccountByOwnerAndName(String user,String accountName);",
"User getUserByUsername(String username);",
"User getUserByUsername(String username);",
"User getUserByUsername(String username);",
"Optional<Account> getAccountByUsername(String username);",
"AccountOwner findByUsername(String username);",
"public User getSpecificUser(String username);",
"List<UserRepresentation> searchUserAccount(final String username);",
"public User getUserByUsername(String username);",
"User findUserByUsername(String username);",
"@Override\n\tpublic Account getAccount(String username) throws SQLException {\n\t\tif (username.length() > Account.getMaxString())\n\t\t\treturn null;\n\t\t\n\t\t// Prepare required account variables\n\t\tString password;\n\t\tString email;\n\t\tint id;\n\n\t\t// Prepare SQL line\n\t\tString sqlQuery = \"SELECT * \"\n\t\t\t\t+ \"FROM account \"\n\t\t\t\t+ \"WHERE username LIKE ?\";\n\t\tPreparedStatement statement = dbConnection.prepareStatement(sqlQuery);\n\t\tstatement.setString(1, username);\n\n\t\t// Execute SQL query\n\t\tResultSet result = statement.executeQuery();\n\n\t\t// If result found, set variables\n\t\t// Otherwise, return null\n\t\tif (result.next()) {\n\t\t\tid = result.getInt(\"id\");\n\t\t\tusername = result.getString(\"username\");\n\t\t\tpassword = result.getString(\"password\");\n\t\t\temail = result.getString(\"email\");\n\t\t\tstatement.close();\n\t\t\tresult.close();\n\t\t}\n\t\telse {\n\t\t\tstatement.close();\n\t\t\tresult.close();\n\t\t\treturn null;\n\t\t}\n\n\t\t// Create account & return it\n\t\tAccount account = new Account(id, username, password, email);\n\t\treturn account;\n\t}",
"public User getUserByName(String username);",
"public User getUserByName(String username);",
"User getByUsername(String username);",
"User getUser(String username);",
"@Override\n\tpublic Account getAccount(String username) {\n\t\treturn map.get(username);\n\t}",
"public User getUserByUserName(String username);",
"User find(String username, String password);",
"private User findByName(String username) {\r\n\t\tCriteriaBuilder cb = entityManager.getCriteriaBuilder();\r\n\t\tCriteriaQuery cq = cb.createQuery(User.class);\r\n\t\tRoot<User> user = cq.from(User.class);\r\n\t\tcq.where(user.get(User_.username).in(username));\r\n\r\n\t\tTypedQuery<User> tq = entityManager.createQuery(cq);\r\n\t\t\r\n\t\treturn tq.getSingleResult();\r\n\t}",
"public User getUser(String username);",
"User getUserByUsername(String name) throws InvalidUserException;",
"public Account findByUsername(String username) {\n return this.accountRepository.findByUsername(username);\n }",
"public Account getAccount(String username) {\n\t\treturn userDao.getAccount(username);\r\n\t}",
"User findByUsername(String username) throws UserDaoException;",
"@Override\n public User getAccount (String username) throws KustvaktException {\n \t\n \tMap<String, String> namedParameters = Collections.singletonMap(\"username\", username);\n final String sql = \"select a.* from korap_users as a where a.username=:username;\";\n User user = null;\n \n try {\n user = this.jdbcTemplate.queryForObject(sql, namedParameters,\n new RowMapperFactory.UserMapper());\n return user;\n \t}\n catch (EmptyResultDataAccessException ae) {\n jlog.warn(\"No user found for name '{}'\", username);\n \t}\n catch (DataAccessException e) {\n jlog.warn(\"Could not retrieve user for name: \" + username, e);\n \n /* DemoUser and DefaultUser have no account,\n * so it's ok they are not found.\n throw new DatabaseException(username, \"korap_users\",\n StatusCodes.DB_GET_FAILED,\n \"Could not retrieve the user with username: \" + username,\n username);\n */\n }\n\n // DemoUser or DefaultUser?\n \n {\t// User cannot be found in SQL DB since LDAP Authentication,\n \t// so create a User Object here.\n \t// TODO: what more data should be stored into it?\n \t// 28.04.17/FB\n \tuser = new KorAPUser(); // oder eigentlich new DemoUser oder new DefaultUser.\n \tuser.setUsername(username);\n \treturn user;\n }\n \n \n }",
"User findByUsername(String username);",
"User findByUsername(String username);",
"User findByUsername(String username);",
"User findByUsername(String username);",
"User findByUsername(String username);",
"User findByUsername(String username);",
"Login findByUserName (String username);",
"User findByUsername(String userName);",
"public User queryUserByUsername(String username);",
"@PreAuthorize(\"hasRole('ROLE_USER')\")\r\n\tpublic UserAccount findUserAccountByUsername(String username);",
"public User findByUserName(String username) throws Exception;",
"@Override\n\tpublic void findUserByUsername(String username) {\n\n\t}",
"private String searchForUser() {\n String userId = \"\";\n String response = given().\n get(\"/users\").then().extract().asString();\n List usernameId = from(response).getList(\"findAll { it.username.equals(\\\"Samantha\\\") }.id\");\n if (!usernameId.isEmpty()) {\n userId = usernameId.get(0).toString();\n }\n return userId;\n }",
"public User findByUsername(String username);",
"public User findByUsername(String username);",
"public User findByUsername(String username);",
"public User findByUsername(String username);",
"@Override\r\n\tpublic UserAccount get(String username) {\n\t\tConnection con = MysqlDatabase.getInstance().getConnection();\r\n\t\tUserAccount ua = null;\r\n\t\ttry {\r\n\t\t\tPreparedStatement ps = con.prepareStatement(GetByUsername);\r\n\t\t\tps.setString(1, username);\r\n\t\t\tResultSet rs = ps.executeQuery();\r\n\t\t\tif (rs.next()) {\r\n\t\t\t\tua = get(rs.getInt(\"id\"));\r\n\t\t\t}\r\n\t\t\tcon.close();\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn ua;\r\n\t}",
"User findByUsername(String username, String password) throws Exception;",
"public static User findUserByName(String username) {\n\n User user = null;\n User targetUser = new User();\n IdentityMap<User> userIdentityMap = IdentityMap.getInstance(targetUser);\n\n String findUserByName = \"SELECT * FROM public.member \"\n + \"WHERE name = '\" + username + \"'\";\n\n PreparedStatement stmt = DBConnection.prepare(findUserByName);\n\n try {\n ResultSet rs = stmt.executeQuery();\n while(rs.next()) {\n user = load(rs);\n }\n DBConnection.close(stmt);\n rs.close();\n } catch (SQLException e) {\n System.out.println(\"Exception!\");\n e.printStackTrace();\n }\n if(user != null) {\n targetUser = userIdentityMap.get(user.getId());\n if(targetUser == null) {\n userIdentityMap.put(user.getId(), user);\n return user;\n }\n else\n return targetUser;\n }\n\n return user;\n }",
"User browseUserByUsername(String username);",
"public static Account getAccount(String username)\n\t{\n\t\treturn Application.getAccountLibrary().getAccount(username);\n\t}",
"@SuppressWarnings(\"static-method\")\n public @NotNull LocalUser findByName(String username) throws UserNotFoundException {\n if (\"admin\".equals(username)) {\n LocalUser user = new LocalUser(\"admin\", \"struts2\");\n return user;\n }\n throw new UserNotFoundException(username);\n }",
"@Override\r\n public UserAccount findByUsernameOrOAuthToken(String userName) {\n if (userName.startsWith(SYSTEM_CONSTS.AUTHENTIFICATION_OAUTH2_USERNAME_PREFIX)) {\r\n return findUserByOAuth2UserNameToken(userName);\r\n } else {\r\n return ops.findOne(Query.query(Criteria.where(\"username\").is(userName)), UserAccount.class);\r\n }\r\n }",
"@Override\r\n\tpublic User findUserByUsername(String username) {\n\t\tSystem.out.println(\"aa\");\r\n\t\treturn dao.selectUserByUsername(username);\r\n\t}",
"@Override\n\tpublic User getUserByCredentials(String userName, String password) {\n\t\tList<User> userList = new ArrayList<User>();\n\t\tString query = \"SELECT u FROM User u\";\n\t\tuserList = em.createQuery(query, User.class).getResultList();\n\t\tUser returnUser = null;\n\t\tfor (User user : userList) {\n\t\t\tif (user.getUserName().equals(userName) && user.getPassword().equals(password)) {\n\t\t\t\tSystem.out.println(user);\n\t\t\t\treturnUser = user;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"Not found\");\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn returnUser;\n\t}",
"public User get(String username);",
"public User search_userinfo(String user_name);",
"@Override\n\tpublic User findUserByUsername(String username) throws SQLException {\n User user = null;\n String sql = \"SELECT * FROM user WHERE username = ?\";\n \n connect();\n \n PreparedStatement statement = jdbcConnection.prepareStatement(sql);\n statement.setString(1, username);\n \n \n ResultSet resultSet = statement.executeQuery();\n \n while (resultSet.next()) {\n String usrname = resultSet.getString(\"username\");\n String pwd = resultSet.getString(\"password\");\n \n user = new User(usrname, pwd);\n }\n \n resultSet.close();\n statement.close();\n \n return user;\n\t}",
"public Account getAccount(String username)\n\t {\n\t\t Account account = null;\n\t\t \n\t\t String columns[] = new String[] {DatabaseContract.AccountContract.COLUMN_NAME_USERNAME,\n\t\t\t\t \t\t\t\t\t\t\tDatabaseContract.AccountContract.COLUMN_NAME_BALANCE,\n\t\t\t\t \t\t\t\t\t\t\tDatabaseContract.AccountContract.COLUMN_NAME_AUTH_TOKEN};\n\t\t \n\t\t String where = DatabaseContract.AccountContract.COLUMN_NAME_USERNAME + \" = ? \";\n\t\t \n\t\t Cursor cursor = db.query(DatabaseContract.AccountContract.TABLE_NAME,\n\t\t\t\t columns,\n\t\t\t\t where,\n\t\t\t\t new String[] {username},\n\t\t\t\t null, null, null);\n\t\t\n\t\t if(cursor.getCount() > 0)\n\t\t {\n\t\t\t cursor.moveToFirst();\n\t\t\t \n\t\t\t int userCol = cursor.getColumnIndex(DatabaseContract.AccountContract.COLUMN_NAME_USERNAME);\n\t\t\t int balCol = cursor.getColumnIndex(DatabaseContract.AccountContract.COLUMN_NAME_BALANCE);\n\t\t\t int authCol = cursor.getColumnIndex(DatabaseContract.AccountContract.COLUMN_NAME_AUTH_TOKEN);\n\t\t\t \n\t\t\t String usernameString = cursor.getString(userCol);\n\t\t\t String authTokenString = cursor.getString(authCol);\n\t\t\t int balance = cursor.getInt(balCol);\n\t\t\t \n\t\t\t account = new Account(usernameString, authTokenString, balance); \n\t\t }\n\t\t \n\t\t cursor.close();\n\t\t return account;\n\t }",
"User loadUser( String username ) throws UserNotFoundException;",
"User get(String username) throws UserNotFoundException, SQLException;",
"@Override\n\tpublic Account getAccount(Bank bank, String username) {\n\t\tif (cache.contains(bank)){\n\t\t\tfor (Account accountInBank : bank.getAccounts()) {\n\t\t\t\tif (accountInBank.getUsername().equals(username)) {\n\t\t\t\t\treturn accountInBank;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public User findUser(String username) {\n if (userList.containsKey(username)) {\n return userList.get(username);\n } else {\n throw new NoSuchElementException(\"User Not Found.\");\n }\n }",
"public User getByUsername(Connection conn, String username) throws Exception {\n \n User resultUser = null;\n String sql = \"select * from jaltantra_users where username=?\";\n PreparedStatement ps = conn.prepareStatement(sql);\n ps.setString(1, username);\n ResultSet rs = ps.executeQuery();\n if(rs.next()) {\n resultUser = new User();\n //resultUser.setId(rs.getInt(\"id\"));\n resultUser.setUsername(rs.getString(\"username\"));\n resultUser.setPassword(rs.getString(\"password\"));\n }\n return resultUser;\n }",
"User findUserByName(String name);",
"public User readByUsername(String username) throws DaoException;",
"public User getUserByUserName(String userName);",
"public boolean findbyUser(String username) {\n\t\tString sql=\"select username from SCOTT.USERS where USERNAME='\"+username+\"'\";\n\t\t\n\t\t Dbobj dj=new Dbobj();\n\t\t JdbcUtils jdbcu=new JdbcUtils();\n\t\t dj=jdbcu.executeQuery(sql);\n\t\t ResultSet rs=dj.getRs(); \n\t\t System.out.println(\"\"+sql);\t\n\t\t String t=\"\";\n\t\t try {\n\t\t\twhile(rs.next())\n\t\t\t\t{\n\t\t\t\t\tt=rs.getString(1);\n\t\t\t\t}\n\t\t} catch (NumberFormatException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t\n\t\t if (t.isEmpty()) {\n\t\t\t return false;\n\t\t }else{\n\t\t\t return true; \n\t\t }\n\t\t\n\t\t\n\t\t\n\t}",
"public User getUserByUsername(String username) throws BillingSystemException{\r\n\t\tUser temp=null;\r\n\t\t\r\n\t\tif(username==null && username.length()==0){\r\n\t\t\tthrow new BillingSystemException(\"Username argument is null\");\r\n\t\t}\r\n\t\t\r\n\t\tfor(User user : listUser){\r\n\t\t\tif(user.getUsername().equals(username)){\r\n\t\t\t\ttemp= user;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn temp;\r\n\t}",
"public EOSUser findUser(String login) throws EOSNotFoundException;",
"@Override\r\n\tpublic Userinfo findbyname(String name) {\n\t\treturn userDAO.searchUserByName(name);\r\n\t}",
"public Person getPerson(String username) throws IllegalArgumentException\r\n\t{\r\n\t\tPerson[] personArray = this.getAllUsers();\r\n\t\tPerson foundPerson = new Person();\r\n\t\tfor(int i = 0; i < personArray.length; i++) \r\n\t\t{\r\n\t\t\tif(personArray[i].getUsername().equals(username)) \r\n\t\t\t{\r\n\t\t\t\tfoundPerson = personArray[i];\r\n\t\t\t} \r\n\t\t} \r\n\t\tif(!foundPerson.getUsername().equals(username)) \r\n\t\t{\r\n\t\t\tthrow new IllegalArgumentException(\"The entered username is not bound to an account.\");\r\n\t\t}\r\n\t\treturn foundPerson;\r\n\t}",
"@Override\r\n\tpublic Credentials fetchUserByUsername(String username) {\n\t\treturn dao.findByUserName(username);\r\n\t}",
"@Override\n\tpublic Account getAccountDetails(String username) {\n\t\treturn account.findByUsername(username);\n\t}",
"@Override\n\tpublic User findByName(String username) {\n\t\treturn userDao.findByName(username);\n\t}",
"private Boolean findUser(String username){\n return usersDataBase.containsKey(username);\n }",
"public static String findUser(String username) {\n URL url = null;\n HttpURLConnection connection = null;\n String methodPath = \"/entities.credential/findByCredential/\";\n String textResult = \"\";\n try {\n url = new URL(BASE_URI + methodPath + username);\n\n connection = (HttpURLConnection) url.openConnection();\n // set the time out\n connection.setReadTimeout(10000);\n connection.setConnectTimeout(15000);\n // set the connection method to GET\n connection.setRequestMethod(\"GET\");\n //add http headers to set your response type to json\n connection.setRequestProperty(\"Content-Type\", \"application/json\");\n connection.setRequestProperty(\"Accept\", \"application/json\");\n //Read the response\n Scanner inStream = new Scanner(connection.getInputStream());\n //read the input stream and store it as string\n\n while (inStream.hasNextLine()) {\n textResult += inStream.nextLine();\n }\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n connection.disconnect();\n }\n return textResult;\n }",
"User findUserByLogin(String login);",
"boolean existsByUsername(String username);",
"@Override\n public List<User> findByName(String username){\n try {\n return runner.query(con.getThreadConnection(),\"select * from user where username like ?\",new BeanListHandler<User>(User.class),username);\n } catch (SQLException e) {\n System.out.println(\"执行失败\");\n throw new RuntimeException(e);\n }\n }",
"User getOne(String username) throws NotFoundException;",
"UserDTO findUserByUsername(String username);",
"User findByUsername(String username) throws DataAccessException;",
"public Utente containUsername(String username) {\r\n \t\r\n \tfor(Utente ut: utenti) {\r\n \t\tString us=ut.getUsername();\r\n \t\tif(us.equals(username)) {\r\n \t\t\treturn ut;\r\n \t\t}\r\n \t}\r\n \t\r\n \treturn null;\r\n \t\r\n }",
"User getUser(String userName) throws UserNotFoundException;",
"@NotNull TUser findByUserName(String username) throws NotFoundException, ErrorConnectionException, TException;",
"List<User> searchUsersByUsername(String username);",
"KingdomUser getUser(String username);",
"Optional<User> findByUsername(String username);",
"Optional<User> findByUsername(String username);",
"public boolean findUserBYName(String name);",
"User getUserByLogin(String login);",
"public static User getUser(String username) {\r\n\t\tfor(User user : userList) {\r\n\t\t\tif(user.getName().equals(username)) {\r\n\t\t\t\treturn user;\r\n\t\t\t}\r\n\t\t}\r\n\t\tthrow new IllegalArgumentException(\"User does not exist\");\r\n\t}",
"boolean exists(String username);",
"public User findUserByNickname(final String nickname);",
"Optional<User> findUserByUsername(String username);",
"public static String getUserAccount(String account){\n return \"select ui_account from user_information where ui_account = '\"+account+\"'\";\n }",
"public boolean existsByUsername(String username);"
] | [
"0.78430635",
"0.76875347",
"0.76028365",
"0.7589141",
"0.74848074",
"0.7431485",
"0.7412727",
"0.74076957",
"0.74076957",
"0.74076957",
"0.7389512",
"0.7345687",
"0.73419297",
"0.7307459",
"0.73051876",
"0.7287535",
"0.7271633",
"0.7250868",
"0.7250868",
"0.72264254",
"0.7197642",
"0.71882325",
"0.7188094",
"0.7126439",
"0.7124101",
"0.7105571",
"0.7074299",
"0.70699173",
"0.70640403",
"0.7045348",
"0.7000531",
"0.69968957",
"0.69968957",
"0.69968957",
"0.69968957",
"0.69968957",
"0.69968957",
"0.6959735",
"0.6956872",
"0.6939569",
"0.69354236",
"0.6925799",
"0.6921074",
"0.69157076",
"0.69107777",
"0.69107777",
"0.69107777",
"0.69107777",
"0.690911",
"0.6883068",
"0.68380904",
"0.68365365",
"0.68225694",
"0.679166",
"0.67873615",
"0.6770651",
"0.6765323",
"0.6761551",
"0.67610234",
"0.6760744",
"0.6760528",
"0.67585343",
"0.6751748",
"0.6748282",
"0.6744678",
"0.67442393",
"0.67414093",
"0.6730374",
"0.6710266",
"0.6698191",
"0.66938597",
"0.66883",
"0.66674227",
"0.6666",
"0.66655225",
"0.66578525",
"0.66463655",
"0.66345984",
"0.6624267",
"0.66146266",
"0.6605564",
"0.66039157",
"0.6599293",
"0.65990835",
"0.65962356",
"0.6594066",
"0.6589128",
"0.65888804",
"0.65819556",
"0.65721583",
"0.65536046",
"0.65536046",
"0.6546167",
"0.65459305",
"0.65409607",
"0.65403855",
"0.6531535",
"0.65164316",
"0.6511982",
"0.65113616"
] | 0.703749 | 30 |
Using 1 DButilities instance | @Override
public void initialize(URL url, ResourceBundle rb) {
this.db = LoginController.db;
this.loggedInUser = SidePaneController.employeeFullName;
System.out.println(loggedInUser);
refreshTable();
tblTrainingList.getColumns().get(2).setStyle("-fx-alignment: CENTER;");
initializedComboBox();
backgroundRefresh();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Object getDB();",
"@Override\r\n public Db_db currentDb(){return curDb_;}",
"public static DbHelper getInstance(){\n\t\treturn _DbHelperHold.INSTANCE;\n\t}",
"public static void main(String[] args){\n\n DbSingleton instance = DbSingleton.getInstance();\n\n //DbSingleton test = new DbSingleton();\n DbSingleton instance2 = DbSingleton.getInstance();\n\n System.out.println(instance);\n System.out.println(instance2);\n\n }",
"private DBMaster() {\r\n\t\t//The current address is localhost - needs to be changed at a later date\r\n\t\t_db = new GraphDatabaseFactory().newEmbeddedDatabase(\"\\\\etc\\\\neo4j\\\\default.graphdb\");\r\n\t\tregisterShutdownHook();\r\n\t}",
"public DbUtil() {}",
"private createSingletonDatabase()\n\t{\n\t\tConnection conn = createDatabase();\n\t\tcreateTable();\n\t\tString filename = \"Summer expereince survey 2016 for oliver.csv\"; \n\t\timportData(conn, filename);\n\t}",
"private OpenSimDB() {\n instance = this;\n }",
"public GraphDatabaseService GetDatabaseInstance() {\r\n\t\treturn _db;\r\n\t}",
"public Emp_Payroll_JDBC_Main() {\n\t\temployeePayrollDBServicebj = EmpPayrollDBService.getInstance();\n\t\tnormalisedDBServiceObj = EmpPayrollDBServiceNormalised.getInstance();\n\t}",
"public static DbManager getInstance() {\n \t\treturn INSTANCE;\n \t}",
"private void getDatabase(){\n\n }",
"private DB getDB() {\n\t\tServletContext context = this.getServletContext();\n\t\tsynchronized (context) {\n\t\t\tDB db = (DB)context.getAttribute(\"DB\");\n\t\t\tif(db == null) {\n\t\t\t\tdb = DBMaker.newFileDB(new File(\"db\")).closeOnJvmShutdown().make();\n\t\t\t\tcontext.setAttribute(\"DB\", db);\n\t\t\t}\n\t\t\tcheckAdminInDB(db);\n\t\t\tcheckCategoriaInDB(db);\n\t\t\treturn db;\n\t\t}\n\t}",
"public DBManager(){\r\n connect(DBConstant.driver,DBConstant.connetionstring);\r\n }",
"DBConnect() {\n \n }",
"private void initDB() {\n dataBaseHelper = new DataBaseHelper(this);\n }",
"DatabaseClient newJobDbClient();",
"DatabaseClient newModulesDbClient();",
"public void testMultipleConnections() throws SQLException {\n Connection conn1 = openConnection(\"FIRSTDB1\");\n conn1.setAutoCommit(false);\n\n Statement st = conn1.createStatement();\n st.execute(\"create table FIRSTDB_T1 (i int, j int, k int)\");\n st.execute(\"insert into FIRSTDB_T1 values (1, 3, 5)\");\n PreparedStatement pSt1 =\n conn1.prepareStatement(\"select * from FIRSTDB_T1\");\n \n ResultSet rs1 = pSt1.executeQuery();\n rs1.next();\n rs1.close();\n pSt1.close();\n st.close();\n \n Connection conn2 = openConnection(\"SECONDDB2\");\n conn2.setAutoCommit(false);\n Statement st2 = conn2.createStatement();\n st2.execute(\"create table SECONDDB_T1 (i int, j int, k int)\");\n st2.execute(\"insert into SECONDDB_T1 values (2, 4, 6)\");\n PreparedStatement pSt2 =\n conn2.prepareStatement(\"select * from SECONDDB_T1\");\n \n rs1 = pSt2.executeQuery();\n rs1.next();\n rs1.close();\n pSt2.close();\n st2.close();\n \n JDBC.cleanup(conn1);\n JDBC.cleanup(conn2);\n }",
"public static DBUtil getInstance() {\n\t\tif (instance == null) {\n//\t\t\tlogger.log(Level.INFO, \"creating instance\");\n\t\t\tinstance = new DBUtil();\n\t\t}\n\t\treturn instance;\n\t}",
"private Connection dbacademia() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }",
"private void makeSQLConn() {\n\t\ttry {\n\t\t\tmyDB = new MySQLAccess();\n\t\t} catch (Exception e) { e.printStackTrace(); }\n\t}",
"public static DBUtils getINSTANCE() {\n return INSTANCE;\n }",
"private void ini_SelectDB()\r\n\t{\r\n\r\n\t}",
"DatabaseClient newTraceDbClient();",
"private void setupDBs()\n {\n\t mSetupDBTask = new SetupDBTask(this);\n\t\tmSetupDBTask.execute((Void[])null);\n }",
"public void setDatabase(Connection _db);",
"public static DBCatalog getInstance(){\n return instance;\n }",
"public void connect() {\n\n DatabaseGlobalAccess.getInstance().setEmf(Persistence.createEntityManagerFactory(\"PU_dashboarddb\"));\n DatabaseGlobalAccess.getInstance().setEm(DatabaseGlobalAccess.getInstance().getEmf().createEntityManager());\n DatabaseGlobalAccess.getInstance().getDatabaseData();\n DatabaseGlobalAccess.getInstance().setDbReachable(true);\n }",
"DatabaseClient newFinalClient();",
"DatabaseClient newStagingClient();",
"public static DBMaster GetAnInstanceOfDBMaster() {\n\t\tif (singletonDBMaster == null) {\r\n\t\t\tsingletonDBMaster = new DBMaster();\r\n\t\t}\r\n\t\t\r\n\t\treturn singletonDBMaster;\r\n\t}",
"@Test\n\tpublic void testGetDbInstance(){\n\t\tConnection c = DatabaseConnect.getInstance();\n\t\tassertTrue(c != null);\t\n\t}",
"public GosplPopulationInDatabase() {\n\t\ttry {\n\t\t\tthis.connection = DriverManager.getConnection(\n\t\t\t\t\t\"jdbc:hsqldb:mem:\"+mySqlDBname+\";shutdown=true\", \"SA\", \"\");\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\tthrow new RuntimeException(\n\t\t\t\t\t\"error while trying to initialize the HDSQL database engine in memory: \"+e.getMessage(), e);\n\t\t}\n\t}",
"private void connectDatabase(){\n }",
"private DBconnectionUtil()\n\t{\n\t\t\n\t}",
"public DB getDB() {\n\treturn _db;\n }",
"Database getDataBase() {\n return database;\n }",
"private String retryDbConnection(TestStepRunner testStepRunner)\n\t\t\tthrows AFTException {\n\t\tString dbInstanceIdentifier = null;\n\t\tint counter = testStepRunner.getTestSuiteRunner().getDbConnCounter();\n\t\tif (counter == 0) {\n\t\t\tLOGGER.info(\"Open new DB connection.\");\n\t\t\tdbInstanceIdentifier = openDBConnection(testStepRunner,\n\t\t\t\t\ttestStepRunner.getTestSuiteRunner().getDbConnIdentifier(),\n\t\t\t\t\ttestStepRunner.getTestSuiteRunner().getDbParameterLst());\n\t\t\tcounter++;\n\t\t\ttestStepRunner.getTestSuiteRunner().setDbConnCounter(counter);\n\t\t} else {\n\t\t\tlogException(testStepRunner);\n\t\t}\n\n\t\treturn dbInstanceIdentifier;\n\t}",
"public DataHandlerDBMS() {\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t\tDBMS = DriverManager.getConnection(url);\n\t\t\tSystem.out.println(\"DBSM inizializzato\");\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\"Errore apertura DBMS\");\n\t\t\te.printStackTrace();\n\t\t} catch (ClassNotFoundException e) {\n\t\t\tSystem.out.println(\"Assenza driver mySQL\");\n\t\t}\n\t}",
"public ODatabaseInternal<?> db() {\n return ODatabaseRecordThreadLocal.INSTANCE.get().getDatabaseOwner();\n }",
"public DAO(String dbType){\n this.dbType = dbType;\n if(this.dbType.equals(\"MySQL\")){\n initialPool();\n\n // for q5 mysql use\n if(wholeUserIds == null){\n wholeUserIds = new TreeSet<Long>();\n }\n }\n else if(this.dbType.equals(\"Memory\")){\n // for q5 memory use\n if(wholeCountData == null){\n wholeCountData = new TreeMap<String, Integer>();\n }\n }\n\n }",
"protected static Database getInstance() {\n if (instance == null) {\n instance = new Database();\n }\n return instance;\n }",
"private DBConnection() \n {\n initConnection();\n }",
"DatabaseController() {\n\n\t\tloadDriver();\n\t\tconnection = getConnection(connection);\n\t}",
"public static Connection getDBInstance() {\r\n\t\tif (db == null)\r\n\t\t\ttry {\r\n\t\t\t\tloadDBDriver();\r\n\t\t\t\tdb = DriverManager.getConnection(url, user, password);\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\treturn db;\r\n\t}",
"private DatabaseRepository() {\n try {\n // connect to database\n\n DB_URL = \"jdbc:sqlite:\"\n + this.getClass().getProtectionDomain()\n .getCodeSource()\n .getLocation()\n .toURI()\n .getPath().replaceAll(\"[/\\\\\\\\]\\\\w*\\\\.jar\", \"/\")\n + \"lib/GM-SIS.db\";\n connection = DriverManager.getConnection(DB_URL);\n mapper = ObjectRelationalMapper.getInstance();\n mapper.initialize(this);\n }\n catch (SQLException | URISyntaxException e) {\n System.out.println(e.toString());\n }\n }",
"private void setupDatabase() {\r\n\t\tDatabaseHelperFactory.init(this);\r\n\t\tdatabase = DatabaseHelperFactory.getInstance();\r\n\t}",
"private static MongoDatabase getDatabase(){\n\t\tint port_number = 27017;\n\t\tString host = \"localhost\";\n\n\t\tMongoClient mongoClient = new MongoClient(host, port_number);\n\t\treturn mongoClient.getDatabase(\"myDb\");\n\t}",
"private ConnectionPool() {\r\n\t\tResourceManagerDB resourceManager = ResourceManagerDB.getInstance();\r\n\t\tthis.driver = resourceManager.getValue(ParameterDB.DRIVER_DB);\r\n\t\tthis.url = resourceManager.getValue(ParameterDB.URL_DB);\r\n\t\tthis.user = resourceManager.getValue(ParameterDB.USER_DB);\r\n\t\tthis.password = resourceManager.getValue(ParameterDB.PASSWORD_DB);\r\n\t\tthis.poolsize = Integer.parseInt(resourceManager.getValue(ParameterDB.POOLSIZE_DB));\r\n\t}",
"@Override\n\t@SuppressWarnings(\"unchecked\")\n\tpublic void start() {\n\t\tinitLogger();\n\n\t\tif (!databaseEnabled) {\n\t\t\tlog.info(\"DB not enabled.\");\n\t\t\treturn;\n\t\t}\n\n\t\tlog.info(\"DB start ----------\");\n\n\t\tfinal PetiteContainer petiteContainer = joyPetiteSupplier.get().getPetiteContainer();\n\n\t\t// connection pool\n\t\tconnectionProvider = createConnectionProviderIfNotSupplied();\n\n\t\tpetiteContainer.addBean(beanNamePrefix() + \"pool\", connectionProvider);\n\n\t\tif (connectionProvider instanceof CoreConnectionPool) {\n\t\t\tfinal CoreConnectionPool pool = (CoreConnectionPool) connectionProvider;\n\t\t\tif (pool.getDriver() == null) {\n\t\t\t\tdatabaseEnabled = false;\n\t\t\t\tlog.warn(\"DB configuration not set (\" + beanNamePrefix() + \"pool.*). DB will be disabled.\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tconnectionProvider.init();\n\n\t\tcheckConnectionProvider();\n\n\t\t// transactions manager\n\t\tjtxManager = createJtxTransactionManager(connectionProvider);\n\t\tjtxManager.setValidateExistingTransaction(true);\n\n\t\tfinal AnnotationTxAdviceManager annTxAdviceManager = new AnnotationTxAdviceManager(new LeanJtxWorker(jtxManager), jtxScopePattern);\n\t\tAnnotationTxAdviceSupport.manager = annTxAdviceManager;\n\n\t\t// create proxy\n\t\tjoyProxettaSupplier.get().getProxetta().withAspect(createTxProxyAspects(annTxAdviceManager.getAnnotations()));\n\n\t\tfinal DbSessionProvider sessionProvider = new DbJtxSessionProvider(jtxManager);\n\n\t\t// querymap\n\t\tfinal long startTime = System.currentTimeMillis();\n\n\t\tfinal QueryMap queryMap = new DbPropsQueryMap();\n\n\t\tlog.debug(\"Queries loaded in \" + (System.currentTimeMillis() - startTime) + \"ms.\");\n\t\tlog.debug(\"Total queries: \" + queryMap.size());\n\n\t\t// dboom\n\t\tdbOom = DbOom.create()\n\t\t\t.withConnectionProvider(connectionProvider)\n\t\t\t.withSessionProvider(sessionProvider)\n\t\t\t.withQueryMap(queryMap)\n\t\t\t.get();\n\n\t\tdbOom.connect();\n\n\t\tfinal DbEntityManager dbEntityManager = dbOom.entityManager();\n\t\tdbEntityManager.reset();\n\n\t\tpetiteContainer.addBean(beanNamePrefix() + \"query\", dbOom.queryConfig());\n\t\tpetiteContainer.addBean(beanNamePrefix() + \"oom\", dbOom.config());\n\n\t\t// automatic configuration\n\t\tif (autoConfiguration) {\n\t\t\tfinal AutomagicDbOomConfigurator automagicDbOomConfigurator =\n\t\t\t\tnew AutomagicDbOomConfigurator(dbEntityManager, true);\n\n\t\t\tautomagicDbOomConfigurator.configure();\n\t\t}\n\n\t\tdbEntityManagerConsumers.accept(dbEntityManager);\n\n\t\tlog.info(\"DB OK!\");\n\t}",
"private DatabaseConnectionService() {\n ds = new HikariDataSource();\n ds.setMaximumPoolSize(20);\n ConfigProperties configProperties = ConfigurationLoader.load();\n if (configProperties == null) {\n throw new RuntimeException(\"Unable to read the config.properties.\");\n }\n ds.setDriverClassName(configProperties.getDatabaseDriverClassName());\n ds.setJdbcUrl(configProperties.getDatabaseConnectionUrl());\n ds.addDataSourceProperty(\"user\", configProperties.getDatabaseUsername());\n ds.addDataSourceProperty(\"password\", configProperties.getDatabasePassword());\n ds.setAutoCommit(false);\n }",
"DatabaseConnector getConnector() {return db;}",
"protected MongoDatabase getDB() {\n return mongoClient.getDatabase(\"comp391_yourusername\");\n }",
"public SpokaneValleyDatabaseHelper getDatabase() {\n\t\treturn helper;\n\t}",
"private DatabaseContext() {\r\n datastore = createDatastore();\r\n init();\r\n }",
"public void uptadeDB(){\n //mainDatabase.modifyStaff(this);\n }",
"static AppDatabase getDatabase(final Context context) {\n if (INSTANCE == null) { //only a single thread can run this block at once\n //we only want this because we don't want to run too many databases\n synchronized (AppDatabase.class) {\n if(INSTANCE == null) {\n INSTANCE = Room.databaseBuilder(context.getApplicationContext(), AppDatabase.class, \"saved_locations_db\").build(); //build a database object\n }\n\n }\n }\n return INSTANCE;\n }",
"public ConexionDB() {\n\n\t\tconn = null;\n\n\t}",
"Database createDatabase();",
"public DbHelper(){\n\t\tmongoDbHelper = new MongoDb();\n\t}",
"public void conectionSql(){\n conection = connectSql.connectDataBase(dataBase);\n }",
"public static synchronized TasksDatabase getInstance(Context context){\n if (instance == null){\n instance = Room.databaseBuilder(context.getApplicationContext(),TasksDatabase.class,\n \"tasks_database\")\n .fallbackToDestructiveMigration() //deletes database and recreates it when there's a version update\n .build();\n }\n return instance ;\n }",
"protected abstract ODatabaseInternal<?> newDatabase();",
"public static DBManager getInstance() {\n DBManager current = db;\n // fast check to see if already created\n if (current == null) {\n // sync so not more then one creates it\n synchronized (DBManager.class) {\n current = db;\n // check if between first check and sync if someone has created it\n if (current == null) {\n //create it\n db = current = new DBManager();\n }\n }\n }\n return current;\n }",
"boolean needSeparateConnectionForDdl();",
"public DatabaseConnector() {\n String dbname = \"jdbc/jobs\";\n\n try {\n ds = (DataSource) new InitialContext().lookup(\"java:comp/env/\" + dbname);\n } catch (NamingException e) {\n System.err.println(dbname + \" is missing: \" + e.toString());\n }\n }",
"public static void main(String[] args) {\n\t\tDbCaller caller = new DbCaller();\n\t\tcaller.dbCall(new Oracle());\n\t\tcaller.dbCall(new MySQL());\n\t\t\n\n\t}",
"public static DbHandler getInstance()\n\t{\n\t\treturn instance;\n\t}",
"public static synchronized Database get() {\n return instance;\n }",
"public DbUtils() {\r\n // do nothing\r\n }",
"private void initDb() {\n\t\tif (dbHelper == null) {\n\t\t\tdbHelper = new DatabaseOpenHelper(this);\n\t\t}\n\t\tif (dbAccess == null) {\n\t\t\tdbAccess = new DatabaseAccess(dbHelper.getWritableDatabase());\n\t\t}\n\t}",
"public static synchronized DBOpenHelper getInstance(Context context){\n\t\tif(dbHelper == null)\n\t\t\tdbHelper = new DBOpenHelper(context);\t\t\n\t\treturn dbHelper;\n\t\t\n\t}",
"@Override\r\n @SuppressWarnings(\"empty-statement\")\r\n public Db_db selectDb(Db_db db)\r\n {\r\n Db_db returnValue = null;\r\n if(curDb_ != null && (curDb_.getName() == null ? db.getName() == null : curDb_.getName().equals(db.getName())))\r\n {\r\n returnValue = curDb_;\r\n }\r\n else\r\n {\r\n try\r\n {\r\n Connection newCon;\r\n if((newCon = this.connections_.get(db))!=null)\r\n {\r\n this.curDb_ = db;\r\n this.curConnection_ = newCon;\r\n returnValue = db;\r\n }\r\n else\r\n {\r\n if(setupConnection(db, Boolean.FALSE) != null)\r\n {\r\n returnValue = db;\r\n }\r\n }\r\n }catch(Exception e){};\r\n }\r\n \r\n return returnValue;\r\n }",
"<DB extends ODatabase> DB getUnderlying();",
"private static OfferDAO getOfferDAO() {\n DbConnection dbConnection = new DbConnection();\n DBI dbi = dbConnection.getDBConnection();\n OfferDAO offerDAO = dbi.onDemand(OfferDAO.class);\n return offerDAO;\n }",
"public Database<T> getDatabase();",
"public FamilyPlaningSupplyItemDB(ConnectionInf db)\n {\n theConnectionInf=db;\n dbObj = new FamilyPlaningSupplyItem();\n initConfig();\n }",
"public DB getDB() {\n return database;\n }",
"public QueryGeneral() {\n try {\n connection = ConnectionDB.getInstance().getConnection();\n } catch (SQLException event) {\n log.error(\"Error in: \" + event.getMessage(), event);\n } catch (ClassNotFoundException event) {\n log.error(\"Error in: \" + event.getMessage(), event);\n }\n }",
"public static DatabaseConnection getInstance() throws SQLException {\n if (instance == null) {//if we didn't create it earlier\n instance = new DatabaseConnection();//we create new one\n }\n return instance;//otherwise it returns old one\n }",
"public DatabaseMeta getSharedDatabase( String name ) {\n return (DatabaseMeta) getSharedObject( DatabaseMeta.class.getName(), name );\n }",
"public Database(){\n ItemBox.getLogger().info(\"[Database] protocol version \" + net.mckitsu.itembox.protocol.ItemBoxProtocol.getVersion());\n }",
"public static void main(String[] args) {\n DBConnector.getInstance().connect();\n\n DBConnector.getInstance().connect();\n\n }",
"private DatabaseManager() {}",
"public static void main(String[] args)\r\n {\n TreeMap<String, String> v_mapDBConf = new TreeMap<>();\r\n //Variable which contains queries to execute.\r\n TreeMap<Integer, String> v_mapQueries = new TreeMap<>();\r\n\r\n Object v_database = null;\r\n\r\n //Affects target database informations and queries to execute into variables.\r\n v_mapDBConf = ConfReader.getConf();\r\n v_mapQueries = ConfReader.getQueries();\r\n\r\n try\r\n {\r\n //Dynamic instantiation corresponding to sgbd.\r\n String dbtype = \"src.database.\"+v_mapDBConf.get(\"DB_TYPE\");\r\n Class<?> clazz = Class.forName(dbtype);\r\n Class[] types = new Class[]{String.class, String.class, String.class, String.class, String.class};\r\n Constructor ct = clazz.getConstructor(types);\r\n v_database = ct.newInstance(new Object[]{v_mapDBConf.get(\"DB_IP_ADDR\"), v_mapDBConf.get(\"DB_PORT\"), v_mapDBConf.get(\"DB_SID\"), v_mapDBConf.get(\"DB_PASS\"), v_mapDBConf.get(\"DB_USER\")});\r\n Method methodConn = clazz.getDeclaredMethod(\"connectDb\");\r\n Method methodDisc = clazz.getSuperclass().getDeclaredMethod(\"disconnectDb\");\r\n Method methodChkConn = clazz.getSuperclass().getDeclaredMethod(\"connectionState\");\r\n\r\n //Connects to database.\r\n methodConn.invoke(v_database);\r\n boolean dbStatus = (boolean) methodChkConn.invoke(v_database);\r\n if (dbStatus)\r\n System.out.println(\"Connected to Database.\");\r\n else\r\n System.out.println(\"Error, not connected to Database.\");\r\n\r\n //Call to XmlBuilder.\r\n XmlBuilder.main((Database) v_database, v_mapQueries);\r\n\r\n //Call to HtmlBuilder.\r\n HtmlReplace.main(\"outputs/auditTemplate.html\", v_mapDBConf.get(\"DB_CLIENT\"), v_mapDBConf.get(\"AUDIT_AUTHOR\"));\r\n HtmlReplace.prepareSummary(\"outputs/htmlFinal.html\");\r\n\r\n //Disconnects from database.\r\n methodDisc.invoke(v_database);\r\n dbStatus = (boolean) methodChkConn.invoke(v_database);\r\n if (!dbStatus)\r\n System.out.println(\"Disconnected from Database.\");\r\n else\r\n System.out.println(\"Error, still connected to Database.\");\r\n } catch (SecurityException e)\r\n {\r\n e.printStackTrace();\r\n } catch (IllegalArgumentException e)\r\n {\r\n e.printStackTrace();\r\n } catch (ClassNotFoundException e)\r\n {\r\n e.printStackTrace();\r\n } catch (InstantiationException e)\r\n {\r\n e.printStackTrace();\r\n } catch (IllegalAccessException e)\r\n {\r\n e.printStackTrace();\r\n } catch (NoSuchMethodException e)\r\n {\r\n e.printStackTrace();\r\n } catch (InvocationTargetException e)\r\n {\r\n e.printStackTrace();\r\n }\r\n }",
"@Test\n public void test() throws SQLException {\n System.out.println(new MyDbutilsDemo().load(12));\n }",
"private void openDatabase() {\r\n SearchHelper = new DBHelper(this);\r\n }",
"public int dbId() { return dbId; }",
"@Test\n public void testConflictingTableOidsAcrossDatabases() throws Exception {\n String dbnameroot = \"testwithtableoids_db\";\n final int kNumLoops = 3;\n\n // Create databases and objects.\n for (int i = 0; i < kNumLoops; i++) {\n String dbname = dbnameroot + i;\n try (Connection connection0 = getConnectionBuilder().withTServer(0).connect();\n Statement statement = connection0.createStatement()) {\n statement.execute(String.format(\"CREATE DATABASE %s\", dbname));\n\n // Creating a few objects in the database.\n try (Connection connection1 = getConnectionBuilder().withTServer(1)\n .withDatabase(dbname)\n .connect()) {\n createDatabaseObjects(connection1, i + 1);\n }\n }\n }\n\n // Validate that everything works fine.\n for (int i = 0; i < kNumLoops; i++) {\n String dbname = dbnameroot + i;\n try (Connection connection0 = getConnectionBuilder().withTServer(1)\n .withDatabase(dbname)\n .connect()) {\n validateDatabaseObjects(connection0, i + 1);\n }\n }\n }",
"public SDB getPrimaryDB() throws SqlJetException,IOException {\r\n\t\treturn getDB(getPrimaryDBID());\r\n\t}",
"public static Database getInstance() {\n if (database == null) database = new Database();\n return database;\n }",
"public static UserPopulateDB UserPopulateDB() {\r\n if (single_instance == null) {\r\n single_instance = new UserPopulateDB();\r\n }\r\n return single_instance;\r\n }",
"private DBUtil() {\r\n\t}",
"public static UtilityDatabaseController getInstance() \n {\n if(instance == null) {\n instance = new UtilityDatabaseController();\n }\n \n return instance;\n }",
"public Driving getDB() {\n\t\treturn this.db;\n\t}",
"private DatabaseCustomAccess(Context context) {\n\t\thelper = new SpokaneValleyDatabaseHelper(context);\n\n\t\tsaveInitialPoolLocation(); // save initial pools into database\n\t\tsaveInitialTotalScore(); // create total score in database\n\t\tsaveInitialGameLocation(); // create game location for GPS checking\n\t\tLoadingDatabaseTotalScore();\n\t\tLoadingDatabaseScores();\n\t\tLoadingDatabaseGameLocation();\n\t}",
"public abstract ODatabaseInternal<?> openDatabase();",
"public DataConnection() {\n\t\ttry {\n\t\t\tString dbClass = \"com.mysql.jdbc.Driver\";\n\t\t\tClass.forName(dbClass).newInstance();\n\t\t\tConnection con = DriverManager.getConnection(DIR_DB, USER_DB, PASS_DB);\n\t\t\tstatement = con.createStatement();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"private Connection dbConnection() {\n\t\t\n\t\t///\n\t\t/// declare local variables\n\t\t///\n\t\t\n\t\tConnection result = null;\t// holds the resulting connection\n\t\t\n\t\t// try to make the connection\n\t\ttry {\n\t\t\tClass.forName(\"org.sqlite.JDBC\");\n\t\t\tresult = DriverManager.getConnection(CONNECTION_STRING);\n\t\t} catch (Exception ex) {\n\t\t\tSystem.out.println(ex.getMessage());\n\t\t}\n\t\t\n\t\t// return the resulting connection\n\t\treturn result;\n\t\t\n\t}",
"private static void dropTheBase()\n\t{\n\t\ttry (MongoClient mongoClient = MongoClients.create())\n\t\t{\n\t\t\tmongoClient.getDatabase(\"TestDB\").drop();\n\t\t\tmongoClient.getDatabase(\"myDB\").drop();\n\t\t}\n\n\t\t//Dropping all Neo4j databases.\n\t\tProperties props = new Properties();\n\t\tprops.setProperty(DBProperties.SERVER_ROOT_URI, \"bolt://localhost:7687\");\n\t\tIDBAccess dbAccess = DBAccessFactory.createDBAccess(iot.jcypher.database.DBType.REMOTE, props, AuthTokens.basic(\"neo4j\", \"neo4j1\"));\n\t\ttry\n\t\t{\n\t\t\tdbAccess.clearDatabase();\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tdbAccess.close();\n\t\t}\n\n\t\tprops = new Properties();\n\t\tprops.setProperty(DBProperties.SERVER_ROOT_URI, \"bolt://localhost:11008\");\n\t\tdbAccess = DBAccessFactory.createDBAccess(DBType.REMOTE, props, AuthTokens.basic(\"neo4j\", \"neo4j1\"));\n\t\ttry\n\t\t{\n\t\t\tdbAccess.clearDatabase();\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tdbAccess.close();\n\t\t}\n\n\t\t//Dropping all SQL databases.\n\t\ttry (DSLContext connection = using(\"jdbc:sqlite:src/main/resources/sqliteDB/test.db\"))\n\t\t{\n\t\t\tconnection.dropTableIfExists(\"User\").execute();\n\t\t\tconnection.dropTableIfExists(\"MovieRate\").execute();\n\t\t\tconnection.dropTableIfExists(\"SeriesRate\").execute();\n\t\t\tconnection.dropTableIfExists(\"EpisodeRate\").execute();\n\t\t\tconnection.dropTableIfExists(\"MovieRole\").execute();\n\t\t\tconnection.dropTableIfExists(\"SeriesRole\").execute();\n\t\t\tconnection.dropTableIfExists(\"EpisodeRole\").execute();\n\t\t\tconnection.dropTableIfExists(\"Movie\").execute();\n\t\t\tconnection.dropTableIfExists(\"Series\").execute();\n\t\t\tconnection.dropTableIfExists(\"Episode\").execute();\n\t\t\tconnection.dropTableIfExists(\"Genre\").execute();\n\t\t\tconnection.dropTableIfExists(\"Quote\").execute();\n\t\t\tconnection.dropTableIfExists(\"Goof\").execute();\n\t\t\tconnection.dropTableIfExists(\"Trivia\").execute();\n\n\t\t}\n\t}"
] | [
"0.63495344",
"0.6254974",
"0.61919343",
"0.6187064",
"0.61075485",
"0.60823935",
"0.60518783",
"0.6033412",
"0.60309976",
"0.6024821",
"0.59962916",
"0.59854966",
"0.5938006",
"0.59295446",
"0.5928522",
"0.5925436",
"0.5918601",
"0.58642346",
"0.5861838",
"0.5855113",
"0.5845972",
"0.5835408",
"0.58235663",
"0.58168447",
"0.58153635",
"0.581156",
"0.58095664",
"0.58029443",
"0.5789764",
"0.57866937",
"0.5771977",
"0.5771483",
"0.5739211",
"0.5727556",
"0.57238454",
"0.5722449",
"0.5718988",
"0.5687922",
"0.568521",
"0.5677509",
"0.5674991",
"0.5662118",
"0.5660085",
"0.56418514",
"0.564084",
"0.56400883",
"0.56367713",
"0.5633278",
"0.5619707",
"0.56195915",
"0.5616476",
"0.56141365",
"0.56119263",
"0.55906135",
"0.5584045",
"0.55798906",
"0.55796385",
"0.5576147",
"0.55738723",
"0.5571547",
"0.5569571",
"0.55590487",
"0.5551893",
"0.5549384",
"0.5542332",
"0.55377066",
"0.55370176",
"0.5535183",
"0.55336237",
"0.5531155",
"0.55301857",
"0.55288905",
"0.5527189",
"0.55236983",
"0.55236536",
"0.5520422",
"0.55189687",
"0.5513293",
"0.55036664",
"0.5500146",
"0.5487366",
"0.5482347",
"0.5479843",
"0.5479042",
"0.5473769",
"0.54726",
"0.54683036",
"0.54657835",
"0.5461702",
"0.5460896",
"0.54540527",
"0.5451337",
"0.5450862",
"0.54460686",
"0.54458874",
"0.54453486",
"0.54452294",
"0.5445061",
"0.5443921",
"0.5443863",
"0.5443567"
] | 0.0 | -1 |
JFXDialogLayout layout = new JFXDialogLayout(); JFXDialog dialog = new JFXDialog(); layout.setHeading(new Text("Heading")); scn.loadModal(layout, dialog); | @FXML
private void search(){
String s = tfSearch.getText().trim();
String type = cmbType.getSelectionModel().getSelectedItem();
String col = cmbFilterBy.getSelectionModel().getSelectedItem();
/**
* Column Filters
*
*/
if(!s.isEmpty()){
if(!chbtoggleInActiveTraining.isSelected()){
db.populateTable(trainingFields+ " WHERE title LIKE '%"+s+"%' AND status<>'active'", tblTrainingList);
}
if(chbtoggleInActiveTraining.isSelected()){
db.populateTable(trainingFields+ " WHERE title LIKE '%"+s+"%'", tblTrainingList);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void waitDialog(String title) {\n Stage dialog = new Stage();\n Parent root = null;\n try {\n root = FXMLLoader.load(Objects.requireNonNull(getClass().getClassLoader().getResource(\"wait.fxml\")));\n Scene s1 = new Scene(root);\n dialog.setScene(s1);\n dialog.getIcons().add(new Image(\"images/cm_boardgame.png\"));\n overlayedStage = dialog;\n overlayedStage.initOwner(thisStage);\n overlayedStage.initModality(Modality.APPLICATION_MODAL);\n overlayedStage.setTitle(title);\n overlayedStage.initStyle(StageStyle.UNDECORATED);\n overlayedStage.setResizable(false);\n dialog.show();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }",
"public void popAddEntity()throws IOException {\n final Stage dialog = new Stage();\n dialog.setTitle(\"Agregar entidad\");\n \n Parent root = FXMLLoader.load(getClass().getResource(\"/view/PopAddEntity.fxml\"));\n \n Scene xscene = new Scene(root);\n \n dialog.setResizable(false);\n dialog.initModality(Modality.APPLICATION_MODAL);\n dialog.initOwner((Stage) root.getScene().getWindow());\n //dialog.resizableProperty().setValue(Boolean.FALSE);\n \n dialog.setScene(xscene);\n dialog.showAndWait();\n dialog.setResizable(false);\n dialog.close();\n\n }",
"public static JDialog createDialog(JFrame owner) {\n PlatformInfoPanel panel = new PlatformInfoPanel();\n JDialog dialog = new JDialog(owner, ResourceManager.getResource(PlatformInfoPanel.class, \"Dialog_title\"));\n dialog.getContentPane().add(panel);\n dialog.setSize(panel.getWidth() + 10, panel.getHeight() + 30);\n return dialog;\n}",
"public void popAddHeritage()throws IOException {\n final Stage dialog = new Stage();\n dialog.setTitle(\"Agregar herencia\");\n \n Parent root = FXMLLoader.load(getClass().getResource(\"/view/PopAddHeritage.fxml\"));\n \n Scene xscene = new Scene(root);\n \n dialog.setResizable(false);\n dialog.initModality(Modality.APPLICATION_MODAL);\n dialog.initOwner((Stage) root.getScene().getWindow());\n \n dialog.setScene(xscene);\n dialog.showAndWait();\n dialog.setResizable(false);\n dialog.resizableProperty().setValue(Boolean.FALSE);\n dialog.close(); \n \n }",
"public static void newJFXDialogPopUp(String min, String sec, String dist, StackPane stP) {\n System.out.println(\"DialogBox Posted\");\n JFXDialogLayout jfxDialogLayout = new JFXDialogLayout();\n jfxDialogLayout.setHeading(new Text(\"Time Details\"));\n jfxDialogLayout.setBody(new Text(\"Time Estimate: \" + min + \" \" + sec +\"\\n\" + \"Distance Estimate: \" + dist));\n JFXDialog dialog = new JFXDialog(stP, jfxDialogLayout, JFXDialog.DialogTransition.CENTER);\n JFXButton okay = new JFXButton(\"Okay\");\n okay.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent event) {\n dialog.close();\n\n }\n });\n jfxDialogLayout.setActions(okay);\n dialog.show();\n }",
"public void showModalWindow() {\n Stage dialog = new Stage();\n dialog.initOwner(stage);\n dialog.initModality(Modality.WINDOW_MODAL); \n dialog.showAndWait();\n }",
"public void showDialogWindow(Stage primaryStage, VBox vbox, String title, Button done) {\n // Create layout\n BorderPane layout = new BorderPane();\n layout.setCenter(vbox);\n\n // Show Modal Dialog Window\n Scene inputScene = new Scene(layout, 350, 250);\n final Stage userInputs = new Stage();\n userInputs.initModality(Modality.APPLICATION_MODAL);\n userInputs.initOwner(primaryStage);\n userInputs.setScene(inputScene);\n userInputs.setTitle(title);\n userInputs.show();\n\n // Add functionality to upload button\n done.setOnAction(e -> userInputs.close());\n }",
"@FXML\r\n\tvoid help_btn_clicked(MouseEvent event) {\r\n\t\tDialog<String> dia = new Dialog<>();\r\n\t\tStage stage = (Stage) dia.getDialogPane().getScene().getWindow();\r\n\t\tDialogPane dialogPane = dia.getDialogPane();\r\n\t\tdialogPane.getStylesheets().add(getClass().getResource(\"/client/boundry/dialog.css\").toExternalForm());\r\n\t\tdialogPane.getStyleClass().add(\"dialog\");\r\n\t\tdia.setTitle(\"Help Dialog\");\r\n\t\tdia.setHeaderText(\"Guide:\");\r\n\t\tdia.setGraphic(new ImageView(this.getClass().getResource(\"/icons8-info-48.png\").toString()));\r\n\t\t// Add a custom icon.\r\n\t\tstage.getIcons().add(new Image(this.getClass().getResource(\"/icons8-help-24.png\").toString()));\r\n\t\tdia.getDialogPane().getButtonTypes().addAll(ButtonType.OK);\r\n\t\tdia.setContentText(\r\n\t\t\t\t\"Main Sale Pattern Screen\\nIn this screen you can choose sale from table,add sale, delete and open\\n\"\r\n\t\t\t\t\t\t+ \"for full information, click on specific sale and choose an action, in addition you can click\"\r\n\t\t\t\t\t\t+ \"on \\\"Statistics\\\" for statistic inforamtion\");\r\n\t\tdia.show();\r\n\t}",
"public void showDialog()\n {\n textInputDialog = new TextInputDialog();\n textInputDialog.setTitle(\"Choose File\");\n Pane pane = new Pane();\n pane.setPrefSize(350, 130);\n\n filePath = new TextField();\n filePath.setPrefSize(250, 20);\n filePath.setPromptText(\"Path File :\");\n filePath.setLayoutX(20);\n filePath.setLayoutY(50);\n\n\n JFXButton Browse = new JFXButton(\"Browse\");\n Browse.setStyle(\" -fx-background-color :#ffffff\");\n Browse.setLayoutX(280);\n Browse.setLayoutY(50);\n\n Browse.setButtonType(JFXButton.ButtonType.RAISED);\n\n pane.getChildren().addAll(filePath, Browse);\n textInputDialog.setHeaderText(null);\n textInputDialog.getDialogPane().setContent(pane);\n Browse.setOnMouseClicked(event ->\n {\n FileChooser fileChooser = new FileChooser();\n file = fileChooser.showOpenDialog(rootAnchorPane.getScene().getWindow());\n filePath.setText(file.getAbsolutePath());\n });\n }",
"public boolean showFilmEditDialog(Movie movie) {\r\n try {\r\n // Load the fxml file and create a new stage for the popup dialog.\r\n FXMLLoader loader = new FXMLLoader();\r\n loader.setLocation(FilmApp.class.getResource(\"view/FilmEditDialog.fxml\"));\r\n AnchorPane page = (AnchorPane) loader.load();\r\n\r\n // Create the dialog Stage.\r\n Stage dialogStage = new Stage();\r\n dialogStage.setTitle(\"Edit movie\");\r\n dialogStage.initModality(Modality.WINDOW_MODAL);\r\n dialogStage.initOwner(primaryStage);\r\n Scene scene = new Scene(page);\r\n dialogStage.setScene(scene);\r\n\r\n // Set the movie into the controller.\r\n this.controller = loader.getController();\r\n controller.setDialogStage(dialogStage);\r\n controller.setMovie(movie);\r\n\r\n // Show the dialog and wait until the user closes it\r\n dialogStage.showAndWait();\r\n\r\n return controller.isOkClicked();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n System.out.println(\"je ot tu\");\r\n return false;\r\n }\r\n}",
"private Scene createScene(final Stage dialog, final Table table) {\n\n\t\t\t\n\t\t\t// * * * Datasource selector * * * \n\t\t\t_selector = new DatasourceSelector(table);\n\t\t\t\n\t\t\t\n\t\t\t// * * * Schema Box * * * \n\t\t\tVBox schemaBox = new VBox();\n\t\t\tschemaBox.setSpacing(5);\n\t\t\tschemaBox.setAlignment(Pos.CENTER_LEFT);\n\t\t\tschemaBox.maxHeight(Double.MAX_VALUE);\n\t\t\t\n\t\t\t_schemaView = new ListView<>();\n\t\t\t\n\t\t\tschemaBox.getChildren().addAll(new Text(\"Select Fields:\"),_schemaView);\n\t\t\t\n\t\t\t_schemaView.setItems(FXCollections.observableList(table.getFields()));\n\t\t\t_schemaView.setMaxHeight(Double.MAX_VALUE);\n\t\t\tVBox.setVgrow(_schemaView, Priority.ALWAYS);\n\t\t\t\n\t\t\tCallback<Field, ObservableValue<Boolean>> getProperty = new Callback<Field, ObservableValue<Boolean>>() {\n\t @Override\n\t public BooleanProperty call(Field field) {\n\t \t// TODO\t make getSelectedProperty meaningful\n\t return field.getSelectedProperty();\n\t }\t \n\t };\n\t\t\t\n\t\t\t Callback<ListView<Field>, ListCell<Field>> forListView = CheckBoxListCell.forListView(getProperty);\n\t\t\t _schemaView.setCellFactory(forListView);\n\t\t\t\n\t\t\t// * * * The ok/cancel buttons * * * \n\t\t\tHBox buttonsBox = new HBox();\n\n\n\t\t\tbuttonsBox.setSpacing(10);\n\t\t\tbuttonsBox.setAlignment(Pos.CENTER_RIGHT);\n\t\t\tbuttonsBox.setPadding(new Insets(5));\n\t\t\t\n\t\t\t// Cancel\n\t\t\tButton cancel = new Button(\"Cancel\");\n\t\t\tcancel.setOnAction(new EventHandler<ActionEvent>() {\n\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\tpublic void handle(ActionEvent arg0) {\n\t\t\t\t\t\t\t\t\t_dialog.hide();\n\t\t\t\t\t\t\t\t};\n\t\t\t});\n\t\t\t\n\t\t\t// OK\n\t\t\tButton ok = new Button(\"Ok\");\n\t\t\tok.setOnAction(new EventHandler<ActionEvent>() {\t\n\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\tpublic void handle(ActionEvent arg0) {\n\t\t\t\t\t\t\t\t\tupdateTable(table);\n\t\t\t\t\t\t\t\t\t_selection.setValue(table);\n\t\t\t\t\t\t\t\t\t_dialog.hide();\n\t\t\t\t\t\t\t\t};\n\t\t\t});\n\t\t\t\n\t\t\tbuttonsBox.getChildren().addAll(new Spring(),cancel,ok);\t\n\t\t\tHBox.setHgrow(buttonsBox, Priority.ALWAYS);\n\t\t\t\n\t\t\t// The vertical layout of the whole wizard\n\t\t\tVBox header = new VBox();\n\t\t\theader.setSpacing(10);\n\t\t\theader.setPadding(new Insets(5));\n\t\t\theader.getChildren().addAll(new Text(\"Name: \" + table.getName()),_selector, schemaBox, buttonsBox);\n\t\t\t\n\t\t\tVBox.setVgrow(schemaBox, Priority.ALWAYS);\n\t\t\t\n\t\t\t// Create the scene\n\t\t\tVBox sceneVbox = new VBox();\n\t\t\tsceneVbox.setSpacing(5);\n\t\t\tsceneVbox.setPadding(new Insets(5));\n\t\t\tsceneVbox.setId(\"datatable-wizard\");\n\t\t\tsceneVbox.getChildren().add(header);\n\t\t\t\n\t\t\tScene scene = new Scene(sceneVbox);\n\n\t\t\t\t\n\t\t\tVBox.setVgrow(schemaBox, Priority.ALWAYS);\n\t\t\tscene.getStylesheets().add(Cyclist.class.getResource(\"assets/Cyclist.css\").toExternalForm());\n\t\t\treturn scene;\n\t\t}",
"protected abstract JDialog createDialog();",
"@Override\n public void start(Stage primaryStage) throws Exception {\n primaryStage.setTitle(\"JavaFX Standard Dialog\");\n Button primaryButton = new Button(\"Try me!\");\n //register event handler\n primaryButton.setOnAction(new EventHandler<ActionEvent>() {\n\n @Override\n public void handle(ActionEvent event) {\n //create a confirmation dialog (alert)\n alert = new Alert(AlertType.CONFIRMATION);\n //Optional title. If not used the standard title \"Confiramation\" will be displayed\n //To remove the title use alert.setTitle(null);\n alert.setTitle(\"Confirmation Dialog\");\n //Optional header.If not used the standard header \"Confiramation\" will be displayed\n //To remove the title use alert.setHeaderText(null); \n alert.setHeaderText(\"Please answer the question!\");\n alert.setContentText(initText);\n //Display the dialog and get the result from the user action\n Optional<ButtonType> result = alert.showAndWait();\n if (result.get() == ButtonType.OK){\n // the user clicked OK\n alert = new Alert(AlertType.INFORMATION);\n alert.setTitle(\"Information Dialog\");\n alert.setHeaderText(\"Important message for you!\");\n alert.setContentText(\"Happiness is ephemeral!\");\n alert.showAndWait(); \n //the user clocked Cancel\n } else {\n // ... user chose CANCEL or closed the dialog\n //Warning Dialog\n alert = new Alert(AlertType.WARNING);\n alert.setTitle(\"Warning Dialog\");\n alert.setHeaderText(\"Read the Warning!\");\n alert.setContentText(\"You must like Java - Shall make you Happy!\");\n alert.showAndWait(); \n }\n }\n });\n //set primary application stage\n StackPane root = new StackPane();\n // add button to the stage\n root.getChildren().add(primaryButton);\n primaryStage.setScene(new Scene(root, 400, 250));\n primaryStage.show();\n }",
"public void Name_Setter() {\n Dialog<Pair<String, String>> dialog = new Dialog<>();\n dialog.setTitle(\"Developer Login\");\n FontAwesomeIconView icon = new FontAwesomeIconView(FontAwesomeIcon.EXPEDITEDSSL);\n icon.setGlyphSize(40);\n icon.setGlyphStyle(\"-fx-fill:green;\");\n\n dialog.setGraphic(icon);\n dialog.setHeaderText(\"Only Developers Authorised..\");\n\n //set Button types\n ButtonType lbutton = new ButtonType(\"Open\", ButtonData.NO);\n dialog.getDialogPane().getButtonTypes().addAll(lbutton, ButtonType.CANCEL);\n\n //create the username and password labels and fields\n GridPane grid = new GridPane();\n grid.setHgap(10);\n grid.setVgap(10);\n grid.setPadding(new Insets(0, 20, 10, 10));\n\n JFXTextField fld = new JFXTextField();\n fld.setPromptText(\"Developer email\");\n fld.setMinWidth(200);\n\n JFXPasswordField pfld = new JFXPasswordField();\n pfld.setPromptText(\"Developer Password\");\n\n Label infor = new Label(\"Enter Email and Password\");\n\n grid.add(fld, 2, 2);\n grid.add(pfld, 2, 5);\n grid.add(infor, 4, 8);\n\n dialog.getDialogPane().setContent(grid);\n\n Optional<Pair<String, String>> result = dialog.showAndWait();\n\n String pass = pfld.getText();\n String uname = fld.getText();\n\n if (pass.equals(\"erickerickyaah\") && uname.equals(\"[email protected]\")) {\n\n reportgenthree.ReportGenThree.NameSetter();\n\n } else {\n\n infor.setText(\"Wrong Password..\");\n }\n\n }",
"private boolean showModal(String resource, String title, Object params) throws Exception {\n FXMLLoader loader = new FXMLLoader();\r\n loader.setLocation(getClass().getResource(resource));\r\n AnchorPane page = loader.load();\r\n\r\n // Create the dialog Stage.\r\n Stage dialogStage = new Stage();\r\n dialogStage.setTitle(title);\r\n dialogStage.initModality(Modality.WINDOW_MODAL);\r\n dialogStage.initOwner(primaryStage);\r\n Scene scene = new Scene(page);\r\n dialogStage.setScene(scene);\r\n\r\n IDataStateModalController controller = loader.getController();\r\n controller.setDialogStage(dialogStage);\r\n controller.setParams(params);\r\n controller.setState(this, this.dataState);\r\n\r\n // Show the dialog and wait until the user closes it\r\n dialogStage.showAndWait();\r\n\r\n return controller.isOkClicked();\r\n }",
"public void openDialogCreateVisual(){\n DataHeader[] tabHeader = dataset.getListDataHeaderDouble(true);\n TypeVisualization[] tabVis = getListTypeVisualization(tabHeader.length);\n DataHeader[] tabHeaderLabel = dataset.getListDataHeaderDouble(false);\n CreateDataVisualDialog dialog = new CreateDataVisualDialog(this, tabVis, tabHeader, tabHeaderLabel);\n dialog.setVisible(true);\n }",
"private void showErrorDialog(String msg) {\n\t\tJFXDialogLayout content = new JFXDialogLayout();\n\t\tcontent.setHeading(new Text(\"ERROR\"));\n\t\tcontent.setBody(new Text(msg));\n\t\tJFXDialog dialog = new JFXDialog(stackPane, content, JFXDialog.DialogTransition.CENTER);\n\t\t;\n\n\t\tJFXButton button = new JFXButton(\"I understand\");\n\t\tbutton.setButtonType(ButtonType.RAISED);\n\t\tbutton.setCursor(Cursor.HAND);\n\t\tbutton.setOnAction(e -> dialog.close());\n\t\tcontent.setActions(button);\n\t\tdialog.show();\n\t}",
"@FXML\n private void aboutMenuItem() {\n\n // Creating an alert dialog\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\n alert.setTitle(\"About\");\n alert.setHeaderText(\"Poster Grabber 1.0\");\n alert.setContentText(\"Poster Grabber is a very simple tool that grabs movie's poster in any desired quality.\\nIt's highly dependant on TheMovieDB API, and won't function without an internet connection.\");\n alert.initOwner(primaryStage);\n\n // Setting custom style\n DialogPane dialogPane = alert.getDialogPane();\n dialogPane.getStylesheets().add(getClass().getResource(\"/AboutDialog.css\").toExternalForm());\n dialogPane.getStyleClass().add(\"myDialog\");\n\n // Displaying the alert dialog\n alert.show();\n }",
"public void showInputCategoryCreateDialog() {\r\n FXMLLoader loader = fxmlLoaderService.getLoader(getClass().getResource(FXML_INPUT_CATEGORY_CREATE_DIALOG));\r\n\r\n Parent page;\r\n\r\n try {\r\n page = loader.load();\r\n } catch (IOException ex) {\r\n logger.warn(\"Failed to load: \" + FXML_INPUT_CATEGORY_CREATE_DIALOG, ex);\r\n\r\n return;\r\n }\r\n\r\n // set the stage\r\n Stage stage = new Stage();\r\n stage.setTitle(\"Create Input Category\");\r\n stage.initModality(Modality.APPLICATION_MODAL);\r\n stage.centerOnScreen();\r\n stage.initOwner(mainStage);\r\n\r\n Scene scene = new Scene(page);\r\n scene.getStylesheets().add(getClass().getResource(STYLESHEET_DEFAULT).toExternalForm());\r\n\r\n stage.setScene(scene);\r\n\r\n // Set the item into the controller.\r\n InputCategoryCreateDialogController controller = loader.getController();\r\n controller.setStage(stage);\r\n\r\n stage.showAndWait();\r\n }",
"public void display() {\n Stage messageStage = new Stage();\n messageStage.initModality(Modality.APPLICATION_MODAL);\n messageStage.setTitle(title);\n messageStage.setMinWidth(350);\n messageStage.setMinHeight(200);\n\n Label messageLabel = new Label();\n messageLabel.setText(message);\n Button closeButton = new Button(\"OK\");\n closeButton.setOnAction(e -> messageStage.close());\n\n VBox vBox = new VBox(10);\n vBox.getChildren().addAll(messageLabel, closeButton);\n vBox.setAlignment(Pos.CENTER);\n\n Scene scene = new Scene(vBox);\n messageStage.setScene(scene);\n messageStage.showAndWait();\n }",
"public void showAddCustomerDialog() {\n\t\ttry {\n\t\t\tFXMLLoader loader = new FXMLLoader();\n\t\t\tloader.setLocation(MainApplication.class.getResource(\"view/AddCustomerDialog.fxml\"));\n\t\t\tAnchorPane page = (AnchorPane) loader.load();\n\t\t\tStage dialogStage = new Stage();\n\t\t\tdialogStage.setTitle(\"Add Customer\");\n\t\t\tdialogStage.initModality(Modality.WINDOW_MODAL);\n\t\t\tdialogStage.initOwner(primaryStage);\n\t\t\tScene scene = new Scene(page);\n\t\t\tdialogStage.setScene(scene);\n\t\t\tAddCustomerDialogController controller = loader.getController();\n\t\t\tcontroller.setDialogStage(dialogStage);\n\t\t\tdialogStage.showAndWait();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t\t}\n\t}",
"public abstract View getMainDialogContainer();",
"public void showLifeCycleDialog() {\n\t\t\tlifeCycleDialogBox = new DialogBox(true);\n\t\t\tlifeCycleDialogBox.setGlassEnabled(true);\n\t\t\tlifeCycleDialogBox.setText(\"Seguimiento del Documento\");\n\n\t\t\t// Vertical Panel\n\t\t\tVerticalPanel vp = new VerticalPanel();\n\t\t\tvp.setSize(\"100%\", \"100%\");\n\t\t\tvp.add(lifeCycleCellTree);\n\t\t\tvp.add(new HTML(\" \"));\n\t\t\tvp.add(lifeCycleCloseButton);\n\n\t\t\t// Scroll Panel\n\t\t\tScrollPanel scrollPanel = new ScrollPanel();\n\t\t\tif (getUiParams().isMobile())\n\t\t\t\tscrollPanel.setSize(Window.getClientWidth() + \"px\", Window.getClientHeight() + \"px\");\n\t\t\telse\n\t\t\t\tscrollPanel.setSize(Window.getClientWidth() * .4 + \"px\", Window.getClientHeight() * .3 + \"px\");\n\t\t\tscrollPanel.setWidget(vp);\n\t\t\tlifeCycleDialogBox.setWidget(scrollPanel);\n\n\t\t\tDouble d = Window.getClientWidth() * .3;\n\t\t\tif (!getUiParams().isMobile()) \n\t\t\t\tlifeCycleDialogBox.setPopupPosition(d.intValue(), UiTemplate.NORTHSIZE * 3);\n\n\t\t\tlifeCycleDialogBox.show();\n\t\t}",
"private void setDialog()\n {\n //this.setSize(350,500);\n this.setTitle(Constant.getTextBundle(\"ปฏิกิริยาต่อกัน\"));\n Toolkit thekit = this.getToolkit(); \n Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();\n this.setLocation((screenSize.width-this.getSize().width)/2, (screenSize.height-this.getSize().height)/2);\n }",
"public void GetReportView()\n {\n try\n {\n FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource(\"/app/UI/JavaFX/Views/ReportView.fxml\"));\n Parent root = null;\n\n root = (Parent) fxmlLoader.load();\n ReportController reportController = fxmlLoader.getController();\n reportController.Initialize(this.reportTitle, this.reportContent);\n\n Stage stage = new Stage();\n stage.initModality(Modality.APPLICATION_MODAL);\n stage.initStyle(StageStyle.DECORATED);\n stage.setTitle(this.reportTitle);\n stage.setScene(new Scene(root));\n stage.show();\n }\n catch (Exception ex)\n {\n ex.printStackTrace();\n }\n }",
"public CustomPopUp(String lblText, String titleText, String btnText, int height, int width) \r\n {\r\n \r\n stage = new Stage();\r\n btn = new Button(btnText);\r\n prompt = new Label(lblText);\r\n pane = new VBox();\r\n pane.getChildren().addAll(prompt,btn);\r\n pane.setAlignment(Pos.CENTER);\r\n scene = new Scene(pane,height,width);\r\n stage.setTitle(titleText);\r\n stage.setScene(scene);\r\n \r\n btn.setOnAction(event ->\r\n {\r\n this.stage.close();\r\n }); \r\n \r\n }",
"public void popup(String s, String id){\n\t\t\n\t\t// call to a db function -> what kind if exercises was carried out during this training?\n\t\tExerciseForTrainingFetch eftf = new ExerciseForTrainingFetch();\n\t\ttry {\n\t\t\teftf.readDataBase(id);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tArrayList<ArrayList> allOvelser = eftf.getExForTraining();\n\t\t\n\t\tStringBuilder bStr = new StringBuilder();\n\t\tfor (int i=0;i<allOvelser.get(0).size();i++){\n\t\t\tbStr.append(\"Ovelse: \" + allOvelser.get(0).get(i) + \" Belastning: \" +allOvelser.get(1).get(i) +\n\t\t\t\t\t\" Sett: \" + allOvelser.get(2).get(i) + \" Repetisjoner: \" + allOvelser.get(3).get(i) + \" Beskrivelse: \" + allOvelser.get(4).get(i) + \n\t\t\t\t\t\" Kategori: \" + allOvelser.get(5).get(i) + \"\\n\" + \"-----------------\\n\");\n\t\t}\n\t\t\n\t\tGroup root = new Group();\n\t\tScene dialogScene = new Scene(root, 400, 300);\n\t\tLabel label3 = new Label(bStr.toString());\n\t\tlabel3.setWrapText(true);\n\t\tlabel3.setFont(new Font(\"Arial\", 12));\n\t\tlabel3.setMaxSize(380, 300);\n\t\t\n final Stage dialog = new Stage();\n dialog.initModality(Modality.APPLICATION_MODAL);\n dialog.initOwner(UserApplication.primaryStage);\n\n Button cancel = new Button(\"Cancel\");\n cancel.setCancelButton(true);\n cancel.setOnAction((actionEvent) -> dialog.close());\n GridPane gridpane = new GridPane();\n gridpane.setMaxSize(400, 300);\n gridpane.setHgap(10); //horizontal gap in pixels => that's what you are asking for\n gridpane.setVgap(10); //vertical gap in pixels\n gridpane.setPadding(new Insets(10, 10, 10, 10)); //margins around the whole grid\n //(top/right/bottom/left)\n ScrollPane s1 = new ScrollPane();\n s1.setPrefSize(380, 300);\n s1.setHbarPolicy(ScrollBarPolicy.NEVER);\n s1.setContent(label3);\n gridpane.add(cancel, 0, 3); // column=0 row=3\n gridpane.add(s1, 0, 1); // column=0 row=1\n gridpane.setMaxSize(400, 300);\n root.getChildren().addAll(gridpane);\n \n dialog.setScene(dialogScene);\n dialog.show(); \n \n\t}",
"void makeDialog()\n\t{\n\t\tfDialog = new ViewOptionsDialog(this.getTopLevelAncestor());\n\t}",
"@FXML\n\tpublic void onAnadirConocimiento() {\n\t\tDialog<ButtonType> dialog = new Dialog<>();\n\t\tdialog.setTitle(\"Nuevo Conocimiento\");\n\n\t\t// declaramos los tipo de botones\n\n\t\tButtonType anadirButton = new ButtonType(\"Crear\", ButtonData.OK_DONE);\n\t\tdialog.getDialogPane().getButtonTypes().addAll(anadirButton, ButtonType.CANCEL);\n\t\tStage stage = (Stage) dialog.getDialogPane().getScene().getWindow();\n\t\tstage.getIcons().add(new Image(\"dad/javafx/resources/cv64x64.png\"));\n\n\t\t// creamos los campos\n\t\tGridPane grid = new GridPane();\n\t\tgrid.setHgap(10);\n\t\tgrid.setVgap(10);\n\t\tgrid.setPadding(new Insets(20, 150, 10, 10));\n\n\t\tButton xButton = new Button(\"X\");\n\n\t\tTextField denominacionTextField = new TextField();\n\t\tLabel denominacionDialogLabel = new Label(\"Denominacion\");\n\t\tLabel nivelDialogLabel = new Label(\"Nivel\");\n\n\t\tComboBox<Nivel> nivelComboBox = new ComboBox<Nivel>();\n\n\t\tnivelComboBox.getItems().addAll(Nivel.values());\n\t\tHBox box = new HBox(nivelComboBox, xButton);\n\t\tbox.setSpacing(5);\n\n\t\tgrid.add(denominacionDialogLabel, 0, 0);\n\t\tgrid.add(denominacionTextField, 1, 0);\n\t\tgrid.add(nivelDialogLabel, 0, 1);\n\t\tgrid.add(box, 1, 1);\n\n\t\txButton.setOnAction(e -> nivelComboBox.getSelectionModel().select(-1));\n\n\t\t// activar o desactivar el boton a�adir dependiendo de si se ha a�adido un\n\t\t// numero de telefono o no\n\n\t\t// metemos el grid pane en nuestro dialog\n\t\tdialog.getDialogPane().setContent(grid);\n\n\t\txButton.setOnAction(e -> nivelComboBox.getSelectionModel().select(-1));\n\t\t\n\t\tOptional<ButtonType> result = dialog.showAndWait();\n\t\tif (result.get() == anadirButton) {\n\t\t\tConocimiento conocimiento = new Conocimiento();\n\t\t\tconocimiento.setDenominacion(denominacionTextField.getText());\n\t\t\tconocimiento.setNivel(nivelComboBox.getSelectionModel().getSelectedItem());\n\t\t\tmodel.getConocimiento().add(conocimiento);\n\t\t}\n\t}",
"public abstract void initDialog();",
"public static void showDialog() {\n\t\tdialog.setLocationRelativeTo(Cytoscape.getDesktop());\n\t\tdialog.setVisible(true);\n\t}",
"@Override\n public void chooseCards(ArrayList<God> gods) {\n System.out.println(\"Scelta della carta size: \" + gods.size());\n Platform.runLater(() -> {\n userName.setText(getName());\n overlayedStage.close();\n System.out.println(\"Scelta della carta\");\n Stage dialog = new Stage();\n dialog.setTitle(\"Scelta Carte Divinità\");\n dialog.getIcons().add(new Image(\"images/cm_boardgame.png\"));\n Parent root;\n FXMLLoader loader = null;\n CardChoice cc = null;\n try {\n switch (gods.size()) {\n case 1:\n loader = new FXMLLoader(Objects.requireNonNull(getClass().getClassLoader().getResource(\"chooseCard1pl.fxml\")));\n cc = new ChooseCard1pl(gods);\n cc.setStage(dialog);\n loader.setController(cc);\n break;\n case 2:\n loader = new FXMLLoader(Objects.requireNonNull(getClass().getClassLoader().getResource(\"chooseCard2pl.fxml\")));\n cc = new ChooseCard2pl(gods);\n cc.setStage(dialog);\n loader.setController(cc);\n break;\n case 3:\n loader = new FXMLLoader(Objects.requireNonNull(getClass().getClassLoader().getResource(\"chooseCard3pl.fxml\")));\n cc = new ChooseCard3pl(gods);\n cc.setStage(dialog);\n loader.setController(cc);\n break;\n default:\n return;\n }\n root = loader.load();\n Scene s = new Scene(root);\n dialog.setResizable(false);\n dialog.setScene(s);\n dialog.initOwner(thisStage);\n dialog.initModality(Modality.APPLICATION_MODAL);\n dialog.initStyle(StageStyle.UNDECORATED);\n //dialog.setOnCloseRequest(event -> returnNumber(numberPlayersController));\n dialog.showAndWait();\n handlerClient.setCard(cc.getChoosed());\n setGod(cc.getChoosed());\n } catch (IOException e) {\n e.printStackTrace();\n }\n God g = getGod();\n System.out.println(g.getDescription());\n buttonPl1.setTooltip(new Tooltip(\n g.getName() + \"\\n\" +\n g.getDescription()));\n Image i = new Image(\"images/GodCards/\" + g.getName() + \".png\", 172, 109, true, false);\n firstPl.setImage(i);\n });\n }",
"public void initialize() {\n\t\tint consumerCount = 9, max_integer = 10;\r\n\t\tisValidInputs = true;\r\n\t\t\r\n\t\t// Init inputs\r\n\t\tinput_threads.setText(String.valueOf(consumerCount));\r\n\t\tinput_max_num.setText(String.valueOf(max_integer));\r\n\t\tbtn_stop.setDisable(true);\r\n\t\t\r\n\t\tJFXDialogLayout content = new JFXDialogLayout();\r\n\t\tcontent.setHeading(new Text(\"Introdução\"));\r\n\t\tcontent.setBody(new Text(\"\\n Após configurar os parâmetros disponíveis do lado esquerdo,\" +\r\n\t\t\t\t\t\t\t\t \"\\n clique em START para começar a simulação.\\n\" + \r\n\t\t\t\t\t\t\t\t \"\\n Cada bloco representa uma thread, o qual mostra o número\" +\r\n\t\t\t\t\t\t\t\t \"\\n que está sendo processado pela única thread ativa, visto que\" +\r\n\t\t\t\t\t\t\t\t \"\\n cada thread compete pelo 'lock' do monitor. \\n\"));\r\n\t\t\r\n\t\tJFXDialog dialog = new JFXDialog(dialog_pane, content, JFXDialog.DialogTransition.CENTER);\r\n\t\tJFXButton btn_dialog = new JFXButton(\"OK\");\r\n\t\tbtn_dialog.setCursor(Cursor.HAND);\r\n\t\tbtn_dialog.setOnAction(new EventHandler<ActionEvent>(){\r\n\t\t @Override\r\n\t\t public void handle(ActionEvent event){\r\n\t\t dialog.close();\r\n\t\t }\r\n\t\t});\r\n\t\tcontent.setActions(btn_dialog);\r\n\t\tdialog.show();\r\n\t\t\r\n\t\t// Start Button\r\n\t\tbtn_start.setOnAction((event) -> {\r\n\t\t\t\r\n\t\t\tif(Integer.parseInt(input_threads.getText()) > 64 || Integer.parseInt(input_threads.getText()) < 1) {\r\n\t\t\t\tisValidInputs = false;\r\n\t\t\t\tinput_threads.setFocusColor(Color.RED);\r\n\t\t\t\tinput_threads.requestFocus();\r\n\t\t\t} else if(Integer.parseInt(input_max_num.getText()) > 1000 || Integer.parseInt(input_max_num.getText()) < 1) {\r\n\t\t\t\tisValidInputs = false;\r\n\t\t\t\tinput_max_num.setFocusColor(Color.RED);\r\n\t\t\t\tinput_max_num.requestFocus();\r\n\t\t\t} else {\r\n\t\t\t\tisValidInputs = true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(isValidInputs) {\r\n\t\t\t\tinitWindow();\r\n\t\t\t\tbtn_start.setDisable(true);\r\n\t\t\t\tbtn_stop.setDisable(false);\r\n\t\t\t}\r\n\t\t});\r\n\t}",
"private void showCreateNewPlayer(){\n try{\n FXMLLoader loader = new FXMLLoader();\n loader.setLocation(Game.class.getResource(\"view/CreateNewPlayer.fxml\"));\n AnchorPane janela = (AnchorPane) loader.load();\n \n Stage createNewPlayerStage = new Stage();\n createNewPlayerStage.setTitle(\"Create new player\");\n createNewPlayerStage.initModality(Modality.WINDOW_MODAL);\n createNewPlayerStage.initOwner(primaryStage);\n Scene scene = new Scene(janela);\n createNewPlayerStage.setScene(scene);\n \n CreateNewPlayerController controller = loader.getController();\n controller.setGame(this);\n controller.setCreateNewPlayerStage(createNewPlayerStage); \n \n createNewPlayerStage.showAndWait();\n }catch(IOException e){\n }\n }",
"public void showUserDefinedInputCreateDialog() {\r\n FXMLLoader loader = fxmlLoaderService.getLoader(getClass().getResource(FXML_USER_DEFINED_INPUT_CREATE_DIALOG));\r\n\r\n Parent page;\r\n\r\n try {\r\n page = loader.load();\r\n } catch (IOException ex) {\r\n logger.warn(\"Failed to load: \" + FXML_USER_DEFINED_INPUT_CREATE_DIALOG, ex);\r\n\r\n return;\r\n }\r\n\r\n // set the stage\r\n Stage stage = new Stage();\r\n stage.setTitle(\"Create Custom Input\");\r\n stage.initModality(Modality.APPLICATION_MODAL);\r\n stage.centerOnScreen();\r\n stage.initOwner(mainStage);\r\n\r\n Scene scene = new Scene(page);\r\n scene.getStylesheets().add(getClass().getResource(STYLESHEET_DEFAULT).toExternalForm());\r\n\r\n stage.setScene(scene);\r\n\r\n // Set the item into the controller.\r\n UserDefinedInputCreateDialogController controller = loader.getController();\r\n controller.setStage(stage);\r\n\r\n stage.showAndWait();\r\n }",
"public void loginAlert() {\n\t\tDialog<Pair<String, String>> dialog = new Dialog<>();\n\t\tdialog.setTitle(\"Login Dialog\");\n\t\tdialog.setHeaderText(\"Look, a Custom Login Dialog\");\n\n\t\t// Set the icon (must be included in the project).\n\t\tdialog.setGraphic(new ImageView(this.getClass().getResource(\"file:src/vista/img/usuario.png\").toString()));\n\n\t\t// Set the button types.\n\t\tButtonType loginButtonType = new ButtonType(\"Login\", ButtonData.OK_DONE);\n\t\tdialog.getDialogPane().getButtonTypes().addAll(loginButtonType, ButtonType.CANCEL);\n\n\t\t// Create the username and password labels and fields.\n\t\tGridPane grid = new GridPane();\n\t\tgrid.setHgap(10);\n\t\tgrid.setVgap(10);\n\t\tgrid.setPadding(new Insets(20, 150, 10, 10));\n\n\t\tTextField username = new TextField();\n\t\tusername.setPromptText(\"Username\");\n\t\tPasswordField password = new PasswordField();\n\t\tpassword.setPromptText(\"Password\");\n\n\t\tgrid.add(new Label(\"Username:\"), 0, 0);\n\t\tgrid.add(username, 1, 0);\n\t\tgrid.add(new Label(\"Password:\"), 0, 1);\n\t\tgrid.add(password, 1, 1);\n\n\t\t// Enable/Disable login button depending on whether a username was entered.\n\t\tNode loginButton = dialog.getDialogPane().lookupButton(loginButtonType);\n\t\tloginButton.setDisable(true);\n\n\t\t// Do some validation (using the Java 8 lambda syntax).\n\t\tusername.textProperty().addListener((observable, oldValue, newValue) -> {\n\t\t loginButton.setDisable(newValue.trim().isEmpty());\n\t\t});\n\n\t\tdialog.getDialogPane().setContent(grid);\n\n\t\t// Request focus on the username field by default.\n\t\tPlatform.runLater(() -> username.requestFocus());\n\n\t\t// Convert the result to a username-password-pair when the login button is clicked.\n\t\tdialog.setResultConverter(dialogButton -> {\n\t\t if (dialogButton == loginButtonType) {\n\t\t return new Pair<>(username.getText(), password.getText());\n\t\t }\n\t\t return null;\n\t\t});\n\n\t\tOptional<Pair<String, String>> result = dialog.showAndWait();\n\n\t\tresult.ifPresent(usernamePassword -> {\n\t\t System.out.println(\"Username=\" + usernamePassword.getKey() + \", Password=\" + usernamePassword.getValue());\n\t\t});\n\t}",
"public void setDialogStage(Stage dialogStage) {\r\n this.dialogStage = dialogStage;\r\n }",
"public void setDialogStage(Stage dialogStage) {\r\n this.dialogStage = dialogStage;\r\n }",
"public void setDialogStage(Stage dialogStage) {\r\n this.dialogStage = dialogStage;\r\n }",
"public void setDialogStage(Stage dialogStage) {\r\n this.dialogStage = dialogStage;\r\n }",
"public void setDialogStage(Stage dialogStage) {\n _dialogStage = dialogStage;\n }",
"public void setDialogStage(Stage dialogStage) {\n _dialogStage = dialogStage;\n }",
"@Override\n public void vittoria() {\n Platform.runLater(() -> {\n /*Alert alert = new Alert(Alert.AlertType.INFORMATION);\n alert.setTitle(\"Hai vinto\");\n alert.setHeaderText(\"Fine della partita\");\n alert.showAndWait();*/\n Parent root = null;\n Stage dialog = new Stage();\n try {\n root = FXMLLoader.load(Objects.requireNonNull(getClass().getClassLoader().getResource(\"winner.fxml\")));\n Scene s = new Scene(root);\n dialog.setScene(s);\n dialog.setTitle(\"Vittoria!\");\n dialog.getIcons().add(new Image(\"images/cm_boardgame.png\"));\n overlayedStage = dialog;\n overlayedStage.initOwner(thisStage);\n overlayedStage.initModality(Modality.APPLICATION_MODAL);\n overlayedStage.setResizable(false);\n overlayedStage.showAndWait();\n } catch (IOException e) {\n e.printStackTrace();\n }\n System.exit(0);\n });\n try {\n handlerClient.getServer().close();\n } catch (IOException e) {\n System.out.println();\n }\n }",
"public void popEditHeritage()throws IOException {\n final Stage dialog = new Stage();\n dialog.setTitle(\"Editar herencia\");\n \n Parent root = FXMLLoader.load(getClass().getResource(\"/view/PopEditHeritage.fxml\"));\n \n Scene xscene = new Scene(root);\n \n dialog.setResizable(false);\n dialog.initModality(Modality.APPLICATION_MODAL);\n dialog.initOwner((Stage) root.getScene().getWindow());\n \n dialog.setScene(xscene);\n dialog.showAndWait();\n dialog.resizableProperty().setValue(Boolean.FALSE);\n dialog.setResizable(false);\n dialog.close();\n\n }",
"public void scene2() {\r\n\t\t \r\n\t\t // Button 2\r\n\t Label label2 = new Label(\"Credit card is valid\");\r\n\t Button button2 = new Button(\"Close\");\r\n\t button2.setOnAction(e -> window.close());\r\n\r\n\t // Layout 2\r\n\t VBox layout2 = new VBox(20);\r\n\t layout2.setAlignment(Pos.CENTER);\r\n\t layout2.getChildren().addAll(label2, button2);\r\n\t scene2 = new Scene(layout2, 250, 120);\r\n\t \r\n\t window.setScene(scene2);\r\n\t window.setTitle(\"Bank Account Verification\");\r\n\t window.show();\r\n\t }",
"@Test\n public void testSetDialogStage() {\n }",
"private void initDialog() {\n }",
"public void setDialogStage(Stage dialogStage) {\n this.dialogStage = dialogStage;\n }",
"public void setDialogStage(Stage dialogStage) {\n this.dialogStage = dialogStage;\n }",
"public void setDialogStage(Stage dialogStage) {\n this.dialogStage = dialogStage;\n }",
"public abstract Dialog createDialog(DialogDescriptor descriptor);",
"protected void dialog() {\n TextInputDialog textInput = new TextInputDialog(\"\");\n textInput.setTitle(\"Text Input Dialog\");\n textInput.getDialogPane().setContentText(\"Nyt bord nr: \");\n textInput.showAndWait()\n .ifPresent(response -> {\n if (!response.isEmpty()) {\n newOrderbutton(response.toUpperCase());\n }\n });\n }",
"public void setDialogStage(Stage dialogStage){\n\t\tthis.dialogStage = dialogStage;\n\t}",
"@Override\n public void sconfitta(String winner) {\n Platform.runLater(() -> {\n /*Alert alert = new Alert(Alert.AlertType.INFORMATION);\n alert.setTitle(\"Hai perso\");\n alert.setHeaderText(\"Ha vinto \" + winner + \"\\nFine della partita\");\n alert.showAndWait();*/\n Parent root = null;\n Stage dialog = new Stage();\n try {\n root = FXMLLoader.load(Objects.requireNonNull(getClass().getClassLoader().getResource(\"loser.fxml\")));\n Scene s = new Scene(root);\n dialog.setScene(s);\n dialog.setTitle(\"Sconfitta!\");\n dialog.getIcons().add(new Image(\"images/cm_boardgame.png\"));\n overlayedStage = dialog;\n overlayedStage.initOwner(thisStage);\n overlayedStage.initModality(Modality.APPLICATION_MODAL);\n overlayedStage.setResizable(false);\n overlayedStage.showAndWait();\n } catch (IOException e) {\n e.printStackTrace();\n }\n System.exit(0);\n });\n try {\n handlerClient.getServer().close();\n } catch (IOException e) {\n System.out.println();\n }\n }",
"@FXML\n public void removeFromTableChoiceDialog() {\n if (selectedAccount == null) {\n // Warn user if no account was selected.\n noAccountSelectedAlert(\"View Account\");\n } else {\n Dialog<Pair<String, LocalDateTime>> dialog = new Dialog<>();\n dialog.setTitle(\"Removal from Transplant List\");\n dialog.setHeaderText(\"Removal from Transplant List\");\n dialog.getDialogPane().getButtonTypes().addAll(ButtonType.OK, ButtonType.CANCEL);\n\n GridPane grid = new GridPane();\n grid.setHgap(10);\n grid.setVgap(10);\n grid.setPadding(new Insets(20, 150, 10, 10));\n\n //Creating a setting labels buttons for dialog\n ComboBox<String> choose = new ComboBox<>();\n\n choose.getItems().addAll(\n errorOption,\n curedOption,\n deathOption\n );\n choose.getSelectionModel().selectFirst();\n\n DatePicker date = new DatePicker(); //For the date of death option\n date.setValue(LocalDate.now());\n date.setVisible(false);\n\n Label dateLabel = new Label(); //Date of death label\n dateLabel.setText(\"Date of Death: \");\n dateLabel.setVisible(false);\n\n Label errorLabel = new Label(); //Error label for date of death\n errorLabel.setText(\"Please enter a date\");\n errorLabel.setTextFill(Color.RED);\n errorLabel.setVisible(false);\n\n CheckBox yes = new CheckBox();\n yes.setText(\"Yes\");\n yes.setVisible(false);\n\n CheckBox no = new CheckBox();\n no.setText(\"No\");\n no.setVisible(false);\n\n Label curedQuestion = new Label();\n curedQuestion.setText(\"Would you like to check the illnesses of the receiver?\");\n curedQuestion.setVisible(false);\n\n Label curedQuestionError = new Label();\n curedQuestionError.setText(\"Please choose yes or no\");\n curedQuestionError.setTextFill(Color.RED);\n curedQuestionError.setVisible(false);\n\n //Adding buttons/Labels to the grid\n grid.add(new Label(\"Reason for removal:\"), 0, 0);\n grid.add(choose, 1, 0);\n grid.add(dateLabel, 0, 1);\n grid.add(date, 1, 1);\n grid.add(errorLabel, 2, 1);\n\n grid.add(curedQuestion, 0, 1);\n grid.add(yes, 1, 1);\n grid.add(no, 2, 1);\n grid.add(curedQuestionError, 3, 1);\n\n createDeathListener(choose, errorLabel, curedQuestionError, date, dateLabel, curedQuestion,\n yes, no);\n\n dialog.getDialogPane().setContent(grid);\n\n //Catches a null date of death value if the reason is death, otherwise closes\n final Button okButton = (Button) dialog.getDialogPane().lookupButton(ButtonType.OK);\n okButton.addEventFilter(ActionEvent.ACTION, event -> {\n if ((date.getValue() == null) && (choose.getSelectionModel().getSelectedItem()\n .equals(deathOption))) {\n errorLabel.setVisible(true);\n event.consume();\n } else if ((!yes.isSelected()) && (!no.isSelected()) && (choose.getSelectionModel()\n .getSelectedItem().equals(curedOption))) {\n curedQuestionError.setVisible(true);\n event.consume();\n } else {\n closeDeathPopup(choose, date, yes);\n }\n });\n dialog.showAndWait();\n }\n }",
"private void setupOverwriteDialog(){\n // Setup dialog box\n dialog.setTitle(\"Overwrite File?\");\n dialog.initModality(Modality.APPLICATION_MODAL);\n\n // Setup buttons\n Button yes = new Button(\"Yes\");\n Button no = new Button(\"No\");\n\n BorderPane bp = new BorderPane();\n bp.setCenter(dialogMessage);\n bp.setId(\"border\"); // Set CSS style ID\n HBox hb = new HBox(yes, no);\n\n BorderPane.setAlignment(hb, Pos.CENTER);\n bp.setBottom(hb);\n\n Scene dialogScene = new Scene(bp,400,100); // Create the scene for the dialog box\n dialogScene.setUserAgentStylesheet(\"style/menus.css\"); // Set the style for the dialog scene\n dialog.setScene(dialogScene);\n\n // If overwrite is selected\n yes.setOnMouseClicked(new EventHandler<MouseEvent>() {\n @Override\n public void handle(MouseEvent event) {\n System.out.println(\"Set overwrite to true\");\n writeUAV(); // Write the settings\n dialog.close();\n createStage.close(); // Close the dialog box\n }\n });\n\n // If overwrite is not selected\n no.setOnMouseClicked(new EventHandler<MouseEvent>() {\n @Override\n public void handle(MouseEvent event) {\n System.out.println(\"Change the name of the craft and re-save\");\n dialog.close();\n }\n });\n }",
"@FXML\r\n void onActionDisplayMainScreen(ActionEvent event) throws IOException {\r\n\r\n //EXCEPTION SET 2 REQUIREMENT\r\n Alert alert = new Alert(Alert.AlertType.CONFIRMATION);\r\n alert.setTitle(\"Confirmation Dialog\");\r\n alert.setHeaderText(\"Changes not Saved\");\r\n alert.setContentText(\"Would you like to continue?\");\r\n\r\n Optional<ButtonType> result = alert.showAndWait();\r\n if (result.get() == ButtonType.OK){\r\n stage = (Stage)((Button)event.getSource()).getScene().getWindow();\r\n scene = FXMLLoader.load(getClass().getResource(\"MainScreen.fxml\"));\r\n stage.setScene(new Scene(scene));\r\n stage.show();\r\n }\r\n }",
"@FXML\r\n void visitationReport(ActionEvent event) {\r\n \tParent root ;\r\n try {\r\n \t root = FXMLLoader.load(getClass().getResource(ClientConstants.Screens.DEPARTMENT_VISITATION_REPORT.toString()));\r\n Stage stage = new Stage();\r\n stage.setTitle(\"department manager visitation report\");\r\n stage.setScene(new Scene(root,707, 893));\r\n stage.show();\r\n\t} catch(Exception e) {\r\n\t\te.printStackTrace();\r\n\t}\r\n }",
"public void openSaveSelection() {\n\t\ttry {\n\t\t\tFXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource(\"/SaveSelectionView.fxml\"));\n\t\t\tfxmlLoader.setResources(bundle);\n\t\t\tParent root1 = (Parent) fxmlLoader.load();\n\t\t\tStage stage = new Stage();\n\t\t\tSaveSelectionController ssc = fxmlLoader.getController();\n\t\t\tssc.setMainController(this);\n\t\t\tstage.initModality(Modality.APPLICATION_MODAL);\n\t\t\t// stage.initStyle(StageStyle.UNDECORATED);\n\t\t\tstage.setTitle(bundle.getString(\"sSHeaderLabel\"));\n\t\t\tstage.setScene(new Scene(root1));\n\t\t\tstage.show();\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"private void createFXScene() {\n try {\n Parent root = FXMLLoader.load(getClass().getResource(\"toolBarFXML.fxml\"));\n Scene scene = new Scene(root, Color.LIGHTGREY);\n fxPanel.setScene(scene);\n } catch (IOException e) {\n Exceptions.printStackTrace(e);\n }\n\n }",
"private WaitTitledPane() {\n\n }",
"@FXML\n public void initialize() {\n DialogBox greeting = DialogBox.getCaitDialog(MainWindow.showGreeting(), caitImage);\n dialogContainer.getChildren().add(greeting);\n scrollPane.vvalueProperty().bind(dialogContainer.heightProperty());\n }",
"public static String display(String title, String header){\n Stage window = new Stage();\n window.initModality(Modality.APPLICATION_MODAL);\n window.setTitle(title);\n \n Label head = new Label(header);\n Button save = new Button(\"Save\");\n Button dontSave = new Button(\"Don't Save\");\n Button cancel = new Button(\"Cancel\");\n \n save.setOnAction(e-> {answer = \"save\"; window.close();}); \n dontSave.setOnAction(e-> {answer = \"dontSave\"; window.close();});\n cancel.setOnAction(e-> {answer = \"cancel\"; window.close();});\n \n VBox vBox = new VBox(10);\n vBox.setAlignment(Pos.CENTER);\n vBox.getChildren().addAll(head,save,dontSave,cancel);\n \n Scene scene = new Scene(vBox, 300, 200);\n window.setScene(scene);\n window.showAndWait();\n \n return answer;\n }",
"@FXML\n\tpublic void onAnadirIdioma() {\n\t\tDialog<ButtonType> dialog = new Dialog<>();\n\t\tdialog.setTitle(\"Nuevo Conocimiento\");\n\n\t\t// declaramos los tipo de botones\n\n\t\tButtonType anadirButton = new ButtonType(\"Crear\", ButtonData.OK_DONE);\n\t\tdialog.getDialogPane().getButtonTypes().addAll(anadirButton, ButtonType.CANCEL);\n\t\tStage stage = (Stage) dialog.getDialogPane().getScene().getWindow();\n\t\tstage.getIcons().add(new Image(\"dad/javafx/resources/cv64x64.png\"));\n\n\t\t// creamos los campos\n\t\tGridPane grid = new GridPane();\n\t\tgrid.setHgap(10);\n\t\tgrid.setVgap(10);\n\t\tgrid.setPadding(new Insets(20, 150, 10, 10));\n\n\t\tButton xButton = new Button(\"X\");\n\n\t\tTextField denominacionTextField = new TextField();\n\t\tTextField certificacionTextField = new TextField();\n\t\tLabel certificacionLabel = new Label(\"Certificacion\");\n\t\tLabel denominacionDialogLabel = new Label(\"Denominacion\");\n\t\tLabel nivelDialogLabel = new Label(\"Nivel\");\n\n\t\tComboBox<Nivel> nivelComboBox = new ComboBox<Nivel>();\n\t\tnivelComboBox.getItems().addAll(Nivel.values());\n\t\tHBox box = new HBox(nivelComboBox, xButton);\n\t\tbox.setSpacing(5);\n\n\t\tgrid.add(denominacionDialogLabel, 0, 0);\n\t\tgrid.add(denominacionTextField, 1, 0);\n\t\tgrid.add(nivelDialogLabel, 0, 1);\n\t\tgrid.add(box, 1, 1);\n\t\tgrid.add(certificacionLabel, 0, 2);\n\t\tgrid.add(certificacionTextField, 1, 2);\n\n\t\txButton.setOnAction(e -> nivelComboBox.getSelectionModel().select(-1));\n\n\t\t// activar o desactivar el boton a�adir dependiendo de si se ha a�adido un\n\t\t// numero de telefono o no\n\n\t\t// metemos el grid pane en nuestro dialog\n\t\tdialog.getDialogPane().setContent(grid);\n\n\t\t// accion al apretar a�adir button\n\n\t\tOptional<ButtonType> result = dialog.showAndWait();\n\t\tif (result.get() == anadirButton) {\n\t\t\tIdioma idioma = new Idioma();\n\t\t\tidioma.setCertificacion(certificacionTextField.getText());\n\t\t\tConocimiento conocimiento = new Conocimiento();\n\t\t\tconocimiento.setDenominacion(denominacionTextField.getText());\n\t\t\tconocimiento.setNivel(nivelComboBox.getValue());\n\t\t\tconocimiento.setIdioma(idioma);\n\t\t\tmodel.conocimientoProperty().add(conocimiento);\n\t\t}\n\t}",
"@FXML\n public void initialize() {\n DialogBox welcome = DialogBox.getMugDialog(MainWindow.welcome(), mugImage);\n dialogContainer.getChildren().add(welcome);\n scrollPane.vvalueProperty().bind(dialogContainer.heightProperty());\n }",
"public static JDialog getDialog(JFrame frame, DiscoveryManagement dMgr, RecordingDiscoveryListener rdl) {\n JDialog dialog = new JDialog(frame, \"Discovery Group Selection\", true);\n GroupSelector gs = new GroupSelector(dMgr, rdl, dialog);\n dialog.getContentPane().add(gs);\n int width = 380;\n int height = 340;\n dialog.pack();\n dialog.setSize(width, height);\n //dialog.setResizable(false);\n dialog.setModal(true);\n dialog.setLocationRelativeTo(frame);\n return (dialog);\n\n }",
"public static void Display(AnalysisController pController, String pstrTitle) {\n \n Stage stgAboutMeerkatDialog = new Stage();\n stgAboutMeerkatDialog.initModality(Modality.APPLICATION_MODAL);\n \n //Label lblAboutMeerkat = new Label(strAboutMeerkat);\n \n String aboutMeerkat = \"Meerkat is a social network analysis tool developed at AMII, Department of Computing Science, University of Alberta, \"\n + \"under the leadership of Dr. Osmar Zaïane.\";\n \n String meerkatURL = \"https://www.amii.ca/meerkat\";\n \n Hyperlink link = new Hyperlink(meerkatURL);\n link.setBorder(Border.EMPTY);\n link.setPadding(new Insets(0, 0, 0, 0));\n link.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent e) {\n try{\n if( Desktop.isDesktopSupported() )\n {\n new Thread(() -> {\n try {\n Desktop.getDesktop().browse( new URI( meerkatURL ) );\n } catch (Exception et) {\n System.out.println(\"Exception in hyperlink click in AboutMeerkat:Disply()\");\n }\n }).start();\n }\n stgAboutMeerkatDialog.close();\n }catch(Exception exp){\n System.out.println(\"Exception in hyperlink click in AboutMeerkat:Disply()\");\n }\n }\n });\n \n \n \n String meerkatEmail = \"[email protected] \";\n\n String details = \"For more details please visit us online at: \";\n String emailDetails = \" or email us at: [email protected]\";\n \n String meerkatVersion = \"Meerkat Version: \"+MeerkatSoftwareValidator.getMeerkatVersion();\n String meerkatReleaseDate = \"Version Release Date: 2018 February 02\";\n\n String meerkatcurrentDevs = \"Current Developers : Sankalp Prabhakar, Talat Iqbal Syed\";\n \n String meerkatPastDevs = \"Past and Present Team Members (alphabetically): Abhimanyu Panwar, Ali Yadollahi, Afra Abnar, Amin Travelsi, Eric Verbeek, Farzad Sangi, Justin Fagnan, \\n\" +\n \"Jiyang Chen, Matt Gallivan, Mansoureh Takaffoli, Reihaneh Rabbany, Sankalp Prabhakar, Shiva Zamani Gharaghooshi, \"\n + \"Talat Iqbal Syed, Xiaoxiao Li.\";\n\n \n VBox labels = new VBox();\n Label label1 = new Label(aboutMeerkat);\n Label label2 = new Label(details);\n Label label3 = new Label(emailDetails);\n \n HBox hbox = new HBox();\n hbox.getChildren().addAll(label2, link, label3);\n \n Label version = new Label(meerkatVersion);\n Label releaseDate = new Label(meerkatReleaseDate);\n Label currDevs = new Label(meerkatcurrentDevs);\n Label pastDevs = new Label(meerkatPastDevs);\n \n labels.getChildren().addAll(label1,hbox,version,releaseDate,currDevs,pastDevs);\n labels.setPadding(new Insets(5, 10, 5, 10));\n labels.setSpacing(10);\n \n // Build a VBox\n Button btnOK = new Button(LangConfig.GENERAL_OK);\n VBox vboxRows = new VBox(5);\n vboxRows.setPadding(new Insets(5,10,5,10)); \n vboxRows.getChildren().addAll(labels, btnOK);\n vboxRows.setAlignment(Pos.CENTER);\n \n Scene scnAboutMeerkatDialog = new Scene(vboxRows);\n scnAboutMeerkatDialog.addEventFilter(KeyEvent.KEY_PRESSED, (KeyEvent evt) -> {\n if (evt.getCode().equals(KeyCode.ESCAPE)) {\n stgAboutMeerkatDialog.close();\n pController.updateStatusBar(false, StatusMsgsConfig.WINDOW_CLOSED);\n }\n });\n \n //stgAboutMeerkatDialog.initModality(Modality.WINDOW_MODAL);\n stgAboutMeerkatDialog.setTitle(pstrTitle); \n stgAboutMeerkatDialog.setResizable(false);\n \n \n // Events \n btnOK.setOnAction((ActionEvent e) -> {\n // Close the dialog box\n stgAboutMeerkatDialog.close();\n \n // Update the Status bar\n pController.updateStatusBar(false, StatusMsgsConfig.ABOUT_CLOSED);\n });\n \n stgAboutMeerkatDialog.setScene(scnAboutMeerkatDialog);\n stgAboutMeerkatDialog.show();\n \n // Update the status bar\n pController.updateStatusBar(true, StatusMsgsConfig.ABOUT_SHOW);\n }",
"@FXML\n public void New_List(ActionEvent actionEvent) {\n\n //Here we are going to open a window to create a list.\n //Working!!\n try {\n FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource(\"NewTodolist.fxml\"));\n Parent root1 = (Parent) fxmlLoader.load();\n Stage stage = new Stage();\n stage.initModality(Modality.APPLICATION_MODAL);\n stage.initStyle(StageStyle.UNDECORATED);\n stage.setTitle(\"New List\");\n stage.setScene(new Scene(root1));\n stage.show();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"private void usernameTakenDialog() {\n Dialog dialog = new Dialog(\"Username taken\", cloudSkin, \"dialog\") {\n public void result(Object obj) {\n System.out.println(\"result \" + obj);\n }\n };\n dialog.text(\"This username has already been taken, try a new one.\");\n dialog.button(\"OK\", true);\n dialog.show(stage);\n }",
"@FXML\n void viewNotes(ActionEvent event) {\n Parent root;\n try {\n //Loads library scene using library.fxml\n root = FXMLLoader.load(getClass().getResource(model.NOTES_VIEW_PATH));\n model.getNotesViewController().setPodcast(this.podcast);\n Stage stage = new Stage();\n stage.setTitle(this.podcast.getTitle()+\" notes\");\n stage.setScene(new Scene(root));\n stage.getIcons().add(new Image(getClass().getResourceAsStream(\"resources/musicnote.png\")));\n stage.setResizable(false);\n stage.showAndWait();\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n\n }",
"@Override\n public void start(Stage primaryStage) throws Exception{\n Parent root = FXMLLoader.load(getClass().getResource(\"MainForm.fxml\"));\n primaryStage.setTitle(\"Inventory Management System\");\n primaryStage.setMinHeight(500);\n primaryStage.setMinWidth(800);\n primaryStage.setScene(new Scene(root, 1280, 720));\n primaryStage.show();\n\n\n }",
"@FXML\n private void loadDriverView() throws Exception{\n Parent root = FXMLLoader.load(getClass().getClassLoader().getResource(\"driverTools.fxml\"));\n Scene scene = new Scene(root);\n getPrimaryStage().setTitle(\"Welcome\");\n getPrimaryStage().setScene(scene);\n }",
"public void setDialogStage(Stage dialogStage) {\r\n\t\tthis.dialogStage = dialogStage;\r\n\t}",
"public void delete_stage() {\r\n\t\tSelectStageDialog s = new SelectStageDialog(this,true);\r\n\t\ts.setAlwaysOnTop(true);\r\n\t\ts.setLocationRelativeTo(null);\r\n\t\ts.setVisible(true);\r\n\t}",
"public void createModalWindow(float cameraX, float cameraY) {\r\n\t\tcamera.position.x = cameraX;\r\n\t\tcamera.position.y = cameraY;\r\n\t\tcamera.update();\r\n\r\n//\t\tpauseMenuStage = new Stage(new ScreenViewport(camera));\r\n\t\tpauseMenu = new Table();\r\n\t\tpauseMenu.setBackground(blueRectangle);\r\n\t\tpauseMenu.setFillParent(true);\r\n\r\n\r\n//\t\tcreate sliders\r\n\t\tSlider.SliderStyle sliderStyle = new Slider.SliderStyle(blueSlider, blueKnob);\r\n\t\tsliderMusic = new Slider(0,1,0.01f,false,sliderStyle);\r\n\t\tsliderSound = new Slider(0,1,0.01f,false,sliderStyle);\r\n\t\tmusicIcon = new Image(blueMusicNote);\r\n\t\tsoundIcon = new Image(blueSound);\r\n\t\tsliderMusic.setValue(volume);\r\n\r\n\r\n\t\texitButton = new Button(blueExit);\r\n\t\tresumeButton = new Button(blueResume);\r\n\t\trestartButton = new Button(blueRestart);\r\n\t\tunderline = new Image(blueUnderline);\r\n\r\n\t\tpauseMenu.add(musicIcon).height(100).width(100);\r\n\t\tpauseMenu.add(sliderMusic).colspan(3).height(150).width(500).padRight(150);\r\n\t\tpauseMenu.row();\r\n\t\tpauseMenu.add(soundIcon).height(100).width(100);\r\n\t\tpauseMenu.add(sliderSound).colspan(3).height(100).width(500).padRight(150);\r\n\t\tsliderSound.setDisabled(true);\r\n\t\tpauseMenu.row();\r\n\t\tpauseMenu.add(exitButton).space(PAUSE_MENU_BUTTON_SPACE).size(150,70).padLeft(110).padTop(50);\r\n\t\tpauseMenu.add(restartButton).space(PAUSE_MENU_BUTTON_SPACE).size(200,70).padTop(50).padLeft(20);\r\n\t\tpauseMenu.add(resumeButton).space(PAUSE_MENU_BUTTON_SPACE).size(200,80).padRight(110).padTop(50);\r\n\t\tpauseMenu.row();\r\n\t\tpauseMenu.add(underline);\r\n\t\tunderline.setVisible(false);\r\n\r\n//\t\tadding listeners\r\n\t\texitButton.addListener(new ClickListener() {\r\n\t\t\tpublic void clicked(InputEvent event, float x, float y) {\r\n\t\t\t\texitClicked = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tresumeButton.addListener(new ClickListener() {\r\n\t\t\tpublic void clicked(InputEvent event, float x, float y) {\r\n\t\t\t\tresumeClicked = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\trestartButton.addListener(new ClickListener() {\r\n\t\t\tpublic void clicked(InputEvent event, float x, float y) {\r\n\t\t\t\trestartClicked = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tsliderMusic.addListener(new ChangeListener() {\r\n\t\t\t@Override\r\n\t\t\tpublic void changed(ChangeEvent event, Actor actor) {\r\n\t\t\t\tif (movementController.isHoldingHands()){\r\n\t\t\t\t\tMusicController.getInstance().setVolume(volume, \"combinedTrack\");\r\n\t\t\t\t}\r\n\t\t\t\telse if (movementController.getAvatar()==somni){\r\n\t\t\t\t\tMusicController.getInstance().setVolume(volume, \"somniTrack\");\r\n\t\t\t\t}\r\n\t\t\t\telse if (movementController.getAvatar()==phobia){\r\n\t\t\t\t\tMusicController.getInstance().setVolume(volume, \"phobiaTrack\");\r\n\t\t\t\t}\r\n\t\t\t\tMusicController.getInstance().setVolume(volume);\r\n\t\t\t\tvolume = sliderMusic.getValue();\r\n\r\n\t\t\t\tGDXRoot.setPreferences(GDXRoot.getPreferences().putFloat(\"volume\", volume));\r\n\r\n\t\t\t}\r\n\t\t});\r\n\r\n//\t\tpauseMenu.setPosition(camera.position.x- canvas.getWidth()/PAUSE_MENU_POSITION_SCALE , camera.position.y-canvas.getHeight()/PAUSE_MENU_POSITION_SCALE );\r\n\t\tpauseMenuStage.addActor(pauseMenu);\r\n\t\tpauseMenu.validate();\r\n\t\tpauseMenu.setTransform(true);\r\n\t\tpauseMenu.setScale(PAUSE_MENU_SCALE);\r\n\t\tunderline.setZIndex(0);\r\n\t\tunderline.setVisible(false);\r\n\r\n\t}",
"private void displayPopUp(Parent root) {\n Scene scene = new Scene(root, 300, 200);\n Stage stage = new Stage();\n stage.initModality(Modality.APPLICATION_MODAL);\n stage.setScene(scene);\n stage.showAndWait();\n }",
"public Dialog<String> createDialog() {\n\t\t// Creating a dialog\n\t\tDialog<String> dialog = new Dialog<String>();\n\n\t\tButtonType type = new ButtonType(\"Ok\", ButtonData.OK_DONE);\n\t\tdialog.getDialogPane().getButtonTypes().add(type);\n\t\treturn dialog;\n\t}",
"DialogResult show();",
"@FXML\r\n void cancellationReport(ActionEvent event) {\r\n\t\tParent root ;\r\n try {\r\n \t root = FXMLLoader.load(getClass().getResource(ClientConstants.Screens.DEPARTMENT_CANCELLATION_REPORT.toString()));\r\n Stage stage = new Stage();\r\n stage.setTitle(\"department manager cancellation report\");\r\n stage.setScene(new Scene(root,753, 579));\r\n stage.show();\r\n\t} catch(Exception e) {\r\n\t\te.printStackTrace();\r\n\t}\r\n }",
"private void setUpDialoguebox() {\n\t\tinput = new CTS_GUI_Dialoguebox();\n\t\tinput.setTitle(\"Settings\");\n\t\tBorderPane pane = new BorderPane();\n\t\tLocalTime t = LocalTime.now();\n\t\tLocalDate d = LocalDate.now();\n\t\tuicontrols = new VBox(10);\n\t\tHBox box0 = new HBox(5);\n\t\tbox0.getChildren().addAll(new Label(\"Latitude: \"),new TextField(\"0\"));\n\t\tHBox box1 = new HBox(5);\n\t\tbox1.getChildren().addAll(new Label(\"Longitude: \"),new TextField(\"0\"));\n\t\tHBox box2 = new HBox(5);\n\t\tbox2.getChildren().addAll(new Label(\"Date: \"),new TextField(d.toString()));\n\t\tTextField time = new TextField(t.getHour() + \":\" + t.getMinute() + \":\" + (int) floor(t.getSecond()));\n\t\tHBox box3 = new HBox(5);\n\t\tbox3.getChildren().addAll(new Label(\"Time: \"),time);\n\t\t// Check boxes\n\t\tHBox box5 = new HBox(5);\n\t\tCheckBox c1 = new CheckBox(\"Plot Stars\");\n\t\tc1.setSelected(true);\n\t\tCheckBox c2 = new CheckBox(\"Plot DSOs\");\n\t\tc2.setSelected(true);\n\t\tCheckBox c3 = new CheckBox(\"Plot Constellations\");\n\t\tc3.setSelected(true);\n\t\tCheckBox c4 = new CheckBox(\"Plot Planets\");\n\t\tc4.setSelected(true);\n\t\tbox5.getChildren().addAll(c1,c2,c3,c4);\n\t\t// Color Picker\n\t\t// 0 = Star color, 1 = Low mag star, 2 = Very low mag star.\n\t\t// 3 = DSO, 4 = Sky background, 5 = Circle around sky background\n\t\t// 6 = Overall background, 7 = Lat/long txt color, 8 = Constellation line color.\n\t\tHBox box6 = new HBox(5);\n\t\tTextField colorSet = new TextField(\"255,255,255,1\");\n\t\tButton setcolorbutton = new Button(\"Submit Color\");\n\t\tbox6.getChildren().addAll(new Label(\"Color to Set: \"),colorSet,setcolorbutton,new Label(\"[PREVIEW COLOR]\"));\n\t\tsetcolorbutton.setOnAction((event) -> { colorPickerHander(); });\n MenuBar mainmenu = new MenuBar();\n Menu colorpickermenu = new Menu(\"Set Custom Colors\");\n String[] colorstrs = {\"Star Color\",\"Low Magnituide Star Color\",\"Very Low Magnituide Star Color\", \"Deep Space Object Color\",\"Sky Background Color\",\n \t\t\"Circle Around Sky Background Color\",\"Overall Background Color\", \"Latitude/Longitude Text Color\",\"Constellation Line Color\"};\n for(int x = 0; x < colorstrs.length; x++) {\n \tMenuItem opt = new MenuItem(colorstrs[x]);\n \tint id = x;\n \topt.setOnAction((event) -> { colorSetterId = id; });\n \tcolorpickermenu.getItems().add(opt);\n }\n \n ComboBox<String> consts = new ComboBox<>();\n HashMap<String, String> cdbs = controller.getModelConstellationDBs();\n\n for (String name : cdbs.keySet()) {\n consts.getItems().add(name);\n }\n HBox box7 = new HBox(5);\n box7.getChildren().addAll(new Label(\"Select Constellation Set\"), consts);\n \n consts.getSelectionModel().select(\"Western\");\n mainmenu.getMenus().addAll(colorpickermenu);\n\t\tHBox box4 = new HBox(5);\n\t\tButton but = new Button(\"Cancel\");\n\t\tbut.setPadding(new Insets(5));\n\t\tButton but2 = new Button(\"Submit\");\n\t\tbut2.setPadding(new Insets(5));\n\t\tbox4.getChildren().addAll(but,but2);\n\t\tuicontrols.getChildren().addAll(box0,box1,box2,box3,box5,box6,box7,box4);\n\t\tbut.setOnAction((event) -> { input.close(); });\n\t\tbut2.setOnAction((event) -> {\n\t\t\tuserSelectedConstellationFileName = cdbs.get(consts.getValue());\n\t\t\tlong i = validateInput();\n\t\t\tif (i == 0) {\n\t\t\t\tchartTheStars();\n\t\t\t\tinput.close();\n\t\t\t} else {\n\t\t\t\tGUIerrorout = new Alert(AlertType.ERROR, getGUIErrorMsg(i));\n\t\t\t\tGUIerrorout.showAndWait();\n\t\t\t}\n });\n\t\tpane.setTop(mainmenu);\n\t\tpane.setCenter(uicontrols);\n\t\tpane.setPadding(new Insets(10));\n\t\tScene scene = new Scene(pane, 520, 310);\n\t\tinput.setScene(scene);\n\t}",
"public void showDialog(Dialog dialog) {\n activeDialog = dialog;\n activeDialog.center();\n }",
"public void setDialogStage(Stage dialogStage) {\n\t\tthis.dialogStage = dialogStage;\n\t}",
"public void setDialogStage(Stage dialogStage) {\n\t\tthis.dialogStage = dialogStage;\n\t}",
"public void setDialogStage(Stage dialogStage) {\n\t\tthis.dialogStage = dialogStage;\n\t}",
"public void setDialogStage(Stage dialogStage) {\n\t\tthis.dialogStage = dialogStage;\n\t}",
"public void setDialogStage(Stage dialogStage) {\n\t\tthis.dialogStage = dialogStage;\n\t}",
"public void setDialogStage(Stage dialogStage) {\n\t\tthis.dialogStage = dialogStage;\n\t}",
"public void rename_stage() {\r\n\t\tSelectStageDialog s = new SelectStageDialog(this,false);\r\n\t\ts.setAlwaysOnTop(true);\r\n\t\ts.setLocationRelativeTo(null);\r\n\t\ts.setVisible(true);\r\n\t}",
"@Override\n public void start(Stage primaryStage) throws Exception {\n\n try {\n Parent root = FXMLLoader.load(getClass().getResource(\"/view/mainForm.fxml\"));\n Scene sceneOne = new Scene(root);\n primaryStage.setScene(sceneOne);\n primaryStage.show();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }",
"private void showDialog() {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(\"User created successfully\");\n builder.setIcon(R.drawable.ic_shield);\n builder.setCancelable(true);\n builder.setPositiveButton(\n \"Continue\",\n new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n finish();\n }\n });\n AlertDialog alert11 = builder.create();\n alert11.show();\n Window window = alert11.getWindow();\n assert window != null;\n WindowManager.LayoutParams wlp = window.getAttributes();\n wlp.gravity = Gravity.CENTER;\n wlp.y = 270;\n wlp.flags &= ~WindowManager.LayoutParams.FLAG_DIM_BEHIND;\n window.setAttributes(wlp);\n }",
"public static void aboutApp(){\n\t\tAlert alertDialog = new Alert(Alert.AlertType.INFORMATION);\n\t\talertDialog.setTitle(\"My first java Desktop App\");\n\t\talertDialog.setHeaderText(\"Learning JavaFX\");\n\t\talertDialog.setContentText(\"I'm a beginner and soon i'll be a pro\");\n\n\t\t//to make custom buttons\n\t\tButtonType yesBtn = new ButtonType(\"yes\");\n\t\tButtonType noBtn = new ButtonType(\"No\");\n\t\talertDialog.getButtonTypes().setAll(yesBtn,noBtn);\n\n\t\t//to perform click event on buttons of the dilague box that opens and make buttons\n\t\tOptional<ButtonType> clickBtn=alertDialog.showAndWait();\n\t\tif(clickBtn.isPresent()&&clickBtn.get()==yesBtn){\n\t\t\t// code .......\n\t\t}\n\t\tif(clickBtn.get()==noBtn){\n\t\t\t//code..........\n\t\t}\n\n\t\talertDialog.show();\n\t}",
"@Override //with all the required instructions on how to use the application\n public void handle(ActionEvent event) {\n Label help = new Label(\"1) Please Enter the Required data\");\n help.setStyle(\"-fx-font-size: 20px;-fx-font-style: italic;-fx-font-weight: bold;\");\n Label help1 = new Label(\"2) Keep the field that you want the answer for as empty\");\n help1.setStyle(\"-fx-font-size: 20px;-fx-font-style: italic;-fx-font-weight: bold;\");\n Label help2 = new Label(\"4) Press calculate to get the answer you want \");\n help2.setStyle(\"-fx-font-size: 20px;-fx-font-style: italic;-fx-font-weight: bold;\");\n Label help3 = new Label(\"3) Press the \"+\"C \"+\"button on the number pad to clear the text fields\");\n help3.setStyle(\"-fx-font-size: 20px;-fx-font-style: italic;-fx-font-weight: bold;\");\n\n help.setLayoutX(10);\n help.setLayoutY(20);\n help1.setLayoutX(10);\n help1.setLayoutY(50);\n help3.setLayoutX(10);\n help3.setLayoutY(80);\n help2.setLayoutX(10);\n help2.setLayoutY(110);\n\n AnchorPane anchorPane1 = new AnchorPane();\n anchorPane1.setStyle(\"-fx-background-color: beige\");\n anchorPane1.getChildren().addAll(help,help1,help3,help2);\n\n\n Scene scene1 = new Scene(anchorPane1,650,500);\n Stage helpwin = new Stage();\n helpwin.setScene(scene1);\n helpwin.setTitle(\"HELP\");\n\n helpwin.show();\n }",
"public void view(Frame owner, FeatureCollection fc) {\n\t\t\tJDialog dialog = new JDialog(owner, \"Replace geometry with circles centered on points\", true);\n\t\t\tContainer parent = dialog.getContentPane();\n\t\t\t\n\t\t}",
"public void setDialogStage(Stage dialogStage) {\n\t\tthis.dialogStage = dialogStage;\n\t\t}",
"@Override // Override the start method in the Application class\r\n public void start(Stage primaryStage) {\n BorderPane bPane = new BorderPane();\r\n bPane.setBottom(this.getHBox());\r\n bPane.setCenter(this.getGPane());\r\n Scene scene = new Scene(bPane);\r\n primaryStage.setTitle(\"Search Window\"); // Set the stage title\r\n primaryStage.initModality(Modality.APPLICATION_MODAL);\r\n primaryStage.setResizable(false);\r\n primaryStage.setScene(scene); // Place the scene in the stage\r\n primaryStage.showAndWait(); // Display the stage\r\n }",
"private void openCreateAccountDialog()\n {\n testDialog();\n\n }",
"public void openLoadSelection() {\n\t\ttry {\n\t\t\tFXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource(\"/LoadSelectionView.fxml\"));\n\t\t\tfxmlLoader.setResources(bundle);\n\t\t\tParent root1 = (Parent) fxmlLoader.load();\n\t\t\tStage stage = new Stage();\n\t\t\tLoadSelectionController lsc = fxmlLoader.getController();\n\t\t\tlsc.setMainController(this);\n\t\t\tstage.initModality(Modality.APPLICATION_MODAL);\n\t\t\t// stage.initStyle(StageStyle.UNDECORATED);\n\t\t\tstage.setTitle(bundle.getString(\"lSTitle\"));\n\t\t\tstage.setScene(new Scene(root1));\n\t\t\tstage.show();\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"private void dialogAbout() {\n\t\tGraphicalUserInterfaceAbout.start();\r\n\t}",
"private void initDialog() {\n Window subWindow = new Window(\"Sub-window\");\n \n FormLayout nameLayout = new FormLayout();\n TextField code = new TextField(\"Code\");\n code.setPlaceholder(\"Code\");\n \n TextField description = new TextField(\"Description\");\n description.setPlaceholder(\"Description\");\n \n Button confirm = new Button(\"Save\");\n confirm.addClickListener(listener -> insertRole(code.getValue(), description.getValue()));\n\n nameLayout.addComponent(code);\n nameLayout.addComponent(description);\n nameLayout.addComponent(confirm);\n \n subWindow.setContent(nameLayout);\n \n // Center it in the browser window\n subWindow.center();\n\n // Open it in the UI\n UI.getCurrent().addWindow(subWindow);\n\t}",
"public void popEditEntity()throws IOException {\n final Stage dialog = new Stage();\n dialog.setTitle(\"Editar entidad\");\n \n Parent root = FXMLLoader.load(getClass().getResource(\"/view/PopEditEntity.fxml\"));\n \n Scene xscene = new Scene(root);\n \n dialog.setResizable(false);\n dialog.initModality(Modality.APPLICATION_MODAL);\n dialog.initOwner((Stage) root.getScene().getWindow());\n \n dialog.setScene(xscene);\n dialog.showAndWait();\n dialog.resizableProperty().setValue(Boolean.FALSE);\n dialog.setResizable(false);\n dialog.close();\n\n }",
"public WinPrompt()\n {\n //Create a label to display text\n Label youWin = new Label(\"Winner, Game Over!\");\n\n //build ok button\n Button ok = new Button(\"Ok\");\n\n //once ok is clicked just close the prompt\n ok.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent event) {\n close();\n }\n });\n\n //generate scene\n VBox root = new VBox();\n root.setPadding(new Insets(30, 30, 30, 30));\n root.getChildren().addAll(youWin, ok);\n Scene s = new Scene(root);\n this.setScene(s);\n }"
] | [
"0.6914522",
"0.65988886",
"0.6563046",
"0.65066457",
"0.64979726",
"0.6473011",
"0.64429665",
"0.6439012",
"0.64151907",
"0.6290382",
"0.61646646",
"0.61102945",
"0.6105415",
"0.6102096",
"0.6061362",
"0.6060167",
"0.5996114",
"0.59907687",
"0.5941149",
"0.5926677",
"0.5925084",
"0.59174097",
"0.5914514",
"0.5914058",
"0.5907871",
"0.58809924",
"0.58795345",
"0.5878013",
"0.5877813",
"0.5859118",
"0.58560175",
"0.5854354",
"0.585173",
"0.58481205",
"0.5847672",
"0.58457166",
"0.5836553",
"0.5836553",
"0.5836553",
"0.5836553",
"0.58360684",
"0.58360684",
"0.5829669",
"0.58231956",
"0.5820921",
"0.58129746",
"0.580663",
"0.58005404",
"0.58005404",
"0.58005404",
"0.5798851",
"0.5785656",
"0.57856023",
"0.5782673",
"0.57812554",
"0.5780748",
"0.57497996",
"0.5742061",
"0.5735614",
"0.5727096",
"0.57221913",
"0.5721453",
"0.5721273",
"0.57182014",
"0.57145524",
"0.5707286",
"0.57035846",
"0.569161",
"0.5688758",
"0.56869966",
"0.5684419",
"0.5677544",
"0.5673718",
"0.5646334",
"0.5645809",
"0.5642996",
"0.5635954",
"0.5635259",
"0.56349224",
"0.5632243",
"0.56296563",
"0.5624989",
"0.5624989",
"0.5624989",
"0.5624989",
"0.5624989",
"0.5624989",
"0.561641",
"0.5609928",
"0.5608862",
"0.5604013",
"0.5597307",
"0.55970824",
"0.5592947",
"0.5588163",
"0.5587951",
"0.55795294",
"0.5574319",
"0.5573312",
"0.55652595",
"0.5562565"
] | 0.0 | -1 |
Processes requests for both HTTP GET and POST methods. | protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
try (PrintWriter out = response.getWriter()) {
Usuario usuario = new Usuario();
DaoUsuario usu = new DaoUsuario();
Aluguel aluguel = new Aluguel();
DaoAluguel alu = new DaoAluguel();
try{
String cod = (String) request.getSession().getAttribute("usu_cod");
usuario = usu.buscar(Integer.parseInt(cod));
} catch (Exception erro) {
request.getSession().setAttribute("Mensagem", "Sua sessão expirou, faça login novamente;");
request.getSession().setAttribute("Link", "../index.jsp");
response.sendRedirect("Status_Imovel.jsp");
}
for (int i = 0; i < alu.listar().size(); i++) {
if (alu.listar().get(i).getAlu_usu_cod() == usuario.getUsu_cod()) {
aluguel=alu.buscar(alu.listar().get(i).getAlu_cod());
aluguel.setAlu_pagamento(false);
alu.altera(aluguel);
}
}
request.getSession().setAttribute("Mensagem", "Todos os alugueis foram resetados.");
request.getSession().setAttribute("Link", "Painel_Aluguel.jsp");
response.sendRedirect("Views/Status_Imovel.jsp");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException {\n final String method = req.getParameter(METHOD);\n if (GET.equals(method)) {\n doGet(req, resp);\n } else {\n resp.setStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED);\n }\n }",
"private void processRequest(HttpServletRequest request, HttpServletResponse response) {\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n // only POST should be used\n doPost(request, response);\n }",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\nSystem.err.println(\"=====================>>>>>123\");\n\t\tString key=req.getParameter(\"method\");\n\t\tswitch (key) {\n\t\tcase \"1\":\n\t\t\tgetProvinces(req,resp);\n\t\t\tbreak;\n\t\tcase \"2\":\n\t\t\tgetCities(req,resp);\t\t\t\n\t\t\tbreak;\n\t\tcase \"3\":\n\t\t\tgetAreas(req,resp);\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tprocess(req, resp);\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\r\n\t\tdoPost(req, resp);\r\n\t}",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoGet(req, resp);\n\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\r\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\r\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\r\n\t}",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}",
"@Override\n \tpublic void doGet(HttpServletRequest req, HttpServletResponse resp)\n \t\t\tthrows ServletException, IOException {\n \t\tdoPost(req, resp);\n \t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tdoPost(req, resp);\r\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tdoPost(req, resp);\r\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t\tdoGet(req, resp);\r\n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\r\n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n processRequest(request, response);\n }",
"@Override\n\tprotected void doGet(HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t\tprocessRequest(request, response);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t\tprocessRequest(request, response);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t\t\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\n\t\tprocess(req,resp);\n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }"
] | [
"0.7003337",
"0.66585124",
"0.66023004",
"0.65085584",
"0.6446528",
"0.6441425",
"0.64401287",
"0.64316165",
"0.64271754",
"0.64235586",
"0.64235586",
"0.6418961",
"0.6418961",
"0.6418961",
"0.6417602",
"0.64138156",
"0.64138156",
"0.6399609",
"0.63932025",
"0.63932025",
"0.63919455",
"0.6391227",
"0.6391227",
"0.63895965",
"0.63895965",
"0.63895965",
"0.63895965",
"0.63882446",
"0.63882446",
"0.63798195",
"0.637763",
"0.6377603",
"0.63762355",
"0.63754046",
"0.6370034",
"0.63621527",
"0.63621527",
"0.6360786",
"0.6354855",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545",
"0.63542545"
] | 0.0 | -1 |
Handles the HTTP GET method. | @Override
protected void doGet
(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void doGet( )\n {\n \n }",
"@Override\n\tprotected void executeGet(GetRequest request, OperationResponse response) {\n\t}",
"@Override\n\tprotected Method getMethod() {\n\t\treturn Method.GET;\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\t\n\t}",
"@Override\n protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t}",
"@Override\r\n\tprotected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoGet(req, resp);\r\n\t}",
"void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException;",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n metGet(request, response);\n }",
"public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException {\r\n\tlogTrace( req, \"GET log\" );\r\n\tString requestId = req.getQueryString();\r\n\tif (requestId == null) return;\r\n\tif (\"get-response\".equals( requestId )) {\r\n\t try {\r\n\t\tonMEVPollsForResponse( req, resp );\r\n\t } catch (Exception e) {\r\n\t\tlogError( req, resp, e, \"MEV polling error\" );\r\n\t\tsendError( resp, \"MEV polling error: \" + e.toString() );\r\n\t }\r\n\t}\r\n }",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n \r\n }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t\t\n\t}",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n\r\n }",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\r\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\r\n\t}",
"public void doGet() throws IOException {\n\n // search ressource\n byte[] contentByte = null;\n try {\n contentByte = ToolBox.readFileByte(RESOURCE_DIRECTORY, this.url);\n this.statusCode = OK;\n ContentType contentType = new ContentType(this.extension);\n sendHeader(statusCode, contentType.getContentType(), contentByte.length);\n } catch (IOException e) {\n System.out.println(\"Ressource non trouvé\");\n statusCode = NOT_FOUND;\n contentByte = ToolBox.readFileByte(RESPONSE_PAGE_DIRECTORY, \"pageNotFound.html\");\n sendHeader(statusCode, \"text/html\", contentByte.length);\n }\n\n this.sendBodyByte(contentByte);\n }",
"public HttpResponseWrapper invokeGET(String path) {\n\t\treturn invokeHttpMethod(HttpMethodType.HTTP_GET, path, \"\");\n\t}",
"@Override\n\tpublic void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n }",
"@Override\n\tprotected void doGet(HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t}",
"public Result get(Get get) throws IOException;",
"@Override\n public void doGet(HttpServletRequest request, HttpServletResponse response) {\n System.out.println(\"[Servlet] GET request \" + request.getRequestURI());\n\n response.setContentType(FrontEndServiceDriver.APP_TYPE);\n response.setStatus(HttpURLConnection.HTTP_BAD_REQUEST);\n\n try {\n String url = FrontEndServiceDriver.primaryEventService +\n request.getRequestURI().replaceFirst(\"/events\", \"\");\n HttpURLConnection connection = doGetRequest(url);\n\n if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) {\n PrintWriter pw = response.getWriter();\n JsonObject responseBody = (JsonObject) parseResponse(connection);\n\n response.setStatus(HttpURLConnection.HTTP_OK);\n pw.println(responseBody.toString());\n }\n }\n catch (Exception ignored) {}\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tSystem.out.println(\"get\");\n\t\tthis.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}",
"public void doGet(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \tSystem.out.println(\"---here--get--\");\n processRequest(request, response);\n }",
"@Override\n public final void doGet() {\n try {\n checkPermissions(getRequest());\n // GET one\n if (id != null) {\n output(api.runGet(id, getParameterAsList(PARAMETER_DEPLOY), getParameterAsList(PARAMETER_COUNTER)));\n } else if (countParameters() == 0) {\n throw new APIMissingIdException(getRequestURL());\n }\n // Search\n else {\n\n final ItemSearchResult<?> result = api.runSearch(Integer.parseInt(getParameter(PARAMETER_PAGE, \"0\")),\n Integer.parseInt(getParameter(PARAMETER_LIMIT, \"10\")), getParameter(PARAMETER_SEARCH),\n getParameter(PARAMETER_ORDER), parseFilters(getParameterAsList(PARAMETER_FILTER)),\n getParameterAsList(PARAMETER_DEPLOY), getParameterAsList(PARAMETER_COUNTER));\n\n head(\"Content-Range\", result.getPage() + \"-\" + result.getLength() + \"/\" + result.getTotal());\n\n output(result.getResults());\n }\n } catch (final APIException e) {\n e.setApi(apiName);\n e.setResource(resourceName);\n throw e;\n }\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }",
"public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n }",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tthis.service(req, resp);\r\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\n\t}",
"@RequestMapping(value = \"/{id}\", method = RequestMethod.GET)\n public void get(@PathVariable(\"id\") String id, HttpServletRequest req){\n throw new NotImplementedException(\"To be implemented\");\n }",
"@Override\npublic void get(String url) {\n\t\n}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tString action = req.getParameter(\"action\");\r\n\t\t\r\n\t\tif(action == null) {\r\n\t\t\taction = \"List\";\r\n\t\t}\r\n\t\t\r\n\t\tswitch(action) {\r\n\t\t\tcase \"List\":\r\n\t\t\t\tlistUser(req, resp);\r\n\t\t\t\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tlistUser(req, resp);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest request, \n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t\tSystem.out.println(\"Routed to doGet\");\n\t}",
"@NonNull\n public String getAction() {\n return \"GET\";\n }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\n\t\tprocess(req,resp);\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"@Override\r\nprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t process(req,resp);\r\n\t }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tprocess(req, resp);\n\t}",
"@Override\n\tpublic HttpResponse get(final String endpoint) {\n\t\treturn httpRequest(HTTP_GET, endpoint, null);\n\t}",
"public void doGet(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\r\n\t}",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n System.out.println(\"teste doget\");\r\n }",
"public void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/plain\");\n // Actual logic goes here.\n PrintWriter out = response.getWriter();\n out.println(\"Wolken,5534-0848-5100,0299-6830-9164\");\n\ttry \n\t{\n Get g = new Get(Bytes.toBytes(request.getParameter(\"userid\")));\n Result r = table.get(g);\n byte [] value = r.getValue(Bytes.toBytes(\"v\"),\n Bytes.toBytes(\"\"));\n\t\tString valueStr = Bytes.toString(value);\n\t\tout.println(valueStr);\n\t}\n\tcatch (Exception e)\n\t{\n\t\tout.println(e);\n\t}\n }",
"@Override\r\n public void doGet(String path, HttpServletRequest request, HttpServletResponse response)\r\n throws Exception {\r\n // throw new UnsupportedOperationException();\r\n System.out.println(\"Inside the get\");\r\n response.setContentType(\"text/xml\");\r\n response.setCharacterEncoding(\"utf-8\");\r\n final Writer w = response.getWriter();\r\n w.write(\"inside the get\");\r\n w.close();\r\n }",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\r\n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n System.out.println(\"Console: doGET visited\");\n String result = \"\";\n //get the user choice from the client\n String choice = (request.getPathInfo()).substring(1);\n response.setContentType(\"text/plain;charset=UTF-8\");\n PrintWriter out = response.getWriter();\n //methods call appropriate to user calls\n if (Integer.valueOf(choice) == 3) {\n result = theBlockChain.toString();\n if (result != null) {\n out.println(result);\n response.setStatus(200);\n //set status if result output is not generated\n } else {\n response.setStatus(401);\n return;\n }\n }\n //verify chain method\n if (Integer.valueOf(choice) == 2) {\n response.setStatus(200);\n boolean validity = theBlockChain.isChainValid();\n out.print(\"verifying:\\nchain verification: \");\n out.println(validity);\n }\n }",
"@Override\n public DataObjectResponse<T> handleGET(DataObjectRequest<T> request)\n {\n if(getRequestValidator() != null) getRequestValidator().validateGET(request);\n\n DefaultDataObjectResponse<T> response = new DefaultDataObjectResponse<>();\n try\n {\n VisibilityFilter<T, DataObjectRequest<T>> visibilityFilter = visibilityFilterMap.get(VisibilityMethod.GET);\n List<Query> queryList = new LinkedList<>();\n if(request.getQueries() != null)\n queryList.addAll(request.getQueries());\n\n if(request.getId() != null)\n {\n // if the id is specified\n queryList.add(new ById(request.getId()));\n }\n\n DataObjectFeed<T> feed = objectPersister.retrieve(queryList);\n if(feed == null)\n feed = new DataObjectFeed<>();\n List<T> filteredObjects = visibilityFilter.filterByVisible(request, feed.getAll());\n response.setCount(feed.getCount());\n response.addAll(filteredObjects);\n }\n catch(PersistenceException e)\n {\n ObjectNotFoundException objectNotFoundException = new ObjectNotFoundException(String.format(OBJECT_NOT_FOUND_EXCEPTION, request.getId()), e);\n response.setErrorResponse(ErrorResponseFactory.objectNotFound(objectNotFoundException, request.getCID()));\n }\n return response;\n }",
"public void handleGet( HttpExchange exchange ) throws IOException {\n switch( exchange.getRequestURI().toString().replace(\"%20\", \" \") ) {\n case \"/\":\n print(\"sending /MainPage.html\");\n sendResponse( exchange, FU.readFromFile( getReqDir( exchange )), 200);\n break;\n case \"/lif\":\n // send log in page ( main page )\n sendResponse ( exchange, FU.readFromFile(getReqDir(exchange)), 200);\n //\n break;\n case \"/home.html\":\n\n break;\n case \"/book.html\":\n\n break;\n default:\n //checks if user is logged in\n\n //if not send log in page\n //if user is logged in then\n print(\"Sending\");\n String directory = getReqDir( exchange ); // dont need to do the / replace as no space\n File page = new File( getReqDir( exchange) );\n\n // IMPLEMENT DIFFERENT RESPONSE CODE FOR HERE IF EXISTS IS FALSE OR CAN READ IS FALSE\n sendResponse(exchange, FU.readFromFile(directory), 200);\n break;\n }\n }",
"public int handleGET(String requestURL) throws ClientProtocolException, IOException{\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\thttpGet = new HttpGet(requestURL);\t\t\r\n\t\t\t\t\t\t\r\n\t\tinputsource=null;\r\n\t\t\t\r\n\t\toutputString=\"\";\r\n\t\t\r\n\t\t//taking response by executing http GET object\r\n\t\tCloseableHttpResponse response = httpclient.execute(httpGet);\t\t\r\n\t\r\n\t\t/* \r\n\t\t * \tThe underlying HTTP connection is still held by the response object\r\n\t\t\tto allow the response content to be streamed directly from the network socket.\r\n\t\t\tIn order to ensure correct deallocation of system resources\r\n\t\t\tthe user MUST call CloseableHttpResponse.close() from a finally clause.\r\n\t\t\tPlease note that if response content is not fully consumed the underlying\r\n\t\t\tconnection cannot be safely re-used and will be shut down and discarded\r\n\t\t\tby the connection manager.\r\n\t\t */\r\n\t\t\r\n\t\t\tstatusLine= response.getStatusLine().toString();\t\t//status line\r\n\t\t\t\r\n\t\t\tHttpEntity entity1 = response.getEntity();\t\t\t\t//getting response entity from server response \t\r\n\t\t\t\t\t\r\n\t\t\tBufferedReader br=new BufferedReader(new InputStreamReader(entity1.getContent()));\r\n\r\n\t\t\tString line;\r\n\t\t\twhile((line=br.readLine())!=null)\r\n\t\t\t{\r\n\t\t\t\toutputString=outputString+line.toString();\r\n\t }\r\n\t\t\t\r\n\t\t\t//removing spaces around server response string.\r\n\t\t\toutputString.trim();\t\t\t\t\t\t\t\t\t\r\n\t\t\t\r\n\t\t\t//converting server response string into InputSource.\r\n\t\t\tinputsource = new InputSource(new StringReader(outputString));\t\r\n\t\t\t\r\n\t\t\t// and ensure it is fully consumed\r\n\t\t\tEntityUtils.consume(entity1);\t\t\t//consuming entity.\r\n\t\t\tresponse.close();\t\t\t\t\t\t//closing response.\r\n\t\t\tbr.close();\t\t\t\t\t\t\t\t//closing buffered reader\r\n\t\t\t\r\n\t\t\t//returning response code\r\n\t\t\treturn response.getStatusLine().getStatusCode();\r\n\t\r\n\t}",
"@Override\n\tprotected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\t logger.error(\"BISHUNNN CALLED\");\n\t\tString category = request.getParameter(\"category\").trim();\n\t\tGetHttpCall getHttpCall = new GetHttpCall();\n\t\turl = APIConstants.baseURL+category.toLowerCase();\n\t\tresponseString = getHttpCall.execute(url);\n\t\tresponse.getWriter().write(responseString);\n\t}",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n //processRequest(request, response);\r\n }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tPrintWriter out = resp.getWriter();\n\t\tout.print(\"<h1>Hello from your doGet method!</h1>\");\n\t}",
"public void doGet(HttpServletRequest request,\n HttpServletResponse response)\n throws IOException, ServletException {\n response.setContentType(TYPE_TEXT_HTML.label);\n response.setCharacterEncoding(UTF8.label);\n request.setCharacterEncoding(UTF8.label);\n String path = request.getRequestURI();\n logger.debug(RECEIVED_REQUEST + path);\n Command command = null;\n try {\n command = commands.get(path);\n command.execute(request, response);\n } catch (NullPointerException e) {\n logger.error(REQUEST_PATH_NOT_FOUND);\n request.setAttribute(JAVAX_SERVLET_ERROR_STATUS_CODE, 404);\n command = commands.get(EXCEPTION.label);\n command.execute(request, response);\n }\n }",
"public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tString search = req.getParameter(\"searchBook\");\n\t\tString output=search;\n\n\t\t//redirect output to view search.jsp\n\t\treq.setAttribute(\"output\", output);\n\t\tresp.setContentType(\"text/json\");\n\t\tRequestDispatcher view = req.getRequestDispatcher(\"search.jsp\");\n\t\tview.forward(req, resp);\n\t\t\t\n\t}",
"public void doGet( HttpServletRequest request, HttpServletResponse response )\n throws ServletException, IOException\n {\n handleRequest( request, response, false );\n }",
"public void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\t}",
"public void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\t}",
"@GET\n @Produces(MediaType.APPLICATION_JSON)\n public Response handleGet() {\n Gson gson = GSONFactory.getInstance();\n List allEmployees = getAllEmployees();\n\n if (allEmployees == null) {\n allEmployees = new ArrayList();\n }\n\n Response response = Response.ok().entity(gson.toJson(allEmployees)).build();\n return response;\n }",
"@Override\n\tprotected void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows IOException, ServletException {\n\t\tsuper.doGet(request, response);\t\t\t\n\t}",
"private static String sendGET(String getURL) throws IOException {\n\t\tURL obj = new URL(getURL);\n\t\tHttpURLConnection con = (HttpURLConnection) obj.openConnection();\n\t\tcon.setRequestMethod(\"GET\");\n\t\tString finalResponse = \"\";\n\n\t\t//This way we know if the request was processed successfully or there was any HTTP error message thrown.\n\t\tint responseCode = con.getResponseCode();\n\t\tSystem.out.println(\"GET Response Code : \" + responseCode);\n\t\tif (responseCode == HttpURLConnection.HTTP_OK) { // success\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));\n\t\t\tString inputLine;\n\t\t\tStringBuffer buffer = new StringBuffer();\n\n\t\t\twhile ((inputLine = in.readLine()) != null) {\n\t\t\t\tbuffer.append(inputLine);\n\t\t\t}\n\t\t\tin.close();\n\n\t\t\t// print result\n\t\t\tfinalResponse = buffer.toString();\n\t\t} else {\n\t\t\tSystem.out.println(\"GET request not worked\");\n\t\t}\n\t\treturn finalResponse;\n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n //processRequest(request, response);\n }",
"@Override\n \tpublic void doGet(HttpServletRequest req, HttpServletResponse resp)\n \t\t\tthrows ServletException, IOException {\n \t\tdoPost(req, resp);\n \t}",
"public BufferedReader reqGet(final String route) throws\n ServerStatusException, IOException {\n System.out.println(\"first reqGet\");\n return reqGet(route, USER_AGENT);\n }",
"HttpGet getRequest(HttpServletRequest request, String address) throws IOException;",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override \r\nprotected void doGet(HttpServletRequest request, HttpServletResponse response) \r\nthrows ServletException, IOException { \r\nprocessRequest(request, response); \r\n}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\n String action = request.getParameter(\"action\");\r\n\r\n try {\r\n switch (action)\r\n {\r\n case \"/getUser\":\r\n \tgetUser(request, response);\r\n break;\r\n \r\n }\r\n } catch (Exception ex) {\r\n throw new ServletException(ex);\r\n }\r\n }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\n\t}",
"@Test\r\n\tpublic void doGet() throws Exception {\n\t\tCloseableHttpClient httpClient = HttpClients.createDefault();\r\n\t\t// Create a GET object and pass a url to it\r\n\t\tHttpGet get = new HttpGet(\"http://www.google.com\");\r\n\t\t// make a request\r\n\t\tCloseableHttpResponse response = httpClient.execute(get);\r\n\t\t// get response as result\r\n\t\tSystem.out.println(response.getStatusLine().getStatusCode());\r\n\t\tHttpEntity entity = response.getEntity();\r\n\t\tSystem.out.println(EntityUtils.toString(entity));\r\n\t\t// close HttpClient\r\n\t\tresponse.close();\r\n\t\thttpClient.close();\r\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tint i = request.getRequestURI().lastIndexOf(\"/\") + 1;\n\t\tString action = request.getRequestURI().substring(i);\n\t\tSystem.out.println(action);\n\t\t\n\t\tString view = \"Error\";\n\t\tObject model = \"service Non disponible\";\n\t\t\n\t\tif (action.equals(\"ProductsList\")) {\n\t\t\tview = productAction.productsList();\n\t\t\tmodel = productAction.getProducts();\n\t\t}\n\t\t\n\t\trequest.setAttribute(\"model\", model);\n\t\trequest.getRequestDispatcher(prefix + view + suffix).forward(request, response); \n\t}",
"private void requestGet(String endpoint, Map<String, String> params, RequestListener listener) throws Exception {\n String requestUri = Constant.API_BASE_URL + ((endpoint.indexOf(\"/\") == 0) ? endpoint : \"/\" + endpoint);\n get(requestUri, params, listener);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n\t throws ServletException, IOException {\n\tprocessRequest(request, response);\n }",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tcommandAction(request,response);\r\n\t}"
] | [
"0.7588987",
"0.7165731",
"0.7114584",
"0.70562947",
"0.7030403",
"0.7029135",
"0.69961035",
"0.697584",
"0.6888159",
"0.68733263",
"0.68536866",
"0.68436044",
"0.68436044",
"0.6835487",
"0.6835487",
"0.6835487",
"0.68192834",
"0.681755",
"0.6797782",
"0.67811096",
"0.676131",
"0.6755122",
"0.6755122",
"0.6739693",
"0.6719442",
"0.6716263",
"0.67053807",
"0.67053807",
"0.6701305",
"0.6683792",
"0.66762924",
"0.6675791",
"0.6675791",
"0.6674836",
"0.6674836",
"0.6668942",
"0.6662203",
"0.6662203",
"0.6647396",
"0.66360617",
"0.661557",
"0.6613155",
"0.6603806",
"0.6570173",
"0.65511245",
"0.6538869",
"0.6536244",
"0.6535807",
"0.64963406",
"0.64670646",
"0.6453451",
"0.6450184",
"0.64114696",
"0.64114696",
"0.64114696",
"0.64114696",
"0.64114696",
"0.64114696",
"0.64114696",
"0.64114696",
"0.64114696",
"0.64114696",
"0.64114696",
"0.64114696",
"0.64064944",
"0.6395551",
"0.6379177",
"0.63734025",
"0.6359922",
"0.63565195",
"0.6340911",
"0.63091",
"0.6305878",
"0.63027",
"0.63015234",
"0.62831336",
"0.627429",
"0.62677175",
"0.6258609",
"0.6254727",
"0.6249613",
"0.624525",
"0.6239081",
"0.6239081",
"0.62380093",
"0.6235722",
"0.62158257",
"0.6212092",
"0.6207318",
"0.6204665",
"0.6204235",
"0.62001777",
"0.6198581",
"0.61877996",
"0.61758053",
"0.61748284",
"0.61713034",
"0.6171271",
"0.61699176",
"0.61687297"
] | 0.6182668 | 94 |
Handles the HTTP POST method. | @Override
protected void doPost
(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void doPost(Request request, Response response) {\n\n\t}",
"@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) {\n }",
"public void doPost( )\n {\n \n }",
"@Override\n public String getMethod() {\n return \"POST\";\n }",
"public String post();",
"@Override\n\tpublic void doPost(HttpRequest request, AbstractHttpResponse response)\n\t\t\tthrows IOException {\n\t\t\n\t}",
"@Override\n public String getMethod() {\n return \"POST\";\n }",
"public ResponseTranslator post() {\n setMethod(\"POST\");\n return doRequest();\n }",
"protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException {\n }",
"public void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows IOException {\n\n\t}",
"public void postData() {\n\n\t}",
"@Override\n public void doPost(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException {\n logger.warn(\"doPost Called\");\n handle(req, res);\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n metPost(request, response);\n }",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n }",
"@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n\r\n }",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}",
"@Override\n\tpublic void postHandle(WebRequest request, ModelMap model) throws Exception {\n\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n }",
"public void doPost(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\r\n\r\n\t\t\r\n\t}",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\t\n\t}",
"@Override\n\tprotected HttpMethod requestMethod() {\n\t\treturn HttpMethod.POST;\n\t}",
"@Override\n\tprotected void handlePostBody(HashMap<String, HashMap<String, String>> params, DataFormat format) throws Exception {\n\t}",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n }",
"@Override\n\tprotected void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t}",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }",
"@Override\n\n\tpublic void handlePOST(CoapExchange exchange) {\n\t\tFIleStream read = new FIleStream();\n\t\tread.tempWrite(Temp_Path, exchange.getRequestText());\n\t\texchange.respond(ResponseCode.CREATED, \"POST successfully!\");\n\t\t_Logger.info(\"Receive post request:\" + exchange.getRequestText());\n\t}",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.getWriter().println(\"go to post method in manager\");\n }",
"@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}",
"@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}",
"@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}",
"@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }",
"@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }",
"public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\t\n\t}",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }",
"public abstract boolean handlePost(FORM form, BindException errors) throws Exception;",
"@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n super.doPost(req, resp);\n }",
"public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\n\t\t\t\n\t\t \n\t}",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}",
"public void processPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException\n {\n }",
"@Override\n\tpublic void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n\t}",
"@Override\n\tpublic void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n\t}",
"public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\n\t}",
"public void doPost(HttpServletRequest request ,HttpServletResponse response){\n\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n }",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request,\r\n\t\t\tHttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}",
"public void post(){\n\t\tHttpClient client = new HttpClient();\n\n\t\tPostMethod post = new PostMethod(\"http://211.138.245.85:8000/sso/POST\");\n//\t\tPostMethod post = new PostMethod(\"/eshopclient/product/show.do?id=111655\");\n//\t\tpost.addRequestHeader(\"Cookie\", cookieHead);\n\n\n\t\ttry {\n\t\t\tSystem.out.println(\"��������====\");\n\t\t\tint status = client.executeMethod(post);\n\t\t\tSystem.out.println(status);\n\t\t} catch (HttpException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n//\t\ttaskCount++;\n//\t\tcountDown--;\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException {\r\n\tlogTrace( req, \"POST log\" );\r\n\tString requestId = req.getQueryString();\r\n\tif (requestId == null) {\r\n\t try {\r\n\t\tServletUtil.bufferedRead( req.getInputStream() );\r\n\t } catch (IOException ex) {\r\n\t }\r\n\t logError( req, resp, new Exception(\"Unrecognized POST\"), \"\" );\r\n\t sendError(resp, \"Unrecognized POST\");\r\n\t} else\r\n\t if (\"post-request\".equals( requestId )) {\r\n\t\ttry {\r\n\t\t onMEVPostsRequest( req, resp );\r\n\t\t} catch (Exception e) {\r\n\t\t try {\r\n\t\t\tServletUtil.bufferedRead( req.getInputStream() );\r\n\t\t } catch (IOException ex) {\r\n\t\t }\r\n\t\t logError( req, resp, e, \"MEV POST error\" );\r\n\t\t sendError( resp, \"MEV POST error: \" + e.toString() );\r\n\t\t}\r\n\t } else if (\"post-response\".equals( requestId )) {\r\n\t\ttry {\r\n\t\t onPVMPostsResponse( req, resp );\r\n\t\t} catch (Exception e) {\r\n\t\t try {\r\n\t\t\tServletUtil.bufferedRead( req.getInputStream() );\r\n\t\t } catch (IOException ex) {\r\n\t\t }\r\n\t\t logError( req, resp, e, \"PVM POST error\" );\r\n\t\t sendError( resp, \"PVM POST error: \" + e.toString() );\r\n\t\t}\r\n\t }\r\n }",
"@Override\n\tpublic void postHandle(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Object handler,\n\t\t\tModelAndView modelAndView) throws Exception {\n\t\t\n\t}",
"@Override\n\tpublic void postHandle(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Object handler,\n\t\t\tModelAndView modelAndView) throws Exception {\n\t\t\n\t}",
"@Override\n\tpublic void postHandle(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Object handler,\n\t\t\tModelAndView modelAndView) throws Exception {\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest req, HttpServletResponse resp, Object handler, ModelAndView m)\r\n\t\t\tthrows Exception {\n\t\t\r\n\t}",
"@Override\n public final void doPost() {\n try {\n checkPermissions(getRequest());\n final IItem jSonStreamAsItem = getJSonStreamAsItem();\n final IItem outputItem = api.runAdd(jSonStreamAsItem);\n\n output(JSonItemWriter.itemToJSON(outputItem));\n } catch (final APIException e) {\n e.setApi(apiName);\n e.setResource(resourceName);\n throw e;\n\n }\n }",
"@Override\n\tvoid post() {\n\t\t\n\t}",
"@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\t\tSystem.out.println(\"=========interCpetor Post=========\");\r\n\t}",
"public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\tString method = request.getParameter(\"method\");\n\t\tswitch(method){\n\t\tcase \"Crawl\":\n\t\t\tcrawl(request, response);\n\t\t\tbreak;\n\t\tcase \"Extract\":\n\t\t\textract(request, response);\n\t\t\tbreak;\n\t\tcase \"JDBC\":\n\t\t\tjdbc(request, response);\n\t\t\tbreak;\n\t\tcase \"Indexer\":\n\t\t\tindexer(request, response);\n\t\t\tbreak;\n\t\t}\n\t}",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n System.out.println(\"teste dopost\");\r\n }",
"protected void doPost(HttpServletRequest request,\r\n\t\t\tHttpServletResponse response)\r\n\t/* 43: */throws ServletException, IOException\r\n\t/* 44: */{\r\n\t\t/* 45:48 */doGet(request, response);\r\n\t\t/* 46: */}",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tprocess(req, resp);\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\tprocess(req,resp);\r\n\t}",
"public void handlePost(SessionSrvc session, IObjectContext context)\n throws Exception\n {\n }",
"public void doPost(HttpServletRequest request, HttpServletResponse response) {\n\t\tdoGet(request, response);\n\t}",
"public void doPost(HttpServletRequest request, HttpServletResponse response) {\n\t\tdoGet(request, response);\n\t}",
"public void doPost(HttpServletRequest request, HttpServletResponse response) {\r\n\t\tdoGet(request, response);\r\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\t}",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n try {\r\n processRequest(request, response);\r\n } catch (JSONException ex) {\r\n Logger.getLogger(PDCBukUpload.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }",
"@Override\r\n protected void doPost(HttpServletRequest request,\r\n HttpServletResponse response)\r\n throws ServletException,\r\n IOException {\r\n processRequest(request,\r\n response);\r\n\r\n }",
"@Override\r\n\tpublic void doPost(CustomHttpRequest request, CustomHttpResponse response) throws Exception {\n\t\tdoGet(request, response);\r\n\t}",
"@Override\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response,\n\t\t\tObject handler, ModelAndView modelAndView) throws Exception {\n\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tdoHandle(request, response);\n\t}",
"private void postRequest() {\n\t\tSystem.out.println(\"post request, iam playing money\");\n\t}",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"@Override\n public void postHandle(HttpServletRequest request,\n HttpServletResponse response, Object handler,\n ModelAndView modelAndView) throws Exception {\n\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (Exception ex) {\n Logger.getLogger(PedidoController.class.getName()).log(Level.SEVERE, null, ex);\n }\n }"
] | [
"0.73289514",
"0.71383566",
"0.7116213",
"0.7105215",
"0.7100045",
"0.70236707",
"0.7016248",
"0.6964149",
"0.6889435",
"0.6784954",
"0.67733276",
"0.67482096",
"0.66677034",
"0.6558593",
"0.65582114",
"0.6525548",
"0.652552",
"0.652552",
"0.652552",
"0.65229493",
"0.6520197",
"0.6515622",
"0.6513045",
"0.6512626",
"0.6492367",
"0.64817846",
"0.6477479",
"0.64725804",
"0.6472099",
"0.6469389",
"0.6456206",
"0.6452577",
"0.6452577",
"0.6452577",
"0.6450273",
"0.6450273",
"0.6438126",
"0.6437522",
"0.64339423",
"0.64253825",
"0.6422238",
"0.6420897",
"0.6420897",
"0.6420897",
"0.6407662",
"0.64041835",
"0.64041835",
"0.639631",
"0.6395677",
"0.6354875",
"0.63334197",
"0.6324263",
"0.62959254",
"0.6288832",
"0.6288832",
"0.6288832",
"0.6288832",
"0.6288832",
"0.6288832",
"0.6288832",
"0.6288832",
"0.6288832",
"0.6288832",
"0.6288832",
"0.6280875",
"0.6272104",
"0.6272104",
"0.62711537",
"0.62616795",
"0.62544584",
"0.6251865",
"0.62274224",
"0.6214439",
"0.62137586",
"0.621211",
"0.620854",
"0.62023044",
"0.61775357",
"0.61775357",
"0.61775357",
"0.61775357",
"0.61775357",
"0.61775357",
"0.61775357",
"0.61638993",
"0.61603814",
"0.6148914",
"0.61465937",
"0.61465937",
"0.614548",
"0.6141879",
"0.61313903",
"0.61300284",
"0.6124381",
"0.6118381",
"0.6118128",
"0.61063534",
"0.60992104",
"0.6098801",
"0.6096766"
] | 0.6136717 | 91 |
Returns a short description of the servlet. | @Override
public String getServletInfo
() {
return "Short description";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getServletInfo()\n {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\r\n return \"Short description\";\r\n }",
"public String getServletInfo() {\r\n return \"Short description\";\r\n }",
"public String getServletInfo() {\r\n return \"Short description\";\r\n }",
"public String getServletInfo() {\r\n return \"Short description\";\r\n }",
"public String getServletInfo() {\r\n return \"Short description\";\r\n }",
"public String getServletInfo() {\r\n return \"Short description\";\r\n }",
"@Override\r\n public String getServletInfo() {\r\n return \"Short description\";\r\n }",
"@Override\r\n public String getServletInfo() {\r\n return \"Short description\";\r\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}",
"@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}",
"@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}",
"@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}",
"@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}",
"@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}",
"@Override\r\n public String getServletInfo()\r\n {\r\n return \"Short description\";\r\n }",
"@Override\n public String getServletInfo()\n {\n return \"Short description\";\n }",
"@Override\r\n\tpublic String getServletInfo() {\r\n\t\treturn \"Short description\";\r\n\t}",
"@Override\r\n public String getServletInfo()\r\n {\r\n return \"Short description\";\r\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }"
] | [
"0.8763362",
"0.87320423",
"0.87320423",
"0.87320423",
"0.87320423",
"0.87320423",
"0.87320423",
"0.87320423",
"0.87320423",
"0.87320423",
"0.87320423",
"0.8698972",
"0.8698972",
"0.8698972",
"0.8698972",
"0.8698972",
"0.8698972",
"0.8531154",
"0.8531154",
"0.85280526",
"0.85280526",
"0.85280526",
"0.8527255",
"0.8527255",
"0.8527255",
"0.8527255",
"0.8527255",
"0.8527255",
"0.8516929",
"0.8512195",
"0.8511082",
"0.8510197",
"0.8496415",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456",
"0.8492456"
] | 0.0 | -1 |
TODO Autogenerated method stub | private static void tableObjAutofit() {
tableObj.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
for (int column = 0; column < tableObj.getColumnCount(); column++) {
final TableColumn tableObjColumn = tableObj.getColumnModel().getColumn(column);
int preferredWidth = tableObjColumn.getMinWidth();
final int maxWidth = tableObjColumn.getMaxWidth();
for (int row = 0; row < tableObj.getRowCount(); row++) {
final TableCellRenderer cellRenderer = tableObj.getCellRenderer(row, column);
final Component c = tableObj.prepareRenderer(cellRenderer, row, column);
final int width = c.getPreferredSize().width + tableObj.getIntercellSpacing().width;
preferredWidth = Math.max(preferredWidth, width);
// We've exceeded the maximum width, no need to check other rows
if (preferredWidth >= maxWidth) {
preferredWidth = maxWidth;
break;
}
}
tableObjColumn.setPreferredWidth(preferredWidth);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
Inflate the menu; this adds items to the action bar if it is present. | @Override
public boolean onCreateOptionsMenu(Menu menu) {
if (currentFragment == HOME_FRAGMENT) {
getMenuInflater().inflate(R.menu.main, menu);
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.actions, menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tgetMenuInflater().inflate(R.menu.actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.actions_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main_actions, menu);\n\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n\t\tinflater.inflate(R.menu.action_bar_menu, menu);\r\n\t\tmMenu = menu;\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.act_bar_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_actions, menu);\r\n\t\treturn true;\r\n //return super.onCreateOptionsMenu(menu);\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\r\n\t inflater.inflate(R.menu.action_bar_all, menu);\r\n\t return super.onCreateOptionsMenu(menu);\r\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\t super.onCreateOptionsMenu(menu);\n\t\tMenuInflater muu= getMenuInflater();\n\t\tmuu.inflate(R.menu.cool_menu, menu);\n\t\treturn true;\n\t\t\n\t\t\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.adventure_archive, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.archive_menu, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n \tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n \t\tinflater.inflate(R.menu.main, menu);\n \t\tsuper.onCreateOptionsMenu(menu, inflater);\n \t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.action_menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater bow=getMenuInflater();\n\t\tbow.inflate(R.menu.menu, menu);\n\t\treturn true;\n\t\t}",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.action_menu, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\t\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\t\t\n\t\t/* Inflate the menu; this adds items to the action bar if it is present */\n\t\tgetMenuInflater().inflate(R.menu.act_main, menu);\t\t\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflate = getMenuInflater();\n inflate.inflate(R.menu.menu, ApplicationData.amvMenu.getMenu());\n return true;\n }",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.menu, menu);\n\t\t\treturn true; \n\t\t\t\t\t\n\t\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.main, menu);\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) \n {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_bar, menu);\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_item, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.menu, menu);\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t \n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\t//menu.clear();\n\t\tinflater.inflate(R.menu.soon_to_be, menu);\n\t\t//getActivity().getActionBar().show();\n\t\t//getActivity().getActionBar().setBackgroundDrawable(\n\t\t\t\t//new ColorDrawable(Color.rgb(223, 160, 23)));\n\t\t//return true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n this.getMenuInflater().inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.main, menu);\n }",
"@Override\n\tpublic void onCreateOptionsMenu( Menu menu, MenuInflater inflater )\n\t{\n\t\tsuper.onCreateOptionsMenu( menu, inflater );\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}",
"@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\r\n \t// We must call through to the base implementation.\r\n \tsuper.onCreateOptionsMenu(menu);\r\n \t\r\n MenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_menu, menu);\r\n\r\n return true;\r\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.inter_main, menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.action, menu);\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu (Menu menu){\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.custom_action_bar, menu);\n\t\treturn true;\n\t}",
"public void initMenubar() {\n\t\tremoveAll();\n\n\t\t// \"File\"\n\t\tfileMenu = new FileMenuD(app);\n\t\tadd(fileMenu);\n\n\t\t// \"Edit\"\n\t\teditMenu = new EditMenuD(app);\n\t\tadd(editMenu);\n\n\t\t// \"View\"\n\t\t// #3711 viewMenu = app.isApplet()? new ViewMenu(app, layout) : new\n\t\t// ViewMenuApplicationD(app, layout);\n\t\tviewMenu = new ViewMenuApplicationD(app, layout);\n\t\tadd(viewMenu);\n\n\t\t// \"Perspectives\"\n\t\t// if(!app.isApplet()) {\n\t\t// perspectivesMenu = new PerspectivesMenu(app, layout);\n\t\t// add(perspectivesMenu);\n\t\t// }\n\n\t\t// \"Options\"\n\t\toptionsMenu = new OptionsMenuD(app);\n\t\tadd(optionsMenu);\n\n\t\t// \"Tools\"\n\t\ttoolsMenu = new ToolsMenuD(app);\n\t\tadd(toolsMenu);\n\n\t\t// \"Window\"\n\t\twindowMenu = new WindowMenuD(app);\n\n\t\tadd(windowMenu);\n\n\t\t// \"Help\"\n\t\thelpMenu = new HelpMenuD(app);\n\t\tadd(helpMenu);\n\n\t\t// support for right-to-left languages\n\t\tapp.setComponentOrientation(this);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp=getMenuInflater();\n\t\tblowUp.inflate(R.menu.welcome_menu, menu);\n\t\treturn true;\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.listing, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.item, menu);\n return true;\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.resource, menu);\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu,menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.home_action_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.template, menu);\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n Log.d(\"onCreateOptionsMenu\", \"create menu\");\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.socket_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_menu, menu);//Menu Resource, Menu\n\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actionbar, menu);\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(toolbar_res, menu);\n updateMenuItemsVisibility(menu);\n return true;\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t// \n\t\tMenuInflater mi = getMenuInflater();\n\t\tmi.inflate(R.menu.thumb_actv_menu, menu);\n\t\t\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n }",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.swag_list_activity_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\n\t\treturn true;\n\t}",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.jarvi, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {\n menuInflater.inflate(R.menu.main, menu);\n\n }",
"public void onCreateOptionsMenu(Menu menu, MenuInflater inflater){\n }",
"@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actmain, menu);\r\n return true;\r\n }",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.add__listing, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.buat_menu, menu);\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.layout.menu, menu);\n\t\treturn true;\n\t}",
"@Override\npublic boolean onCreateOptionsMenu(Menu menu) {\n\n\t\n\t\n\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\n\treturn super.onCreateOptionsMenu(menu);\n}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ichat, menu);\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater)\n\t{\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\tinflater.inflate(R.menu.expenses_menu, menu);\n\t}",
"@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}",
"@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}",
"@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.action_bar, menu);\n return true;\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp = getMenuInflater();\n\t\tblowUp.inflate(R.menu.status, menu);\n\t\treturn true;\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.menu, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn true;\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ui_main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_activity_actions, menu);\n return true;\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }"
] | [
"0.7249201",
"0.7204109",
"0.7197405",
"0.71792436",
"0.7109801",
"0.7041446",
"0.7040234",
"0.70145714",
"0.7011273",
"0.6983118",
"0.6946729",
"0.6940447",
"0.6936383",
"0.6920103",
"0.6920103",
"0.6893587",
"0.6885479",
"0.6877562",
"0.6877041",
"0.6864375",
"0.6864375",
"0.6864375",
"0.6864375",
"0.6854553",
"0.6848997",
"0.68213886",
"0.6819509",
"0.6814738",
"0.68146676",
"0.68146676",
"0.6807654",
"0.6802825",
"0.679964",
"0.67930657",
"0.67922",
"0.67903394",
"0.6786084",
"0.6761232",
"0.6759505",
"0.67503023",
"0.6746139",
"0.6746139",
"0.6743613",
"0.6743027",
"0.6727706",
"0.67254",
"0.67245597",
"0.67245597",
"0.6723394",
"0.67136675",
"0.67081934",
"0.6706639",
"0.67022187",
"0.6700513",
"0.66984093",
"0.66964614",
"0.66886663",
"0.6685854",
"0.6685854",
"0.6685123",
"0.66817266",
"0.66811055",
"0.6679423",
"0.66700786",
"0.66692066",
"0.66648287",
"0.6659215",
"0.6659215",
"0.6659215",
"0.665847",
"0.6656809",
"0.6656809",
"0.6656809",
"0.66543585",
"0.6653763",
"0.6652573",
"0.6650882",
"0.66493136",
"0.66489655",
"0.6648397",
"0.6648281",
"0.664721",
"0.6647127",
"0.6645251",
"0.66444296",
"0.6644408",
"0.66408044",
"0.66365176",
"0.6635421",
"0.6634293",
"0.6634293",
"0.6634293",
"0.66340095",
"0.66314715",
"0.6629901",
"0.6628624",
"0.662851",
"0.66264814",
"0.6622667",
"0.6621362",
"0.6621362"
] | 0.0 | -1 |
Handle action bar item clicks here. The action bar will automatically handle clicks on the Home/Up button, so long as you specify a parent activity in AndroidManifest.xml. | @Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.main_search_icon) {
return true;
} else if (id == R.id.main_cart_icon) {
myCart();
return true;
}
return super.onOptionsItemSelected(item);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public boolean onOptionsItemSelected(MenuItem item) { Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n\n //\n // HANDLE BACK BUTTON\n //\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // Back button clicked\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // app icon in action bar clicked; goto parent activity.\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n switch (id) {\r\n case android.R.id.home:\r\n // app icon in action bar clicked; go home\r\n this.finish();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // app icon in action bar clicked; go home\n finish();\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n Log.e(\"clik\", \"action bar clicked\");\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n\t public boolean onOptionsItemSelected(MenuItem item) {\n\t int id = item.getItemId();\n\t \n\t\t\tif (id == android.R.id.home) {\n\t\t\t\t// Respond to the action bar's Up/Home button\n\t\t\t\t// NavUtils.navigateUpFromSameTask(this);\n\t\t\t\tonBackPressed();\n\t\t\t\treturn true;\n\t\t\t}\n\t \n\t \n\t return super.onOptionsItemSelected(item);\n\t }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n switch (item.getItemId()) {\r\n // Respond to the action bar's Up/Home button\r\n case android.R.id.home:\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n\n switch (item.getItemId()) {\n case android.R.id.home:\n\n // app icon in action bar clicked; goto parent activity.\n this.finish();\n return true;\n default:\n\n return super.onOptionsItemSelected(item);\n\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n\n switch (item.getItemId()) {\n case android.R.id.home:\n\n // app icon in action bar clicked; goto parent activity.\n this.finish();\n return true;\n default:\n\n return super.onOptionsItemSelected(item);\n\n }\n }",
"@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tonBackPressed();\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Handle presses on the action bar items\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n case R.id.action_clear:\n return true;\n case R.id.action_done:\n\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n onActionHomePressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n switch (item.getItemId())\n {\n case android.R.id.home :\n super.onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId ()) {\n case android.R.id.home:\n onBackPressed ();\n return true;\n\n default:\n break;\n }\n return super.onOptionsItemSelected ( item );\n }",
"@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t switch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\t// app icon in action bar clicked; go home \n\t\t\tIntent intent = new Intent(this, Kelutral.class); \n\t\t\tintent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); \n\t\t\tstartActivity(intent); \n\t\t\treturn true;\t\t\n\t case R.id.Search:\n\t \treturn onSearchRequested();\n\t\tcase R.id.AppInfo:\n\t\t\t// Place holder menu item\n\t\t\tIntent newIntent = new Intent(Intent.ACTION_VIEW,\n\t\t\t\t\tUri.parse(\"http://forum.learnnavi.org/mobile-apps/\"));\n\t\t\tstartActivity(newIntent);\n\t\t\treturn true;\n\t\tcase R.id.Preferences:\n\t\t\tnewIntent = new Intent(getBaseContext(), Preferences.class);\n\t\t\tstartActivity(newIntent);\n\t\t\treturn true;\t\n\t }\n\t return false;\n\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n\n case android.R.id.home:\n onBackPressed();\n return true;\n\n }\n return super.onOptionsItemSelected(item);\n\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // Intent homeIntent = new Intent(this, MainActivity.class);\n // homeIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n // startActivity(homeIntent);\n finish();\n return true;\n default:\n return (super.onOptionsItemSelected(item));\n }\n\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // setResult and close the activity when Action Bar Up Button clicked.\n if (item.getItemId() == android.R.id.home) {\n setResult(RESULT_CANCELED);\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // This ID represents the Home or Up button. In the case of this\n // activity, the Up button is shown. Use NavUtils to allow users\n // to navigate up one level in the application structure. For\n // more details, see the Navigation pattern on Android Design:\n //\n // http://developer.android.com/design/patterns/navigation.html#up-vs-back\n //\n \tgetActionBar().setDisplayHomeAsUpEnabled(false);\n \tgetFragmentManager().popBackStack();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n switch (item.getItemId()) {\n case android.R.id.home:\n super.onBackPressed();\n return true;\n\n default:\n // If we got here, the user's action was not recognized.\n // Invoke the superclass to handle it.\n return super.onOptionsItemSelected(item);\n\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if(id == android.R.id.home){\n onBackPressed();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n\n }\n\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@RequiresApi(api = Build.VERSION_CODES.M)\n @Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tif(item.getItemId()==android.R.id.home)\r\n\t\t{\r\n\t\t\tgetActivity().onBackPressed();\r\n\t\t}\r\n\t\treturn super.onOptionsItemSelected(item);\r\n\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if(item.getItemId()==android.R.id.home){\n super.onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n return false;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n //Back arrow\n case android.R.id.home:\n onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // android.R.id.home是Android内置home按钮的id\n finish();\n break;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n super.onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n this.onBackPressed();\n return false;\n }\n return false;\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n int id = item.getItemId();\n\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n switch (item.getItemId()) {\r\n\r\n case android.R.id.home:\r\n /*Intent i= new Intent(getApplication(), MainActivity.class);\r\n i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);\r\n startActivity(i);*/\r\n onBackPressed();\r\n finish();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id){\n case android.R.id.home:\n this.finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n NavUtils.navigateUpFromSameTask(getActivity());\n return true;\n case R.id.action_settings:\n Intent i = new Intent(getActivity(), SettingsActivity.class);\n startActivity(i);\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Pass the event to ActionBarDrawerToggle, if it returns\n // true, then it has handled the app icon touch event\n if (mDrawerToggle.onOptionsItemSelected(item)) {\n return true;\n }\n\n // Handle your other action bar items...\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n //Fixes the Up Button\n if(id == android.R.id.home) {\n BuildRoute.this.finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()){\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return true;\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n if (id == android.R.id.home) {\n NavUtils.navigateUpFromSameTask(this);\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\r\n case android.R.id.home:\r\n onBackPressed();\r\n break;\r\n }\r\n return true;\r\n }",
"@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tif (item.getItemId() == android.R.id.home) {\n\t\t\tfinish();\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n onBackPressed();\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n if ( id == android.R.id.home ) {\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.home) {\r\n NavUtils.navigateUpFromSameTask(this);\r\n return true;\r\n }\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.action_about) {\r\n AboutDialog();\r\n return true;\r\n }\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.action_exit) {\r\n finish();\r\n return true;\r\n }\r\n\r\n\r\n return super.onOptionsItemSelected(item);\r\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n//noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n// finish the activity\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item)\n {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if( id == android.R.id.home ) // Back button of the actionbar\n {\n finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\r\n\t\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\t\tswitch (item.getItemId()) {\r\n\t\t\tcase android.R.id.home:\r\n\t\t\t\tfinish();\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\treturn super.onOptionsItemSelected(item);\r\n\t\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if (item.getItemId() == android.R.id.home) {\n onBackPressed();\n return true;\n }\n return false;\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n\n this.finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n if(id == android.R.id.home){\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n if (item.getItemId() == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\r\n\t\tcase android.R.id.home:\r\n\t\t\tsetResult(RESULT_OK, getIntent());\r\n\t\t\tfinish();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n finish();\n return true;\n default:\n // If we got here, the user's action was not recognized.\n // Invoke the superclass to handle it.\n return super.onOptionsItemSelected(item);\n\n }\n }",
"@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\tbreak;\n\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n\n case android.R.id.home:\n this.finish();\n return true;\n }\n return true;\n }",
"@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}",
"@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tint id = item.getItemId();\n\t\tif (id == android.R.id.home) {\n\t\t\tfinish();\n\t\t\treturn true;\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n if (id == android.R.id.home) {\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n //NavUtils.navigateUpFromSameTask(this);\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // todo: goto back activity from here\n finish();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n // Handle item selection\r\n switch (item.getItemId()) {\r\n case android.R.id.home:\r\n onBackPressed();\r\n return true;\r\n\r\n case me.cchiang.lookforthings.R.id.action_sample:\r\n// Snackbar.make(parent_view, item.getTitle() + \" Clicked \", Snackbar.LENGTH_SHORT).show();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n\n\n }",
"@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tonBackPressed();\n\t\t\treturn true;\n\t\tcase R.id.scan_menu:\n\t\t\tonScan();\n\t\t\tbreak;\n\t\tcase R.id.opt_about:\n\t\t\t//onAbout();\n\t\t\tbreak;\n\t\tcase R.id.opt_exit:\n\t\t\tfinish();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t\treturn true;\n\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n super.onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n this.finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }",
"@Override\n public boolean onOptionsItemSelected(@NonNull MenuItem item) {\n if (item.getItemId() == android.R.id.home) {\n onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n\n case android.R.id.home:\n finish();\n return true;\n\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\r\n\t switch (item.getItemId()) {\r\n\t \t// back to previous page\r\n\t case android.R.id.home:\r\n\t finish();\r\n\t return true;\r\n\t }\r\n\t return super.onOptionsItemSelected(item);\r\n\t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if(id==android.R.id.home){\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == android.R.id.home) {\r\n // finish the activity\r\n onBackPressed();\r\n return true;\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == android.R.id.home) {\r\n // finish the activity\r\n onBackPressed();\r\n return true;\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId())\n {\n case android.R.id.home:\n this.finish();\n return (true);\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id){\n case R.id.home:{\n NavUtils.navigateUpFromSameTask(this);\n return true;\n }\n }\n return super.onOptionsItemSelected(item);\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n switch(item.getItemId())\n {\n case android.R.id.home:\n super.onBackPressed();\n break;\n }\n\n return super.onOptionsItemSelected(item);\n }",
"@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\treturn true;\n\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t}",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n\r\n int id = item.getItemId();\r\n if(id==android.R.id.home){\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }"
] | [
"0.79052806",
"0.7806316",
"0.7767438",
"0.772778",
"0.76324606",
"0.7622031",
"0.758556",
"0.7531728",
"0.7489057",
"0.74576724",
"0.74576724",
"0.743964",
"0.7422121",
"0.74037784",
"0.73926556",
"0.7387903",
"0.73803806",
"0.73715395",
"0.7362778",
"0.7357048",
"0.7346653",
"0.73422706",
"0.7331221",
"0.7329421",
"0.7326524",
"0.73197514",
"0.73175013",
"0.7314632",
"0.7305193",
"0.7305193",
"0.73030055",
"0.72992206",
"0.7294402",
"0.7287853",
"0.7284157",
"0.72821075",
"0.72797185",
"0.7260893",
"0.7260893",
"0.7260893",
"0.7260798",
"0.72604334",
"0.7250995",
"0.72243106",
"0.72205526",
"0.7217967",
"0.72052115",
"0.72008896",
"0.7200226",
"0.71938485",
"0.7186533",
"0.7178549",
"0.71698415",
"0.7168567",
"0.7154602",
"0.7154338",
"0.71365875",
"0.71357495",
"0.71357495",
"0.71302795",
"0.7129606",
"0.7125107",
"0.7124433",
"0.71243066",
"0.7122874",
"0.7118138",
"0.71181303",
"0.71180034",
"0.71180034",
"0.71180034",
"0.71180034",
"0.7117241",
"0.71159554",
"0.7113099",
"0.7110779",
"0.71097904",
"0.71062744",
"0.710078",
"0.7099281",
"0.70957214",
"0.7094494",
"0.7094494",
"0.7087356",
"0.70834076",
"0.7081747",
"0.70809853",
"0.70746684",
"0.70691484",
"0.70627403",
"0.70616937",
"0.7060999",
"0.7052165",
"0.70382303",
"0.70382303",
"0.7036847",
"0.7036218",
"0.7036218",
"0.70333946",
"0.7031289",
"0.7030542",
"0.70198953"
] | 0.0 | -1 |
Handle navigation view item clicks here. | @Override
public boolean onNavigationItemSelected(MenuItem item) {
int id = item.getItemId();
if (id==R.id.nav_my_mall){
getSupportActionBar().setDisplayShowTitleEnabled(false);
setFragment(new HomeFragment(),HOME_FRAGMENT);
}else if (id == R.id.nav_my_orders) {
} else if (id == R.id.nav_my_rewards) {
} else if (id == R.id.nav_my_cart) {
myCart();
} else if (id == R.id.nav_my_wishlist) {
} else if (id == R.id.nav_my_account) {
gotoFragment("My Account",new MyAccountFragment(),ACCOUNT_FRAGMENT);
}else if (id == R.id.nav_sign_out){
}
DrawerLayout drawer = findViewById(R.id.drawer_layout);
drawer.closeDrawer(GravityCompat.START);
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void onNavigationItemClicked(Element element);",
"@Override\n public void onClick(View view) { listener.onItemClick(view, getPosition()); }",
"void onDialogNavigationItemClicked(Element element);",
"@Override\n public void onClick(View view) {\n itemInterface.OnItemClickedListener(tracks, getAdapterPosition());\n }",
"@Override\n public void onClickItem(MeowBottomNavigation.Model item) {\n }",
"@Override\n public void onClickItem(MeowBottomNavigation.Model item) {\n }",
"@Override\n public void onClick(View view) {\n listener.menuButtonClicked(view.getId());\n }",
"@Override\r\n\tpublic boolean onNavigationItemSelected(int itemPosition, long itemId) {\n\t\tLog.d(\"SomeTag\", \"Get click event at position: \" + itemPosition);\r\n\t\tswitch (itemPosition) {\r\n\t\tcase 1:\r\n\t\t\tIntent i = new Intent();\r\n\t\t\ti.setClass(getApplicationContext(), MainActivity.class);\r\n\t\t\tstartActivity(i);\r\n\t\t\t//return true;\r\n\t\t\tbreak;\r\n\t\tcase 2 :\r\n\t\t\tIntent intent = new Intent(this,WhiteListActivity.class);\r\n\t\t\tstartActivity(intent);\r\n\t\t\t//return true;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n String name = navDrawerItems.get(position).getListItemName();\n // call a helper method to perform a corresponding action\n performActionOnNavDrawerItem(name);\n }",
"@Override\n\tpublic void rightNavClick() {\n\t\t\n\t}",
"@Override\n public void OnItemClick(int position) {\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tif (itemClicked != null)\n\t\t\t\t\titemClicked.OnItemClicked((BusinessType)item.getTag(), item);\n\t\t\t}",
"@Override\n public void onClick(View view) {\n clickListener.onItemClicked(getBindingAdapterPosition());\n }",
"@Override\n\t\t\tpublic void onItemClick(AdapterView<?> parent, View view,\n\t\t\t\t\tint position, long id) {\n\t\t\t\thandleClick(position);\n\t\t\t}",
"@Override\n public void onItemClicked(int itemPosition, Object dataObject) {\n }",
"@Override\n public void onItemClick(int pos) {\n }",
"@Override\n public void onClick(View v) {\n if (listener != null)\n listener.onItemClick(itemView, getPosition());\n }",
"private void handleNavClick(View view) {\n final String label = ((TextView) view).getText().toString();\n if (\"Logout\".equals(label)) {\n logout();\n }\n if (\"Profile\".equals(label)) {\n final Intent intent = new Intent(this, ViewProfileActivity.class);\n startActivity(intent);\n }\n if (\"Search\".equals(label)){\n final Intent intent = new Intent(this, SearchActivity.class);\n startActivity(intent);\n }\n if (\"Home\".equals(label)) {\n final Intent intent = new Intent(this, HomeActivity.class);\n startActivity(intent);\n }\n }",
"void onMenuItemClicked();",
"@Override\n public void onClick(View view) {\n\n switch (view.getId()) {\n case R.id.tvSomeText:\n listener.sendDataToActivity(\"MainActivity: TextView clicked\");\n break;\n\n case -1:\n listener.sendDataToActivity(\"MainActivity: ItemView clicked\");\n break;\n }\n }",
"@Override\n\t\t\t\t\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\t\t\t\t\tMainActivity sct = (MainActivity) act;\n\t\t\t\t\t\t\t\t\tsct.onItemClick(posit2, 11);\n\t\t\t\t\t\t\t\t}",
"@Override\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\t}",
"@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\n\t\t\t}",
"@Override\n public void onClick(View v) {\n listener.onItemClick(v, position);\n }",
"@Override\n public void onItemClick(View view, String data) {\n }",
"@Override\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\t\t\n\t}",
"abstract public void onSingleItemClick(View view);",
"@Override\n public void onClick(View v) {\n this.itemClickListener.onItemClick(v, getLayoutPosition());\n }",
"@Override\n public void itemClick(int pos) {\n }",
"@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {\n TextView textView = (TextView)view;\n switch(textView.getText().toString()){\n case \"NavBar\":\n Intent nav = new Intent(this, NavDrawerActivity.class);\n startActivity(nav);\n break;\n }\n\n //Toast.makeText(MainActivity.this,\"Go to \" + textView.getText().toString() + \" page.\",Toast.LENGTH_LONG).show();\n }",
"@Override\r\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\t\t\r\n\t}",
"@Override\n\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\tlong arg3) {\n\t\t\t\n\t\t}",
"@Override\n public void onItemClick(Nson parent, View view, int position) {\n }",
"@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\t\t\t\t\tlong arg3) {\n\t\t\t}",
"@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\t\t\t\t\n\t\t\t}",
"@Override\n public void onClick(View view) {\n int position = getAdapterPosition();\n\n // Check if listener!=null bcz it is not guarantee that we'll call setOnItemClickListener\n // RecyclerView.NO_POSITION - Constant for -1, so that we don't click item at Invalid position (safety measure)\n if (listener != null && position != RecyclerView.NO_POSITION) {\n //listener.onItemClick(notes.get(position)); - used in RecyclerView.Adapter\n listener.onItemClick(getItem(position)); // getting data from superclass\n }\n }",
"@Override\n\t\tpublic void onClick(View view) {\n\t\t\tif (iOnItemClickListener != null) {\n\t\t\t\tiOnItemClickListener.onItemClick(view, null, getAdapterPosition());\n\t\t\t}\n\t\t}",
"@Override\n public void onClick(View v) {\n itemClickListener.itemClicked(movieId, v);\n }",
"@Override\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\n\t}",
"@Override\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\n\t}",
"public void onItemClick(View view, int position);",
"@Override\n public void onClick(View v) {\n if (mListener != null){\n mListener.onItemClick(itemView, getLayoutPosition());\n }\n }",
"@Override\n public void onItemClick(int position) {\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\titemClickListener.Callback(itemInfo);\n\t\n\t\t\t}",
"@Override\n public void onItemClick(View view, int position) {\n }",
"@Override\n public void onItemClick(View view, int position) {\n }",
"@Override\n public void onClick(View view) {\n if(mFrom.equals(NetConstants.BOOKMARK_IN_TAB)) {\n IntentUtil.openDetailActivity(holder.itemView.getContext(), NetConstants.G_BOOKMARK_DEFAULT,\n bean.getArticleUrl(), position, bean.getArticleId());\n }\n else {\n IntentUtil.openDetailActivity(holder.itemView.getContext(), mFrom,\n bean.getArticleUrl(), position, bean.getArticleId());\n }\n }",
"@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\t\t\t}",
"@Override\n public void onItemOfListClicked(Object o) {\n UserProfileFragmentDirections.ActionUserProfileFragmentToEventProfileFragment action = UserProfileFragmentDirections.actionUserProfileFragmentToEventProfileFragment((MyEvent) o);\n navController.navigate(action);\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_ds_note) {\n // Handle the camera action\n } else if (id == R.id.nav_ds_todo) {\n\n } else if (id == R.id.nav_ql_the) {\n\n } else if (id == R.id.nav_tuychinh) {\n Intent intent = new Intent(this, CustomActivity.class);\n startActivity(intent);\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@Override\n\t\t\t\t\t\t\t\tpublic void onItemClick(AdapterView<?> parent, View view,\n\t\t\t\t\t\t\t\t\t\tint position, long id) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}",
"@Override\n public void onItemClick(View view, ListItem obj, int position) {\n }",
"@Override\n\tpublic void onItemClick(Object o, int position) {\n\n\t}",
"@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\n\t\t\t}",
"@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\n\t\t\t}",
"void onLinkClicked(@Nullable ContentId itemId);",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id){\n case R.id.home:\n Intent homeIntent = new Intent(this, MainActivity.class);\n startActivity(homeIntent);\n break;\n case R.id.send_email:\n Intent mailIntent = new Intent(this, ContactActivity.class);\n startActivity(mailIntent);\n break;\n case R.id.send_failure_ticket:\n Intent ticketIntent = new Intent(this, TicketActivity.class);\n startActivity(ticketIntent);\n break;\n case R.id.position:\n Intent positionIntent = new Intent(this, LocationActivity.class);\n startActivity(positionIntent);\n break;\n case R.id.author:\n UrlRedirect urlRed = new UrlRedirect(this.getApplicationContext(),getString(R.string.linkedinDeveloper));\n urlRed.redirect();\n break;\n default:\n break;\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout_main_activity);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@Override\n public void onClick(View v) {\n startNavigation();\n }",
"@SuppressWarnings(\"ConstantConditions\")\n public void onItemClicked(@NonNull Item item) {\n getView().openDetail(item);\n }",
"void onItemClick(View view, int position);",
"void onItemClick(int position);",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(@NonNull MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_logs) {\n startActivity(new Intent(this, LogView.class));\n } else if (id == R.id.nav_signOut) {\n signOut();\n }\n\n DrawerLayout drawer = findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@Override\n public void onClick(View v) {\n if(listener!=null & getLayoutPosition()!=0)\n listener.onItemClick(itemView, getLayoutPosition());\n }",
"@Override\n\tpublic void onItemClick(AdapterView<?> parent, View view, int position,\n\t\t\tlong id) {\n\t\tpresenter.onItemClicked(position);\n\t}",
"@Override\n public void onClick(View view) {\n listener.onMenuButtonSelected(view.getId());\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view,\n int position, long id) {\n }",
"@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\t\t\t\tHashMap<String, Object> item = (HashMap<String, Object>) arg0\n\t\t\t\t\t\t.getAdapter().getItem(arg2);\n\n\t\t\t\tIntent intent = new Intent(ViewActivity.this,\n\t\t\t\t\t\tContentActivity.class);\n\t\t\t\tBundle bundle = new Bundle();\n\t\t\t\tbundle.putString(\"_id\", item.get(\"_id\").toString());\n\t\t\t\tbundle.putString(\"_CityEventID\", item.get(\"_CityEventID\")\n\t\t\t\t\t\t.toString());\n\t\t\t\tbundle.putString(\"_type\", String.valueOf(_type));\n\t\t\t\tintent.putExtras(bundle);\n\t\t\t\tstartActivity(intent);\n\t\t\t}",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }",
"@Override\n public void onClick(View view) {\n Navigation.findNavController(view).navigate(R.id.addEventFragment);\n }",
"void clickItem(int uid);",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n Log.w(TAG , \"POSITION : \" + position);\n\n itemClick(position);\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(@NonNull MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_categories) {\n Intent intent = new Intent(getApplicationContext(), CategoryActivity.class);\n startActivity(intent, compat.toBundle());\n newsHere.setSourceActivity(\"search\");\n newsHere.setTargetActivity(\"category\");\n\n } else if (id == R.id.nav_top_headlines) {\n newsHere.setSourceActivity(\"search\");\n newsHere.setTargetActivity(\"home\");\n Intent intent = new Intent(getApplicationContext(), HomeActivity.class);\n startActivity(intent, compat.toBundle());\n } else if (id == R.id.nav_search) {\n // Do nothing\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@Override\n public void onItemClick(View view, int position) {\n\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_orders) {\n\n Intent orderStatusIntent = new Intent(Home.this , OrderStatus.class);\n startActivity(orderStatusIntent);\n\n } else if (id == R.id.nav_banner) {\n\n Intent bannerIntent = new Intent(Home.this , BannerActivity.class);\n startActivity(bannerIntent);\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n }",
"public void onItemClick(View view, int position) {\n\n }",
"@Override\r\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\r\n\t\t\t\t\tlong arg3) {\n\r\n\t\t\t}",
"@Override\n\tpublic void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n\t}",
"@Override\n\tpublic void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n\t}",
"void onClick(View item, View widget, int position, int which);",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position,\n long id) {\n\n\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n Intent intent;\n switch(item.getItemId()){\n case R.id.nav_home:\n finish();\n intent = new Intent(this, NavigationActivity.class);\n startActivity(intent);\n return true;\n case R.id.nav_calendar:\n finish();\n intent = new Intent(this, EventHome.class);\n startActivity(intent);\n return true;\n case R.id.nav_discussion:\n return true;\n case R.id.nav_settings:\n intent = new Intent(this, SettingsActivity.class);\n startActivity(intent);\n return true;\n case R.id.nav_app_blocker:\n intent = new Intent(this, AppBlockingActivity.class);\n startActivity(intent);\n return true;\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@Override\n public boolean onNavigationItemSelected(@NonNull MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n\n case R.id.nav_home:\n break;\n\n case R.id.nav_favourites:\n\n if (User.getInstance().getUser() == null) {\n Intent intent = new Intent(getApplicationContext(), LoginActivity.class);\n startActivity(intent);\n }\n\n Intent intent = new Intent(getApplicationContext(), PlaceItemListActivity.class);\n startActivity(intent);\n\n break;\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tonRgtRgtMenuClick(v);\n\t\t\t}",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n Toast.makeText(this, \"gallery is clicked!\", Toast.LENGTH_LONG).show();\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"public void menuClicked(MenuItem menuItemSelected);",
"@Override\n public void onItemClick(int position) {\n }",
"@Override\n public void onItemClick(int position) {\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_my_account) {\n startActivity(new Intent(this, MyAccountActivity.class));\n } else if (id == R.id.nav_message_inbox) {\n startActivity(new Intent(this, MessageInboxActivity.class));\n } else if (id == R.id.nav_view_offers) {\n //Do Nothing\n } else if (id == R.id.nav_create_listing) {\n startActivity(new Intent(this, CreateListingActivity.class));\n } else if (id == R.id.nav_view_listings) {\n startActivity(new Intent(this, ViewListingsActivity.class));\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position,\n long id) {\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position,\n long id) {\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }",
"@Override\r\n\t\t\t\tpublic void onItemClick(AdapterView<?> parent, View view,\r\n\t\t\t\t\t\tint position, long id) {\n\t\t\t\t}"
] | [
"0.78807783",
"0.723447",
"0.69863516",
"0.6943918",
"0.69152725",
"0.69152725",
"0.68832517",
"0.6873738",
"0.6865404",
"0.6766271",
"0.6740349",
"0.67190737",
"0.671563",
"0.6712706",
"0.669685",
"0.66966915",
"0.6677797",
"0.6662864",
"0.6658379",
"0.66458774",
"0.6639868",
"0.6622861",
"0.6622686",
"0.6619209",
"0.66012836",
"0.6601021",
"0.6598265",
"0.6597023",
"0.65920526",
"0.6584375",
"0.65833306",
"0.65798014",
"0.6575024",
"0.657375",
"0.6568046",
"0.65611774",
"0.6557193",
"0.65562755",
"0.65513086",
"0.65513086",
"0.65481067",
"0.65374863",
"0.6533213",
"0.6531833",
"0.65228486",
"0.65228486",
"0.65211695",
"0.652111",
"0.651972",
"0.6518377",
"0.65149677",
"0.65144426",
"0.6501814",
"0.64966875",
"0.64966875",
"0.64949477",
"0.6493193",
"0.6486557",
"0.6486461",
"0.64856565",
"0.6485643",
"0.64835817",
"0.64799297",
"0.6473094",
"0.64629585",
"0.6453445",
"0.64453626",
"0.6441998",
"0.6441998",
"0.6441998",
"0.6441998",
"0.6441998",
"0.64379585",
"0.6434229",
"0.6434119",
"0.64317745",
"0.6431297",
"0.6428675",
"0.6423849",
"0.6423849",
"0.64105946",
"0.6409071",
"0.6407935",
"0.6407842",
"0.6407842",
"0.640625",
"0.64044565",
"0.64014935",
"0.6396105",
"0.639296",
"0.6391149",
"0.63892716",
"0.63872063",
"0.63872063",
"0.6386368",
"0.6367087",
"0.6367087",
"0.6362672",
"0.6362672",
"0.6362672",
"0.6357283"
] | 0.0 | -1 |
Create the correct answer of a T/F question | public void create() {
io.writeLine("Enter correct answer(T/F)");
String answer = io.readLine();
while (!answer.equals("T") && !answer.equals("F")) {
io.writeLine("Please put in T or F");
answer = io.readLine();
}
rightAnswers.add(answer);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"java.lang.String getCorrectAnswer();",
"public static void main(){\n \n \n String question = \"There are 10 types of people in this world, those who understand binary and those who don't.\";\n String answer = \"true\";\n \n Question tfQuest = new Question (question, answer);\n tfQuest.getAnswer();\n \n }",
"protected abstract String answer();",
"int getWrongAnswers();",
"public void createTrueFalse() {\n Question q = new TrueFalse(this.in,this.o);\n this.o.setDisplay(\"Enter the prompt for your True/False question:\\n\");\n this.o.getDisplay();\n\n q.setPrompt(this.in.getUserInput());\n\n if (isTest) {\n Test t = (Test)this.survey;\n RCA ca = new RCA(this.in,this.o);\n\n this.o.setDisplay(\"Enter the correct answer (T/F):\\n\");\n this.o.getDisplay();\n\n ca.addResponse();\n\n while (!ca.getResponses().get(0).contains(\"T\") && !ca.getResponses().get(0).contains(\"F\")) {\n ca.removeResponse(0);\n this.o.setDisplay(\"Enter a valid answer (T/F):\\n\");\n this.o.getDisplay();\n ca.addResponse();\n }\n\n t.addAnswer(ca);\n }\n this.survey.addQuestion(q);\n }",
"boolean hasCorrectAnswer();",
"public String checkNewQuestions() {\n\t\tint numAnswers = testGenerator.getNumAnswers(questionNo);\n\t\tString question = \"\";\n\n\t\tquestion += testGenerator.getQuestionText(questionNo);\n\t\tquestion += testGenerator.getAnswerText(questionNo, 1);\n\t\tquestion += testGenerator.getAnswerText(questionNo, 2);\n\n\t\tif(numAnswers >= 3) {\n\t\t\tquestion += testGenerator.getAnswerText(questionNo, 3);\n\t\t} \n\t\tif(numAnswers == 4) {\n\t\t\tquestion += testGenerator.getAnswerText(questionNo, 4);\n\t\t}\n\t\treturn question;\n\t}",
"public abstract void generateQuestion();",
"public static String[] randomQuestions(String op){\r\n String question = \"\";\r\n String ansStr = \"\";\r\n \r\n int part1 = randomNumber();\r\n int part2 = randomNumber();\r\n int ans = 0;\r\n double roundAns = 0.0;\r\n \r\n if (op.equals(\"^\")){\r\n //Round to Closest Whole Number\r\n roundAns = (randomDecimal());\r\n double k = Math.round(roundAns);\r\n \r\n question = Double.toString(roundAns);\r\n ansStr = Double.toString(k);\r\n }\r\n else if (op.equals(\"Alg\")){\r\n //Algebraic Formula - Find x/y\r\n int coeff = randomNumberAlg();\r\n int layout = randomNumber();\r\n part1 = randomNumberAlg();\r\n part2 = randomNumberAlg();\r\n \r\n if (layout < 3){\r\n //?x = int\r\n ans = part1 * coeff;\r\n \r\n question = coeff+\"x = \"+ ans;\r\n ansStr = Integer.toString(part1);\r\n \r\n } else if (layout > 3 && layout <= 7){\r\n //?x+num = int || ?x-num = int\r\n if (layout == 4||layout == 5){\r\n ans = (part1 * coeff) + part2;\r\n \r\n question = coeff+\"x + \"+part2+\" = \"+ans;\r\n ansStr = Integer.toString(part1);\r\n } else if (layout == 6||layout == 7){\r\n ans = (part1 * coeff) - part2;\r\n \r\n question = coeff+\"x - \"+part2+\" = \"+ans;\r\n ansStr = Integer.toString(part1);\r\n } \r\n } else if (layout > 7 && layout <= 10){\r\n //?x/num = int \r\n ans = (part1 * coeff)/part2;\r\n \r\n question = coeff+\"x/\"+part2+\" = \"+ ans;\r\n ansStr = Integer.toString(part1);\r\n } \r\n }\r\n else if (op.equals(\"%\")){\r\n //Precentages - Covert Fraction to Percentage\r\n int div = HCF(part1, part2);\r\n int finalp1 = part1 % div;\r\n int finalp2 = part2 % div;\r\n \r\n if (finalp1 == 0){\r\n finalp1 = randomNumberRatio();\r\n }\r\n if (finalp2 == 0){\r\n finalp2 = randomNumberRatio();\r\n }\r\n \r\n double fract = finalp1/finalp2;\r\n \r\n if (finalp1>finalp2){\r\n fract = finalp1/finalp2;\r\n question = finalp1+\"/\"+finalp2;\r\n }\r\n else {\r\n fract = finalp2/finalp1;\r\n question = finalp2+\"/\"+finalp1;\r\n }\r\n \r\n double perc = fract * 100;\r\n \r\n ansStr = Double.toString(perc);\r\n \r\n }\r\n else if (op.equals(\":\")){\r\n //Ratio - Simplifying\r\n part1 = randomNumberRatio();\r\n part2 = randomNumberRatio();\r\n int div = HCF(part1, part2);\r\n int finalp1 = part1 / div;\r\n int finalp2 = part2 / div;\r\n \r\n question = part1+\":\"+part2;\r\n ansStr = finalp1+\":\"+finalp2;\r\n }\r\n\r\n else if (op.equals(\"//\")){\r\n //Fractions - Simplifying\r\n int div = HCF(part1, part2);\r\n int finalp1 = part1 % div;\r\n int finalp2 = part2 % div;\r\n \r\n question = part1+\"/\"+part2;\r\n ansStr = finalp1+\"/\"+finalp2;\r\n \r\n }\r\n \r\n String x[] = new String[2];\r\n x[0] = question;\r\n x[1] = ansStr;\r\n \r\n return x;\r\n }",
"public void quiz() {\n\t\t\t\t\tcorrectans = 0;\n\t\t\t\t\tint k = 0;\n\t\t\t\t\tint j = 0;\n\t\t\t\t\tint M = 0;\n\t\t\t\t\tj = readDifficulty();\n\t\t\t\t\tM = readProblemType();\n\t\t\t\t\t//ask the student to solve 10 different problems, as determined by the problem type\n\t\t\t for(int i = 0; i < 10; i++ ) {\n\t\t\t \t//contain two numbers sampled from a uniform random distribution with bounds determined by the problem difficulty\n\t\t\t \tint x = rand.nextInt(j); \n\t\t\t\t int y = rand.nextInt(j);\n\t\t\t\t int O = askquestion(j, M,x,y);\n\t\t\t\t if(M == 4) {\n\t\t\t\t \t float floatans = readdivision();\n\t\t\t\t \tk = divisionsol(floatans, x, y);\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t int userin = readResponse();\n\t\t\t k = isnanswercorrect(O , userin);\n\t\t\t }\n\t\t\t if(k == 1) {\n\t\t\t \t correctans++;\n\t\t\t }\n\t\t\t }\n\t\t\t int L = 0;\n\t\t\t L = displayCompletionMessage(correctans);\n\t\t\t if ( L == 1) {\n\t\t\t \tquiz();\n\t\t\t }\n\t\t\t else {\n\t\t\t \treturn;\n\t\t\t }\n\t\t\t \n\t\t\t\t}",
"public void setTFChoices() {\r\n Random randomGenerator = new Random();\r\n int trueFalseAnswer = randomGenerator.nextInt(2);\r\n studentAnswer.add(trueFalseAnswer);\r\n }",
"@Override\n\t public String solve() {\n\t if (count == 0) {\n\t answer1 = getVariable2()*getVariable3();\n\t setAnswer(answer1 + \"\");\n\t } else if (count == 1) {\n\t answer1 = getVariable1()/getVariable2();\n\t setAnswer(answer1 + \"\");\n\t }else if (count == 2) {\n\t answer1 = getVariable1()/getVariable3();\n\t setAnswer(answer1 + \"\");\n\t }\n\t return getAnswer();\n\t }",
"boolean getCorrect();",
"public abstract AnswerStatus checkAnswer(String answer) throws SyntaxException;",
"@Override\r\n\tpublic void checkAnswer() {\n\t\t\r\n\t}",
"public void questionGenerator()\n\t{\n\t\t//creates questions\n\t\toperation = rand.nextInt(3) + min;\n\t\t\n\t\t//makes max # 10 to make it easier for user if random generator picks multiplication problem\n\t\tif (operation == 3)\n\t\t\tmax = 10; \n\t\t\n\t\t//sets random for number1 & number2\n\t\tnumber1 = rand.nextInt(max) + min; //random number max and min\n\t\tnumber2 = rand.nextInt(max) + min; \n\t\t\t\t\n\t\t//ensures final answer of problem is not negative by switching #'s if random generator picks subtraction problem\n\t\tif (operation == 2 && number1 < number2)\n\t\t{\n\t\t\tint tempNum = number1;\n\t\t\tnumber1 = number2;\n\t\t\tnumber2 = tempNum;\n\t\t}\n\t\tanswer = 0;\n\t\t\n\t\t//randomizes operator to randomize question types\n\t\tif (operation == 1)\n\t\t{\n\t\t\toperator = '+';\n\t\t\tanswer = number1 + number2;\n\t\t}\n\t\tif (operation == 2)\n\t\t{\n\t\t\toperator = '-';\n\t\t\tanswer = number1 - number2;\n\t\t}\n\t\tif (operation == 3)\n\t\t{\n\t\t\toperator = '*';\n\t\t\tanswer = number1 * number2;\n\t\t}\n\t\t\t\n\t\t//prints question\n\t\tlabel2.setText(\"Question: \" + number1 + \" \" + operator + \" \" + number2 + \" = ?\");\n\t}",
"com.google.protobuf.ByteString\n getCorrectAnswerBytes();",
"private void creatingNewQuestion() {\r\n AbstractStatement<?> s;\r\n ListQuestions lq = new ListQuestions(ThemesController.getThemeSelected());\r\n switch ((String) typeQuestion.getValue()) {\r\n case \"TrueFalse\":\r\n // just to be sure the answer corresponds to the json file\r\n Boolean answer = CorrectAnswer.getText().equalsIgnoreCase(\"true\");\r\n s = new TrueFalse<>(Text.getText(), answer);\r\n break;\r\n\r\n case \"MCQ\":\r\n s = new MCQ<>(Text.getText(), TextAnswer1.getText(), TextAnswer2.getText(), TextAnswer3.getText(), CorrectAnswer.getText());\r\n break;\r\n\r\n default:\r\n s = new ShortAnswer<>(Text.getText(), CorrectAnswer.getText());\r\n break;\r\n }\r\n lq.addQuestion(new Question(s, ThemesController.getThemeSelected(), Difficulty.fromInteger((Integer) difficulty.getValue()) ));\r\n lq.writeJson(ThemesController.getThemeSelected());\r\n }",
"double scoreAnswer(Question question, Answer answer);",
"public void createShortAnswer() {\n Question q = new ShortAnswer(this.in,this.o);\n this.o.setDisplay(\"Enter the prompt for your Short Answer question:\\n\");\n this.o.getDisplay();\n\n q.setPrompt(this.in.getUserInput());\n\n int charlimit = 0;\n while (charlimit == 0) {\n this.o.setDisplay(\"Enter character limit\\n\");\n this.o.getDisplay();\n\n try {\n charlimit = Integer.parseInt(this.in.getUserInput());\n if (charlimit < 1) {\n charlimit = 0;\n } else {\n ((ShortAnswer) q).setCharLimit(charlimit);\n }\n } catch (NumberFormatException e) {\n charlimit = 0;\n }\n }\n\n int numAns = 0;\n while (numAns == 0) {\n this.o.setDisplay(\"How many answers does this question have?\\n\");\n this.o.getDisplay();\n\n try {\n numAns = Integer.parseInt(this.in.getUserInput());\n if (numAns > numChoices || numAns < 1) {\n numAns = 0;\n } else {\n q.setMaxResponses(numAns);\n }\n } catch (NumberFormatException e) {\n numAns = 0;\n }\n }\n\n if (isTest) {\n RCA ca = new RCA(this.in,this.o);\n Test t = (Test)this.survey;\n String ans;\n\n for (int j=0; j < q.getMaxResponses(); j++){\n this.o.setDisplay(\"Enter correct answer(s):\\n\");\n this.o.getDisplay();\n\n ans = this.in.getUserInput();\n\n while (ans.length() > ((ShortAnswer) q).getCharLimit()) {\n this.o.setDisplay(\"Answer must be less then \" + ((ShortAnswer) q).getCharLimit() + \" characters \\n\");\n this.o.getDisplay();\n ans = this.in.getUserInput();\n }\n\n ca.addResponse(ans);\n }\n t.addAnswer(ca);\n }\n this.survey.addQuestion(q);\n }",
"public ServerResponse<String> checkAnswer(String username,String questiion,String answer) {\n int resultCount = userMapper.checkAnswer(username,questiion,answer);\n if (resultCount > 0){\n // the question and answer belong to this user, and it's right\n String forgetToken = UUID.randomUUID().toString();\n //add \"token_\" as a namespace,or just to say we use it to distinguish.\n TokenCache.setKey(TokenCache.TOKEN_PREFIX+username,forgetToken);\n return ServerResponse.createBySuccess(forgetToken);\n }\n return ServerResponse.createByErrorMessage(\"wrong answer\");\n }",
"@Override\n\tpublic Boolean isCorrect(){\n\t\t\n\t\tif (super.question instanceof TfQuestion){\n\t\t\tif(this.answer.equals(super.question.getAnswer())){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"String answerStatement(boolean answer) {\n String answerStatement = getResources().getString(R.string.wrong);\n if (answer) {\n answerStatement = getResources().getString(R.string.correct);\n }\n return answerStatement;\n }",
"public int get_correctAnswer(){return this._correctAnswer;}",
"private void checkAsk(FyQuestion q, FyAnswer a) {\n\t\treturn;\r\n\t}",
"public void checkIfCorrect(Note answer){\n Note tmpNote = answer;\n Tone tmpTone = tmpNote.getTone();\n boolean isSharp = tmpNote.isSharp();\n String checkCorrect = \"\";\n\n //Normal Keys\n if(tmpTone.equals(Tone.A) && !isSharp)\n checkCorrect = \"A\";\n else if(tmpTone.equals(Tone.B) && !isSharp)\n checkCorrect = \"B\";\n else if(tmpTone.equals(Tone.C) && !isSharp)\n checkCorrect = \"C\";\n else if(tmpTone.equals(Tone.D) && !isSharp)\n checkCorrect = \"D\";\n else if(tmpTone.equals(Tone.E) && !isSharp)\n checkCorrect = \"E\";\n else if(tmpTone.equals(Tone.F) && !isSharp)\n checkCorrect = \"F\";\n else if(tmpTone.equals(Tone.G) && !isSharp)\n checkCorrect = \"G\";\n\n //Sharp Keys\n else if(tmpTone.equals(Tone.A) && isSharp)\n checkCorrect = \"A#\";\n else if(tmpTone.equals(Tone.C) && isSharp)\n checkCorrect = \"C#\";\n else if(tmpTone.equals(Tone.D) && isSharp)\n checkCorrect = \"D#\";\n else if(tmpTone.equals(Tone.F) && isSharp)\n checkCorrect = \"F#\";\n else if(tmpTone.equals(Tone.G) && isSharp)\n checkCorrect = \"G#\";\n\n checkCorrectHelper(checkCorrect);\n\n }",
"@Override\n\tpublic String getAnswer() {\n\t\treturn \"\" + IntStream.iterate(1, i->i+1)\n\t\t\t\t.mapToObj(i -> Tuple.of(i, sort(DigitsUtils.getDigits(i))))\n\t\t\t\t.filter(tuple -> Arrays.equals(tuple.getValue(), sort(DigitsUtils.getDigits(2*tuple.getKey()))))\n\t\t\t\t.filter(tuple -> Arrays.equals(tuple.getValue(), sort(DigitsUtils.getDigits(3*tuple.getKey()))))\n\t\t\t\t.filter(tuple -> Arrays.equals(tuple.getValue(), sort(DigitsUtils.getDigits(4*tuple.getKey()))))\n\t\t\t\t.filter(tuple -> Arrays.equals(tuple.getValue(), sort(DigitsUtils.getDigits(5*tuple.getKey()))))\n\t\t\t\t.filter(tuple -> Arrays.equals(tuple.getValue(), sort(DigitsUtils.getDigits(6*tuple.getKey()))))\n\t\t\t\t.findFirst()\n\t\t\t\t.orElseThrow(SolutionNotFoundException::new)\n\t\t\t\t.getKey();\n\t}",
"public static String[] randomQuestionKS2(String op){\r\n int part1 = randomNumber();\r\n int part2 = randomNumber();\r\n \r\n ArrayList<Integer> multiQs = new ArrayList<>(Arrays.asList(2,5,10));\r\n ArrayList<Integer> divQs = new ArrayList<>(Arrays.asList(5,10));\r\n \r\n \r\n if (op.equals(\"*\")){ \r\n int pos = multiQs.get(randomMulti());\r\n \r\n part1 = pos;\r\n } else if (op.equals(\"/\")){\r\n ArrayList <Integer> divide10 = new ArrayList<>(Arrays.asList(10,20,30,40,50,60,70,80,90,100));\r\n \r\n int pos = (randomNumber()) - 1;\r\n int pos2 = (randomDivide());\r\n \r\n part1 = divide10.get(pos);\r\n part2 = divQs.get(pos2); \r\n }\r\n \r\n String str1 = Integer.toString(part1);\r\n String str2 = Integer.toString(part2);\r\n \r\n String question = str1 + \" \" + op + \" \" + str2;\r\n int ans = 0;\r\n \r\n if (op.equals(\"+\")){\r\n part1 = randomNumber50();\r\n part2 = randomNumber50();\r\n ans = part1 + part2;\r\n str1 = Integer.toString(part1);\r\n str2 = Integer.toString(part2);\r\n question = str1 + \" \" + op + \" \" + str2;\r\n }\r\n else if (op.equals(\"-\")){\r\n part1 = randomNumber100();\r\n part2 = randomNumber50();\r\n if (part1 < part2){\r\n ans = part2 - part1;\r\n str1 = Integer.toString(part1);\r\n str2 = Integer.toString(part2);\r\n question = str2 + \" \" + op + \" \" + str1;\r\n }\r\n ans = part1 - part2;\r\n str1 = Integer.toString(part1);\r\n str2 = Integer.toString(part2);\r\n question = str1 + \" \" + op + \" \" + str2;\r\n }\r\n else if (op.equals(\"*\")){\r\n ans = part1 * part2;\r\n }\r\n else if (op.equals(\"/\")){\r\n ans = part1 / part2;\r\n }\r\n \r\n String ansStr = Integer.toString(ans);\r\n \r\n String x[] = new String[2];\r\n x[0] = question;\r\n x[1] = ansStr;\r\n \r\n return x;\r\n }",
"public void setQuestion(){\n Random rand = new Random();\n a = rand.nextInt(maxRange)+1;\n b = rand.nextInt(maxRange)+1;\n int res = rand.nextInt(4);\n equation.setText(a +\"+\"+ b);\n for(int i=0; i<4; i++){\n if(i == res)\n arr[i] = a+b;\n else {\n int answer = rand.nextInt(2*maxRange)+1;\n while(answer == a+b)\n answer = rand.nextInt(2*maxRange)+1;\n arr[i] = answer;\n }\n }\n for(int i=0; i<4; i++)\n buttons[i].setText(String.valueOf(arr[i]));\n }",
"public static void main(String[] args) {\n\t\t\tSystem.out.println(\"Question 1\");\r\n\t\t\tfloat a = 5240.5f;\r\n\t\t\tfloat b = 10970.055f;\r\n\t\t\tint x = (int) a;\r\n\t\t\tint y = (int) b;\r\n\t\t\tSystem.out.println(x);\r\n\t\t\tSystem.out.println(y + \"\\n\");\r\n\r\n\t\t\t// Question 2:\r\n\t\t\tSystem.out.println(\"Question 2\");\r\n\t\t\tint a1 = random.nextInt(100000);\r\n\t\t\tSystem.out.printf(\"%05d\", a1);\r\n\t\t\tSystem.out.println(\"\\n\");\r\n\r\n\t\t\t// Question 3:\r\n\t\t\tSystem.out.println(\"Question 3\");\r\n\t\t\tint b1 = a1 % 100;\r\n\t\t\tSystem.out.println(\"Hai số cuối của a1: \" + b1);\r\n\t\t\tSystem.out.println(\"\\n\");\r\n\r\n\t\t\tQuestion4();\r\n\r\n\t\t\tExercise2();\r\n\r\n\t\t\tSystem.out.println(\"\\n\");\r\n\r\n\t\t\t// Exercise 3:\r\n\t\t\tSystem.out.println(\"Exercise3\");\r\n\t\t\t// Question 1:\r\n\t\t\tSystem.out.println(\"Question 1:\");\r\n\t\t\tInteger salary = 5000;\r\n\t\t\tfloat salaryf = salary;\r\n\t\t\tSystem.out.printf(\"%.2f\", salaryf);\r\n\r\n\t\t\t// Question 2:\r\n\t\t\tSystem.out.println(\"Question 2:\");\r\n\t\t\tString value = \"1234567\";\r\n\t\t\tint a2 = Integer.parseInt(value);\r\n\t\t\tSystem.out.println(a2);\r\n\r\n\t\t\t// Question 3:\r\n\t\t\tSystem.out.println(\"Question 3:\");\r\n\t\t\tInteger value1 = 1234567;\r\n\t\t\tint a3 = value1.intValue();\r\n\t\t\tSystem.out.println(a3);\r\n\t\t\tSystem.out.println(\"\\n\");\r\n\r\n\t\t\t// Exercise 4:\r\n\t\t\tSystem.out.println(\"Exercise 4:\");\r\n\t\t\t// Question 1:\r\n\t\t\tSystem.out.println(\"Question 1\");\r\n\t\t\tSystem.out.println(\"Mời bạn nhập họ và tên: \");\r\n\t\t\tString nhapGiaTri1 = scanner.nextLine();\r\n\t\t\tString nhapGiaTri = scanner.nextLine();\r\n\t\t\tint count = 1;\r\n\t\t\tint j;\r\n\t\t\tfor (j = 0; j < nhapGiaTri.length(); j++) {\r\n\t\t\t\tif (nhapGiaTri.charAt(j) != ' ') {\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"Độ dài của chuỗi ký tự nhapGiaTri: \" + count);\r\n\t\t\tSystem.out.println(\"\\n\");\r\n\r\n\t\t\t// Question 2:\r\n\t\t\tSystem.out.println(\"Question 2\");\r\n\t\t\tSystem.out.println(\"Mời bạn nhập chuỗi ký tự 1: \");\r\n\t\t\tString s1 = scanner.next();\r\n\t\t\tSystem.out.println(\" \");\r\n\t\t\tSystem.out.println(\"Mời bạn nhập chuỗi ký tự 2: \");\r\n\t\t\tString s2 = scanner.next();\r\n\t\t\tSystem.out.println(\"Kết quả khi nối hai xâu kí tự s1 và s2: \" + s1 + s2);\r\n\t\t\tSystem.out.println(\"\\n\");\r\n\r\n\t\t\t// Question 3:\r\n\t\t\tSystem.out.println(\"Mời bạn nhập họ tên: \");\r\n\t\t\tString hoTen1 = scanner.nextLine();\r\n\t\t\tString hoTen2 = scanner.nextLine();\r\n\t\t\tString hoTen = hoTen2.substring(0, 1).toUpperCase() + hoTen2.substring(1);\r\n\t\t\tSystem.out.println(hoTen);\r\n\t\t\tSystem.out.println(\"\\n\");\r\n\r\n\t\t\t// question 4:\r\n\t\t\tString name;\r\n\t\t\tSystem.out.println(\"Nhập tên: \");\r\n\t\t\tname = scanner.nextLine();\r\n\t\t\tname = name.toUpperCase();\r\n\t\t\tfor (int i = 0; i < name.length(); i++) {\r\n\t\t\t\tSystem.out.println(\"Ký tự thứ \" + i + \" là: \" + name.charAt(i));\r\n\t\t\t}\r\n\r\n\t\t\t// question 5:;\r\n\t\t\tSystem.out.println(\"Nhập họ: \");\r\n\t\t\tString firstName = scanner.nextLine();\r\n\t\t\tSystem.out.println(\"Nhập tên: \");\r\n\t\t\tString lastName = scanner.nextLine();\r\n\t\t\tSystem.out.println(\"Họ tên đầy đủ: \" + firstName.concat(lastName));\r\n\r\n\t\t\t// question 6:\r\n\t\t\tSystem.out.println(\"Nhập họ: \");\r\n\t\t\tString firstName1 = scanner.nextLine();\r\n\t\t\tSystem.out.println(\"Nhập tên: \");\r\n\t\t\tString lastName1 = scanner.nextLine();\r\n\t\t\tSystem.out.println(\"Họ tên đầy đủ: \" + firstName.concat(lastName));\r\n\r\n\t\t\t// question 7:\r\n\r\n\t\t\tString fullName;\r\n\t\t\tSystem.out.println(\"Nhập họ tên đầy đủ\");\r\n\t\t\tfullName = scanner.nextLine();\r\n\t\t\t// remove space characters\r\n\t\t\tfullName = fullName.trim();\r\n\t\t\tfullName = fullName.replaceAll(\"\\\\s+\", \" \");\r\n\t\t\tSystem.out.println(fullName);\r\n\t\t\tString[] words = fullName.split(\" \");\r\n\t\t\tfullName = \"\";\r\n\t\t\tfor (String word : words) {\r\n\t\t\t\tString firstCharacter = word.substring(0, 1).toUpperCase();\r\n\t\t\t\tString leftCharacter = word.substring(1);\r\n\t\t\t\tword = firstCharacter + leftCharacter;\r\n\t\t\t\tfullName += word + \" \";\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"Họ tên sau khi chuẩn hóa: \" + fullName);\r\n\r\n\t\t\t// question 8:\r\n\t\t\tString[] groupNames = { \"Java with VTI\", \"Cách qua môn gia va\", \"Học Java có khó không?\" };\r\n\t\t\tfor (String groupName : groupNames) {\r\n\t\t\t\tif (groupName.contains(\"Java\")) {\r\n\t\t\t\t\tSystem.out.println(groupName);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Question 9:\r\n\t\t\tString[] groupNames1 = { \"Java\", \"C#\", \"C++\" };\r\n\t\t\tfor (String groupName : groupNames) {\r\n\t\t\t\tif (groupName.equals(\"Java\")) {\r\n\t\t\t\t\tSystem.out.println(groupName);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// question 10:\r\n\t\t\tString x1, x2, reversex1 = \"\";\r\n\t\t\tSystem.out.println(\"Nhập chuỗi 1\");\r\n\t\t\tx1 = scanner.nextLine();\r\n\t\t\tSystem.out.println(\"Nhập chuỗi 2\");\r\n\t\t\tx2 = scanner.nextLine();\r\n\t\t\tfor (int i = x1.length() - 1; i >= 0; i--) {\r\n\t\t\t\treversex1 += x1.substring(i, i + 1);\r\n\t\t\t}\r\n\t\t\tif (x2.equals(reversex1)) {\r\n\t\t\t\tSystem.out.println(\"Đây là chuỗi đảo ngược !\");\r\n\t\t\t} else {\r\n\t\t\t\tSystem.out.println(\"Đây không phải chuỗi đảo ngược\");\r\n\t\t\t}\r\n\r\n\t\t\t// question 11:\r\n\t\t\tSystem.out.println(\"Mời bạn nhập vào một chuỗi: \");\r\n\t\t\tString str = scanner.nextLine();\r\n\t\t\tint count1 = 0;\r\n\t\t\tfor (int i = 0; i < str.length(); i++) {\r\n\t\t\t\tif ('a' == str.charAt(i)) {\r\n\t\t\t\t\tcount1++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.println(count);\r\n\r\n\t\t\t// question 12:\r\n\t\t\tString daoNguoc = \"\";\r\n\t\t\tSystem.out.println(\"Nhập chuỗi 1\");\r\n\t\t\tString x3 = scanner.nextLine();\r\n\t\t\tfor (int i = x3.length() - 1; i >= 0; i--) {\r\n\t\t\t\tdaoNguoc += x3.charAt(i);\r\n\t\t\t}\r\n\t\t\tSystem.out.println(daoNguoc);\t\t\t\r\n\t\t\t\r\n\t\t}",
"@Ignore\n @Test\n public void shouldNotGiveQuestionIfAllQuestionsHaveBeenAnsweredWithInts() {\n attributes.put(FinancialPlanningSpeechlet.GOAL_AMOUNT_KEY, 1000);\n attributes.put(FinancialPlanningSpeechlet.MONTHLY_CONTRIBUTION_KEY, 1000);\n attributes.put(FinancialPlanningSpeechlet.GOAL_PERIOD_KEY, 1000);\n String question = NextQuestionFactory.get(session);\n\n assertThat(question, Is.is(\"\"));\n }",
"@Test\r\n public void MathQuestionCorrect()\r\n {\r\n var answerInput = 8;\r\n var questionInput = \"4 + 4\";\r\n\r\n var responseAnswer = 8;\r\n var expectedText = \"What is 4 + 4?\\n8 is correct!\\n\\r\\n\";\r\n\r\n var testOutputByteArray = new ByteArrayOutputStream();\r\n var testOutputStream = new PrintStream(testOutputByteArray );\r\n\r\n // Check math question logic\r\n var mathQuestionAdd = new MathQuestion(answerInput, questionInput, testOutputStream);\r\n mathQuestionAdd.showQuestion();\r\n assertTrue(mathQuestionAdd.checkAnswer(responseAnswer));\r\n\r\n // Check math question console outputs\r\n var content = testOutputByteArray.toString();\r\n assertEquals(content,expectedText);\r\n }",
"public static String produceAnswer(String input) { \r\n \tString[] array = input.split(\" \");\t//create an array that will store the 3 split string outputs(split on spaces)\t\r\n String firstOperand = array[0];\t\t//create a variable that will store the firstoperand\r\n String operator = array[1];\t\t//create a variable that will store the secondoperand\r\n String secondOperand = array[2];\t//create a variable that will store the thirdoperand\r\n int[] finalAnswer = new int [3];\t//create a new array that stores 3 values and will also serve to store the final answer\r\n \r\n int operand1Whole= findWhole(firstOperand);\t//use findwhole method to find the whole # and store in variable\r\n int operand1Num= findNumerator(firstOperand);\t//use findnumerator method to get the num of first frac\r\n int operand1Denom= findDenominator(firstOperand);\t//use finddenominator method to find denom of first frac\r\n int[] op1Fraction = toImproperFrac(operand1Whole, operand1Num, operand1Denom);\t//make a new int array to store \r\n \r\n int operand2Whole= findWhole(secondOperand);\t//use findwhole method to find the whole # and store in variable for the 2nd fraction\r\n int operand2Num= findNumerator(secondOperand);\t//use findnumerator method to find num of 2nd operand\r\n int operand2Denom= findDenominator(secondOperand);\t//use find denominator method to find the denom of the 2nd operand\r\n int[] op2Fraction = toImproperFrac(operand2Whole, operand2Num, operand2Denom);\t//make a new int array to store the improper frac of operand 2\r\n \r\n String result=\"\";\t//make a string variable that will be used when returning the result\r\n if(operator.equals(\"+\")) {\t//make a conditional that checks if the operator is +\r\n \taddingFrac(op1Fraction, op2Fraction, finalAnswer);\t//if it is use the addingfrac method with op1fraction, op2, and the final answer to get the sum\r\n \tresult = toMixedNum(finalAnswer[1], finalAnswer[2]);\t//convert the sum into a mixed number using the tomixednumber method; set = to result\r\n \t\r\n } else if(operator.equals(\"-\")) {\t//also test if operator is -\r\n \t\tsubFrac(op1Fraction, op2Fraction, finalAnswer);\t//if so use subfrac method to get the difference (use op1frac, op2 frac, and final answer\r\n \t\tresult = toMixedNum(finalAnswer[1], finalAnswer[2]);\t//convert diff into mixed number set = to result\r\n \t\t\r\n \t} else if(operator.equals(\"*\")) {\t//also test if operator is *\r\n \t\t\tmultiplyFrac(op1Fraction, op2Fraction, finalAnswer);\t//if so use multiply frac to get the product \r\n \t\t\tresult = toMixedNum(finalAnswer[1], finalAnswer[2]);\t//convert to mixed number set = to result\r\n \t\t\t\r\n \t\t} else if(operator.equals(\"/\")) {\t//also check if operator is /\r\n \t\t\t\tdivideFrac(op1Fraction, op2Fraction, finalAnswer);\t//if so use dividefrac method to get the quotient\r\n \t\t\t\tresult = toMixedNum(finalAnswer[1], finalAnswer[2]);\t//convert to mixed number set = to result\r\n \t\t\t\t\t\r\n \t\t\t}\r\n \treturn result;\t\t//return result\r\n \t\t}",
"public void q1Submit(View view) {\n\n EditText editText = (EditText) findViewById(R.id.q1enterEditText);\n String q1answer = editText.getText().toString().trim();\n\n //Nested if statements to check if the answer is correct or not, then to assign 2 points if it's correct.\n if ((q1answer.toLowerCase().equals(getString(R.string.q1AnswerCheck1))) || (q1answer.toLowerCase().equals(getString(R.string.q1AnswerCheck2)))) {\n if (isNotAnsweredQ1) {\n display(pointCounter += 2);\n Toast.makeText(this, getString(R.string.correct1), Toast.LENGTH_SHORT).show();\n isNotAnsweredQ1 = false;\n }\n } else {\n Toast.makeText(this, getString(R.string.thinkAgain), Toast.LENGTH_SHORT).show();\n }\n }",
"public static <T, A> Answer<T> answer(Answer1<T, A> answer) {\n return toAnswer(answer);\n }",
"boolean hasCorrect();",
"Boolean getPartiallyCorrect();",
"public static String produceAnswer(String input) {\n // TODO: Implement this function to produce the solution to the input\n \n // Parsing one line of input\n int space = input.indexOf(\" \"); // find the index of the first space\n String operandOne = input.substring(0, space); // substring of beginning to space before operator\n \n String newString1 = input.substring(space + 1, input.length());\n int space2 = newString1.indexOf(\" \"); // find the index of the second space\n String operator = newString1.substring(0, space2); // operator is between the first space and the second space\n \n String newString2 = newString1.substring(space2, newString1.length());\n String operandTwo = newString2.substring(space2, newString2.length()); // substring of space after operator to the end\n \n \n // Multiple operations\n while (operandTwo.indexOf(\" \") > 0) {\n int space3 = operandTwo.indexOf(\" \");\n String value = operandTwo.substring(0, space3);\n String new_String3 = operandTwo.substring(space3 + 1, operandTwo.length());\n int space4 = new_String3.indexOf(\" \");\n String operator2 = new_String3.substring(space4 - 1, space4);\n operandTwo = new_String3.substring(space4 + 1, new_String3.length());\n String new_equation = operandOne + \" \" + operator + \" \" + value;\n operandOne = produceAnswer(new_equation);\n operator = operator2;\n }\n \n // Parsing fractions: Operand 1\n String whole1 = operandOne; // hi_\n String num1 = \"\";\n String denom1 = \"\";\n int slash1 = operandOne.indexOf(\"/\");\n \n if (slash1 > 0) {\n int underscore1 = operandOne.indexOf(\"_\");\n if (underscore1 > 0) {\n whole1 = operandOne.substring(0, underscore1);\n num1 = operandOne.substring(underscore1 + 1, slash1);\n denom1 = operandOne.substring(slash1 + 1, operandOne.length());\n } else {\n whole1 = \"0\";\n num1 = operandOne.substring(underscore1 + 1, slash1);\n denom1 = operandOne.substring(slash1 + 1, operandOne.length());\n }\n \n } else {\n num1 = \"0\";\n denom1 = \"1\";\n }\n \n // Parsing fractions: Operand 2\n String whole2 = operandTwo;\n String num2 = \"\";\n String denom2 = \"\";\n int slash2 = operandTwo.indexOf(\"/\");\n \n if (slash2 > 0) {\n int underscore2 = operandTwo.indexOf(\"_\");\n if (underscore2 > 0) {\n whole2 = operandTwo.substring(0, underscore2);\n num2 = operandTwo.substring(underscore2 + 1, slash2);\n denom2 = operandTwo.substring(slash2 + 1, operandTwo.length());\n } else {\n whole2 = \"0\";\n num2 = operandTwo.substring(underscore2 + 1, slash2);\n denom2 = operandTwo.substring(slash2 + 1, operandTwo.length());\n }\n \n } else {\n num2 = \"0\";\n denom2 = \"1\";\n }\n \n \n // change strings to integers\n int intwhole1 = Integer.parseInt(whole1);\n int intnum1 = Integer.parseInt(num1);\n int intdenom1 = Integer.parseInt(denom1);\n \n int intwhole2 = Integer.parseInt(whole2);\n int intnum2 = Integer.parseInt(num2);\n int intdenom2 = Integer.parseInt(denom2);\n \n // convert to improper fraction\n intnum1 += intdenom1 * Math.abs(intwhole1);\n if (intwhole1 < 0) {\n intnum1 *= -1;\n }\n \n intnum2 += intdenom2 * Math.abs(intwhole2);\n if (intwhole2 < 0) {\n intnum2 *= -1;\n }\n \n int finalnum = 0;\n int finaldenom = 0;\n int finalwhole = 0;\n \n // if denominator equals 0, quit\n if (intdenom1 == 0 || intdenom2 == 0) {\n return \"Invalid\";\n }\n \n // if operator is incorrect, quit\n if (operator.length() > 1) {\n return \"Invalid\";\n }\n \n // addition calculation\n // multiply whole values to fraction to get a common denominator\n if (operator.equals(\"+\")) {\n intnum1 *= intdenom2;\n intnum2 *= intdenom1;\n finalnum = intnum1 + intnum2;\n finaldenom = intdenom1 * intdenom2;\n }\n \n // subtraction calculation\n if (operator.equals(\"-\")) {\n intnum1 *= intdenom2;\n intnum2 *= intdenom1;\n finalnum = intnum1 - intnum2;\n finaldenom = intdenom1 * intdenom2;\n }\n \n // multiplication calculation\n if (operator.equals(\"*\")) {\n finalnum = intnum1 * intnum2;\n finaldenom = intdenom1 * intdenom2;\n if (intnum1 == 0 || intnum2 == 0) {\n return 0 + \"\";\n }\n }\n \n // division calculation\n if (operator.equals(\"/\")) {\n finalnum = intnum1 * intdenom2;\n finaldenom = intdenom1 * intnum2;\n }\n \n // make numerator negative instead of the denominator\n if (finaldenom < 0 && finalnum > 0) {\n finaldenom *= -1;\n finalnum *= -1;\n }\n \n // convert to mixed fraction if numerator is positive\n while (finalnum / finaldenom >= 1) {\n finalnum -= finaldenom;\n finalwhole += 1;\n }\n \n // convert to mixed fraction if numerator is negative\n while (finalnum / finaldenom <= -1) {\n finalnum += finaldenom;\n finalwhole -= 1;\n }\n \n // remove signs from numerator and denominator if there is a whole number\n if (finalwhole != 0) {\n finalnum = Math.abs(finalnum);\n finaldenom = Math.abs(finaldenom);\n }\n \n // reduce fraction\n int gcd = 1;\n for (int i = 1; i <= Math.abs(finalnum) && i <= Math.abs(finaldenom); i++) {\n if (finalnum % i == 0 && finaldenom % i == 0)\n gcd = i;\n }\n finalnum /= gcd;\n finaldenom /= gcd;\n \n // final output\n if (finalwhole == 0) {\n if (finalnum == 0) {\n return \"0\";\n } else {\n return finalnum + \"/\" + finaldenom;\n }\n } else if (finalnum == 0 || finaldenom == 1) {\n return finalwhole + \"\";\n } else {\n return finalwhole + \"_\" + finalnum + \"/\" + finaldenom;\n }\n }",
"public void createQuestion(int sid,int qid,String qtype,String qtitle,String answer_a,String answer_b,String answer_c,String answer_d);",
"public String printOutQuestion()\n\t{\n\t\tRandom rand = new Random();\n\t\tString[] answers = new String[4];\n\t\tString returnString;\n\t\tanswers[0] = answer;\n\t\tanswers[1] = falseAnswers[0];\n\t\tanswers[2] = falseAnswers[1];\n\t\tanswers[3] = falseAnswers[2];\n\t\tString firstAns = \"\", secondAns = \"\", thirdAns = \"\", fourthAns = \"\";\n\t\t\n\t\twhile(firstAns == secondAns || firstAns == thirdAns || firstAns == fourthAns || secondAns == thirdAns || secondAns == fourthAns || thirdAns == fourthAns)\n\t\t{\n\t\t\tfirstAns = answers[rand.nextInt(4)];\n\t\t//\tSystem.out.println(firstAns); Used for debugging\n\t\t\tsecondAns = answers[rand.nextInt(4)];\n\t\t//\tSystem.out.println(secondAns); Used for debugging\n\t\t\tthirdAns = answers[rand.nextInt(4)];\n\t\t//\tSystem.out.println(thirdAns); Used for debugging\n\t\t\tfourthAns = answers[rand.nextInt(4)];\n\t\t//\tSystem.out.println(fourthAns); Used for debugging\n\t\t}\n\t\t\n\t\tanswerA = firstAns;\n\t\tanswerB = secondAns;\n\t\tanswerC = thirdAns;\n\t\tanswerD = fourthAns;\n\t\t//System.out.println(questionString + \"Answer A: \" + firstAns + \"Answer B: \" + secondAns + \"Answer C: \" + thirdAns + \"Answer D: \" + fourthAns); Used for debugging\n\t\treturnString = questionString + \"?\"; \n\t\tSystem.out.println(\"Actual Answer is: \" + answer);\n\t\treturn returnString;\n\t}",
"public static String produceAnswer(String input)\r\n { \r\n // TODO: Implement this function to produce the solution to the input\r\n\t\tint space = input.indexOf(' ');\r\n String value1 = input.substring(0, space);\r\n\t\tString value2 = input.substring(space + 3, input.length());\r\n\t\tString operator = input.substring(space, space + 3);\r\n\t\tif (value1.contains(\"_\"))\r\n\t\t{\r\n\t\t\tString newValue1 = convertMixedNumber(value1);\r\n\t\t\tif (value2.contains(\"_\"))\r\n\t\t\t{\r\n\t\t\t\tString newValue2 = convertMixedNumber(value2);\r\n\t\t\t\tinput = newValue1 + operator + newValue2;\r\n\t\t\t}\r\n\t\t\telse if (value2.contains(\"/\"))\r\n\t\t\t{\r\n\t\t\t\tString newValue2 = value2;\r\n\t\t\t\tinput = newValue1 + operator + newValue2;\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\tString newValue2 = convertWholeNumber(value2);\r\n\t\t\t\tinput = newValue1 + operator + newValue2;\r\n\t\t\t}\t\r\n\t\t}\r\n\t\telse if (value1.contains(\"/\"))\r\n\t\t{\r\n\t\t\tString newValue1 = value1;\r\n\t\t\tif (value2.contains(\"_\"))\r\n\t\t\t{\r\n\t\t\t\tString newValue2 = convertMixedNumber(value2);\r\n\t\t\t\tinput = newValue1 + operator + newValue2;\r\n\t\t\t}\r\n\t\t\telse if (value2.contains(\"/\"))\r\n\t\t\t{\r\n\t\t\t\tString newValue2 = value2;\r\n\t\t\t\tinput = newValue1 + operator + newValue2;\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\tString newValue2 = convertWholeNumber(value2);\r\n\t\t\t\tinput = newValue1 + operator + newValue2;\r\n\t\t\t}\t\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t\tString newValue1 = convertWholeNumber(value1);\r\n\t\t\tif (value2.contains(\"_\"))\r\n\t\t\t{\r\n\t\t\t\tString newValue2 = convertMixedNumber(value2);\r\n\t\t\t\tinput = newValue1 + operator + newValue2;\r\n\t\t\t}\r\n\t\t\telse if (value2.contains(\"/\"))\r\n\t\t\t{\r\n\t\t\t\tString newValue2 = value2;\r\n\t\t\t\tinput = newValue1 + operator + newValue2;\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\tString newValue2 = convertWholeNumber(value2);\r\n\t\t\t\tinput = newValue1 + operator + newValue2;\r\n\t\t\t}\t\r\n\t\t}\r\n\t\tif (input.contains(\" / \"))\r\n\t\t{\r\n\t\t int slash = input.indexOf('/');\r\n\t\t int slash2 = input.indexOf('/', slash + 1);\r\n\t\t int slash3 = input.indexOf('/', slash2 + 1);\r\n\t\t space = input.indexOf(' ');\r\n\t\t int num1 = Integer.parseInt(input.substring(0, slash));\r\n\t\t int denom1 = Integer.parseInt(input.substring(slash + 1, space));\r\n\t\t int num2 = Integer.parseInt(input.substring(space + 3, slash3));\r\n\t\t int denom2 = Integer.parseInt(input.substring(slash3 + 1, input.length()));\r\n\t\t if (num2 < 0)\r\n\t\t {\r\n\t\t\t num2 = num2 * -1;\r\n\t\t\t denom2 = denom2 * -1;\r\n\t\t\t int numerator = num1 * denom2;\r\n\t\t\t int denominator = denom1 * num2;\r\n\t\t\t String Answer = numerator + \"/\" + denominator;\r\n\t\t\t return reduceAnswer(Answer);\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t int numerator = num1 * denom2;\r\n\t\t int denominator = denom1 * num2;\r\n\t\t String Answer = numerator + \"/\" + denominator;\r\n\t\t return reduceAnswer(Answer);\r\n\t\t }\r\n\t\t}\r\n\t\telse {\r\n\t\t int slash = input.indexOf('/');\r\n\t int slash2 = input.indexOf('/', slash + 1);\r\n\t space = input.indexOf(' ');\r\n\t\t int num1 = Integer.parseInt(input.substring(0, slash));\r\n\t int denom1 = Integer.parseInt(input.substring(slash + 1, space));\r\n\t int num2 = Integer.parseInt(input.substring(space + 3, slash2));\r\n\t int denom2 = Integer.parseInt(input.substring(slash2 + 1, input.length()));\r\n\t if (input.contains(\" + \"))\r\n {\r\n \t int numerator1 = num1 * denom2;\r\n \t int numerator2 = num2 * denom1;\r\n \t int finalNumerator = numerator1 + numerator2;\r\n \t int denominator = denom2 * denom1;\r\n \t String Answer = finalNumerator + \"/\" + denominator;\r\n \t return reduceAnswer(Answer);\r\n \t\t\r\n }\r\n else if (input.contains(\" - \"))\r\n {\r\n \tint numerator1 = num1 * denom2;\r\n \tint numerator2 = num2 * denom1;\r\n \tint finalNumerator = numerator1 - numerator2;\r\n \tint denominator = denom2 * denom1;\r\n \tString Answer = finalNumerator + \"/\" + denominator;\r\n \treturn reduceAnswer(Answer);\r\n }\r\n else if (input.contains(\" * \"))\r\n {\r\n \tint numerator = num1 * num2;\r\n \tint denominator = denom1 * denom2;\r\n \tString Answer = numerator + \"/\" + denominator;\r\n \treturn reduceAnswer(Answer);\r\n }\r\n else\r\n {\r\n \tString error = \"Error: Invalid user input\";\r\n \treturn error; \r\n }\r\n\t}\r\n }",
"public String generateQuestion(){\r\n qType = rand.nextInt(2);\r\n if (qType ==0)\r\n return \"Multiple choice question.\";\r\n else\r\n return \"Single choice question.\";\r\n }",
"public MovieQuestion getQuestion() {\n\t\tMovieQuestion newQ = new MovieQuestion();\n\t\tint row;\n\t\tCursor c;\n\t\tboolean okToAdd = false;\n\n\t\t// Pick random question\n\t\tswitch ((int)(Math.random()*9)) {\n\t\tcase 0: // Who directed the movie %s?\n\t\t\tc = mDb.rawQuery(\"SELECT * FROM movies\", null);\n\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\tc.moveToPosition(row);\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[0], c.getString(1));\n\t\t\tnewQ.answers[0] = c.getString(3);\n\t\t\t\n\t\t\tLog.i(\"NewQuestion\", \"Correct:\" + c.getString(3));\n\t\t\t\n\t\t\t// Fill answers with unique wrong values\n\t\t\tfor(int i = 1; i < 4;) {\n\t\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\t\tc.moveToPosition(row);\n\t\t\t\tLog.i(\"NewQuestion\", \"Wrong:\" + c.getString(3));\n\t\t\t\t// i < 4, so we do not increment indefinitely.\n\t\t\t\tfor(int j = 0; j < i && i < 4; j++) {\n\t\t\t\t\tif(newQ.answers[j].equals(c.getString(3))) {\n\t\t\t\t\t\tokToAdd = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tokToAdd = true;\n\t\t\t\t}\n\t\t\t\tif(okToAdd)\n\t\t\t\t\tnewQ.answers[i++] = c.getString(3);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 1: // When was the movie %s released?\n\t\t\tc = mDb.rawQuery(\"SELECT * FROM movies\", null);\n\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\tc.moveToPosition(row);\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[1], c.getString(1));\n\t\t\tnewQ.answers[0] = c.getString(2);\n\n\t\t\t// Fill answers with unique wrong values\n\t\t\tfor(int i = 1; i < 4;) {\n\t\t\t\tint wrongYear = Integer.parseInt(newQ.answers[0]) + (int)((Math.random()-.5)*50); // +/- [1-25] years\n\t\t\t\tif (wrongYear <= 2014 && wrongYear != Integer.parseInt(newQ.answers[0]))\n\t\t\t\t\tnewQ.answers[i++] = \"\" + wrongYear;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 2: // Which star was in the movie %s?\n\t\t\tc = mDb.rawQuery(\"SELECT DISTINCT m.`title`, m.`director`, s.`first_name`, s.`last_name` FROM `movies` m, `stars` s, `stars_in_movies` sm WHERE m.id = sm.movie_id AND s.id = sm.star_id AND s.id GROUP BY m.`id`, s.`first_name`, s.`last_name` ORDER BY RANDOM() LIMIT 4\", null);\n\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\tc.moveToFirst(); // only 4 results are returned.\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[2], c.getString(0));\n\t\t\tnewQ.answers[0] = c.getString(2) +\" \"+ c.getString(3); \n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\tfor (int j = 1; j < 4; j++) {\n\t\t\t\tc.moveToNext();\n\t\t\t\tnewQ.answers[j] = c.getString(2) +\" \"+ c.getString(3);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 3: // Which star was not in the movie %s?\n\t\t\t// The lone star, the left out one...the answer\n\t\t\tString singleActorQuery = \"SELECT mov.`title`, star.`first_name`, star.`last_name`, star.`id` FROM `movies` mov, `stars` star, \"+\n\t\t\t\t\t\"(SELECT movie_id, star_id FROM `stars_in_movies` GROUP BY movie_id HAVING COUNT(star_id) <= 1 ORDER BY RANDOM() LIMIT 1) mult \"+ \n\t\t\t\t\t\"WHERE mov.`id` = mult.`movie_id` AND star.`id`= mult.`star_id`\";\n\t\t\tc = mDb.rawQuery(singleActorQuery, null);\n\t\t\tc.moveToFirst();\n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\tnewQ.answers[0] = c.getString(1) +\" \"+c.getString(2);\n\n\t\t\t// The cool kids: A group of actors in the same movie....excluding the lone star.\n//\t\t\tString starId = c.getString(3);\n\t\t\tString multipleActorQuery = \"SELECT mov.`title`, star.`first_name`, star.`last_name` \" +\n\t\t\t\t\t\"FROM `movies` mov, `stars` star, `stars_in_movies` sim, \" +\n\t\t\t\t\t\"(SELECT movie_id, star_id FROM `stars_in_movies` GROUP BY movie_id HAVING COUNT(star_id) > 2 ORDER BY RANDOM() LIMIT 1) mult\" +\n\t\t\t\t\t\" WHERE mov.`id` = mult.`movie_id` AND star.`id` = sim.`star_id` AND mult.`movie_id` = sim.`movie_id` \" +\n\t\t\t\t\t\"LIMIT 3\";\n\t\t\tc = mDb.rawQuery(multipleActorQuery, null);\n\t\t\tc.moveToFirst();\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[3], c.getString(0));\n\t\t\tfor (int i = 1; i < 4; i++) {\n\t\t\t\tnewQ.answers[i] = c.getString(1) +\" \"+c.getString(2);\n\t\t\t\tc.moveToNext();\n\t\t\t}\n\n\t\t\tbreak;\n\t\tcase 4: // In which movie do the stars %s and %s appear together?\n\t\t\t// Get a movie they both star in\n\t\t\tc = mDb.rawQuery(\"SELECT m.`title`, s.`first_name`, s.`last_name`, s2.`first_name`, s2.`last_name`\" +\n\t\t\t\t\t\"FROM `movies` m, `stars` s, `stars` s2, `stars_in_movies` sm, `stars_in_movies` sm2 \" +\n\t\t\t\t\t\"WHERE m.id = sm.movie_id AND m.id = sm2.movie_id AND s.id = sm.star_id AND s2.id = sm2.star_id AND s.id != s2.id \" +\n\t\t\t\t\t\"GROUP BY m.`id`, s.`first_name`, s.`last_name` ORDER BY RANDOM() LIMIT 4\", null);\n\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\tc.moveToFirst();\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[4], c.getString(1)+\" \"+c.getString(2), c.getString(3)+\" \"+c.getString(4));\n\t\t\tnewQ.answers[0] = c.getString(0); \n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\tfor (int j = 1; j < 4; j++) {\n\t\t\t\tc.moveToNext();\n\t\t\t\tnewQ.answers[j] = c.getString(0);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 5: // Who directed the star %s?\n\t\t\tc = mDb.rawQuery(\"SELECT DISTINCT m.`year`, m.`director`, s.`first_name`, s.`last_name` FROM `movies` m, `stars` s, `stars_in_movies` sm WHERE m.id = sm.movie_id AND s.id = sm.star_id AND s.id GROUP BY m.`id`, s.`first_name`, s.`last_name` ORDER BY RANDOM() LIMIT 4\", null);\n\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\tc.moveToFirst(); // only 4 results are returned.\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[5], c.getString(2) +\" \"+ c.getString(3));\n\t\t\tnewQ.answers[0] = c.getString(1); \n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\tfor (int j = 1; j < 4; j++) {\n\t\t\t\tc.moveToNext();\n\t\t\t\tnewQ.answers[j] = c.getString(1);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 6: // Which star appears in both movies %s and %s?\n\t\t\t// Get the 2 movies with the same actor...\n\t\t\tc = mDb.rawQuery(\"SELECT mov.`id`, mov.`title`, star.`first_name`, star.`last_name`, star.`id` FROM `movies` mov, `stars_in_movies` sim, `stars` star, (SELECT movie_id, star_id, COUNT(movie_id) as cnt FROM `stars_in_movies` GROUP BY star_id HAVING COUNT(movie_id) > 3 ORDER BY RANDOM() LIMIT 1) as popular WHERE sim.`movie_id` = mov.`id` AND popular.`star_id` = sim.`star_id` AND star.`id` = sim.`star_id` LIMIT 2\", null);\n\t\t\tc.moveToFirst();\n\t\t\tString id = c.getString(4);\n\t\t\t\n\t\t\tString[] movies = new String[2];\n\t\t\tmovies[0] = c.getString(1);\n\t\t\tc.moveToNext();\n\t\t\tmovies[1] = c.getString(1);\n\t\t\t\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[6], movies[0], movies[1]);\n\t\t\tnewQ.answers[0] = c.getString(2) +\" \"+ c.getString(3);\n\t\t\t\n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\t\n\t\t\t// Pick 3 alternatives...\n\t\t\tc = mDb.rawQuery(\"SELECT s.first_name, s.last_name FROM stars s WHERE s.id != \"+id+\" GROUP BY s.id ORDER BY RANDOM() LIMIT 3\", null);\n\t\t\tc.moveToFirst();\n\t\t\tfor (int i = 1; i < 4; i++) {\n\t\t\t\tnewQ.answers[i] = c.getString(0) +\" \"+ c.getString(1);\n\t\t\t\tc.moveToNext();\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 7: // Which star did not appear in the same movie with the star %s?\n\t\t\t// The lone star, the left out one...the answer\n\t\t\tString singleActorQueryII = \"SELECT mov.`title`, star.`first_name`, star.`last_name`, star.`id` FROM `movies` mov, `stars` star, \"+\n\t\t\t\t\t\"(SELECT movie_id, star_id FROM `stars_in_movies` GROUP BY movie_id HAVING COUNT(star_id) <= 1 ORDER BY RANDOM() LIMIT 1) mult \"+ \n\t\t\t\t\t\"WHERE mov.`id` = mult.`movie_id` AND star.`id`= mult.`star_id`\";\n\t\t\tc = mDb.rawQuery(singleActorQueryII, null);\n\t\t\tc.moveToFirst();\n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\tnewQ.answers[0] = c.getString(1) +\" \"+c.getString(2);\n\n\t\t\t// The cool kids: A group of actors in the same movie....excluding the lone star.\n\t\t\tString multipleActorQueryII = \"SELECT mov.`title`, star.`first_name`, star.`last_name` \" +\n\t\t\t\t\t\"FROM `movies` mov, `stars` star, `stars_in_movies` sim, \" +\n\t\t\t\t\t\"(SELECT movie_id, star_id FROM `stars_in_movies` GROUP BY movie_id HAVING COUNT(star_id) > 3 ORDER BY RANDOM() LIMIT 1) mult\" +\n\t\t\t\t\t\" WHERE mov.`id` = mult.`movie_id` AND star.`id` = sim.`star_id` AND mult.`movie_id` = sim.`movie_id` \" +\n\t\t\t\t\t\" GROUP BY star.`id`\"+\n\t\t\t\t\t\" LIMIT 4\";\n\t\t\tc = mDb.rawQuery(multipleActorQueryII, null);\n\t\t\tc.moveToFirst();\n\t\t\t// Take the first of the group and put his name in the question\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[7], c.getString(1) +\" \"+c.getString(2));\n\t\t\tc.moveToNext();\n\t\t\tfor (int i = 1; i < 4; i++) {\n\t\t\t\tnewQ.answers[i] = c.getString(1) +\" \"+c.getString(2);\n\t\t\t\tc.moveToNext();\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault: // Who directed the star %s in year %s?\n\t\t\tc = mDb.rawQuery(\"SELECT DISTINCT m.`year`, m.`director`, s.`first_name`, s.`last_name` FROM `movies` m, `stars` s, `stars_in_movies` sm WHERE m.id = sm.movie_id AND s.id = sm.star_id AND s.id GROUP BY m.`id`, s.`first_name`, s.`last_name` ORDER BY RANDOM() LIMIT 4\", null);\n\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\tc.moveToFirst(); // only 4 results are returned.\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[8], c.getString(2) +\" \"+ c.getString(3), c.getString(0));\n\t\t\tnewQ.answers[0] = c.getString(1); \n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\tfor (int j = 1; j < 4; j++) {\n\t\t\t\tc.moveToNext();\n\t\t\t\tnewQ.answers[j] = c.getString(1);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\treturn newQ;\n\t}",
"@FXML\n\tprivate void answerQuestion() {\n\t\tint correctAnsID = 0;\n\t\ttry {\n\t\t\tswitch (((RadioButton) answerGroup.getSelectedToggle()).getId()) {\n\t\t\tcase \"ans1Check\":\n\t\t\t\tcorrectAnsID = 1;\n\t\t\t\tbreak;\n\t\t\tcase \"ans2Check\":\n\t\t\t\tcorrectAnsID = 2;\n\t\t\t\tbreak;\n\t\t\tcase \"ans3Check\":\n\t\t\t\tcorrectAnsID = 3;\n\t\t\t\tbreak;\n\t\t\tcase \"ans4Check\":\n\t\t\t\tcorrectAnsID = 4;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\terrorLabel.setVisible(true);\n\t\t}\n\n\t\t// nothing is selected\n\t\tif (correctAnsID == 0) { \n\t\t\terrorLabel.setVisible(true);\n\t\t\t// correct answer\n\t\t} else if (question.getCorrect_ans() == correctAnsID) {\n\t\t\tcontrol.setScore(control.getScore() + question.getScore());\n\t\t\thandleAlertAndWindow(AlertType.INFORMATION, \"Congrats! :D\",\n\t\t\t\t\t\"You received \" + question.getScore() + \" points\");\n\t\t\t// wrong answer\n\t\t} else {\n\t\t\tcontrol.setScore(control.getScore() + question.getPenalty());\n\n\t\t\thandleAlertAndWindow(AlertType.ERROR, \"Uh oh! :(\",\n\t\t\t\t\t\"You lost \" + question.getPenalty() + \" points\");\n\t\t}\n\n\t\t// reset the eaten question\n\t\tViewLogic.playGameController.getControl().setQuestionEaten(null);\n\t}",
"public abstract String chooseAnswer();",
"public void showQuestion()\n\t{\n\t\tSystem.out.println(ans);\n\t\tfor(int k = 0; k<numAns; k++)\n\t\t{\n\t\t\tSystem.out.println(k+\". \"+answers[k]);\n\t\t}\n\t}",
"@PostMapping(\"tematicAnswer/{taskId}\")\n\tpublic ResponseEntity tematicAnswer(@PathVariable String taskId, @RequestBody AnswerDTO answer) throws IOException {\n\t\tSystem.out.println(\" rad tematski prikladan: \" + answer.getAnswer() + \" za task sa idom: \" + taskId);\n\t\tfinal ArrayList<FormFieldDTO> taskFormFieldDtos = new ArrayList<>();\n\t\tif (answer.getAnswer().equals(\"yes\")) {\n\t\t\ttaskFormFieldDtos.add(new FormFieldDTO(\"radPrikladan\", true));\n\t\t} else {\n\t\t\ttaskFormFieldDtos.add(new FormFieldDTO(\"radPrikladan\", false));\n\t\t}\n\n\t\trspe.submitTaskForm(taskId, taskFormFieldDtos);\n\n\t\tSystem.out.println(\"Submitovani podaci za rad dosao dovde tematic\");\n\t\treturn new ResponseEntity<>(HttpStatus.OK);\n\t}",
"public void chooseAnswer(View view)\n {\n\n if(view.getTag().toString().equals(Integer.toString(pos_of_correct)))\n {\n //Log.i(\"Result\",\"Correct Answer\");\n correct++;\n noOfQues++;\n correct();\n }\n else\n {\n //Log.i(\"Result\",\"Incorrect Answer\");\n //resluttextview.setText(\"Incorrect!\");\n incorrect();\n noOfQues++;\n }\n pointtextView.setText(Integer.toString(correct)+\"/\"+Integer.toString(noOfQues));\n if(tag==4)\n generateAdditionQuestion();\n if(tag==5)\n generateSubtractionQuestion();\n if(tag==6)\n generateMultiplicationQuestion();\n if(tag==7)\n generateDivisionQuestion();\n\n }",
"public void checkAnswer() {\n }",
"public double getAnswer() {\n return answer;\n }",
"public java.lang.String getCorrectAnswer() {\n java.lang.Object ref = correctAnswer_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n correctAnswer_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public static <T, A, B, C, D, E, F> Answer<T> answer(Answer6<T, A, B, C, D, E, F> answer) {\n return toAnswer(answer);\n }",
"public Results(String question, ArrayList<String> correctAnswers) {\n\t\t\tthis.questionForFT = question;\n\t\t\tthis.correctAnswersForFT = correctAnswers;\n\t\t}",
"private void detectCorrectAnswer() {\n switch (chapterSection) {\n case 5:\n if (typedAnswer.toString().toLowerCase().contentEquals(\"baybayin\")) {\n ansCorrect = true;\n }\n break;\n case 6:\n if (typedAnswer.toString().toLowerCase().contentEquals(\"kabundukan\")) {\n ansCorrect = true;\n }\n break;\n case 7:\n if (typedAnswer.toString().toLowerCase().contentEquals(\"lungsod\")) {\n ansCorrect = true;\n }\n break;\n case 8:\n if (typedAnswer.toString().toLowerCase().contentEquals(\"kabukiran\")) {\n ansCorrect = true;\n }\n break;\n }\n }",
"@Test\r\n public void MathQuestionWrong()\r\n {\r\n var answerInput = 8;\r\n var questionInput = \"4 + 4\";\r\n\r\n var responseAnswer = 9;\r\n var expectedText = \"What is 4 + 4?\\n9 is wrong. 4 + 4 equals 8\\n\\r\\n\";\r\n\r\n var testOutputByteArray = new ByteArrayOutputStream();\r\n var testOutputStream = new PrintStream(testOutputByteArray );\r\n\r\n // Check math question logic\r\n var mathQuestionAdd = new MathQuestion(answerInput, questionInput, testOutputStream);\r\n mathQuestionAdd.showQuestion();\r\n assertFalse(mathQuestionAdd.checkAnswer(responseAnswer));\r\n\r\n // Check math question console outputs\r\n var content = testOutputByteArray.toString();\r\n assertEquals(content,expectedText);\r\n }",
"public abstract T adaptResult(F solution);",
"public String getAnswer() {\n return answer;\n }",
"static void askQuestion() {\n\t\t// Setting up a Scanner to get user input\n\t\tScanner userInput = new Scanner(System.in);\n\n\t\t// Declaring variables\n\t\tdouble num1, num2, answer, userAnswer;\n\n\t\t// GENERATING QUESTION\n\n\t\t// Getting two new random numbers, rounded to one decimal place (with numbers generation from 0 to 50)\n\t\tnum1 = Math.round((Math.random() * 50)*10.0)/10.0;\n\t\tnum2 = Math.round((Math.random() * 50)*10.0)/10.0;\n\n\t\t// Generating a random number between 1 and 4 to randomize the math operation. A switch case is used to calculate the answer based on the math operation that gets generated.\n\t\tswitch ((int) Math.round(Math.random() * 3 + 1)) {\n\t\t\tcase 1: // Similar structure for each case (and the default case), structured as follows\n\t\t\t\tSystem.out.print(num1 + \" + \" + num2 + \" = \"); // Printing the question (based on the generated operation)\n\t\t\t\tanswer = num1 + num2; // Calculating the answer (based on the generated operation)\n\t\t\t\tbreak; // Exit the switch statement\n\t\t\tcase 2:\n\t\t\t\tSystem.out.print(num1 + \" - \" + num2 + \" = \");\n\t\t\t\tanswer = num1 - num2;\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tSystem.out.print(num1 + \" / \" + num2 + \" = \");\n\t\t\t\tanswer = num1 / num2;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tSystem.out.print(num1 + \" * \" + num2 + \" = \");\n\t\t\t\tanswer = num1 * num2;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tanswer = Math.round(answer * 10.0) / 10.0; // Rounding the answer to one decimal place\n\t\tuserAnswer = userInput.nextDouble(); // Getting the user's answer\n\n\t\tif (answer == userAnswer) System.out.println(\"That's right. Good Job!\\n\"); // If the answers match, the user is correct and the staetment is printed accordingly.\n\t\telse System.out.println(\"Incorrect. The correct answer was \" + answer + \".\\n\"); // Otherwise, show that the user's answer is incorrect and output an according statement.\n\t}",
"private void verifyQuestion(Answer answer) {\n // If is running, stop the question timer\n //(Hard mode)\n timerQuestion.stop();\n \n //if (challengeModel.getChallenge().getCurrentCorrectAnswer()) {\n if (challengeModel.getChallenge().getQuestionsList().get(challengeModel.getChallenge().getCurrentQuestionNumber()-1).getAnswer() == answer) {\n imgCenter.setIcon(Resources.getImageCorrect());\n labelAnswerResult.setText(\"Correto \");\n labelClarification.setText(\"\");\n }\n else {\n imgCenter.setIcon(Resources.getImageIncorrect());\n // Show clarification\n labelAnswerResult.setText(\"\");\n labelClarification.setText(\"<HTML><B>Esclarecimento: </B>\"+challengeModel.getChallenge().getCurrentRuleClarification()+\"</HTML>\");\n }\n \n showAnswerResult(answer);\n }",
"public String retA()\n\t{\n\t\treturn answers[correctAns]; \t\n\t}",
"@Override\n public String ask(String question) {\n return answers[position++];\n }",
"public int generateQuestionBox() {\n\n if(mGame.isInQuestion()) return 0;\n\n Vector2 relVel = mGame.getPlayer().getVelocity();\n\n QuestionBox e = new QuestionBox();\n e.setRelativeVelocity(relVel);\n e.setPosition(1000, rand.nextInt(mMap.getBottomBound()));\n\n Question question = mQuestionManager.getQuestion(); \n question.setVelocity(relVel.x, relVel.y);\n question.setPosition(mGame.getWidth() / 4, 20);\n question.setOptionsPosition(mGame.getWidth() - 40);\n question.setOptionsRelativeVelocity(relVel);\n question.pack(mGame.getWidth(), mGame.getHeight());\n question.reset();\n\n e.setQuestion(question);\n\n mGame.addEntity(e);\n return e.getWidth();\n }",
"public static String getQuestion() {\n\t\treturn \"3) A line in the xy-plane passes through the origin and has a slope of 1/7. Which of \\\\n\"+\"the following points lies on the line?\";\n\t}",
"String getAnswerResponse();",
"@Test\n public void shouldNotGiveQuestionIfAllQuestionsHaveBeenAnswered() {\n attributes.put(FinancialPlanningSpeechlet.GOAL_AMOUNT_KEY, 1000.0);\n attributes.put(FinancialPlanningSpeechlet.MONTHLY_CONTRIBUTION_KEY, 1000.0);\n attributes.put(FinancialPlanningSpeechlet.GOAL_PERIOD_KEY, 1000.0);\n String question = NextQuestionFactory.get(session);\n\n assertThat(question, Is.is(\"\"));\n }",
"Boolean getCompletelyCorrect();",
"FactoryQuestion(String textA, String textB, ArrayList<String> textOps, ArrayList<String> rightAns, ArrayList<String> answers, String topic, int bloom){\n\t\tthis.rightAns = new ArrayList<String>();\n\t\tthis.textOps = new ArrayList<String>();\n\t\tthis.answers = new ArrayList<String>();\n\t\tthis.textA = textA;\n\t\tthis.textB = textB;\n\t\t\n\t\tfor(String t : textOps){\n\t\t\tthis.textOps.add(t);\n\t\t}\n\t\tfor(String r : rightAns){\n\t\t\tthis.rightAns.add(r);\n\t\t}\n\t\tfor(String a : answers){\n\t\t\tthis.answers.add(a);\n\t\t}\n\t\t\n\t\t//asked = false;\n\t\tthis.topic = topic;\n\t\tthis.bloom = bloom;\n\t}",
"public Boolean validate(R answerFromTest);",
"public String getCorrect() {\n\t\treturn new String(correctAnswer);\n\t}",
"@Override\n\tpublic String getQuestion() {\n\n\t\treturn \"http://leetcode.com/onlinejudge#question_11\";\n\t}",
"public void verifyAnswer() {\n\t\tint i=0;\n\t\tSystem.out.println(\"in verify answer function\");\n\t\tSystem.out.println(\"Number of Answers: \"+ansCount);\n\t\tSystem.out.println(\"User ans: \"+userEquation);\n\t\tif (ansCount==0)\n\t\t\tlb2.setText(\"There is no solution for this set\");\n\t\telse{\n\t\t\tint c=0;\n\t\t\t\n\t\t\twhile(c<ansCount) {\n\t\t\t\tif (solutions[i].equals(userEquation)) {\n\t\t\t\t\tSystem.out.println(\"Ans was Correct\");\n\t\t\t\t\tfinal long duration = System.nanoTime() - startTime;\n\t\t\t\t\tseconds = TimeUnit.NANOSECONDS.toSeconds(duration);\n\t\t\t\t\tlb2.setText(\"Congradulations! You took \"+seconds+\" seconds to find an answer.\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t\tc++;\n\t\t\t\tSystem.out.println(\"C: \"+c);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"Ans was not Correct\");\n\t}\n\t}",
"protected void constructNewQuestion(){\n arabicWordScoreItem = wordScoreTable.whatWordToLearn();\n arabicWord = arabicWordScoreItem.word;\n correctAnswer = dictionary.get(arabicWord);\n\n for (int i=0;i<wrongAnswers.length;i++){\n int wrongAnswerId;\n String randomArabicWord;\n String wrongAnswer;\n do {\n wrongAnswerId = constructQuestionRandom.nextInt(next_word_index);\n randomArabicWord = dictionary_key_list.get(wrongAnswerId);\n wrongAnswer = dictionary.get(randomArabicWord);\n } while (wrongAnswer.equals(correctAnswer));\n wrongAnswers[i] = wrongAnswer;\n }\n }",
"public String getAnswer(){\n\t\tString result = new String(answer);\n\t\tanswer = \"\"; //reset answer after every read\n\t\treturn result;\n\t}",
"public void createMatching() {\n int numChoices = 0;\n Question q = new Matching(this.in,this.o);\n this.o.setDisplay(\"Enter the prompt for your Matching question:\\n\");\n this.o.getDisplay();\n\n q.setPrompt(this.in.getUserInput());\n\n while (numChoices == 0) {\n this.o.setDisplay(\"Enter the number of choices for your question:\\n\");\n this.o.getDisplay();\n\n try {\n numChoices = Integer.parseInt(this.in.getUserInput());\n } catch (NumberFormatException e) {\n numChoices = 0;\n }\n }\n\n for (int i=0; i<numChoices;i++) {\n this.o.setDisplay(\"Enter choice#\" + (i+1) + \"\\n\");\n this.o.getDisplay();\n\n ((Matching) q).addChoicesToMatch(this.in.getUserInput());\n }\n\n for (int i=0; i<numChoices;i++) {\n this.o.setDisplay(\"Answer#\" + (i+1) + \" (enter any answer for one of the choices)\\n\");\n this.o.getDisplay();\n\n ((Matching) q).addChoice(this.in.getUserInput());\n }\n\n q.setMaxResponses(numChoices);\n\n if (isTest) {\n int choiceNum = 0;\n RCA ca = new RCA(this.in,this.o);\n Test t = (Test)this.survey;\n ArrayList<Integer> ans = new ArrayList<Integer>();\n\n for (int j=0; j < q.getMaxResponses(); j++){\n\n while (choiceNum == 0) {\n this.o.setDisplay(\"Enter answer# for choice#\" + (j+1) + \": \\n\");\n this.o.getDisplay();\n\n try {\n choiceNum = Integer.parseInt(this.in.getUserInput());\n\n if (choiceNum > numChoices || choiceNum < 1) {\n choiceNum = 0;\n } else {\n if (ans.contains(choiceNum)) {\n this.o.setDisplay(\"Answer already used\\n\");\n this.o.getDisplay();\n choiceNum = 0;\n } else {\n ans.add(choiceNum);\n ca.addResponse(Integer.toString(choiceNum));\n }\n }\n\n } catch (NumberFormatException e) {\n choiceNum = 0;\n }\n }\n choiceNum = 0;\n }\n t.addAnswer(ca);\n }\n this.survey.addQuestion(q);\n }",
"public String getQuestionStr(Node q) {\n \n \t\tString s;\n \n \t\ts = q.getMinStr();\n \t\tif (s != null)\n \t\t\tq.setMinDatum(parser.parse(evidence,s));\n \t\telse\n \t\t\tq.setMinDatum(null);\n \n \t\ts = q.getMaxStr();\n \t\tif (s != null)\n \t\t\tq.setMaxDatum(parser.parse(evidence,s));\n \t\telse\n \t\t\tq.setMaxDatum(null);\n \n \t\tq.createParseRangeStr();\n \n \t\tq.setQuestionAsAsked(parser.parseJSP(evidence, q.getQuestionOrEval()) + q.getQuestionMask());\n \t\treturn q.getQuestionAsAsked();\n \t}",
"public int getAnswer()\n {\n return answer;\n }",
"private void generateNewQuestion() {\n GameManager gameManager = new GameManager();\n long previousQuestionId = -1;\n try {\n previousQuestionId = mGameModel.getQuestion().getId();\n } catch (NullPointerException e) {\n previousQuestionId = -1;\n }\n mGameModel.setQuestion(gameManager.generateRandomQuestion(previousQuestionId));\n mGameModel.getGameMaster().setDidPlayerAnswer(false);\n mGameModel.getGameMaster().setPlayerAnswerCorrect(false);\n mGameModel.getGameSlave().setDidPlayerAnswer(false);\n mGameModel.getGameSlave().setPlayerAnswerCorrect(false);\n LOGD(TAG, \"New question generated\");\n }",
"Question getQuestion();",
"@java.lang.Override\n public java.lang.String getCorrectAnswer() {\n java.lang.Object ref = correctAnswer_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n correctAnswer_ = s;\n return s;\n }\n }",
"public QuestionTF() {}",
"public void modify() {\n io.writeLine(\"Enter the new correct answer\");\n String newAnswer = io.readLine();\n while (!newAnswer.equals(\"T\") && !newAnswer.equals(\"F\")) {\n io.writeLine(\"Please put in T or F\");\n newAnswer = io.readLine();\n }\n rightAnswers.set(0, newAnswer);\n }",
"public void feedback(boolean isCorrect, VocabularyQuiz question) {\n String correctMeaning = question.getSelections().get(question.getAnswer());\n String message;\n if (isCorrect) {\n message = \"Correct!\";\n totalCorrect++;\n } else {\n message = \"Incorrect! The answer is \" + correctMeaning;\n }\n JOptionPane.showMessageDialog(gui.getFrame(), message);\n }",
"private String createQuestionSummary(boolean answerCorrect, int questionNumber, String rightAnswer) {\n String answerStatementQuestion = answerStatement(answerCorrect);\n String questionSummary = getResources().getString(R.string.correct_answer_to_question) + questionNumber + getResources().getString(R.string.is) + rightAnswer + \"\\n\";\n questionSummary += getResources().getString(R.string.your_answer_is) + answerStatementQuestion + \"\\n\";\n return questionSummary;\n }",
"public void setAnswer(String answer) {\r\n this.answer = answer;\r\n }",
"public void q2Submit(View view) {\n\n RadioButton radioButton = (RadioButton) findViewById(R.id.q2option3);\n\n //Nested if statements to check if the answer is correct or not, then to assign 2 points if it's correct.\n if (radioButton.isChecked()) {\n if (isNotAnsweredQ2) {\n display(pointCounter += 2);\n Toast.makeText(this, getString(R.string.correct2), Toast.LENGTH_SHORT).show();\n isNotAnsweredQ2 = false;\n }\n } else {\n Toast.makeText(this, getString(R.string.thinkAgain), Toast.LENGTH_SHORT).show();\n }\n }",
"public void q5Submit(View view) {\n\n RadioButton radioButton = (RadioButton) findViewById(R.id.q5option3);\n\n //Nested if statements to check if the answer is correct or not, then to assign 2 points if it's correct.\n if (radioButton.isChecked()) {\n if (isNotAnsweredQ5) {\n display(pointCounter += 2);\n Toast.makeText(this, getString(R.string.correct2), Toast.LENGTH_SHORT).show();\n isNotAnsweredQ5 = false;\n }\n } else {\n Toast.makeText(this, getString(R.string.thinkAgain), Toast.LENGTH_SHORT).show();\n }\n }",
"private void addQuestion() {\n Question q = new Question(\n \"¿Quien propuso la prueba del camino básico ?\", \"Tom McCabe\", \"Tom Robert\", \"Tom Charlie\", \"Tom McCabe\");\n this.addQuestion(q);\n\n\n Question q1 = new Question(\"¿Qué es una prueba de Caja negra y que errores desean encontrar en las categorías?\", \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\", \"esta basada en la funcionalidad de los módulos del programa\", \" determina la funcionalidad del sistema\", \" determina la funcionalidad del sistema\");\n this.addQuestion(q1);\n Question q2 = new Question(\"¿Qué es la complejidad ciclomática es una métrica de calidad software?\", \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\", \"esta basada en la funcionalidad de los módulos del programa\", \"basada en el cálculo del número\", \"basada en el cálculo del número\");\n this.addQuestion(q2);\n //preguntas del quiz II\n Question q3=new Question(\"Las pruebas de caja blanca buscan revisar los caminos, condiciones, \" +\n \"particiones de control y datos, de las funciones o módulos del sistema; \" +\n \"para lo cual el grupo de diseño de pruebas debe:\",\n \"Conformar un grupo de personas para que use el sistema nuevo\",\n \"Ejecutar sistema nuevo con los datos usados en el sistema actual\",\n \"Generar registro de datos que ejecute al menos una vez cada instrucción\",\n \"Generar registro de datos que ejecute al menos una vez cada instrucción\");\n this.addQuestion(q3);\n Question q4=new Question(\"¿Las pruebas unitarias son llamadas?\",\n \"Pruebas del camino\", \"Pruebas modulares\",\n \"Pruebas de complejidad\", \"Pruebas modulares\");\n this.addQuestion(q4);\n Question q5=new Question(\"¿Qué es una prueba de camino básico?\",\n \"Hace una cobertura de declaraciones del código\",\n \"Permite determinar si un modulo esta listo\",\n \"Técnica de pueba de caja blanca\",\n \"Técnica de pueba de caja blanca\" );\n this.addQuestion(q5);\n Question q6=new Question(\"Prueba de camino es propuesta:\", \"Tom McCabe\", \"McCall \", \"Pressman\",\n \"Tom McCabe\");\n this.addQuestion(q6);\n Question q7=new Question(\"¿Qué es complejidad ciclomatica?\",\"Grafo de flujo\",\"Programming\",\n \"Metrica\",\"Metrica\");\n this.addQuestion(q7);\n //preguntas del quiz III\n Question q8 = new Question(\n \"¿Se le llama prueba de regresión?\", \"Se tienen que hacer nuevas pruebas donde se han probado antes\",\n \"Manten informes detallados de las pruebas\", \"Selección de los usuarios que van a realizar las pruebas\",\n \"Se tienen que hacer nuevas pruebas donde se han probado antes\");\n this.addQuestion(q8);\n Question q9 = new Question(\"¿Cómo se realizan las pruebas de regresión?\",\n \"Selección de los usuarios que van a realizar las pruebas\",\n \"Se tienen que hacer nuevas pruebas donde se han probado antes\", \"A través de herramientas de automatización de pruebas\", \"A través de herramientas de automatización de pruebas\");\n this.addQuestion(q9);\n Question q10 = new Question(\"¿Cuándo ya hay falta de tiempo para ejecutar casos de prueba ya ejecutadas se dejan?\",\n \"En primer plano\", \"En segundo plano\", \"En tercer plano\", \"En segundo plano\");\n this.addQuestion(q10);\n //preguntas del quiz IV\n Question q11 = new Question(\n \"¿En qué se enfocan las pruebas funcionales?\",\n \"Enfocarse en los requisitos funcionales\", \"Enfocarse en los requisitos no funcionales\",\n \"Verificar la apropiada aceptación de datos\", \"Enfocarse en los requisitos funcionales\");\n this.addQuestion(q11);\n Question q12 = new Question(\"Las metas de estas pruebas son:\", \"Verificar la apropiada aceptación de datos\",\n \"Verificar el procesamiento\", \"Verificar la apropiada aceptación de datos, procedimiento y recuperación\",\n \"Verificar la apropiada aceptación de datos, procedimiento y recuperación\");\n this.addQuestion(q12);\n Question q13 = new Question(\"¿En qué estan basadas este tipo de pruebas?\",\n \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\",\n \"Esta basada en la funcionalidad de los módulos del programa\",\n \"Técnicas de cajas negra\", \"Técnicas de cajas negra\");\n this.addQuestion(q13);\n //preguntas del quiz V\n Question q14 = new Question(\n \"¿Cúal es el objetivo de esta técnica?\", \"Identificar errores introducidos por la combinación de programas probados unitariamente\",\n \"Decide qué acciones tomar cuando se descubren problemas\",\n \"Verificar que las interfaces entre las componentes de software funcionan correctamente\",\n \"Identificar errores introducidos por la combinación de programas probados unitariamente\");\n this.addQuestion(q14);\n Question q15 = new Question(\"¿Cúal es la descripción de la Prueba?\",\n \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\",\n \"Esta basada en la funcionalidad de los módulos del programa\",\n \"Describe cómo verificar que las interfaces entre las componentes de software funcionan correctamente\",\n \"Describe cómo verificar que las interfaces entre las componentes de software funcionan correctamente\");\n this.addQuestion(q15);\n Question q16 = new Question(\"Por cada caso de prueba ejecutado:\",\n \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\",\n \"Esta basada en la funcionalidad de los módulos del programa\",\n \"Comparar el resultado esperado con el resultado obtenido\", \"Comparar el resultado esperado con el resultado obtenido\");\n this.addQuestion(q16);\n //preguntas del quiz VI\n Question q17 = new Question(\n \"Este tipo de pruebas sirven para garantizar que la calidad del código es realmente óptima:\",\n \"Pruebas Unitarias\", \"Pruebas de Calidad de Código\",\n \"Pruebas de Regresión\", \"Pruebas de Calidad de Código\");\n this.addQuestion(q17);\n Question q18 = new Question(\"Pruebas de Calidad de código sirven para: \",\n \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\",\n \"Verificar que las especificaciones de diseño sean alcanzadas\",\n \"Garantizar la probabilidad de tener errores o bugs en la codificación\", \"Garantizar la probabilidad de tener errores o bugs en la codificación\");\n this.addQuestion(q18);\n Question q19 = new Question(\"Este análisis nos indica el porcentaje que nuestro código desarrollado ha sido probado por las pruebas unitarias\",\n \"Cobertura\", \"Focalización\", \"Regresión\", \"Cobertura\");\n this.addQuestion(q19);\n\n Question q20 = new Question( \"¿Qué significa V(G)?\",\n \"Número de Regiones\", \"Número de Aristas\", \"Número de Nodos\", \"Número de Regiones\");\n this.addQuestion(q20);\n\n Question q21 = new Question( \"¿Qué significa A?\",\n \"Número de Regiones\", \"Número de Aristas\", \"Número de Nodos\", \"Número de Aristas\");\n this.addQuestion(q21);\n\n Question q22 = new Question( \"¿Qué significa N?\",\n \"Número de Regiones\", \"Número de Aristas\", \"Número de Nodos\", \"Número de Nodos\");\n this.addQuestion(q22);\n\n Question q23 = new Question( \"¿Qué significa P?\",\n \"Número de Regiones\", \"Número de Aristas\", \"Número de Nodos Predicado\", \"Número de Nodos Predicado\");\n this.addQuestion(q23);\n Question q24 = new Question( \"De cuantás formas se puede calcular la complejidad ciclomatica V(G):\",\n \"3\", \"1\", \"2\", \"3\");\n this.addQuestion(q24);\n\n // END\n }",
"public void q6Submit(View view) {\n\n RadioButton radioButton = (RadioButton) findViewById(R.id.q6option1);\n\n //Nested if statements to check if the answer is correct or not, then to assign 2 points if it's correct.\n if (radioButton.isChecked()) {\n if (isNotAnsweredQ6) {\n display(pointCounter += 2);\n Toast.makeText(this, getString(R.string.correct2), Toast.LENGTH_SHORT).show();\n isNotAnsweredQ6 = false;\n }\n } else {\n Toast.makeText(this, getString(R.string.thinkAgain), Toast.LENGTH_SHORT).show();\n }\n }",
"private void checkAnswers() {\n\n //fetch the SolutionInts\n String[] solutionTags = currentTask.getSolutionStringArray();\n\n //fetch the userInput\n String[] userSolution = new String[solutionTags.length];\n for (int i = 0; i < solutionTags.length; i++) {\n LinearLayout linearLayout = currentView.findViewWithTag(i);\n userSolution[i] = (String) linearLayout.getChildAt(0).getTag();\n }\n\n Log.i(\"M_ORDER\",\"solutiontags: \"+ Arrays.toString(solutionTags) +\" usertags:\"+ Arrays.toString(userSolution));\n Date ended;\n if (Arrays.equals(solutionTags, userSolution)) {\n ended = Calendar.getInstance().getTime();\n String duration = progressController.calculateDuration(entered, ended);\n progressController.makeaDurationLog(getContext(),Calendar.getInstance().getTime(), \"EXERCISE_ORDER_FRAGMENT_RIGHT\", \"number: \" + currentTask.getTaskNumber() + \" section: \"+currentTask.getSectionNumber()+\" viewtype: \"+currentTask.getExerciseViewType()+\" userInput: \" + Arrays.toString(userSolution),duration);\n mListener.sendAnswerFromExerciseView(true);\n Log.i(\"M_EXERCISE_VIEW_ORDER\", \" send answer: true\");\n } else {\n Log.i(\"ANSWER\", \" was wrong\");\n ended = Calendar.getInstance().getTime();\n String duration = progressController.calculateDuration(entered, ended);\n progressController.makeaDurationLog(getContext(),Calendar.getInstance().getTime(), \"EXERCISE_ORDER_FRAGMENT_WRONG\", \"number: \" + currentTask.getTaskNumber() + \" section: \"+currentTask.getSectionNumber()+\" viewtype: \"+currentTask.getExerciseViewType()+\" userInput: \" + Arrays.toString(userSolution),duration);\n mListener.sendAnswerFromExerciseView(false);\n Log.i(\"M_EXERCISE_VIEW_ORDER\", \" send answer: false\");\n }\n }",
"public String getCorrectAnswer(int a){\n String answer = correctAnswers[a];\n return answer;\n }",
"public void q7Submit(View view) {\n\n RadioButton radioButton = (RadioButton) findViewById(R.id.q7option4);\n\n //Nested if statements to check if the answer is correct or not, then to assign 2 points if it's correct.\n if (radioButton.isChecked()) {\n if (isNotAnsweredQ7) {\n display(pointCounter += 2);\n Toast.makeText(this, getString(R.string.correct1), Toast.LENGTH_SHORT).show();\n isNotAnsweredQ7 = false;\n }\n } else {\n Toast.makeText(this, getString(R.string.thinkAgain), Toast.LENGTH_SHORT).show();\n }\n }",
"public MAidQuestion(String s) {\n\t\tScanner sc = new Scanner(s);\n\t\tSystem.err.println(\"s: \"+s);\n //test if there is an integer\n\t\ttry {\n\t\t\tsc.nextInt();\n\t\t\tsc.next();\n\t\t} catch (Exception e) {\n\t\t\tsc.next();\n\t\t}\n\t\t\n //tests if there is one and only one question mark\n\t\ts = \"\";\n\t\twhile (sc.hasNextLine()){\n\t\t\ts = s+sc.nextLine().trim()+\" \";\n\t\t}\n\t\ts = s.trim();\n\t\tint lq = s.lastIndexOf('?');\n\t\tint fq = s.indexOf('?');\n\t\tif (fq != lq){\n\t\t\tSystem.out.println(\"bad question:\\n\"+s);\n\t\t\treturn;\n\t\t}\n \n\t\tquestion = s.substring(0,lq+1);\n\t\t//validate the answer\n s = s.substring(lq+1).trim();\n\t\tSystem.out.println(\"ans s: \"+s);\n\t\tint f_ = s.indexOf('_');\n\t\ts = s.substring(0,f_);\n\t\tsc = new Scanner(s);\n\t\tString numS = Util.dollarProcess(sc.next()); //process currency quantity\n\t\ttry {\n\t\t\tanswerNum = Double.parseDouble(numS); //gets answer as a number if possible\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tgoodQ = false; //if we can't represent the answer as a number, badness results\n\t\t\treturn;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tanswerObj = sc.nextLine();\n\t\t} catch (Exception e) {\n\t\t\t\n\t\t}\n\t\t\n\t\tif (sc.hasNext()){\n\t\t\tSystem.out.println(\"bad end \"+question+\" \"+answerNum);\n\t\t\tgoodQ = false;\n\t\t}\n\t\tgoodQ = true;\n\t}",
"@Test(expected = AnswerException.class)\n public void questionNotMatchTest()throws Exception{\n Mockito.when(paperAnswerRepository.getMaxTimes(1L,1L)).thenReturn(Optional.of(2));\n Mockito.when(paperService.getPaperInfo(1L,1L)).thenReturn(paper);\n Mockito.when(userService.getUserInfo(1L)).thenReturn(user);\n Mockito.when(courseService.getCourseInfo(1L)).thenReturn(course);\n PaperAnswer paperAnswer1 = new PaperAnswer();\n PaperAnswerPrimaryKey paperAnswerPrimaryKey = new PaperAnswerPrimaryKey(user,paper,2);\n paperAnswer1.setPaperAnswerPrimaryKey(paperAnswerPrimaryKey);\n paperAnswer1.setState(PaperAnswerState.FINISHED);\n Mockito.when(paperAnswerRepository.getOne(new PaperAnswerPrimaryKey(user,paper,2))).thenReturn(paperAnswer1);\n Mockito.when(paperAnswerRepository.save(any(PaperAnswer.class))).thenAnswer(i -> i.getArguments()[0]);\n\n Mockito.when(paperRepository.getOne(1L)).thenReturn(paper);\n\n Question question2 = new Question();\n question2.setId(2L);\n Mockito.when(questionRepository.findById(2L)).thenReturn(Optional.of(question2));\n\n QuestionAnswer questionAnswer = new QuestionAnswer(2L,\"A\");\n SubmitAnswerForm submitAnswerForm = new SubmitAnswerForm(List.of(questionAnswer),\"FINISHED\");\n paperAnswerService.submitAnswer(1L,1L,1L,submitAnswerForm);\n\n }",
"void add(String question, long time, boolean correct);",
"public String getAnswer(){\n return this.answer;\n }",
"private QuestionNode askQuestionsHelper(QuestionNode root) {\r\n if (root.left == null || root.right == null) {\r\n if (yesTo(\"Would your object happen to be \" + root.data + \"?\") == true) {\r\n System.out.println(\"Great, I got it right!\");\r\n } else {\r\n System.out.print(\"What is the name of your object? \");\r\n String object = console.nextLine();\r\n QuestionNode leaf = new QuestionNode(object);\r\n System.out.println(\"Please give me a yes/no question that\");\r\n System.out.println(\"distinguishes between your object\");\r\n System.out.print(\"and mine--> \");\r\n String question = console.nextLine();\r\n QuestionNode branch = new QuestionNode(question);\r\n if (yesTo(\"And what is the answer for your object?\") == true) {\r\n branch.left = leaf;\r\n branch.right = root;\r\n } else {\r\n branch.left = root;\r\n branch.right = leaf;\r\n }\r\n root = branch;\r\n }\r\n } else {\r\n if (yesTo(root.data)) {\r\n root.left = askQuestionsHelper(root.left);\r\n } else {\r\n root.right = askQuestionsHelper(root.right);\r\n }\r\n }\r\n return root;\r\n }",
"private boolean checkType() {\r\n if (CorrectAnswer.getText().equals(\"\") || typeQuestion.getValue() == null) {\r\n if (typeQuestion.getValue() == null)\r\n errorMsg += \"Which type of question do you want?\\n\";\r\n\r\n if (CorrectAnswer.getText().equals(\"\"))\r\n errorMsg += \"There is no Correct Answer\\n\";\r\n\r\n return false;\r\n } else {\r\n switch ((String) typeQuestion.getValue()) {\r\n\r\n // case TrueFalse : it must true or false\r\n case \"TrueFalse\" : {\r\n if(CorrectAnswer.getText().equalsIgnoreCase(\"true\") || CorrectAnswer.getText().equalsIgnoreCase(\"false\"))\r\n return true;\r\n\r\n errorMsg += \"The answer has to be True or False\\n\";\r\n return false;\r\n }\r\n\r\n // case MCQ : the answer has to be in the list of the different proposed answers\r\n case \"MCQ\" :\r\n // each answer is different from the others\r\n if(TextAnswer1.getText().equals(TextAnswer2.getText())\r\n || TextAnswer1.getText().equals(TextAnswer3.getText())\r\n || TextAnswer2.getText().equals(TextAnswer3.getText())) {\r\n errorMsg += \"You can not have multiple times the same answer !!!\\n\";\r\n return false;\r\n }\r\n\r\n if(CorrectAnswer.getText().equals(TextAnswer1.getText())\r\n || CorrectAnswer.getText().equals(TextAnswer2.getText())\r\n || CorrectAnswer.getText().equals(TextAnswer3.getText()))\r\n return true;\r\n\r\n errorMsg += \"There must be a Correct Answer !\\n\";\r\n return false;\r\n\r\n // case ShortAnswer : if there is an answer it is good\r\n default:\r\n return true;\r\n }\r\n }\r\n }",
"public void q3Submit(View view) {\n\n RadioButton radioButton = (RadioButton) findViewById(R.id.q3option1);\n\n //Nested if statements to check if the answer is correct or not, then to assign 2 points if it's correct.\n if (radioButton.isChecked()) {\n if (isNotAnsweredQ3) {\n display(pointCounter += 2);\n Toast.makeText(this, getString(R.string.correct2), Toast.LENGTH_SHORT).show();\n isNotAnsweredQ3 = false;\n }\n } else {\n Toast.makeText(this, getString(R.string.thinkAgain), Toast.LENGTH_SHORT).show();\n }\n }",
"private Answer generateAnswer(int numberOfPossibleAnswers, int numberOfCorrectAnswers) {\n\t\tAnswer answer = new Answer();\n\t\t//check to make sure that an impossible value cannot be passed\n\t\tif(numberOfPossibleAnswers > 9) {\n\t\t\tnumberOfPossibleAnswers = 9;\n\t\t}\n\t\t//check to make sure that an impossible value cannot be passed\n\t\tif(numberOfCorrectAnswers > 9) {\n\t\t\tnumberOfCorrectAnswers = 9;\n\t\t}\n\t\tRandom random = new Random();\n\t\t//if the question can only have one correct answer the student will only choose one answer at random\n\t\tif(numberOfCorrectAnswers == 1) {\n\t\t\tanswer.setAnswer(random.nextInt(numberOfPossibleAnswers));\n\t\t}\n\t\telse if(numberOfCorrectAnswers > 1) {\n\t\t\t//randomly chooses how many answers to give for the question\n\t\t\tint numberOfAnswers = random.nextInt(numberOfPossibleAnswers) + 1;\n\t\t\t//chooses at random which answers to choose\n\t\t\tfor(int i = 0; i < numberOfAnswers; i++) { \n\t\t\t\tint answerId = random.nextInt(numberOfPossibleAnswers);\n\t\t\t\t//if the answer has already been given by the student, the student will choose \n\t\t\t\t//another random answer until it has not already been chosen\n\t\t\t\twhile(answer.getAnswer(answerId)) {\n\t\t\t\t\tanswerId = random.nextInt(numberOfPossibleAnswers);\n\t\t\t\t}\n\t\t\t\tanswer.setAnswer(answerId);\n\t\t\t}\n\t\t}\n\t\treturn answer;\n\t}",
"public String quizResponse(Boolean isCorrect, String answer) {\n if (isCorrect) {\n return (\"Yes!! The correct answer is \\\"\" + answer + \"\\\".\\n\");\n } else {\n return (\"Sorry, The answer is \\\"\" + answer + \"\\\".\\n\");\n }\n }"
] | [
"0.7193753",
"0.6483561",
"0.6297395",
"0.6273104",
"0.6217082",
"0.6216508",
"0.6081003",
"0.6079308",
"0.60337293",
"0.5994447",
"0.5930246",
"0.5927284",
"0.5923451",
"0.5851789",
"0.5849765",
"0.58410025",
"0.5840373",
"0.5799988",
"0.5778149",
"0.577394",
"0.5752287",
"0.5746129",
"0.5742987",
"0.5737368",
"0.5723598",
"0.570639",
"0.56799775",
"0.56768286",
"0.5672797",
"0.56530726",
"0.5638804",
"0.56328315",
"0.56147957",
"0.55822897",
"0.5581041",
"0.55684257",
"0.55667704",
"0.55658615",
"0.55493677",
"0.5541971",
"0.5541061",
"0.5534827",
"0.55341923",
"0.55332947",
"0.553298",
"0.5509615",
"0.5508716",
"0.5507563",
"0.5505342",
"0.5503249",
"0.5493751",
"0.54916865",
"0.5489396",
"0.54737747",
"0.54694015",
"0.54667693",
"0.545984",
"0.5458957",
"0.5448213",
"0.5442605",
"0.54386",
"0.5434678",
"0.54345655",
"0.54063857",
"0.54007685",
"0.5386087",
"0.53855777",
"0.5383288",
"0.5382551",
"0.53787696",
"0.53756976",
"0.53730255",
"0.537283",
"0.5370195",
"0.5363026",
"0.53630143",
"0.5361967",
"0.53618026",
"0.5353408",
"0.5352455",
"0.5351443",
"0.5347894",
"0.5340929",
"0.53375614",
"0.5336226",
"0.53334606",
"0.53319734",
"0.53306854",
"0.5327635",
"0.53238267",
"0.5321052",
"0.53126884",
"0.53120935",
"0.5310167",
"0.53007686",
"0.5300417",
"0.5298079",
"0.52976364",
"0.5289744",
"0.5277107"
] | 0.5967078 | 10 |
Display the correct answer of a T/F question | public void display() {
io.writeLine("The correct answer is " + rightAnswers.get(0));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"java.lang.String getCorrectAnswer();",
"public void showQuestion()\n\t{\n\t\tSystem.out.println(ans);\n\t\tfor(int k = 0; k<numAns; k++)\n\t\t{\n\t\t\tSystem.out.println(k+\". \"+answers[k]);\n\t\t}\n\t}",
"public void quiz() {\n\t\t\t\t\tcorrectans = 0;\n\t\t\t\t\tint k = 0;\n\t\t\t\t\tint j = 0;\n\t\t\t\t\tint M = 0;\n\t\t\t\t\tj = readDifficulty();\n\t\t\t\t\tM = readProblemType();\n\t\t\t\t\t//ask the student to solve 10 different problems, as determined by the problem type\n\t\t\t for(int i = 0; i < 10; i++ ) {\n\t\t\t \t//contain two numbers sampled from a uniform random distribution with bounds determined by the problem difficulty\n\t\t\t \tint x = rand.nextInt(j); \n\t\t\t\t int y = rand.nextInt(j);\n\t\t\t\t int O = askquestion(j, M,x,y);\n\t\t\t\t if(M == 4) {\n\t\t\t\t \t float floatans = readdivision();\n\t\t\t\t \tk = divisionsol(floatans, x, y);\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t int userin = readResponse();\n\t\t\t k = isnanswercorrect(O , userin);\n\t\t\t }\n\t\t\t if(k == 1) {\n\t\t\t \t correctans++;\n\t\t\t }\n\t\t\t }\n\t\t\t int L = 0;\n\t\t\t L = displayCompletionMessage(correctans);\n\t\t\t if ( L == 1) {\n\t\t\t \tquiz();\n\t\t\t }\n\t\t\t else {\n\t\t\t \treturn;\n\t\t\t }\n\t\t\t \n\t\t\t\t}",
"boolean hasCorrectAnswer();",
"private void printAnswerResults(){\n\t\tSystem.out.print(\"\\nCorrect Answer Set: \" + q.getCorrectAnswers().toString());\n\t\tSystem.out.print(\"\\nCorrect Answers: \"+correctAnswers+\n\t\t\t\t\t\t \"\\nWrong Answers: \"+wrongAnswers);\n\t}",
"public void displayCorrect(){\n textPane1.setText(\"\");\r\n generatePlayerName();\r\n textPane1.setText(\"GOOD JOB! That was the correct answer.\\n\"\r\n + atBatPlayer + \" got a hit!\\n\" +\r\n \"Press Next Question, or hit ENTER, to continue.\");\r\n SWINGButton.setText(\"Next Question\");\r\n formattedTextField1.setText(\"\");\r\n formattedTextField1.setText(\"Score: \" + score);\r\n }",
"int getWrongAnswers();",
"private void checkAnswer()\r\n\t{\r\n\t\t//Submission to the model and getting 'true' if correct and 'false' otherwise\r\n\t\tboolean response = quizModel.isCorrect(group.getSelection().getActionCommand());\r\n\t\t\r\n\t\t//Updating score label based on result\r\n\t\tif (response == true)\r\n\t\t{\r\n\t\t\tscoreLabel.setText(\"<html><div style='text-align: center;'>\" + \"Score = \" + quizModel.getScore() + \"<br>Correct answer!\" + \"</div></html>\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tscoreLabel.setText(\"<html><div style='text-align: center;'>\" + \"Score = \" + quizModel.getScore() + \"<br>Incorrect answer!\" + \"</div></html>\");\r\n\t\t}\r\n\t}",
"@Override\r\n public void display() {\n super.display();\r\n System.out.println(\"You can choose one of the correct answers!\");\r\n }",
"public static void main(){\n \n \n String question = \"There are 10 types of people in this world, those who understand binary and those who don't.\";\n String answer = \"true\";\n \n Question tfQuest = new Question (question, answer);\n tfQuest.getAnswer();\n \n }",
"public static void displayQuestions() {\n System.out.println(\"1. Is your character male?\");\n System.out.println(\"2. Is your character female?\");\n System.out.println(\"3. Does your character have brown hair?\");\n System.out.println(\"4. Does your character have red hair?\");\n System.out.println(\"5. Does your character have blonde hair?\");\n System.out.println(\"6. Does your character have green eyes?\");\n System.out.println(\"7. Does your character have blue eyes?\");\n System.out.println(\"8. Does your character have brown eyes?\");\n System.out.println(\"9. Is your character wearing a green shirt?\");\n System.out.println(\"10. Is your character wearing a blue shirt?\");\n System.out.println(\"11. Is your character wearing a red shirt?\");\n }",
"public void feedback(boolean isCorrect, VocabularyQuiz question) {\n String correctMeaning = question.getSelections().get(question.getAnswer());\n String message;\n if (isCorrect) {\n message = \"Correct!\";\n totalCorrect++;\n } else {\n message = \"Incorrect! The answer is \" + correctMeaning;\n }\n JOptionPane.showMessageDialog(gui.getFrame(), message);\n }",
"@Override\r\n\tpublic void checkAnswer() {\n\t\t\r\n\t}",
"boolean getCorrect();",
"private void verifyQuestion(Answer answer) {\n // If is running, stop the question timer\n //(Hard mode)\n timerQuestion.stop();\n \n //if (challengeModel.getChallenge().getCurrentCorrectAnswer()) {\n if (challengeModel.getChallenge().getQuestionsList().get(challengeModel.getChallenge().getCurrentQuestionNumber()-1).getAnswer() == answer) {\n imgCenter.setIcon(Resources.getImageCorrect());\n labelAnswerResult.setText(\"Correto \");\n labelClarification.setText(\"\");\n }\n else {\n imgCenter.setIcon(Resources.getImageIncorrect());\n // Show clarification\n labelAnswerResult.setText(\"\");\n labelClarification.setText(\"<HTML><B>Esclarecimento: </B>\"+challengeModel.getChallenge().getCurrentRuleClarification()+\"</HTML>\");\n }\n \n showAnswerResult(answer);\n }",
"String answerStatement(boolean answer) {\n String answerStatement = getResources().getString(R.string.wrong);\n if (answer) {\n answerStatement = getResources().getString(R.string.correct);\n }\n return answerStatement;\n }",
"@FXML\n\tprivate void answerQuestion() {\n\t\tint correctAnsID = 0;\n\t\ttry {\n\t\t\tswitch (((RadioButton) answerGroup.getSelectedToggle()).getId()) {\n\t\t\tcase \"ans1Check\":\n\t\t\t\tcorrectAnsID = 1;\n\t\t\t\tbreak;\n\t\t\tcase \"ans2Check\":\n\t\t\t\tcorrectAnsID = 2;\n\t\t\t\tbreak;\n\t\t\tcase \"ans3Check\":\n\t\t\t\tcorrectAnsID = 3;\n\t\t\t\tbreak;\n\t\t\tcase \"ans4Check\":\n\t\t\t\tcorrectAnsID = 4;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\terrorLabel.setVisible(true);\n\t\t}\n\n\t\t// nothing is selected\n\t\tif (correctAnsID == 0) { \n\t\t\terrorLabel.setVisible(true);\n\t\t\t// correct answer\n\t\t} else if (question.getCorrect_ans() == correctAnsID) {\n\t\t\tcontrol.setScore(control.getScore() + question.getScore());\n\t\t\thandleAlertAndWindow(AlertType.INFORMATION, \"Congrats! :D\",\n\t\t\t\t\t\"You received \" + question.getScore() + \" points\");\n\t\t\t// wrong answer\n\t\t} else {\n\t\t\tcontrol.setScore(control.getScore() + question.getPenalty());\n\n\t\t\thandleAlertAndWindow(AlertType.ERROR, \"Uh oh! :(\",\n\t\t\t\t\t\"You lost \" + question.getPenalty() + \" points\");\n\t\t}\n\n\t\t// reset the eaten question\n\t\tViewLogic.playGameController.getControl().setQuestionEaten(null);\n\t}",
"public void verifyAnswer() {\n\t\tint i=0;\n\t\tSystem.out.println(\"in verify answer function\");\n\t\tSystem.out.println(\"Number of Answers: \"+ansCount);\n\t\tSystem.out.println(\"User ans: \"+userEquation);\n\t\tif (ansCount==0)\n\t\t\tlb2.setText(\"There is no solution for this set\");\n\t\telse{\n\t\t\tint c=0;\n\t\t\t\n\t\t\twhile(c<ansCount) {\n\t\t\t\tif (solutions[i].equals(userEquation)) {\n\t\t\t\t\tSystem.out.println(\"Ans was Correct\");\n\t\t\t\t\tfinal long duration = System.nanoTime() - startTime;\n\t\t\t\t\tseconds = TimeUnit.NANOSECONDS.toSeconds(duration);\n\t\t\t\t\tlb2.setText(\"Congradulations! You took \"+seconds+\" seconds to find an answer.\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t\tc++;\n\t\t\t\tSystem.out.println(\"C: \"+c);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"Ans was not Correct\");\n\t}\n\t}",
"private void showResults() {\n if (!sent) {\n if(checkAnswerOne()) {\n nbOfCorrectAnswers++;\n }\n if(checkAnswerTwo()) {\n nbOfCorrectAnswers++;\n }\n if(checkAnswerThree()) {\n nbOfCorrectAnswers++;\n }\n if(checkAnswerFour()) {\n nbOfCorrectAnswers++;\n }\n\n showResultAsToast(nbOfCorrectAnswers);\n\n } else {\n showResultAsToast(nbOfCorrectAnswers);\n }\n }",
"public void displayAnswer(){\r\n String message = \"That is the correct answer!\";\r\n\r\n Toast.makeText(QuizActivity.this,\r\n message, Toast.LENGTH_SHORT).show();\r\n }",
"public void printQuestion() {\n\t\tSystem.out.println(question);\n\t}",
"public String printOutQuestion()\n\t{\n\t\tRandom rand = new Random();\n\t\tString[] answers = new String[4];\n\t\tString returnString;\n\t\tanswers[0] = answer;\n\t\tanswers[1] = falseAnswers[0];\n\t\tanswers[2] = falseAnswers[1];\n\t\tanswers[3] = falseAnswers[2];\n\t\tString firstAns = \"\", secondAns = \"\", thirdAns = \"\", fourthAns = \"\";\n\t\t\n\t\twhile(firstAns == secondAns || firstAns == thirdAns || firstAns == fourthAns || secondAns == thirdAns || secondAns == fourthAns || thirdAns == fourthAns)\n\t\t{\n\t\t\tfirstAns = answers[rand.nextInt(4)];\n\t\t//\tSystem.out.println(firstAns); Used for debugging\n\t\t\tsecondAns = answers[rand.nextInt(4)];\n\t\t//\tSystem.out.println(secondAns); Used for debugging\n\t\t\tthirdAns = answers[rand.nextInt(4)];\n\t\t//\tSystem.out.println(thirdAns); Used for debugging\n\t\t\tfourthAns = answers[rand.nextInt(4)];\n\t\t//\tSystem.out.println(fourthAns); Used for debugging\n\t\t}\n\t\t\n\t\tanswerA = firstAns;\n\t\tanswerB = secondAns;\n\t\tanswerC = thirdAns;\n\t\tanswerD = fourthAns;\n\t\t//System.out.println(questionString + \"Answer A: \" + firstAns + \"Answer B: \" + secondAns + \"Answer C: \" + thirdAns + \"Answer D: \" + fourthAns); Used for debugging\n\t\treturnString = questionString + \"?\"; \n\t\tSystem.out.println(\"Actual Answer is: \" + answer);\n\t\treturn returnString;\n\t}",
"protected abstract String answer();",
"public void q1Submit(View view) {\n\n EditText editText = (EditText) findViewById(R.id.q1enterEditText);\n String q1answer = editText.getText().toString().trim();\n\n //Nested if statements to check if the answer is correct or not, then to assign 2 points if it's correct.\n if ((q1answer.toLowerCase().equals(getString(R.string.q1AnswerCheck1))) || (q1answer.toLowerCase().equals(getString(R.string.q1AnswerCheck2)))) {\n if (isNotAnsweredQ1) {\n display(pointCounter += 2);\n Toast.makeText(this, getString(R.string.correct1), Toast.LENGTH_SHORT).show();\n isNotAnsweredQ1 = false;\n }\n } else {\n Toast.makeText(this, getString(R.string.thinkAgain), Toast.LENGTH_SHORT).show();\n }\n }",
"@Override\n\tpublic Boolean isCorrect(){\n\t\t\n\t\tif (super.question instanceof TfQuestion){\n\t\t\tif(this.answer.equals(super.question.getAnswer())){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"private void detectCorrectAnswer() {\n switch (chapterSection) {\n case 5:\n if (typedAnswer.toString().toLowerCase().contentEquals(\"baybayin\")) {\n ansCorrect = true;\n }\n break;\n case 6:\n if (typedAnswer.toString().toLowerCase().contentEquals(\"kabundukan\")) {\n ansCorrect = true;\n }\n break;\n case 7:\n if (typedAnswer.toString().toLowerCase().contentEquals(\"lungsod\")) {\n ansCorrect = true;\n }\n break;\n case 8:\n if (typedAnswer.toString().toLowerCase().contentEquals(\"kabukiran\")) {\n ansCorrect = true;\n }\n break;\n }\n }",
"public void checkAnswer() {\n }",
"static void askQuestion() {\n\t\t// Setting up a Scanner to get user input\n\t\tScanner userInput = new Scanner(System.in);\n\n\t\t// Declaring variables\n\t\tdouble num1, num2, answer, userAnswer;\n\n\t\t// GENERATING QUESTION\n\n\t\t// Getting two new random numbers, rounded to one decimal place (with numbers generation from 0 to 50)\n\t\tnum1 = Math.round((Math.random() * 50)*10.0)/10.0;\n\t\tnum2 = Math.round((Math.random() * 50)*10.0)/10.0;\n\n\t\t// Generating a random number between 1 and 4 to randomize the math operation. A switch case is used to calculate the answer based on the math operation that gets generated.\n\t\tswitch ((int) Math.round(Math.random() * 3 + 1)) {\n\t\t\tcase 1: // Similar structure for each case (and the default case), structured as follows\n\t\t\t\tSystem.out.print(num1 + \" + \" + num2 + \" = \"); // Printing the question (based on the generated operation)\n\t\t\t\tanswer = num1 + num2; // Calculating the answer (based on the generated operation)\n\t\t\t\tbreak; // Exit the switch statement\n\t\t\tcase 2:\n\t\t\t\tSystem.out.print(num1 + \" - \" + num2 + \" = \");\n\t\t\t\tanswer = num1 - num2;\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tSystem.out.print(num1 + \" / \" + num2 + \" = \");\n\t\t\t\tanswer = num1 / num2;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tSystem.out.print(num1 + \" * \" + num2 + \" = \");\n\t\t\t\tanswer = num1 * num2;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tanswer = Math.round(answer * 10.0) / 10.0; // Rounding the answer to one decimal place\n\t\tuserAnswer = userInput.nextDouble(); // Getting the user's answer\n\n\t\tif (answer == userAnswer) System.out.println(\"That's right. Good Job!\\n\"); // If the answers match, the user is correct and the staetment is printed accordingly.\n\t\telse System.out.println(\"Incorrect. The correct answer was \" + answer + \".\\n\"); // Otherwise, show that the user's answer is incorrect and output an according statement.\n\t}",
"private void showResultAsToast(int nbOfCorrectAnswers) {\n String msg = \"\";\n\n if(nbOfCorrectAnswers == 4) {\n msg = \"Genius ! LOL !! \" + nbOfCorrectAnswers + \"/4\";\n } else if (nbOfCorrectAnswers < 4) {\n msg = \"You can do better than this! \" + nbOfCorrectAnswers + \"/4\";\n }\n\n // The Toast method helps to show a message that shows the number of correct answers\n Toast.makeText(this, msg, Toast.LENGTH_LONG).show();\n }",
"public void checkAnswer(){\n int selectedRadioButtonId = radioTermGroup.getCheckedRadioButtonId();\n\n // find the radiobutton by returned id\n RadioButton radioSelected = findViewById(selectedRadioButtonId);\n\n String term = radioSelected.getText().toString();\n String definition = tvDefinition.getText().toString();\n\n if (Objects.equals(termsAndDefinitionsHashMap.get(term), definition)) {\n correctAnswers += 1;\n Toast.makeText(ActivityQuiz.this, \"Correct\", Toast.LENGTH_SHORT).show();\n }\n else {\n Toast.makeText(ActivityQuiz.this, \"Incorrect\", Toast.LENGTH_SHORT).show();\n }\n\n tvCorrectAnswer.setText(String.format(\"%s\", correctAnswers));\n }",
"public String checkNewQuestions() {\n\t\tint numAnswers = testGenerator.getNumAnswers(questionNo);\n\t\tString question = \"\";\n\n\t\tquestion += testGenerator.getQuestionText(questionNo);\n\t\tquestion += testGenerator.getAnswerText(questionNo, 1);\n\t\tquestion += testGenerator.getAnswerText(questionNo, 2);\n\n\t\tif(numAnswers >= 3) {\n\t\t\tquestion += testGenerator.getAnswerText(questionNo, 3);\n\t\t} \n\t\tif(numAnswers == 4) {\n\t\t\tquestion += testGenerator.getAnswerText(questionNo, 4);\n\t\t}\n\t\treturn question;\n\t}",
"public void showResult(boolean isCorrect, String answer){\n if(isCorrect){\n mResultText.setText(\"CORRECT!\");\n mResultText.setTextColor(getResources().getColor(android.R.color.holo_green_light));\n } else {\n mResultText.setText(\"WRONG!\");\n mResultText.setTextColor(getResources().getColor(android.R.color.holo_red_light));\n mCorrectAnswerText.setText(\"Correct answer is \"+ answer);\n }\n }",
"public int get_correctAnswer(){return this._correctAnswer;}",
"@UiThread\n public void showCorrectAnswer(@NonNull final TextQuestionHolder holder) {\n //format the correct answer to be displayable, and display it\n String correctText = correctAnswers.get(0);\n correctText = correctText.replace(\"[s]\", \" \");\n TextView possibleSolutionView = holder.possibleSolutionLayout.findViewById(R.id.possibleSolutionTextView);\n possibleSolutionView.setText(correctText);\n\n final Context context = holder.answerEditText.getContext();\n if(ThemeUtils.isDarkTheme()) { //recolor text on dark theme for better visibility\n holder.answerDisplayer.setTextColor(ContextCompat.getColor(context, android.R.color.black));\n }\n holder.answerDisplayer.setText(holder.answerEditText.getText());\n holder.answerDisplayer.setVisibility(View.VISIBLE);\n holder.answerEditText.setVisibility(View.GONE);\n if(isCorrect()) {\n holder.questionIcon.setImageResource(R.drawable.tick_icon);\n holder.answerDisplayer.setBackgroundResource(R.drawable.correct_answer_background);\n holder.answerDisplayer.setTag(R.drawable.correct_answer_background); //tag is used in testing\n } else {\n if(!isAnswered()) holder.answerDisplayer.setText(context.getString(R.string.no_answer_given));\n holder.questionIcon.setImageResource(R.drawable.problem_icon);\n holder.answerDisplayer.setBackgroundResource(R.drawable.incorrect_background);\n holder.answerDisplayer.setTag(R.drawable.incorrect_background); //tag is used in testing\n holder.possibleSolutionLayout.setVisibility(View.VISIBLE);\n }\n }",
"public void checkAnswer(View view) {\n TextView tv=findViewById(R.id.question);\n String question=tv.getText().toString();\n\n //split the question into numbers\n String [] numbers=question.split(\"X\");\n\n\n //convert the numbers into integer\n Integer num1, num2;\n num1=Integer.valueOf(numbers[0]);\n num2=Integer.valueOf(numbers[1]);\n\n\n user=findViewById(R.id.printAns);\n ans=findViewById(R.id.answer);\n Integer uer=Integer.parseInt(ans.getText().toString());\n\n\n\n int total=uer;\n\n\n if (num1*num2==total){\n user.setText(\"Your answer is correct\");\n\n }else{\n user.setText(\"Try Again\");\n }\n\n\n\n }",
"boolean hasCorrect();",
"public String getAnswer() {\n return answer;\n }",
"private void printResults() {\n\t\tdouble percentCorrect = (double)(correctAnswers/numberAmt) * 100;\n\t\tSystem.out.println(\"Amount of number memorized: \" + numberAmt +\n\t\t\t\t \"\\n\" + \"Amount correctly answered: \" + correctAnswers +\n\t\t\t\t \"\\n\" + \"Percent correct: \" + (int)percentCorrect);\n\t}",
"public void q6Submit(View view) {\n\n RadioButton radioButton = (RadioButton) findViewById(R.id.q6option1);\n\n //Nested if statements to check if the answer is correct or not, then to assign 2 points if it's correct.\n if (radioButton.isChecked()) {\n if (isNotAnsweredQ6) {\n display(pointCounter += 2);\n Toast.makeText(this, getString(R.string.correct2), Toast.LENGTH_SHORT).show();\n isNotAnsweredQ6 = false;\n }\n } else {\n Toast.makeText(this, getString(R.string.thinkAgain), Toast.LENGTH_SHORT).show();\n }\n }",
"public void Correct(View view) {\n\n TextView textview = (TextView) findViewById(R.id.textViewer);\n CharSequence text = textview.getText();\n String temp = text.toString(); //extracting the number from question string\n String[] s = temp.split(\" \");\n String n = s[0];\n int prime = Integer.parseInt(n);\n\n Context context = getApplicationContext();\n\n int i, flag = 0;\n if (prime == 1) {\n flag = 1;\n }\n for (i = 2; i <= prime / 2; ++i) {\n // condition for nonprime number\n if (prime % i == 0) {\n flag = 1;\n break;\n }\n }\n\n if(flag==0 && pressed>=1 && clicked>=1)\n {\n Toast.makeText(context, \"Correct but you have taken hint and cheated\", Toast.LENGTH_SHORT).show();\n }\n else if (flag == 0 && pressed>=1) {\n\n Toast.makeText(context, \"Correct but you have taken hint\", Toast.LENGTH_SHORT).show();\n }\n\n else if(flag==0 && clicked>=1)\n {\n Toast.makeText(context, \"Correct but you have cheated\", Toast.LENGTH_SHORT).show();\n }\n else if(flag==0)\n {\n Toast.makeText(context, \"Correct\", Toast.LENGTH_SHORT).show();\n }\n\n else if(flag==1 && clicked>=1 && pressed>=1)\n {\n Toast.makeText(context, \" Not Correct but you have taken hint and cheated\", Toast.LENGTH_SHORT).show();\n }\n\n else if (flag == 1 && pressed>=1) {\n\n Toast.makeText(context, \" Not Correct but you have taken hint\", Toast.LENGTH_SHORT).show();\n }\n\n else if(flag==1 && clicked>=1)\n {\n Toast.makeText(context, \" Not Correct but you have cheated\", Toast.LENGTH_SHORT).show();\n }\n\n\n else if(flag==1)\n {\n Toast.makeText(context, \" Not Correct\", Toast.LENGTH_SHORT).show();\n }\n }",
"@Override\n\t public String solve() {\n\t if (count == 0) {\n\t answer1 = getVariable2()*getVariable3();\n\t setAnswer(answer1 + \"\");\n\t } else if (count == 1) {\n\t answer1 = getVariable1()/getVariable2();\n\t setAnswer(answer1 + \"\");\n\t }else if (count == 2) {\n\t answer1 = getVariable1()/getVariable3();\n\t setAnswer(answer1 + \"\");\n\t }\n\t return getAnswer();\n\t }",
"public void chooseAnswer(View view)\n {\n\n if(view.getTag().toString().equals(Integer.toString(pos_of_correct)))\n {\n //Log.i(\"Result\",\"Correct Answer\");\n correct++;\n noOfQues++;\n correct();\n }\n else\n {\n //Log.i(\"Result\",\"Incorrect Answer\");\n //resluttextview.setText(\"Incorrect!\");\n incorrect();\n noOfQues++;\n }\n pointtextView.setText(Integer.toString(correct)+\"/\"+Integer.toString(noOfQues));\n if(tag==4)\n generateAdditionQuestion();\n if(tag==5)\n generateSubtractionQuestion();\n if(tag==6)\n generateMultiplicationQuestion();\n if(tag==7)\n generateDivisionQuestion();\n\n }",
"@Override\n\tpublic void solve(String result) {\n\t\tSystem.out.println(\"你告诉我的答案是--->\"+result); \n\t}",
"public void checkCorrect() {\n\t\t \n\t\t if(rb1.isSelected()) {\n\t\t\t if(rb1.getText() == answer) {\n\t\t\t\t showCorrectDialog();\n\t\t\t }\n\t\t\t else\n\t\t\t\t showIncorrectDialog();\n\t\t }\n\t\t else if(rb2.isSelected()) {\n\t\t\t if(rb2.getText() == answer) {\n\t\t\t\t showCorrectDialog();\n\t\t\t }\n\t\t\t else\n\t\t\t\t showIncorrectDialog();\n\t\t }\n\t\t else if(rb3.isSelected()) {\n\t\t\t if(rb3.getText() == answer) {\n\t\t\t\t showCorrectDialog();\n\t\t\t }\n\t\t\t else\n\t\t\t\t showIncorrectDialog();\n\t\t }\n\t\t else if(rb4.isSelected()) {\n\t\t\t if(rb4.getText() == answer) {\n\t\t\t\t showCorrectDialog();\n\t\t\t }\n\t\t\t else\n\t\t\t\t showIncorrectDialog();\n\t\t }\n\t }",
"public String getCorrect() {\n\t\treturn new String(correctAnswer);\n\t}",
"public void q3Submit(View view) {\n\n RadioButton radioButton = (RadioButton) findViewById(R.id.q3option1);\n\n //Nested if statements to check if the answer is correct or not, then to assign 2 points if it's correct.\n if (radioButton.isChecked()) {\n if (isNotAnsweredQ3) {\n display(pointCounter += 2);\n Toast.makeText(this, getString(R.string.correct2), Toast.LENGTH_SHORT).show();\n isNotAnsweredQ3 = false;\n }\n } else {\n Toast.makeText(this, getString(R.string.thinkAgain), Toast.LENGTH_SHORT).show();\n }\n }",
"public void q5Submit(View view) {\n\n RadioButton radioButton = (RadioButton) findViewById(R.id.q5option3);\n\n //Nested if statements to check if the answer is correct or not, then to assign 2 points if it's correct.\n if (radioButton.isChecked()) {\n if (isNotAnsweredQ5) {\n display(pointCounter += 2);\n Toast.makeText(this, getString(R.string.correct2), Toast.LENGTH_SHORT).show();\n isNotAnsweredQ5 = false;\n }\n } else {\n Toast.makeText(this, getString(R.string.thinkAgain), Toast.LENGTH_SHORT).show();\n }\n }",
"public java.lang.String getCorrectAnswer() {\n java.lang.Object ref = correctAnswer_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n correctAnswer_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"private void displayQuestion(Question question) {\n String query = question.getQuery();\n TextView queryTextView = getTextViewById(\"quiz_query\");\n queryTextView.setText(query);\n\n //Setting text for quiz options\n Iterator<String> options = question.getOptions().iterator();\n RadioButton A = getRadioButtonById(\"optionA\");\n RadioButton B = getRadioButtonById(\"optionB\");\n RadioButton C = getRadioButtonById(\"optionC\");\n RadioButton D = getRadioButtonById(\"optionD\");\n A.setText(options.next());\n B.setText(options.next());\n C.setText(options.next());\n D.setText(options.next());\n }",
"@Test\r\n public void MathQuestionCorrect()\r\n {\r\n var answerInput = 8;\r\n var questionInput = \"4 + 4\";\r\n\r\n var responseAnswer = 8;\r\n var expectedText = \"What is 4 + 4?\\n8 is correct!\\n\\r\\n\";\r\n\r\n var testOutputByteArray = new ByteArrayOutputStream();\r\n var testOutputStream = new PrintStream(testOutputByteArray );\r\n\r\n // Check math question logic\r\n var mathQuestionAdd = new MathQuestion(answerInput, questionInput, testOutputStream);\r\n mathQuestionAdd.showQuestion();\r\n assertTrue(mathQuestionAdd.checkAnswer(responseAnswer));\r\n\r\n // Check math question console outputs\r\n var content = testOutputByteArray.toString();\r\n assertEquals(content,expectedText);\r\n }",
"public void q7Submit(View view) {\n\n RadioButton radioButton = (RadioButton) findViewById(R.id.q7option4);\n\n //Nested if statements to check if the answer is correct or not, then to assign 2 points if it's correct.\n if (radioButton.isChecked()) {\n if (isNotAnsweredQ7) {\n display(pointCounter += 2);\n Toast.makeText(this, getString(R.string.correct1), Toast.LENGTH_SHORT).show();\n isNotAnsweredQ7 = false;\n }\n } else {\n Toast.makeText(this, getString(R.string.thinkAgain), Toast.LENGTH_SHORT).show();\n }\n }",
"public String quizResponse(Boolean isCorrect, String answer) {\n if (isCorrect) {\n return (\"Yes!! The correct answer is \\\"\" + answer + \"\\\".\\n\");\n } else {\n return (\"Sorry, The answer is \\\"\" + answer + \"\\\".\\n\");\n }\n }",
"public void correctAnswer(){\n AlertDialog.Builder dialogBoxAns = new AlertDialog.Builder(this);\n //set title to dialog box\n dialogBoxAns.setTitle(\"Results\");\n //set correct message to dialog box\n dialogBoxAns.setMessage((Html.fromHtml(\"<font color='#39FF14'> CORRECT! </font> \")));\n //set button to dialog box\n dialogBoxAns.setPositiveButton(\"OK\", null);\n //create new dialog box\n AlertDialog dialog = dialogBoxAns.create();\n dialog.show();\n }",
"public void displayInorrectResponse(int x) {\n\t\t\t\t\tswitch (x) {\n\t\t case 1: System.out.println(\"No. Please try again.\");;\n\t\t break;\n\t\t case 2: System.out.println(\"Wrong. Try once more.\");;\n\t\t break;\n\t\t case 3: System.out.println(\"Donít give up!\");\n\t\t break;\n\t\t case 0: System.out.println(\"No. Keep trying.\");\n\t\t break;\n\t\t\t\t}}",
"public int displayCompletionMessage(int correctans) {\n\t\t\t\t\tcorrectans = ((correctans * 100) / 10);\n\t\t\t\t\tSystem.out.println(\"Your score is \"+ correctans);\n\t\t\t\t\t//display the message \"Congratulations, you are ready to go to the next level!\" if the student's score is greater than or equal to 75%\n\t\t\t\t\tif(correctans >= 75) {\n\t\t\t\t\t\tSystem.out.println(\"Congratulations, you are ready to go to the next level!\");\n\t\t\t\t\t}\n\t\t\t\t\t// display the message \"Please ask your teacher for extra help.\" if the student's score is less than 75%\n\t\t\t\t\telse {\n\t\t\t\t\t\tSystem.out.println(\"Please ask your teacher for extra help.\");\n\t\t\t\t\t}\n\t\t\t\t\t//restart when the student agrees to solve a new problem set\n\t\t\t\t\t// shall terminate when the student declines to solve another problem set\n\t\t\t\t\tSystem.out.println(\"Want to solve a new problem set? 1 for yes/ 0 for no\");\n\t\t\t\t\t int counter = resp.nextInt();\n\t\t\t\t\t return counter;\n\t\t\t\t\t\n\t\t\t}",
"public static void resultOfPlayAllCorrect() {\n\t\tString mark=\"null\";\n\t\ttry {\n\t\t\tmark=PlayTrivia.playAllRightAnswers();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t} \n\t\tif(mark==\"Sucsses\") {\n\t\t\tSystem.out.println(\"Test end page has:\" + mark + \" Test pass\");\n\t\t}else{\n\t\t\tSystem.out.println(\"Test end page - failed\");\n\t\t}\n\t}",
"public abstract AnswerStatus checkAnswer(String answer) throws SyntaxException;",
"public boolean askQuestion(Question curentQuestion, int level) {\n this.level = level;\n System.out.println(\"Die \"+(1+level)*100+\" Euro Frage!\");\n System.out.println(curentQuestion.getQuestion());\n //Sets the position of the right answer so it will be random\n int positionCorrectAnswer = (int) (Math.random() * ((curentQuestion.getWrongAnswers().size()) + 1));\n curentQuestion.getWrongAnswers().add(positionCorrectAnswer, curentQuestion.getCorrectAnswer());\n for (int j = 0; j < curentQuestion.getWrongAnswers().size(); j++) {\n System.out.println(\"\\t\" + (1 + j) + \". \" + curentQuestion.getWrongAnswers().get(j));\n }\n int amountOfAnswers = curentQuestion.getWrongAnswers().size();\n if (joker) {\n System.out.println(\"\\t5. 50:50 Joker\");\n amountOfAnswers = 5;\n\n }\n return getUserInput(amountOfAnswers, positionCorrectAnswer, curentQuestion);\n\n }",
"public void q2Submit(View view) {\n\n RadioButton radioButton = (RadioButton) findViewById(R.id.q2option3);\n\n //Nested if statements to check if the answer is correct or not, then to assign 2 points if it's correct.\n if (radioButton.isChecked()) {\n if (isNotAnsweredQ2) {\n display(pointCounter += 2);\n Toast.makeText(this, getString(R.string.correct2), Toast.LENGTH_SHORT).show();\n isNotAnsweredQ2 = false;\n }\n } else {\n Toast.makeText(this, getString(R.string.thinkAgain), Toast.LENGTH_SHORT).show();\n }\n }",
"public void displayCorrectResponse(int x) {\n\t\t\t\t\tswitch (x) {\n\t\t case 1: System.out.println(\"Very Good!\");;\n\t\t break;\n\t\t case 2: System.out.println(\"Excellent!\");;\n\t\t break;\n\t\t case 3: System.out.println(\"Nice Work!\");;\n\t\t break;\n\t\t case 0: System.out.println(\"Keep up the good work!\");\n\t\t break;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t}",
"public static void printGameQuestion(String question) {\n final String label = \"Q: \";\n System.out.println(label + prettyPrintFormatter(question, label.length()));\n System.out.println(ENTER_ATTEMPT_LINE);\n printPrompt();\n }",
"public void showEquationAnswer(String answer, String note, boolean isCorrect) throws IOException{\n\t\tshowNextButton();\n\t\tshowAnswerIcon(isCorrect);\n\t\tif(note != null)\n\t\t\tshowAnswerNote(note, isCorrect);\n\t\t\n\t\tif(answer != null){\n\t\t\tFont font;\n\t\t\ttry {\n\t\t\t\tfont = FontMaker.getFont(PREFERRED_FONT, 24);\n\t\t\t} catch (IndexOutOfBoundsException | IOException | FontFormatException e) {\n\t\t\t\tfont = FontMaker.getDefaultFont(24);\n\t\t\t}\n\t\t\t\n\t\t\tJLabel answerLabel = new JLabel(\"<HTML>\" + answer + \"</HTML>\");\n\t\t\tanswerLabel.setFont(font);\n\t\t\t//Set the default text color depending on if the user was correct or not.\n\t\t\tif(isCorrect)\n\t\t\t\tanswerLabel.setForeground(Color.GREEN);\n\t\t\telse\n\t\t\t\tanswerLabel.setForeground(Color.RED);\n\t\t\t\n\t\t\t//Find answerText's coordinates.\n\t\t\tint textWidth = answerLabel.getPreferredSize().width;\n\t\t\tint textHeight = answerLabel.getPreferredSize().height;\n\t\t\t\n\t\t\tanswerText = new ContentPane(textWidth, textHeight, false, false);\n\t\t\t\n\t\t\t//If answerText wider than questionText, offset is negative; moves left.\n\t\t\t//If questionText wider than answerText, offset is positive; moves right.\n\t\t\tint answerXOffset = equationText.getWidth() - textWidth;\n\t\t\tint answerXOrigin = equationText.getX() + answerXOffset;\n\t\t\t\n\t\t\tint yPadding = 5;\n\t\t\tint answerYOrigin = lineY + yPadding;\n\t\t\t\n\t\t\tanswerText.addComponent(answerLabel, 0, 0);\n\t\t\tquestionBox.addComponent(answerText, answerXOrigin, answerYOrigin);\n\t\t}\n\t}",
"double scoreAnswer(Question question, Answer answer);",
"public void showCorrectAnswers() {\n holders.forEach(QuizViewHolder::showCorrectAnswer);\n }",
"public double testQuiz(Quiz quiz) {\n\t\t// System.out.println(\"Testing quiz: \" + quiz + \"\\n\" +\n\t\t// quiz.display() + \"\\nwith QuizTester: \" + id\n\t\t// + \" SearchString: \" + searchString);\n\t\tdouble score = 0;\n\t\tfor (Question question : quiz.getQuestionList()) {\n\t\t\tboolean guess = question.getPrompt().contains(searchString);\n\t\t\tif (question.isAnswer() == guess) {\n\t\t\t\t++score;\n\t\t\t}\n\t\t}\n\t\t// System.out.println(\"Completed testing quiz: \" + quiz + \"\\nFinal Score: \" +\n\t\t// score + \" / \" + quiz.getQuestionList().size() + \" AKA: \" + (score /\n\t\t// quiz.getQuestionList().size()) );\n\t\treturn score / quiz.getQuestionList().size();\n\t}",
"public java.lang.String getTestAnswer() {\r\n return testAnswer;\r\n }",
"private void setQuestion() {\n Question.setText(gen.getQuestion() + \"\\t\\tProblem # \" + currentQuestion + \"/\" + numQuestions);\n }",
"private void popupCorrection() {\n\t\tQuestionShortAnswer questionShortAnswer = DbTableQuestionShortAnswer.getShortAnswerQuestionWithId(currentQ.getId());\n\t\tString studentAnswer = textAnswer.getText().toString();\n\t\t//get the right answers\n\t\tArrayList<String> rightAnswers = questionShortAnswer.getAnswers();\n\n\t\t//compare the student answer with the right answers\n\t\tString correction = \"\";\n\t\tif (rightAnswers.contains(studentAnswer)) {\n\t\t\tcorrection = \"<font size='5' color='green'>Right :-)</font> <br/>\" + studentAnswer;\n\t\t} else {\n\t\t\tcorrection = studentAnswer + \"<br/><font size='5' color='red'>Unfortunately, this wasn't the right answer :-( </font>\";\n\t\t\tif (rightAnswers.size() == 0) {\n\t\t\t\tcorrection += \"The right answer was EMPTY ANSWER\";\n\t\t\t} else if (rightAnswers.size() == 1) {\n\t\t\t\tcorrection += \"The right answer was:<br/>\" + rightAnswers.get(0);\n\t\t\t} else {\n\t\t\t\tcorrection += \"The right answer was for example:<br/>\" + rightAnswers.get(0);\n\t\t\t}\n\t\t}\n\t\ttextAnswer.setText(Html.fromHtml(correction));\n\t}",
"@Override\n public void display()\n {\n // Display the question text\n super.display();\n int choiceNumber = 0;\n // Display the answer choices\n for (int i = 0; i < m_choices.size(); i++) {\n choiceNumber = i + 1;\n System.out.println(choiceNumber + \": \" + m_choices.get(i));\n }\n }",
"public void correctAnswer(View view) {\n\n // Update correct count\n deck.getCard(deckPos).setNumCorrect(deck.getCard(deckPos).getNumCorrect() + 1);\n\n // Update points\n float p = Float.valueOf(deck.getCard(deckPos).getRating()) * 10;\n quiz.setPoints((int) (quiz.getPoints() + p));\n points.setText(String.valueOf(quiz.getPoints()));\n\n // Set to question and update counter\n isQuestion = true;\n deckPos ++;\n\n // If not last card - Update card\n if(!(deckPos == deck.deckLength)) {\n displayCard(deck.getCard(deckPos), isQuestion);\n } else {\n finishQuiz();\n }\n\n // Set quiz counts\n quiz.setCorrectCount(quiz.getCorrectCount() + 1);\n }",
"public double getAnswer() {\n return answer;\n }",
"private void showCorrectAnswerDialogueBox() {\n\n\t\tupdateImageView(currentQuestionNumber);\n\n\t\t// check if all other questions are answered\n\t\tif (StoreAnalysisStateApplication.stageCleared) {\n\t\t\t// this call is specifically for updating fragment in description\n\t\t\t// tab\n\n\t\t\tString _title = getString(R.string.levelcleared);\n\t\t\tString _message = getString(R.string.analysislevelclearedmessage);\n\t\t\tUtilityMethods.createAlertDialog(_title, _message,\n\t\t\t\t\tAnalysisActivity.this);\n\n\t\t} else {\n\n\t\t\tString _title = getString(R.string.correctansweralertdialoguetitle);\n\t\t\tString _message = getString(R.string.correctansweralertdialoguemessage);\n\t\t\tUtilityMethods.createAlertDialog(_title, _message,\n\t\t\t\t\tAnalysisActivity.this);\n\t\t}\n\n\t\tdisableRadioOptions();\n\t}",
"private void determineButtonPress(boolean answer){\n boolean expectedAnswer = currentQuestion.isAnswer();\n String result;\n if (answer == expectedAnswer){\n result=\"Correct\";\n score++;\n txtScore.setText(\"Score: \" + score);\n } else {\n result=\"False\";\n }\n //call this function to display the result to the player\n answerResultAlert(result);\n\n }",
"public static void main(String[] args) {\n\t\t\tSystem.out.println(\"Question 1\");\r\n\t\t\tfloat a = 5240.5f;\r\n\t\t\tfloat b = 10970.055f;\r\n\t\t\tint x = (int) a;\r\n\t\t\tint y = (int) b;\r\n\t\t\tSystem.out.println(x);\r\n\t\t\tSystem.out.println(y + \"\\n\");\r\n\r\n\t\t\t// Question 2:\r\n\t\t\tSystem.out.println(\"Question 2\");\r\n\t\t\tint a1 = random.nextInt(100000);\r\n\t\t\tSystem.out.printf(\"%05d\", a1);\r\n\t\t\tSystem.out.println(\"\\n\");\r\n\r\n\t\t\t// Question 3:\r\n\t\t\tSystem.out.println(\"Question 3\");\r\n\t\t\tint b1 = a1 % 100;\r\n\t\t\tSystem.out.println(\"Hai số cuối của a1: \" + b1);\r\n\t\t\tSystem.out.println(\"\\n\");\r\n\r\n\t\t\tQuestion4();\r\n\r\n\t\t\tExercise2();\r\n\r\n\t\t\tSystem.out.println(\"\\n\");\r\n\r\n\t\t\t// Exercise 3:\r\n\t\t\tSystem.out.println(\"Exercise3\");\r\n\t\t\t// Question 1:\r\n\t\t\tSystem.out.println(\"Question 1:\");\r\n\t\t\tInteger salary = 5000;\r\n\t\t\tfloat salaryf = salary;\r\n\t\t\tSystem.out.printf(\"%.2f\", salaryf);\r\n\r\n\t\t\t// Question 2:\r\n\t\t\tSystem.out.println(\"Question 2:\");\r\n\t\t\tString value = \"1234567\";\r\n\t\t\tint a2 = Integer.parseInt(value);\r\n\t\t\tSystem.out.println(a2);\r\n\r\n\t\t\t// Question 3:\r\n\t\t\tSystem.out.println(\"Question 3:\");\r\n\t\t\tInteger value1 = 1234567;\r\n\t\t\tint a3 = value1.intValue();\r\n\t\t\tSystem.out.println(a3);\r\n\t\t\tSystem.out.println(\"\\n\");\r\n\r\n\t\t\t// Exercise 4:\r\n\t\t\tSystem.out.println(\"Exercise 4:\");\r\n\t\t\t// Question 1:\r\n\t\t\tSystem.out.println(\"Question 1\");\r\n\t\t\tSystem.out.println(\"Mời bạn nhập họ và tên: \");\r\n\t\t\tString nhapGiaTri1 = scanner.nextLine();\r\n\t\t\tString nhapGiaTri = scanner.nextLine();\r\n\t\t\tint count = 1;\r\n\t\t\tint j;\r\n\t\t\tfor (j = 0; j < nhapGiaTri.length(); j++) {\r\n\t\t\t\tif (nhapGiaTri.charAt(j) != ' ') {\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"Độ dài của chuỗi ký tự nhapGiaTri: \" + count);\r\n\t\t\tSystem.out.println(\"\\n\");\r\n\r\n\t\t\t// Question 2:\r\n\t\t\tSystem.out.println(\"Question 2\");\r\n\t\t\tSystem.out.println(\"Mời bạn nhập chuỗi ký tự 1: \");\r\n\t\t\tString s1 = scanner.next();\r\n\t\t\tSystem.out.println(\" \");\r\n\t\t\tSystem.out.println(\"Mời bạn nhập chuỗi ký tự 2: \");\r\n\t\t\tString s2 = scanner.next();\r\n\t\t\tSystem.out.println(\"Kết quả khi nối hai xâu kí tự s1 và s2: \" + s1 + s2);\r\n\t\t\tSystem.out.println(\"\\n\");\r\n\r\n\t\t\t// Question 3:\r\n\t\t\tSystem.out.println(\"Mời bạn nhập họ tên: \");\r\n\t\t\tString hoTen1 = scanner.nextLine();\r\n\t\t\tString hoTen2 = scanner.nextLine();\r\n\t\t\tString hoTen = hoTen2.substring(0, 1).toUpperCase() + hoTen2.substring(1);\r\n\t\t\tSystem.out.println(hoTen);\r\n\t\t\tSystem.out.println(\"\\n\");\r\n\r\n\t\t\t// question 4:\r\n\t\t\tString name;\r\n\t\t\tSystem.out.println(\"Nhập tên: \");\r\n\t\t\tname = scanner.nextLine();\r\n\t\t\tname = name.toUpperCase();\r\n\t\t\tfor (int i = 0; i < name.length(); i++) {\r\n\t\t\t\tSystem.out.println(\"Ký tự thứ \" + i + \" là: \" + name.charAt(i));\r\n\t\t\t}\r\n\r\n\t\t\t// question 5:;\r\n\t\t\tSystem.out.println(\"Nhập họ: \");\r\n\t\t\tString firstName = scanner.nextLine();\r\n\t\t\tSystem.out.println(\"Nhập tên: \");\r\n\t\t\tString lastName = scanner.nextLine();\r\n\t\t\tSystem.out.println(\"Họ tên đầy đủ: \" + firstName.concat(lastName));\r\n\r\n\t\t\t// question 6:\r\n\t\t\tSystem.out.println(\"Nhập họ: \");\r\n\t\t\tString firstName1 = scanner.nextLine();\r\n\t\t\tSystem.out.println(\"Nhập tên: \");\r\n\t\t\tString lastName1 = scanner.nextLine();\r\n\t\t\tSystem.out.println(\"Họ tên đầy đủ: \" + firstName.concat(lastName));\r\n\r\n\t\t\t// question 7:\r\n\r\n\t\t\tString fullName;\r\n\t\t\tSystem.out.println(\"Nhập họ tên đầy đủ\");\r\n\t\t\tfullName = scanner.nextLine();\r\n\t\t\t// remove space characters\r\n\t\t\tfullName = fullName.trim();\r\n\t\t\tfullName = fullName.replaceAll(\"\\\\s+\", \" \");\r\n\t\t\tSystem.out.println(fullName);\r\n\t\t\tString[] words = fullName.split(\" \");\r\n\t\t\tfullName = \"\";\r\n\t\t\tfor (String word : words) {\r\n\t\t\t\tString firstCharacter = word.substring(0, 1).toUpperCase();\r\n\t\t\t\tString leftCharacter = word.substring(1);\r\n\t\t\t\tword = firstCharacter + leftCharacter;\r\n\t\t\t\tfullName += word + \" \";\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"Họ tên sau khi chuẩn hóa: \" + fullName);\r\n\r\n\t\t\t// question 8:\r\n\t\t\tString[] groupNames = { \"Java with VTI\", \"Cách qua môn gia va\", \"Học Java có khó không?\" };\r\n\t\t\tfor (String groupName : groupNames) {\r\n\t\t\t\tif (groupName.contains(\"Java\")) {\r\n\t\t\t\t\tSystem.out.println(groupName);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Question 9:\r\n\t\t\tString[] groupNames1 = { \"Java\", \"C#\", \"C++\" };\r\n\t\t\tfor (String groupName : groupNames) {\r\n\t\t\t\tif (groupName.equals(\"Java\")) {\r\n\t\t\t\t\tSystem.out.println(groupName);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// question 10:\r\n\t\t\tString x1, x2, reversex1 = \"\";\r\n\t\t\tSystem.out.println(\"Nhập chuỗi 1\");\r\n\t\t\tx1 = scanner.nextLine();\r\n\t\t\tSystem.out.println(\"Nhập chuỗi 2\");\r\n\t\t\tx2 = scanner.nextLine();\r\n\t\t\tfor (int i = x1.length() - 1; i >= 0; i--) {\r\n\t\t\t\treversex1 += x1.substring(i, i + 1);\r\n\t\t\t}\r\n\t\t\tif (x2.equals(reversex1)) {\r\n\t\t\t\tSystem.out.println(\"Đây là chuỗi đảo ngược !\");\r\n\t\t\t} else {\r\n\t\t\t\tSystem.out.println(\"Đây không phải chuỗi đảo ngược\");\r\n\t\t\t}\r\n\r\n\t\t\t// question 11:\r\n\t\t\tSystem.out.println(\"Mời bạn nhập vào một chuỗi: \");\r\n\t\t\tString str = scanner.nextLine();\r\n\t\t\tint count1 = 0;\r\n\t\t\tfor (int i = 0; i < str.length(); i++) {\r\n\t\t\t\tif ('a' == str.charAt(i)) {\r\n\t\t\t\t\tcount1++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.println(count);\r\n\r\n\t\t\t// question 12:\r\n\t\t\tString daoNguoc = \"\";\r\n\t\t\tSystem.out.println(\"Nhập chuỗi 1\");\r\n\t\t\tString x3 = scanner.nextLine();\r\n\t\t\tfor (int i = x3.length() - 1; i >= 0; i--) {\r\n\t\t\t\tdaoNguoc += x3.charAt(i);\r\n\t\t\t}\r\n\t\t\tSystem.out.println(daoNguoc);\t\t\t\r\n\t\t\t\r\n\t\t}",
"private void checkAsk(FyQuestion q, FyAnswer a) {\n\t\treturn;\r\n\t}",
"@Override\n public String ask(String question) {\n return answers[position++];\n }",
"public String getAnswer(){\n return this.answer;\n }",
"@java.lang.Override\n public java.lang.String getCorrectAnswer() {\n java.lang.Object ref = correctAnswer_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n correctAnswer_ = s;\n return s;\n }\n }",
"public int getCorrect()\n\t{\n\t\treturn correct;\t\n\t}",
"public abstract String chooseAnswer();",
"public void setTFChoices() {\r\n Random randomGenerator = new Random();\r\n int trueFalseAnswer = randomGenerator.nextInt(2);\r\n studentAnswer.add(trueFalseAnswer);\r\n }",
"@SuppressWarnings(\"UnusedParameters\")\n private void openWrongAnswer(@SuppressWarnings(\"UnusedParameters\") View view) {\n AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(MainActivity.this);\n alertDialogBuilder.setTitle(\"INCORRECT ANSWER\");\n alertDialogBuilder.setMessage(\"The correct answer is: \\n\" + currentQ.getANSWER() + \"\\n Ref: \" + currentQ.getREFERENCE());\n // set negative button: No message\n alertDialogBuilder.setNegativeButton(\"Continue\" ,new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog,int id) {\n checkFinish();\n // cancel the alert box and put a Toast to the user\n dialog.cancel();\n }\n });\n alertDialogBuilder.setPositiveButton(\"Challenge Answer\" ,new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog,int id) {\n submitBug();\n // Add information to Review List for display after completion of test\n\n\n // cancel the alert box and put a Toast to the user\n dialog.cancel();\n }\n });\n\n AlertDialog alertDialog = alertDialogBuilder.create();\n // show alert\n alertDialog.show();\n alertDialog.getWindow().getAttributes();\n TextView msgTxt = (TextView) alertDialog.findViewById(android.R.id.message);\n msgTxt.setTextSize(20);\n msgTxt.setGravity(Gravity.CENTER_HORIZONTAL);\n }",
"public void dispQ()\n\t{\n\t\tSystem.out.println(ans);\t\n\t}",
"public void question() {\n\t\tlead.answer(this);\n\t}",
"public String getCorrectAnswer(int a){\n String answer = correctAnswers[a];\n return answer;\n }",
"String getAnswerResponse();",
"public void checkIfCorrect(Note answer){\n Note tmpNote = answer;\n Tone tmpTone = tmpNote.getTone();\n boolean isSharp = tmpNote.isSharp();\n String checkCorrect = \"\";\n\n //Normal Keys\n if(tmpTone.equals(Tone.A) && !isSharp)\n checkCorrect = \"A\";\n else if(tmpTone.equals(Tone.B) && !isSharp)\n checkCorrect = \"B\";\n else if(tmpTone.equals(Tone.C) && !isSharp)\n checkCorrect = \"C\";\n else if(tmpTone.equals(Tone.D) && !isSharp)\n checkCorrect = \"D\";\n else if(tmpTone.equals(Tone.E) && !isSharp)\n checkCorrect = \"E\";\n else if(tmpTone.equals(Tone.F) && !isSharp)\n checkCorrect = \"F\";\n else if(tmpTone.equals(Tone.G) && !isSharp)\n checkCorrect = \"G\";\n\n //Sharp Keys\n else if(tmpTone.equals(Tone.A) && isSharp)\n checkCorrect = \"A#\";\n else if(tmpTone.equals(Tone.C) && isSharp)\n checkCorrect = \"C#\";\n else if(tmpTone.equals(Tone.D) && isSharp)\n checkCorrect = \"D#\";\n else if(tmpTone.equals(Tone.F) && isSharp)\n checkCorrect = \"F#\";\n else if(tmpTone.equals(Tone.G) && isSharp)\n checkCorrect = \"G#\";\n\n checkCorrectHelper(checkCorrect);\n\n }",
"public void checkAnswer(String a){\r\n if(a.equals(answer)) {\r\n displayAnswer();\r\n score++;\r\n }\r\n else{\r\n Toast.makeText(QuizActivity.this,\r\n \"Incorrect Choice\", Toast.LENGTH_SHORT).show();\r\n }\r\n\r\n }",
"@Override\n public String ask(Tweet question) throws TwitterException {\n for (SmartCell cell : smartCells) {\n String answer = cell.ask(question);\n if (answer != null)\n {\n return answer+ \" #pokebattle\";\n }\n }\n return null;\n }",
"public static String getQuestion() {\n\t\treturn \"3) A line in the xy-plane passes through the origin and has a slope of 1/7. Which of \\\\n\"+\"the following points lies on the line?\";\n\t}",
"public int giveMark() {\n String tmpAnswer = textQuestionInput.getText().toString();\n textQuestion.isAnswerCorrect(tmpAnswer);\n textQuestionInput.setText(\"\");\n return textQuestion.getQuestionMark();\n }",
"public int getAnswer()\n {\n return answer;\n }",
"public static boolean QuestionVisible(){\r\n\t return (question.getText().equalsIgnoreCase(\"How would you rate your satisfaction with this website?\"));\t\r\n\t}",
"@Test\r\n public void MathQuestionWrong()\r\n {\r\n var answerInput = 8;\r\n var questionInput = \"4 + 4\";\r\n\r\n var responseAnswer = 9;\r\n var expectedText = \"What is 4 + 4?\\n9 is wrong. 4 + 4 equals 8\\n\\r\\n\";\r\n\r\n var testOutputByteArray = new ByteArrayOutputStream();\r\n var testOutputStream = new PrintStream(testOutputByteArray );\r\n\r\n // Check math question logic\r\n var mathQuestionAdd = new MathQuestion(answerInput, questionInput, testOutputStream);\r\n mathQuestionAdd.showQuestion();\r\n assertFalse(mathQuestionAdd.checkAnswer(responseAnswer));\r\n\r\n // Check math question console outputs\r\n var content = testOutputByteArray.toString();\r\n assertEquals(content,expectedText);\r\n }",
"public static void questionnaire() {\n\t\tboolean flag = true;\n\t\tString a = null;\n\t\t//donor's username\n\t\tflag = true;\n\t\tdo {\n\t\t\ttry {\n\t\t\t\tusername = JOptionPane.showInputDialog(null,\"Enter your username: \", \"SIGN UP\", JOptionPane.INFORMATION_MESSAGE);\n\t\t\t\tif (username.equals(\"null\")) {\n\t\t\t\t\tthrow new NullPointerException();\n\t\t }\n\t\t\t\tflag = false;\n\t\t\t} catch (NullPointerException e) {\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Please enter a username.\", \"ALERT MESSAGE\", JOptionPane.WARNING_MESSAGE);\n\t\t flag = true;\n\t\t\t}\t\n\t\t}while (flag);\n\t\ttry {\n\t\t\tResultSet rs = Messages.connect().executeQuery(\"SELECT * FROM Questionnaire \");\n\t\t\twhile (rs.next()) {\n\t\t\t\tint qid = rs.getInt(\"Q_id\");\n\t\t\t\tString r = rs.getString(\"Question\");\n\t\t\t\tdo {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (qid == 1) {\n\t\t\t\t\t\t\tflag = true;\n \t \t\t\t\t\tObject[] opt = {\"Male\", \"Female\"};\n\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tint g = JOptionPane.showOptionDialog(null,\"Choose your gender: \", \"SIGN UP\", JOptionPane.YES_NO_OPTION,\n\t\t\t\t\t\t\t\t\t\t\tJOptionPane.PLAIN_MESSAGE, null, opt, null);\n\t\t\t\t\t\t\t\t\tif (g == 0) {\n\t\t\t\t\t\t\t\t\t\tgender = \"male\";\n\t\t\t\t\t\t\t\t\t\tflag = false;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t} else if (g == 1){\n\t\t\t\t\t\t\t\t\t\tgender = \"female\";\n\t\t\t\t\t\t\t\t\t\tflag = false;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tthrow new NullPointerException();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} catch (NullPointerException e1) {\n\t\t\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Please choose your gender\", \"ALERT MESSAGE\", JOptionPane.WARNING_MESSAGE);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}while (flag);\n\t\t\t\t\t\t\ta = gender;\n\t\t\t\t\t\t} else if (((qid >= 2) && (qid<=12)) || (qid == 14)) {\n\t\t\t\t\t\t\ta = JOptionPane.showInputDialog(null, qid + \". \" + r, \"QUESTIONNAIRE\", JOptionPane.PLAIN_MESSAGE);\n\t\t\t\t\t\t\tif (a.equals(null)) {\n\t\t\t\t\t\t\t\tthrow new NullPointerException();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tflag = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tint p = JOptionPane.showConfirmDialog(null, qid + \". \" + r, \"QUESTIONNAIRE\", JOptionPane.YES_NO_OPTION, JOptionPane.PLAIN_MESSAGE);\n\t\t\t\t\t\t\ta = String.valueOf(p);\n\t\t\t\t\t\t\tif (p == -1) {\n\t\t\t\t\t\t\t\tthrow new NullPointerException();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tflag = false;\n\t\t\t\t\t\t \t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Please insert your answer\", \"ALERT MESSAGE\", JOptionPane.WARNING_MESSAGE);\n\t\t\t\t\t\tflag = true;\n\t\t\t\t\t}\n\t\t\t\t} while (flag);\n\t\t\t\tif (checkQuestion(qid, a) == false) {\n\t\t\t\t\t//delete data from data base\n\t\t\t\t\tint d = Messages.connect().executeUpdate(\"DELETE FROM Answers WHERE B_Username ='\" + username + \"'\");\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"We regret to inform you that you are not compatible as a blood donor.\", \"ALERT MESSAGE\", JOptionPane.WARNING_MESSAGE);\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t} else {\n\t\t\t\t\tinsertAnswers(username, qid, a);\n\t\t\t\t}\n\t\t\t}\n\t\t\trs.close();\n\t\t\tMessages.connect().close();\n\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t}\n\t\t}",
"public java.lang.String getTestQuestion() {\r\n return testQuestion;\r\n }",
"public void questionGenerator()\n\t{\n\t\t//creates questions\n\t\toperation = rand.nextInt(3) + min;\n\t\t\n\t\t//makes max # 10 to make it easier for user if random generator picks multiplication problem\n\t\tif (operation == 3)\n\t\t\tmax = 10; \n\t\t\n\t\t//sets random for number1 & number2\n\t\tnumber1 = rand.nextInt(max) + min; //random number max and min\n\t\tnumber2 = rand.nextInt(max) + min; \n\t\t\t\t\n\t\t//ensures final answer of problem is not negative by switching #'s if random generator picks subtraction problem\n\t\tif (operation == 2 && number1 < number2)\n\t\t{\n\t\t\tint tempNum = number1;\n\t\t\tnumber1 = number2;\n\t\t\tnumber2 = tempNum;\n\t\t}\n\t\tanswer = 0;\n\t\t\n\t\t//randomizes operator to randomize question types\n\t\tif (operation == 1)\n\t\t{\n\t\t\toperator = '+';\n\t\t\tanswer = number1 + number2;\n\t\t}\n\t\tif (operation == 2)\n\t\t{\n\t\t\toperator = '-';\n\t\t\tanswer = number1 - number2;\n\t\t}\n\t\tif (operation == 3)\n\t\t{\n\t\t\toperator = '*';\n\t\t\tanswer = number1 * number2;\n\t\t}\n\t\t\t\n\t\t//prints question\n\t\tlabel2.setText(\"Question: \" + number1 + \" \" + operator + \" \" + number2 + \" = ?\");\n\t}",
"public static void displayScore(final Quiz quiz) {\n\t\tint qNumber = 0;\n\t\tint totScore = 0;\n\t\tfor (question q : quiz.getQList()) {\n\t\t\tSystem.out.println(q.qText);\n\t\t\tif (q.corrChoice.equals(quiz.getAnswers(qNumber))) {\n\t\t\t\tSystem.out.println(\" Correct Answer! - Marks Awarded: \" + q.maxMarks);\n\t\t\t\ttotScore += Integer.parseInt(q.maxMarks);\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\" Wrong Answer! - Penalty: \" + q.penalty);\n\t\t\t\ttotScore += Integer.parseInt(q.penalty);\n\t\t\t}\n\t\t\tqNumber += 1;\n\t\t}\n\t\tSystem.out.println(\"Total Score: \" + totScore);\n\t}",
"public void setAnswer(String answer) {\r\n this.answer = answer;\r\n }",
"public int getAnswer() {\n return answer;\n }"
] | [
"0.77704936",
"0.71621865",
"0.68923753",
"0.6856392",
"0.6788283",
"0.6785392",
"0.670423",
"0.6638775",
"0.6533943",
"0.651586",
"0.648518",
"0.64841497",
"0.64389306",
"0.6438103",
"0.6430635",
"0.64288104",
"0.6401641",
"0.6348183",
"0.6323852",
"0.63205504",
"0.63131034",
"0.62994766",
"0.6283207",
"0.62779635",
"0.62679625",
"0.6261173",
"0.62296325",
"0.62050724",
"0.6200929",
"0.61980295",
"0.61908406",
"0.6182202",
"0.61747223",
"0.61617625",
"0.6159706",
"0.6151891",
"0.6145978",
"0.61235756",
"0.6102295",
"0.6100815",
"0.60939515",
"0.6090278",
"0.6085749",
"0.606958",
"0.6064945",
"0.6060257",
"0.605844",
"0.6041823",
"0.6036584",
"0.6036091",
"0.6031039",
"0.6029003",
"0.6022842",
"0.6011507",
"0.6010055",
"0.5983768",
"0.59716177",
"0.59662545",
"0.5962693",
"0.5955837",
"0.59493154",
"0.5943044",
"0.5942673",
"0.5940701",
"0.5928293",
"0.59260535",
"0.59150946",
"0.59145355",
"0.5912852",
"0.591055",
"0.5907512",
"0.5905992",
"0.5905487",
"0.5904404",
"0.5880072",
"0.58771",
"0.58749884",
"0.5868882",
"0.58565617",
"0.58518857",
"0.58499247",
"0.5845939",
"0.58447635",
"0.5840373",
"0.58294356",
"0.5819627",
"0.58163077",
"0.58125836",
"0.5812073",
"0.5799946",
"0.5798781",
"0.5794847",
"0.5789628",
"0.57745004",
"0.57731557",
"0.57695657",
"0.5769433",
"0.5763027",
"0.5757768",
"0.5756265"
] | 0.6583262 | 8 |
Modify the correct answer of a T/F question | public void modify() {
io.writeLine("Enter the new correct answer");
String newAnswer = io.readLine();
while (!newAnswer.equals("T") && !newAnswer.equals("F")) {
io.writeLine("Please put in T or F");
newAnswer = io.readLine();
}
rightAnswers.set(0, newAnswer);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"java.lang.String getCorrectAnswer();",
"@FXML\n\tprivate void answerQuestion() {\n\t\tint correctAnsID = 0;\n\t\ttry {\n\t\t\tswitch (((RadioButton) answerGroup.getSelectedToggle()).getId()) {\n\t\t\tcase \"ans1Check\":\n\t\t\t\tcorrectAnsID = 1;\n\t\t\t\tbreak;\n\t\t\tcase \"ans2Check\":\n\t\t\t\tcorrectAnsID = 2;\n\t\t\t\tbreak;\n\t\t\tcase \"ans3Check\":\n\t\t\t\tcorrectAnsID = 3;\n\t\t\t\tbreak;\n\t\t\tcase \"ans4Check\":\n\t\t\t\tcorrectAnsID = 4;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\terrorLabel.setVisible(true);\n\t\t}\n\n\t\t// nothing is selected\n\t\tif (correctAnsID == 0) { \n\t\t\terrorLabel.setVisible(true);\n\t\t\t// correct answer\n\t\t} else if (question.getCorrect_ans() == correctAnsID) {\n\t\t\tcontrol.setScore(control.getScore() + question.getScore());\n\t\t\thandleAlertAndWindow(AlertType.INFORMATION, \"Congrats! :D\",\n\t\t\t\t\t\"You received \" + question.getScore() + \" points\");\n\t\t\t// wrong answer\n\t\t} else {\n\t\t\tcontrol.setScore(control.getScore() + question.getPenalty());\n\n\t\t\thandleAlertAndWindow(AlertType.ERROR, \"Uh oh! :(\",\n\t\t\t\t\t\"You lost \" + question.getPenalty() + \" points\");\n\t\t}\n\n\t\t// reset the eaten question\n\t\tViewLogic.playGameController.getControl().setQuestionEaten(null);\n\t}",
"public void setAnswer(double correctResponse)\n { \n answer = correctResponse; \n }",
"public int get_correctAnswer(){return this._correctAnswer;}",
"protected abstract String answer();",
"@Override\n\t public String solve() {\n\t if (count == 0) {\n\t answer1 = getVariable2()*getVariable3();\n\t setAnswer(answer1 + \"\");\n\t } else if (count == 1) {\n\t answer1 = getVariable1()/getVariable2();\n\t setAnswer(answer1 + \"\");\n\t }else if (count == 2) {\n\t answer1 = getVariable1()/getVariable3();\n\t setAnswer(answer1 + \"\");\n\t }\n\t return getAnswer();\n\t }",
"@Override\r\n\tpublic void checkAnswer() {\n\t\t\r\n\t}",
"public void setTFChoices() {\r\n Random randomGenerator = new Random();\r\n int trueFalseAnswer = randomGenerator.nextInt(2);\r\n studentAnswer.add(trueFalseAnswer);\r\n }",
"public void setAnswer(String newAnswer){\n this.answer = newAnswer; \n }",
"public void quiz() {\n\t\t\t\t\tcorrectans = 0;\n\t\t\t\t\tint k = 0;\n\t\t\t\t\tint j = 0;\n\t\t\t\t\tint M = 0;\n\t\t\t\t\tj = readDifficulty();\n\t\t\t\t\tM = readProblemType();\n\t\t\t\t\t//ask the student to solve 10 different problems, as determined by the problem type\n\t\t\t for(int i = 0; i < 10; i++ ) {\n\t\t\t \t//contain two numbers sampled from a uniform random distribution with bounds determined by the problem difficulty\n\t\t\t \tint x = rand.nextInt(j); \n\t\t\t\t int y = rand.nextInt(j);\n\t\t\t\t int O = askquestion(j, M,x,y);\n\t\t\t\t if(M == 4) {\n\t\t\t\t \t float floatans = readdivision();\n\t\t\t\t \tk = divisionsol(floatans, x, y);\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t int userin = readResponse();\n\t\t\t k = isnanswercorrect(O , userin);\n\t\t\t }\n\t\t\t if(k == 1) {\n\t\t\t \t correctans++;\n\t\t\t }\n\t\t\t }\n\t\t\t int L = 0;\n\t\t\t L = displayCompletionMessage(correctans);\n\t\t\t if ( L == 1) {\n\t\t\t \tquiz();\n\t\t\t }\n\t\t\t else {\n\t\t\t \treturn;\n\t\t\t }\n\t\t\t \n\t\t\t\t}",
"public void question() {\n\t\tlead.answer(this);\n\t}",
"int getWrongAnswers();",
"public static void main(){\n \n \n String question = \"There are 10 types of people in this world, those who understand binary and those who don't.\";\n String answer = \"true\";\n \n Question tfQuest = new Question (question, answer);\n tfQuest.getAnswer();\n \n }",
"public void setQuestion(){\n Random rand = new Random();\n a = rand.nextInt(maxRange)+1;\n b = rand.nextInt(maxRange)+1;\n int res = rand.nextInt(4);\n equation.setText(a +\"+\"+ b);\n for(int i=0; i<4; i++){\n if(i == res)\n arr[i] = a+b;\n else {\n int answer = rand.nextInt(2*maxRange)+1;\n while(answer == a+b)\n answer = rand.nextInt(2*maxRange)+1;\n arr[i] = answer;\n }\n }\n for(int i=0; i<4; i++)\n buttons[i].setText(String.valueOf(arr[i]));\n }",
"@Override\n\tpublic Boolean isCorrect(){\n\t\t\n\t\tif (super.question instanceof TfQuestion){\n\t\t\tif(this.answer.equals(super.question.getAnswer())){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"double scoreAnswer(Question question, Answer answer);",
"public double getAnswer() {\n return answer;\n }",
"@Override\n public void resetQuestion() {\n super.resetQuestion();\n hadSecondChance = false;\n currentTeam = null;\n originalTeam = null;\n teamHasAnswered.clear();\n //reset teamHasAnswered map so all teams get a chance to anaswer again\n for (int i = 0; i < numTeams; i++) teamHasAnswered.put(i, false);\n }",
"public void setCorrect_answer(String correct_answer) {\n this.correct_answer=correct_answer;\n }",
"boolean getCorrect();",
"public void setAnswer(String answer) {\r\n this.answer = answer;\r\n }",
"public abstract T adaptResult(F solution);",
"private void checkAsk(FyQuestion q, FyAnswer a) {\n\t\treturn;\r\n\t}",
"public void checkIfCorrect(Note answer){\n Note tmpNote = answer;\n Tone tmpTone = tmpNote.getTone();\n boolean isSharp = tmpNote.isSharp();\n String checkCorrect = \"\";\n\n //Normal Keys\n if(tmpTone.equals(Tone.A) && !isSharp)\n checkCorrect = \"A\";\n else if(tmpTone.equals(Tone.B) && !isSharp)\n checkCorrect = \"B\";\n else if(tmpTone.equals(Tone.C) && !isSharp)\n checkCorrect = \"C\";\n else if(tmpTone.equals(Tone.D) && !isSharp)\n checkCorrect = \"D\";\n else if(tmpTone.equals(Tone.E) && !isSharp)\n checkCorrect = \"E\";\n else if(tmpTone.equals(Tone.F) && !isSharp)\n checkCorrect = \"F\";\n else if(tmpTone.equals(Tone.G) && !isSharp)\n checkCorrect = \"G\";\n\n //Sharp Keys\n else if(tmpTone.equals(Tone.A) && isSharp)\n checkCorrect = \"A#\";\n else if(tmpTone.equals(Tone.C) && isSharp)\n checkCorrect = \"C#\";\n else if(tmpTone.equals(Tone.D) && isSharp)\n checkCorrect = \"D#\";\n else if(tmpTone.equals(Tone.F) && isSharp)\n checkCorrect = \"F#\";\n else if(tmpTone.equals(Tone.G) && isSharp)\n checkCorrect = \"G#\";\n\n checkCorrectHelper(checkCorrect);\n\n }",
"public abstract AnswerStatus checkAnswer(String answer) throws SyntaxException;",
"private void updateQuestion(){\n mchoice1.setChecked(false);\n mchoice2.setChecked(false);\n mchoice3.setChecked(false);\n mchoice4.setChecked(false);\n\n if (mQuestonNumber < mQuizLibrary.getLength()){\n //menset setiap textview dan radiobutton untuk diubah jadi pertanyaan\n sQuestion.setText(mQuizLibrary.getQuestion(mQuestonNumber));\n //mengatur opsi sesuai pada optional A\n mchoice1.setText(mQuizLibrary.getChoice(mQuestonNumber, 1)); //Pilihan Ganda ke 1\n //mengatur opsi sesuai pada optional B\n mchoice2.setText(mQuizLibrary.getChoice(mQuestonNumber, 2)); //Pilihan Ganda ke 2\n //mengatur opsi sesuai pada optional C\n mchoice3.setText(mQuizLibrary.getChoice(mQuestonNumber, 3)); //Pilihan Ganda ke 3\n //mengatur opsi sesuai pada optional D\n mchoice4.setText(mQuizLibrary.getChoice(mQuestonNumber, 4)); //Pilihan Ganda ke 4\n\n manswer = mQuizLibrary.getCorrect(mQuestonNumber);\n //untuk mengkoreksi jawaban yang ada di class QuizBank sesuai nomor urut\n mQuestonNumber++; //update pertanyaan\n }else{\n Toast.makeText(Quiz.this, \"ini pertanyaan terakhir\", Toast.LENGTH_LONG).show();\n Intent i = new Intent (Quiz.this, HighestScore.class);\n i.putExtra(\"score\", mScore); //UNTUK MENGIRIM NILAI KE activity melalui intent\n startActivity(i);\n }\n }",
"public static void changeQuestion(int qid, String username) {\n\t\t\tboolean flag = false;\n\t\t\tString a2 = null;\n \t\tint d = 0;\n\t\t\tdo {\n\t\t\t\ttry {\n\t\t\t\t\tif ((qid <= 12) || (qid == 14)) {\n\t\t\t\t\t\ta2 = JOptionPane.showInputDialog(null, qid + \" Update your answer\", \"QUESTIONNAIRE\", JOptionPane.PLAIN_MESSAGE);\n \t\t\t\tflag = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\td = JOptionPane.showConfirmDialog(null, qid + \" Update your answer\", \"QUESTIONNAIRE\", JOptionPane.YES_NO_OPTION,JOptionPane.PLAIN_MESSAGE);\n \t\t\t\ta2 = String.valueOf(d);\n \t\t\tflag = true;\n \t\t\t} \n \t\t\tif (a2.equals(null) || (d == -1)) {\n \t\t\t\tthrow new NullPointerException();\n \t\t\t}\n \t\t} catch (NullPointerException e1) {\n \t\t\tJOptionPane.showMessageDialog(null, \"Please insert your answer\", \"ALERT MESSAGE\", JOptionPane.WARNING_MESSAGE);\n \t\t\tflag = false;\n \t\t}\n \t\t}while (flag == false);\n\t\t\tif (checkQuestion(qid, a2) == false) {\n\t\t\t\tJOptionPane.showMessageDialog(null, \"We regret to inform you that you are no longer compatible as a blood donor.\", \"ALERT MESSAGE\", JOptionPane.WARNING_MESSAGE);\n\t\t\t\tSystem.exit(0);\n\t\t\t} else {\n\t\t\t\tupdateTableAnswers(qid, username, a2);\n\t\t\t}\n\t\t\t\n\t\t\treturn;\t\n\t\t}",
"private void setquestion() {\n qinit();\n question_count++;\n\n if (modeflag == 3) {\n modetag = (int) (Math.random() * 3);\n } else {\n modetag = modeflag;\n }\n\n WordingIO trueword = new WordingIO(vocabulary);\n\n if (modetag == 0) {\n\n MCmode(trueword);\n }\n\n if (modetag == 1) {\n BFmode(trueword);\n }\n\n if (modetag == 2) {\n TLmode(trueword);\n }\n\n if (time_limit != 0) {\n timingtoanswer(time_limit, jLabel2, answer_temp, jLabel5, jLabel6, jButton1);\n }\n }",
"boolean hasCorrectAnswer();",
"private void updateQuestion(){\n\t\tint question = mQuestionBank[mCurrentIndex].getQuestion();\n\t\tmQuestionTextView.setText(question);\n\t}",
"private void updateQuestion(){\n int question = mQuestionBank[mCurrentIndex].getmQuestion();\n mQuestionTextView.setText(question);\n }",
"public void feedback(boolean isCorrect, VocabularyQuiz question) {\n String correctMeaning = question.getSelections().get(question.getAnswer());\n String message;\n if (isCorrect) {\n message = \"Correct!\";\n totalCorrect++;\n } else {\n message = \"Incorrect! The answer is \" + correctMeaning;\n }\n JOptionPane.showMessageDialog(gui.getFrame(), message);\n }",
"public void modifyQuestion(int index)\r\n\t{\r\n\t\tScanner in = new Scanner(System.in);\r\n\t\tboolean input = true;\r\n\t\tint choice;\r\n\t\tString info;\r\n\t\t\r\n\t\twhile (input)\r\n\t\t{\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"\\nChoose which part of the question to modify:\");\r\n\t\t\t\tSystem.out.println(\"1. Question\\n2. Answer choice #1\\n3. Answer choice #2\\n4. Answer choice #3\\n\" +\r\n\t\t\t\t\t\t\"5. Answer choice #4\\n6. Correct Answer\");\r\n\t\t\t\tchoice = in.nextInt();\r\n\t\t\t\tin.nextLine();\r\n\t\t\t\t\r\n\t\t\t\tif (choice <= 0 || choice > 6)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"Invalid input\");\r\n\t\t\t\t\tinput = true;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( choice == 1) // modify question\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.println(\"Please enter a modified question:\");\r\n\t\t\t\t\t\tinfo = in.nextLine();\r\n\t\t\t\t\t\tquestions.get(index-1).setQuestion(info);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ( choice == 2) // modify answer choice #1\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.println(\"Please enter a modified answer choice #1:\");\r\n\t\t\t\t\t\tinfo = in.nextLine();\r\n\t\t\t\t\t\tquestions.get(index-1).setAnswer1(info);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ( choice == 3) // modify answer choice #2\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.println(\"Please enter a modified answer choice #2:\");\r\n\t\t\t\t\t\tinfo = in.nextLine();\r\n\t\t\t\t\t\tquestions.get(index-1).setAnswer2(info);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ( choice == 4) // modify answer choice #3\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.println(\"Please enter a modified answer choice #3:\");\r\n\t\t\t\t\t\tinfo = in.nextLine();\r\n\t\t\t\t\t\tquestions.get(index-1).setAnswer3(info);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ( choice == 5) // modify answer choice #4\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.println(\"Please enter a modified answer choice #4:\");\r\n\t\t\t\t\t\tinfo = in.nextLine();\r\n\t\t\t\t\t\tquestions.get(index-1).setAnswer4(info);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ( choice == 6) // modify the correct answer \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.println(\"Please enter a modified correct answer :\");\r\n\t\t\t\t\t\tinfo = in.nextLine();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//checks input\r\n\t\t\t\t\t\twhile( !( info.equalsIgnoreCase(\"1\") || info.equalsIgnoreCase(\"2\") || info.equalsIgnoreCase(\"3\") || info.equalsIgnoreCase(\"4\") ) )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.println(\"Invalid entry. Enter again:\");\r\n\t\t\t\t\t\t\tinfo = in.nextLine();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tquestions.get(index-1).setCorrectAnswer(info);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tinput = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcatch( InputMismatchException im ) \r\n\t\t\t{\r\n\t\t\t\tin.next(); //clear buffer\r\n\t\t\t\tSystem.out.println(\"Invalid Input\");\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void modifyQuestion(String text) {\n // TODO implement here\n }",
"@Override\n public String ask(String question) {\n return answers[position++];\n }",
"private void setQuestion() {\n Question.setText(gen.getQuestion() + \"\\t\\tProblem # \" + currentQuestion + \"/\" + numQuestions);\n }",
"private void updateQuestion()//update the question each time\n\t{\n\t\tInteger num = random.nextInt(20);\n\t\tcurrentAminoAcid = FULL_NAMES[num];\n\t\tcurrentShortAA= SHORT_NAMES[num];\n\t\tquestionField.setText(\"What is the ONE letter name for:\");\n\t\taminoacid.setText(currentAminoAcid);\n\t\tanswerField.setText(\"\");\n\t\tvalidate();\n\t}",
"private void updateQuestion() {\r\n\r\n //The code below resets the option\r\n mOption1.setVisibility(View.VISIBLE);\r\n mOption2.setVisibility(View.VISIBLE);\r\n mOption3.setVisibility(View.VISIBLE);\r\n mNext.setVisibility(View.INVISIBLE);\r\n\r\n int questionSize = 12;\r\n\r\n if (mQuestionNumber < questionSize) {\r\n\r\n mQuestionView.setText((questionsDB.getQuestion(mQuestionNumber)));\r\n mOption1.setText(questionsDB.getChoice1(mQuestionNumber));\r\n mOption2.setText(questionsDB.getChoice2(mQuestionNumber));\r\n mOption3.setText(questionsDB.getChoice3(mQuestionNumber));\r\n\r\n mAnswer = questionsDB.getCorrectAnswer(mQuestionNumber);\r\n mQuestionNumber++;\r\n timeLeftInMillis = COUNTDOWN_IN_MILLIS;\r\n startCountDown();\r\n\r\n\r\n } else {\r\n displayScore();\r\n }\r\n\r\n }",
"private void verifyQuestion(Answer answer) {\n // If is running, stop the question timer\n //(Hard mode)\n timerQuestion.stop();\n \n //if (challengeModel.getChallenge().getCurrentCorrectAnswer()) {\n if (challengeModel.getChallenge().getQuestionsList().get(challengeModel.getChallenge().getCurrentQuestionNumber()-1).getAnswer() == answer) {\n imgCenter.setIcon(Resources.getImageCorrect());\n labelAnswerResult.setText(\"Correto \");\n labelClarification.setText(\"\");\n }\n else {\n imgCenter.setIcon(Resources.getImageIncorrect());\n // Show clarification\n labelAnswerResult.setText(\"\");\n labelClarification.setText(\"<HTML><B>Esclarecimento: </B>\"+challengeModel.getChallenge().getCurrentRuleClarification()+\"</HTML>\");\n }\n \n showAnswerResult(answer);\n }",
"public void resetQuestion() \n\t{\n\t\tthis.game = masterPanel.getGame();\n\t\t\n\t\tArrayList<String> tempQuestion = new ArrayList<String>();\n\t\ttempQuestion = getRandQuestion();\n\t\t\n\t\tquestion.setText(tempQuestion.get(0));\n\t\tanswerOne.setText(tempQuestion.get(1));\n\t\tanswerTwo.setText(tempQuestion.get(2));\n\t\tanswerThree.setText(tempQuestion.get(3));\n\t\tanswerFour.setText(tempQuestion.get(4));\n\t\tcorrectAnswer = tempQuestion.get(5);\n\t\t\n\t\tlayoutConstraints.gridy = 1;\n\t\tthis.add(answerOne, layoutConstraints);\n\t\t\n\t\tlayoutConstraints.gridy = 2;\n\t\tthis.add(answerTwo, layoutConstraints);\n\t\t\n\t\tlayoutConstraints.gridy = 3;\n\t\tthis.add(answerThree, layoutConstraints);\n\t\t\n\t\tlayoutConstraints.gridy = 4;\n\t\tthis.add(answerFour, layoutConstraints);\n\t\t\n\t\tthis.repaint();\n\t}",
"public void changeAnswers(String question, ArrayList<Integer> choices) {\r\n Random randomGenerator = new Random();\r\n boolean hasChange = randomGenerator.nextBoolean();\r\n\r\n // if boolean is true, student will change answer by jumping back to submitAnswer()\r\n if (hasChange) {\r\n System.out.println(studentID + \" is changing answer...\");\r\n studentAnswer.clear();\r\n submitAnswer(question, choices);\r\n }\r\n }",
"Boolean getPartiallyCorrect();",
"public void chooseAnswer(View view)\n {\n\n if(view.getTag().toString().equals(Integer.toString(pos_of_correct)))\n {\n //Log.i(\"Result\",\"Correct Answer\");\n correct++;\n noOfQues++;\n correct();\n }\n else\n {\n //Log.i(\"Result\",\"Incorrect Answer\");\n //resluttextview.setText(\"Incorrect!\");\n incorrect();\n noOfQues++;\n }\n pointtextView.setText(Integer.toString(correct)+\"/\"+Integer.toString(noOfQues));\n if(tag==4)\n generateAdditionQuestion();\n if(tag==5)\n generateSubtractionQuestion();\n if(tag==6)\n generateMultiplicationQuestion();\n if(tag==7)\n generateDivisionQuestion();\n\n }",
"public java.lang.String getCorrectAnswer() {\n java.lang.Object ref = correctAnswer_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n correctAnswer_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public boolean replyResult(int answer){\n \t_numberOfChoice = answer;\r\n return false;\r\n }",
"String answerStatement(boolean answer) {\n String answerStatement = getResources().getString(R.string.wrong);\n if (answer) {\n answerStatement = getResources().getString(R.string.correct);\n }\n return answerStatement;\n }",
"public int getAnswer()\n {\n return answer;\n }",
"public void correctAnswer(View view) {\n\n // Update correct count\n deck.getCard(deckPos).setNumCorrect(deck.getCard(deckPos).getNumCorrect() + 1);\n\n // Update points\n float p = Float.valueOf(deck.getCard(deckPos).getRating()) * 10;\n quiz.setPoints((int) (quiz.getPoints() + p));\n points.setText(String.valueOf(quiz.getPoints()));\n\n // Set to question and update counter\n isQuestion = true;\n deckPos ++;\n\n // If not last card - Update card\n if(!(deckPos == deck.deckLength)) {\n displayCard(deck.getCard(deckPos), isQuestion);\n } else {\n finishQuiz();\n }\n\n // Set quiz counts\n quiz.setCorrectCount(quiz.getCorrectCount() + 1);\n }",
"public void createTrueFalse() {\n Question q = new TrueFalse(this.in,this.o);\n this.o.setDisplay(\"Enter the prompt for your True/False question:\\n\");\n this.o.getDisplay();\n\n q.setPrompt(this.in.getUserInput());\n\n if (isTest) {\n Test t = (Test)this.survey;\n RCA ca = new RCA(this.in,this.o);\n\n this.o.setDisplay(\"Enter the correct answer (T/F):\\n\");\n this.o.getDisplay();\n\n ca.addResponse();\n\n while (!ca.getResponses().get(0).contains(\"T\") && !ca.getResponses().get(0).contains(\"F\")) {\n ca.removeResponse(0);\n this.o.setDisplay(\"Enter a valid answer (T/F):\\n\");\n this.o.getDisplay();\n ca.addResponse();\n }\n\n t.addAnswer(ca);\n }\n this.survey.addQuestion(q);\n }",
"@Test\n\tpublic void testModifyQuestion() {\n\t\tQnaQuestion question = questionLogic.getQuestionById(tdp.question1_location1.getId());\n\n\t\tquestion.setQuestionText(\"Testing update\");\n\n\t\t// Test with invalid permissions\n\t\ttry {\n\t\t\texternalLogicStub.currentUserId = USER_NO_UPDATE;\n\t\t\tquestionLogic.saveQuestion(question,LOCATION1_ID);\n\t\t\tAssert.fail(\"Should have thrown exception\");\n\t\t} catch (SecurityException e) {\n\t\t\tAssert.assertNotNull(e);\n\t\t} \n\n\t\t// Test with valid permission\n\t\ttry {\n\t\t\texternalLogicStub.currentUserId = USER_UPDATE;\n\t\t\tquestionLogic.saveQuestion(question,LOCATION1_ID);\n\t\t\tQnaQuestion changedQuestion = questionLogic.getQuestionById(tdp.question1_location1.getId());\n\t\t\tAssert.assertEquals(changedQuestion.getQuestionText(), \"Testing update\");\n\t\t} catch (Exception e) {\n\t\t\tAssert.fail(\"Should not have thrown exception\");\n\t\t}\n\t}",
"public void setCorrect(boolean ncorrect) {\r\n this.correct = ncorrect;\r\n }",
"public int giveMark() {\n String tmpAnswer = textQuestionInput.getText().toString();\n textQuestion.isAnswerCorrect(tmpAnswer);\n textQuestionInput.setText(\"\");\n return textQuestion.getQuestionMark();\n }",
"public String checkNewQuestions() {\n\t\tint numAnswers = testGenerator.getNumAnswers(questionNo);\n\t\tString question = \"\";\n\n\t\tquestion += testGenerator.getQuestionText(questionNo);\n\t\tquestion += testGenerator.getAnswerText(questionNo, 1);\n\t\tquestion += testGenerator.getAnswerText(questionNo, 2);\n\n\t\tif(numAnswers >= 3) {\n\t\t\tquestion += testGenerator.getAnswerText(questionNo, 3);\n\t\t} \n\t\tif(numAnswers == 4) {\n\t\t\tquestion += testGenerator.getAnswerText(questionNo, 4);\n\t\t}\n\t\treturn question;\n\t}",
"public void q1Submit(View view) {\n\n EditText editText = (EditText) findViewById(R.id.q1enterEditText);\n String q1answer = editText.getText().toString().trim();\n\n //Nested if statements to check if the answer is correct or not, then to assign 2 points if it's correct.\n if ((q1answer.toLowerCase().equals(getString(R.string.q1AnswerCheck1))) || (q1answer.toLowerCase().equals(getString(R.string.q1AnswerCheck2)))) {\n if (isNotAnsweredQ1) {\n display(pointCounter += 2);\n Toast.makeText(this, getString(R.string.correct1), Toast.LENGTH_SHORT).show();\n isNotAnsweredQ1 = false;\n }\n } else {\n Toast.makeText(this, getString(R.string.thinkAgain), Toast.LENGTH_SHORT).show();\n }\n }",
"public void setQuestion(){\n txt_question.setText(arrayList.get(quesAttempted).getQuestion());\n txt_optionA.setText(arrayList.get(quesAttempted).getOptionA());\n txt_optionB.setText(arrayList.get(quesAttempted).getOptionB());\n txt_optionC.setText(arrayList.get(quesAttempted).getOptionC());\n txt_optionD.setText(arrayList.get(quesAttempted).getOptionD());\n txt_que_count.setText(\"Que: \"+(quesAttempted+1)+\"/\"+totalQues);\n txt_score.setText(\"Score: \"+setScore);\n }",
"com.google.protobuf.ByteString\n getCorrectAnswerBytes();",
"public void correct() {\n\n\n }",
"public void answer(Properties answers) {\n/* 56 */ setAnswer(answers);\n/* 57 */ QuestionParser.parseManageAllianceQuestion(this);\n/* */ }",
"private void checkAnswer()\r\n\t{\r\n\t\t//Submission to the model and getting 'true' if correct and 'false' otherwise\r\n\t\tboolean response = quizModel.isCorrect(group.getSelection().getActionCommand());\r\n\t\t\r\n\t\t//Updating score label based on result\r\n\t\tif (response == true)\r\n\t\t{\r\n\t\t\tscoreLabel.setText(\"<html><div style='text-align: center;'>\" + \"Score = \" + quizModel.getScore() + \"<br>Correct answer!\" + \"</div></html>\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tscoreLabel.setText(\"<html><div style='text-align: center;'>\" + \"Score = \" + quizModel.getScore() + \"<br>Incorrect answer!\" + \"</div></html>\");\r\n\t\t}\r\n\t}",
"public void checkAnswer() {\n }",
"@Override\n\tpublic Questions updateQuestion(BigInteger testId, BigInteger questionId, Questions question) throws UserException {\n\t\treturn null;\n\t}",
"public void setIdQuestion(int idT) {\r\n idQuestion=rand(idT);\r\n }",
"@java.lang.Override\n public java.lang.String getCorrectAnswer() {\n java.lang.Object ref = correctAnswer_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n correctAnswer_ = s;\n return s;\n }\n }",
"public ServerResponse<String> checkAnswer(String username,String questiion,String answer) {\n int resultCount = userMapper.checkAnswer(username,questiion,answer);\n if (resultCount > 0){\n // the question and answer belong to this user, and it's right\n String forgetToken = UUID.randomUUID().toString();\n //add \"token_\" as a namespace,or just to say we use it to distinguish.\n TokenCache.setKey(TokenCache.TOKEN_PREFIX+username,forgetToken);\n return ServerResponse.createBySuccess(forgetToken);\n }\n return ServerResponse.createByErrorMessage(\"wrong answer\");\n }",
"@Override\n\tpublic void solve(String result) {\n\t\tSystem.out.println(\"你告诉我的答案是--->\"+result); \n\t}",
"public void showQuestion()\n\t{\n\t\tSystem.out.println(ans);\n\t\tfor(int k = 0; k<numAns; k++)\n\t\t{\n\t\t\tSystem.out.println(k+\". \"+answers[k]);\n\t\t}\n\t}",
"private void detectCorrectAnswer() {\n switch (chapterSection) {\n case 5:\n if (typedAnswer.toString().toLowerCase().contentEquals(\"baybayin\")) {\n ansCorrect = true;\n }\n break;\n case 6:\n if (typedAnswer.toString().toLowerCase().contentEquals(\"kabundukan\")) {\n ansCorrect = true;\n }\n break;\n case 7:\n if (typedAnswer.toString().toLowerCase().contentEquals(\"lungsod\")) {\n ansCorrect = true;\n }\n break;\n case 8:\n if (typedAnswer.toString().toLowerCase().contentEquals(\"kabukiran\")) {\n ansCorrect = true;\n }\n break;\n }\n }",
"@Test\r\n public void testSubtractionAsReversion() {\r\n Application.loadQuestions();\r\n assertTrue(Application.allQuestions.contains(\"21 - 7 = ?\") || Application.allQuestions.contains(\"21 - 14 = ?\"));\r\n }",
"public int getAnswer() {\n return answer;\n }",
"private void settingQuestion() {\n\n int[] setWord = {0, 0, 0, 0, 0};\n int[] setPos = {0, 0, 0, 0};\n int[] setBtn = {0, 0, 0, 0};\n\n Random ans = new Random();\n int wordNum = ans.nextInt(vocabularyLesson.size());\n //answer = vocabularyLesson.get(wordNum).getMean();\n word = vocabularyLesson.get(wordNum).getWord();\n vocabularyID = vocabularyLesson.get(wordNum).getId();\n answer = word;\n\n Practice practice = pc.getPracticeById(vocabularyID);\n if (practice != null) {\n Log.d(\"idVocabulary\", practice.getSentence());\n question.setText(practice.getSentence());\n }\n\n\n // Random position contain answer\n setWord[wordNum] = 1;\n Random p = new Random();\n int pos = p.nextInt(4);\n if (pos == 0) {\n word1.setText(word);\n setBtn[0] = 1;\n }\n if (pos == 1) {\n word2.setText(word);\n setBtn[1] = 1;\n }\n if (pos == 2) {\n word3.setText(word);\n setBtn[2] = 1;\n }\n if (pos == 3) {\n word4.setText(word);\n setBtn[3] = 1;\n }\n setPos[pos] = 1;\n\n // Random 3 position contain 3 answer\n for (int i = 0; i < 3; i++) {\n Random ques = new Random();\n int num = ques.nextInt(5);\n int p1 = ques.nextInt(4);\n while (setWord[num] == 1 || setPos[p1] == 1) {\n num = ques.nextInt(5);\n p1 = ques.nextInt(4);\n }\n String wordIncorrect = vocabularyLesson.get(num).getWord();\n setWord[num] = 1;\n setPos[p1] = 1;\n if (setBtn[p1] == 0 && p1 == 0) {\n word1.setText(wordIncorrect);\n setBtn[0] = 1;\n }\n if (setBtn[p1] == 0 && p1 == 1) {\n word2.setText(wordIncorrect);\n setBtn[1] = 1;\n }\n if (setBtn[p1] == 0 && p1 == 2) {\n word3.setText(wordIncorrect);\n setBtn[2] = 1;\n }\n if (setBtn[p1] == 0 && p1 == 3) {\n word4.setText(wordIncorrect);\n setBtn[3] = 1;\n }\n }\n\n }",
"@Test\n\tpublic void updateTestPaperQuestion() throws Exception {\n\t}",
"public void verifyAnswer() {\n\t\tint i=0;\n\t\tSystem.out.println(\"in verify answer function\");\n\t\tSystem.out.println(\"Number of Answers: \"+ansCount);\n\t\tSystem.out.println(\"User ans: \"+userEquation);\n\t\tif (ansCount==0)\n\t\t\tlb2.setText(\"There is no solution for this set\");\n\t\telse{\n\t\t\tint c=0;\n\t\t\t\n\t\t\twhile(c<ansCount) {\n\t\t\t\tif (solutions[i].equals(userEquation)) {\n\t\t\t\t\tSystem.out.println(\"Ans was Correct\");\n\t\t\t\t\tfinal long duration = System.nanoTime() - startTime;\n\t\t\t\t\tseconds = TimeUnit.NANOSECONDS.toSeconds(duration);\n\t\t\t\t\tlb2.setText(\"Congradulations! You took \"+seconds+\" seconds to find an answer.\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t\tc++;\n\t\t\t\tSystem.out.println(\"C: \"+c);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"Ans was not Correct\");\n\t}\n\t}",
"public static <T, A, B, C, D, E, F> Answer<T> answer(Answer6<T, A, B, C, D, E, F> answer) {\n return toAnswer(answer);\n }",
"public static <T, A> Answer<T> answer(Answer1<T, A> answer) {\n return toAnswer(answer);\n }",
"public String getAnswer() {\n return answer;\n }",
"public void wrongAnswer() {\n if (quizGeneralState.checkAndPerformAction(QuizGeneralState.QuizAction.WRONG)) {\n quizStateChanger.wrongAnswerGiven();\n }\n }",
"public static String[] randomQuestions(String op){\r\n String question = \"\";\r\n String ansStr = \"\";\r\n \r\n int part1 = randomNumber();\r\n int part2 = randomNumber();\r\n int ans = 0;\r\n double roundAns = 0.0;\r\n \r\n if (op.equals(\"^\")){\r\n //Round to Closest Whole Number\r\n roundAns = (randomDecimal());\r\n double k = Math.round(roundAns);\r\n \r\n question = Double.toString(roundAns);\r\n ansStr = Double.toString(k);\r\n }\r\n else if (op.equals(\"Alg\")){\r\n //Algebraic Formula - Find x/y\r\n int coeff = randomNumberAlg();\r\n int layout = randomNumber();\r\n part1 = randomNumberAlg();\r\n part2 = randomNumberAlg();\r\n \r\n if (layout < 3){\r\n //?x = int\r\n ans = part1 * coeff;\r\n \r\n question = coeff+\"x = \"+ ans;\r\n ansStr = Integer.toString(part1);\r\n \r\n } else if (layout > 3 && layout <= 7){\r\n //?x+num = int || ?x-num = int\r\n if (layout == 4||layout == 5){\r\n ans = (part1 * coeff) + part2;\r\n \r\n question = coeff+\"x + \"+part2+\" = \"+ans;\r\n ansStr = Integer.toString(part1);\r\n } else if (layout == 6||layout == 7){\r\n ans = (part1 * coeff) - part2;\r\n \r\n question = coeff+\"x - \"+part2+\" = \"+ans;\r\n ansStr = Integer.toString(part1);\r\n } \r\n } else if (layout > 7 && layout <= 10){\r\n //?x/num = int \r\n ans = (part1 * coeff)/part2;\r\n \r\n question = coeff+\"x/\"+part2+\" = \"+ ans;\r\n ansStr = Integer.toString(part1);\r\n } \r\n }\r\n else if (op.equals(\"%\")){\r\n //Precentages - Covert Fraction to Percentage\r\n int div = HCF(part1, part2);\r\n int finalp1 = part1 % div;\r\n int finalp2 = part2 % div;\r\n \r\n if (finalp1 == 0){\r\n finalp1 = randomNumberRatio();\r\n }\r\n if (finalp2 == 0){\r\n finalp2 = randomNumberRatio();\r\n }\r\n \r\n double fract = finalp1/finalp2;\r\n \r\n if (finalp1>finalp2){\r\n fract = finalp1/finalp2;\r\n question = finalp1+\"/\"+finalp2;\r\n }\r\n else {\r\n fract = finalp2/finalp1;\r\n question = finalp2+\"/\"+finalp1;\r\n }\r\n \r\n double perc = fract * 100;\r\n \r\n ansStr = Double.toString(perc);\r\n \r\n }\r\n else if (op.equals(\":\")){\r\n //Ratio - Simplifying\r\n part1 = randomNumberRatio();\r\n part2 = randomNumberRatio();\r\n int div = HCF(part1, part2);\r\n int finalp1 = part1 / div;\r\n int finalp2 = part2 / div;\r\n \r\n question = part1+\":\"+part2;\r\n ansStr = finalp1+\":\"+finalp2;\r\n }\r\n\r\n else if (op.equals(\"//\")){\r\n //Fractions - Simplifying\r\n int div = HCF(part1, part2);\r\n int finalp1 = part1 % div;\r\n int finalp2 = part2 % div;\r\n \r\n question = part1+\"/\"+part2;\r\n ansStr = finalp1+\"/\"+finalp2;\r\n \r\n }\r\n \r\n String x[] = new String[2];\r\n x[0] = question;\r\n x[1] = ansStr;\r\n \r\n return x;\r\n }",
"public double getResult()\n { \n return answer;\n }",
"public interface TypeSpecificAnswer extends Cloneable\n{\n\t/**\n\t * Clear the is changed flag.s\n\t */\n\tvoid clearIsChanged();\n\n\t/**\n\t * Clone a copy\n\t * \n\t * @param the\n\t * answer that the copy is for.\n\t * @return A copy.\n\t */\n\tObject clone(Answer answer);\n\n\t/**\n\t * Consolidate the answer, such as after entering and before save.\n\t * \n\t * @param destination\n\t * The destination from the post.\n\t */\n\tvoid consolidate(String destination);\n\n\t/**\n\t * Access the answer's automatic score.\n\t * \n\t * @return The answer's auto-score.\n\t */\n\tFloat getAutoScore();\n\n\t/**\n\t * Check if the answer if completely correct.\n\t * \n\t * @return TRUE if the answer is answered and completely correct, FALSE if not. If there is no correct answer, returns null.\n\t */\n\tBoolean getCompletelyCorrect();\n\n\t/**\n\t * Check if the answer is partially correct.\n\t * \n\t * @return TRUE if the answer is answered and partially correct, FALSE if not. If there is no correct answer, returns null.\n\t */\n\tBoolean getPartiallyCorrect();\n\n\n\t/**\n\t * Access the type specific answer data as an array of strings that can be restored with setData()\n\t * \n\t * @return The type specific answer data.\n\t */\n\tString[] getData();\n\n\t/**\n\t * Check if the question is answered.\n\t * \n\t * @return TRUE if the question is considered to be answered, FALSE if not.\n\t */\n\tBoolean getIsAnswered();\n\n\t/**\n\t * Check if this answer has been changed by a setter.\n\t * \n\t * @return TRUE if changed, FALSE if not.\n\t */\n\tBoolean getIsChanged();\n\n\t/**\n\t * Restore settings from this array of strings, created by getData()\n\t * \n\t * @param data\n\t * The data to restore.\n\t */\n\tvoid setData(String[] data);\n}",
"public void setCorrectFlag(){\n\t\tcorrectFlag = true;\n\t}",
"public void setQuestion(String newQuestion) {\n question = newQuestion;\n }",
"public void saveQuestion(){\n\n\t\tint numAnswers = testGenerator.getNumAnswers(questionNo);\n\t\tString setAnswerBox = Integer.toString(numAnswers);\n\n\t\ttestGenerator.setQuestionText(questionNo, ques.getText());\n\t\ttestGenerator.setAnswerText(questionNo, 1, ans1.getText());\n\t\ttestGenerator.setAnswerText(questionNo, 2, ans2.getText());\n\n\t\ttestGenerator.setIsAnswerCorrect(questionNo, 1, answer1.isSelected());\n\t\ttestGenerator.setIsAnswerCorrect(questionNo, 2, answer2.isSelected());\n\n\t\tif((setAnswerBox.equals(\"3\")) || setAnswerBox.equals(\"4\")) {\n\t\t\ttestGenerator.setAnswerText(questionNo, 3, ans3.getText()); \t\n\t\t\ttestGenerator.setIsAnswerCorrect(questionNo, 3, answer3.isSelected());\n\t\t}\n\n\t\tif(setAnswerBox.equals(\"4\")) {\n\t\t\ttestGenerator.setAnswerText(questionNo, 4, ans4.getText()); \t\n\t\t\ttestGenerator.setIsAnswerCorrect(questionNo, 4, answer4.isSelected());\n\t\t}\n\t}",
"public void Correct(View view) {\n\n TextView textview = (TextView) findViewById(R.id.textViewer);\n CharSequence text = textview.getText();\n String temp = text.toString(); //extracting the number from question string\n String[] s = temp.split(\" \");\n String n = s[0];\n int prime = Integer.parseInt(n);\n\n Context context = getApplicationContext();\n\n int i, flag = 0;\n if (prime == 1) {\n flag = 1;\n }\n for (i = 2; i <= prime / 2; ++i) {\n // condition for nonprime number\n if (prime % i == 0) {\n flag = 1;\n break;\n }\n }\n\n if(flag==0 && pressed>=1 && clicked>=1)\n {\n Toast.makeText(context, \"Correct but you have taken hint and cheated\", Toast.LENGTH_SHORT).show();\n }\n else if (flag == 0 && pressed>=1) {\n\n Toast.makeText(context, \"Correct but you have taken hint\", Toast.LENGTH_SHORT).show();\n }\n\n else if(flag==0 && clicked>=1)\n {\n Toast.makeText(context, \"Correct but you have cheated\", Toast.LENGTH_SHORT).show();\n }\n else if(flag==0)\n {\n Toast.makeText(context, \"Correct\", Toast.LENGTH_SHORT).show();\n }\n\n else if(flag==1 && clicked>=1 && pressed>=1)\n {\n Toast.makeText(context, \" Not Correct but you have taken hint and cheated\", Toast.LENGTH_SHORT).show();\n }\n\n else if (flag == 1 && pressed>=1) {\n\n Toast.makeText(context, \" Not Correct but you have taken hint\", Toast.LENGTH_SHORT).show();\n }\n\n else if(flag==1 && clicked>=1)\n {\n Toast.makeText(context, \" Not Correct but you have cheated\", Toast.LENGTH_SHORT).show();\n }\n\n\n else if(flag==1)\n {\n Toast.makeText(context, \" Not Correct\", Toast.LENGTH_SHORT).show();\n }\n }",
"public void q7Submit(View view) {\n\n RadioButton radioButton = (RadioButton) findViewById(R.id.q7option4);\n\n //Nested if statements to check if the answer is correct or not, then to assign 2 points if it's correct.\n if (radioButton.isChecked()) {\n if (isNotAnsweredQ7) {\n display(pointCounter += 2);\n Toast.makeText(this, getString(R.string.correct1), Toast.LENGTH_SHORT).show();\n isNotAnsweredQ7 = false;\n }\n } else {\n Toast.makeText(this, getString(R.string.thinkAgain), Toast.LENGTH_SHORT).show();\n }\n }",
"static void askQuestion() {\n\t\t// Setting up a Scanner to get user input\n\t\tScanner userInput = new Scanner(System.in);\n\n\t\t// Declaring variables\n\t\tdouble num1, num2, answer, userAnswer;\n\n\t\t// GENERATING QUESTION\n\n\t\t// Getting two new random numbers, rounded to one decimal place (with numbers generation from 0 to 50)\n\t\tnum1 = Math.round((Math.random() * 50)*10.0)/10.0;\n\t\tnum2 = Math.round((Math.random() * 50)*10.0)/10.0;\n\n\t\t// Generating a random number between 1 and 4 to randomize the math operation. A switch case is used to calculate the answer based on the math operation that gets generated.\n\t\tswitch ((int) Math.round(Math.random() * 3 + 1)) {\n\t\t\tcase 1: // Similar structure for each case (and the default case), structured as follows\n\t\t\t\tSystem.out.print(num1 + \" + \" + num2 + \" = \"); // Printing the question (based on the generated operation)\n\t\t\t\tanswer = num1 + num2; // Calculating the answer (based on the generated operation)\n\t\t\t\tbreak; // Exit the switch statement\n\t\t\tcase 2:\n\t\t\t\tSystem.out.print(num1 + \" - \" + num2 + \" = \");\n\t\t\t\tanswer = num1 - num2;\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tSystem.out.print(num1 + \" / \" + num2 + \" = \");\n\t\t\t\tanswer = num1 / num2;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tSystem.out.print(num1 + \" * \" + num2 + \" = \");\n\t\t\t\tanswer = num1 * num2;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tanswer = Math.round(answer * 10.0) / 10.0; // Rounding the answer to one decimal place\n\t\tuserAnswer = userInput.nextDouble(); // Getting the user's answer\n\n\t\tif (answer == userAnswer) System.out.println(\"That's right. Good Job!\\n\"); // If the answers match, the user is correct and the staetment is printed accordingly.\n\t\telse System.out.println(\"Incorrect. The correct answer was \" + answer + \".\\n\"); // Otherwise, show that the user's answer is incorrect and output an according statement.\n\t}",
"@Test\r\n public void MathQuestionCorrect()\r\n {\r\n var answerInput = 8;\r\n var questionInput = \"4 + 4\";\r\n\r\n var responseAnswer = 8;\r\n var expectedText = \"What is 4 + 4?\\n8 is correct!\\n\\r\\n\";\r\n\r\n var testOutputByteArray = new ByteArrayOutputStream();\r\n var testOutputStream = new PrintStream(testOutputByteArray );\r\n\r\n // Check math question logic\r\n var mathQuestionAdd = new MathQuestion(answerInput, questionInput, testOutputStream);\r\n mathQuestionAdd.showQuestion();\r\n assertTrue(mathQuestionAdd.checkAnswer(responseAnswer));\r\n\r\n // Check math question console outputs\r\n var content = testOutputByteArray.toString();\r\n assertEquals(content,expectedText);\r\n }",
"private void setQuestionView()\n\t{\n txtQNumber.setText(qid + 1 + \"/\" + numberOfQuestions);\n\t\ttxtQuestion.setText(currentQ.getQUESTION());\n\t\ttxtReference.setText(currentQ.getREFERENCE());\n\t\trda.setText(currentQ.getOPTA());\n\t\trdb.setText(currentQ.getOPTB());\n\t\trdc.setText(currentQ.getOPTC());\n\t\trdd.setText(currentQ.getOPTD());\n\t\tqid++;\n\t}",
"@PostMapping(\"tematicAnswer/{taskId}\")\n\tpublic ResponseEntity tematicAnswer(@PathVariable String taskId, @RequestBody AnswerDTO answer) throws IOException {\n\t\tSystem.out.println(\" rad tematski prikladan: \" + answer.getAnswer() + \" za task sa idom: \" + taskId);\n\t\tfinal ArrayList<FormFieldDTO> taskFormFieldDtos = new ArrayList<>();\n\t\tif (answer.getAnswer().equals(\"yes\")) {\n\t\t\ttaskFormFieldDtos.add(new FormFieldDTO(\"radPrikladan\", true));\n\t\t} else {\n\t\t\ttaskFormFieldDtos.add(new FormFieldDTO(\"radPrikladan\", false));\n\t\t}\n\n\t\trspe.submitTaskForm(taskId, taskFormFieldDtos);\n\n\t\tSystem.out.println(\"Submitovani podaci za rad dosao dovde tematic\");\n\t\treturn new ResponseEntity<>(HttpStatus.OK);\n\t}",
"public void q6Submit(View view) {\n\n RadioButton radioButton = (RadioButton) findViewById(R.id.q6option1);\n\n //Nested if statements to check if the answer is correct or not, then to assign 2 points if it's correct.\n if (radioButton.isChecked()) {\n if (isNotAnsweredQ6) {\n display(pointCounter += 2);\n Toast.makeText(this, getString(R.string.correct2), Toast.LENGTH_SHORT).show();\n isNotAnsweredQ6 = false;\n }\n } else {\n Toast.makeText(this, getString(R.string.thinkAgain), Toast.LENGTH_SHORT).show();\n }\n }",
"public abstract void generateQuestion();",
"protected void markAsCorrect(Answer a, Boolean b) {\n if (a.getQuestion().getAuthor().equals(this)) {\n if(b && a.getQuestion().hasCorrectAnswer()) \n \t return;\n else\t\t \n \t this.setFlag(a, \"correct\", b);\n }\n }",
"public void q2Submit(View view) {\n\n RadioButton radioButton = (RadioButton) findViewById(R.id.q2option3);\n\n //Nested if statements to check if the answer is correct or not, then to assign 2 points if it's correct.\n if (radioButton.isChecked()) {\n if (isNotAnsweredQ2) {\n display(pointCounter += 2);\n Toast.makeText(this, getString(R.string.correct2), Toast.LENGTH_SHORT).show();\n isNotAnsweredQ2 = false;\n }\n } else {\n Toast.makeText(this, getString(R.string.thinkAgain), Toast.LENGTH_SHORT).show();\n }\n }",
"public String getAnswer(){\n return this.answer;\n }",
"public void updateQ4scoreAndGoToNext(View view){\r\n EditText q1Correct;\r\n q1Correct = (EditText) findViewById(R.id.q1Answer);\r\n String inputText = q1Correct.getText().toString();\r\n String rightAnswer = \"TextView\";\r\n\r\n if (inputText.equals(rightAnswer)) {\r\n q1Score = q1Score + 1;\r\n Toast toast = Toast.makeText(this, \"Great Job! 1 point added.\", Toast.LENGTH_SHORT);\r\n toast.show();\r\n } else {\r\n q1Score = 0;\r\n Toast toast = Toast.makeText(this, \"Better luck next time, 0 points added.\", Toast.LENGTH_SHORT);\r\n toast.show();\r\n }\r\n\r\n Intent i = new Intent(this, Question2Activity.class);\r\n startActivity(i);\r\n }",
"public void q3Submit(View view) {\n\n RadioButton radioButton = (RadioButton) findViewById(R.id.q3option1);\n\n //Nested if statements to check if the answer is correct or not, then to assign 2 points if it's correct.\n if (radioButton.isChecked()) {\n if (isNotAnsweredQ3) {\n display(pointCounter += 2);\n Toast.makeText(this, getString(R.string.correct2), Toast.LENGTH_SHORT).show();\n isNotAnsweredQ3 = false;\n }\n } else {\n Toast.makeText(this, getString(R.string.thinkAgain), Toast.LENGTH_SHORT).show();\n }\n }",
"public abstract void editQuestion();",
"public static boolean checkAnswerCorrect(KeyEvent e, boolean yesCorrect, boolean FforTrue) {\n boolean correct;\n if ((yesCorrect && e.getCode() == KeyCode.F)\n || !yesCorrect && e.getCode() == KeyCode.J) {\n correct = true;\n } else { \n correct = false; \n } \n if (!FforTrue) {\n return !correct;\n }\n return correct;\n }",
"private void setAnswer() {\n DbHelper dbhelper = new DbHelper(context);\n questionNo = questionNo + 1;\n QuizAnswer answer = new QuizAnswer();\n answer.setQuizId(quizId);\n answer.setQuestionId(questionId);\n int optionId = shareprefs.getInt(\"optionId\", 0);\n answer.setOptionId(optionId);\n int correctAns = shareprefs.getInt(\"correctAns\", 0);\n answer.setAnswer(correctAns);\n answer.setContentId(contentId);\n boolean flage = dbhelper.upsertQuizAnswerEntity(answer);\n if (flage) {\n shareprefs.edit().clear().commit();//clear select OptionPreferences\n setValue();\n }\n }",
"public void wrongClick(View view) {\n if (roundOne[questionId].getCorrect_answer().equals(\"False\")) {\n Toast.makeText(getApplicationContext(), \"Juiste Antwoord\",\n Toast.LENGTH_SHORT).show();\n score += 5;\n } else {\n Toast.makeText(getApplicationContext(), \"Foute Antwoord\",\n Toast.LENGTH_SHORT).show();\n }\n questionId++;\n setQuestion(questionId);\n }",
"public void q5Submit(View view) {\n\n RadioButton radioButton = (RadioButton) findViewById(R.id.q5option3);\n\n //Nested if statements to check if the answer is correct or not, then to assign 2 points if it's correct.\n if (radioButton.isChecked()) {\n if (isNotAnsweredQ5) {\n display(pointCounter += 2);\n Toast.makeText(this, getString(R.string.correct2), Toast.LENGTH_SHORT).show();\n isNotAnsweredQ5 = false;\n }\n } else {\n Toast.makeText(this, getString(R.string.thinkAgain), Toast.LENGTH_SHORT).show();\n }\n }"
] | [
"0.67303824",
"0.62397367",
"0.6223092",
"0.6122589",
"0.61184144",
"0.60924095",
"0.6089252",
"0.6077811",
"0.6006732",
"0.5968584",
"0.594839",
"0.5893194",
"0.58742774",
"0.58537614",
"0.5850749",
"0.584702",
"0.581117",
"0.5802317",
"0.5800102",
"0.5793951",
"0.5793083",
"0.57858086",
"0.5783935",
"0.57812357",
"0.57576835",
"0.574768",
"0.5738168",
"0.5731752",
"0.5730622",
"0.57214713",
"0.57120216",
"0.5705736",
"0.5700977",
"0.5693952",
"0.5656132",
"0.56349736",
"0.5622633",
"0.56202507",
"0.5586015",
"0.5584965",
"0.55784744",
"0.55775034",
"0.55706",
"0.5548836",
"0.5547633",
"0.55354613",
"0.5532435",
"0.5530743",
"0.5523837",
"0.5519129",
"0.5516557",
"0.55048996",
"0.5504861",
"0.5497503",
"0.5495333",
"0.54947215",
"0.5493065",
"0.54916155",
"0.54844767",
"0.5483727",
"0.5477029",
"0.54729265",
"0.54725266",
"0.54638815",
"0.5462994",
"0.54599565",
"0.54572475",
"0.54539186",
"0.5451424",
"0.5448823",
"0.5448626",
"0.54477775",
"0.5441451",
"0.54327035",
"0.5429682",
"0.54241204",
"0.5423355",
"0.54230386",
"0.54045343",
"0.5384169",
"0.53801376",
"0.53764665",
"0.53653944",
"0.53647095",
"0.5360743",
"0.5357875",
"0.535439",
"0.53443635",
"0.53440285",
"0.5329217",
"0.5327566",
"0.5321197",
"0.53182524",
"0.5317898",
"0.5310507",
"0.53081644",
"0.5306932",
"0.5301906",
"0.52999574",
"0.5298097"
] | 0.6645291 | 1 |
IEggLayer Should be implemented for every Genetic Mob that has the chance to lay eggs. Should NOT be implemented if the mob periodically drops something other than an egg. | public interface IEggLayer {
/**
* canLayEgg
* Whether this mob can currently lay an egg.
* @param geneticMob the mob being checked
* @return true if egglaying is possible
*/
boolean canLayEgg(IGeneticMob geneticMob);
/**
* getEggItem
* The ItemStack that this mob would currently drop as an egg.
* @param geneticMob the mob being checked
* @return the egg
*/
ItemStack getEggItem(IGeneticMob geneticMob);
/**
* willEggHatch
* Whether an egg laid right now by this mob is fertilized and will hatch into a baby mob.
* @param geneticMob the mob being checked
* @return true if it will eventually hatch
*/
boolean willEggHatch(IGeneticMob geneticMob);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean canLayEgg(IGeneticMob geneticMob);",
"boolean willEggHatch(IGeneticMob geneticMob);",
"ItemStack getEggItem(IGeneticMob geneticMob);",
"@Override\n\tpublic void laysEgg() {\n\t\t\n\t}",
"public void livingTick() {\n super.livingTick();\n this.oFlap = this.wingRotation;\n this.oFlapSpeed = this.destPos;\n this.destPos = (float)((double)this.destPos + (double)(this.onGround ? -1 : 4) * 0.3D);\n this.destPos = MathHelper.clamp(this.destPos, 0.0F, 1.0F);\n if (!this.onGround && this.wingRotDelta < 1.0F) {\n this.wingRotDelta = 1.0F;\n }\n\n this.wingRotDelta = (float)((double)this.wingRotDelta * 0.9D);\n Vec3d vec3d = this.getMotion();\n if (!this.onGround && vec3d.y < 0.0D) {\n this.setMotion(vec3d.mul(1.0D, 0.6D, 1.0D));\n }\n\n this.wingRotation += this.wingRotDelta * 2.0F;\n if (!this.world.isRemote && this.isAlive() && !this.isChild() && getGender()==Gender.FEMALE && --this.timeUntilNextEgg <= 0) {\n this.playSound(SoundEvents.ENTITY_CHICKEN_EGG, 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);\n this.entityDropItem(Items.EGG);\n this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000;\n }\n\n ++this.eatTicks;\n ItemStack itemstack = this.getItemStackFromSlot(EquipmentSlotType.MAINHAND);\n if (this.canEatItem(itemstack)) {\n if (this.eatTicks > 600) {\n ItemStack itemstack1 = itemstack.onItemUseFinish(this.world, this);\n if (!itemstack1.isEmpty()) {\n this.setItemStackToSlot(EquipmentSlotType.MAINHAND, itemstack1);\n }\n\n this.eatTicks = 0;\n } else if (this.eatTicks > 560 && this.rand.nextFloat() < 0.1F) {\n this.playSound(this.getEatSound(itemstack), 1.0F, 1.0F);\n this.world.setEntityState(this, (byte)45);\n }\n }\n\n }",
"public interface IMachineGlasses \n{\n\t/**\n\t * Called on display ticks with the player to determine if the player can see complex machine interfaces. Return true to allow it.\n\t * @return True to allow the player to see complex machine interfaces.\n\t * @param player The player wearing the gear\n\t */\n\tpublic boolean isVisionary(EntityPlayer player);\n}",
"public void act() \n {\n EggFactory eggFactory = new EggFactory();\n \n move(4);\n int random = Greenfoot.getRandomNumber(5000);\n if((random>200 & random<300) || ((Farm)getWorld()).atWorldEdge(this))\n {\n turn(180);\n getImage().mirrorVertically();\n move(4);\n \n }\n\n if( Greenfoot.getRandomNumber(100) ==0)\n {\n\n Farm farm = (Farm)getWorld();\n Egg egg = null; \n int eggPicker = Greenfoot.getRandomNumber(80);\n //DropEggStrategy dropEgg = new DropEggStrategy(); //Strategy pattern\n\n IEggStrategy whiteStrategy = new WhiteEggStrategy(eggFactory);\n IEggStrategy blackStrategy = new BlackEggStrategy(eggFactory);\n IEggStrategy goldenStrategy = new GoldenEggStrategy(eggFactory);\n \n DropEggContext context = new DropEggContext();\n \n if(eggPicker >= 50 && eggPicker <= 60){\n \n context.setIEggStrategy(goldenStrategy);\n egg = context.dropEgg();\n getWorld().addObject(egg, this.getX(), this.getY()+45);\n }\n else if(eggPicker >= 60 && eggPicker <= 70){\n\n context.setIEggStrategy(blackStrategy);\n egg = context.dropEgg();\n getWorld().addObject(egg, this.getX(), this.getY()+45);\n }\n else{\n context.setIEggStrategy(whiteStrategy);\n egg = context.dropEgg();\n getWorld().addObject(egg, this.getX(), this.getY()+45);\n }\n \n egg.register(farm.getLifeObserver());//register life creator observer into egg subject \n\n \n\n }\n\n }",
"boolean shouldAutoAggro(IGeneticMob geneticMob, EntityLiving otherEntity);",
"@ForgeSubscribe\n \tpublic void onLivingUpdate(LivingUpdateEvent event) {\n \t\t\n \t\tEntityLivingBase entity = event.entityLiving;\n \t\tEntityPlayer player = ((entity instanceof EntityPlayer) ? (EntityPlayer)entity : null);\n \t\tItemStack backpack = ItemBackpack.getBackpack(entity);\n \t\t\n \t\tPropertiesBackpack backpackData;\n \t\tif (backpack == null) {\n \t\t\t\n \t\t\tbackpackData = EntityUtils.getProperties(entity, PropertiesBackpack.class);\n \t\t\tif (backpackData == null) return;\n \t\t\t\n \t\t\t// If the entity is supposed to spawn with\n \t\t\t// a backpack, equip it with one.\n \t\t\tif (backpackData.spawnsWithBackpack) {\n \t\t\t\t\n \t\t\t\tItemStack[] contents = null;\n \t\t\t\tif (entity instanceof EntityFrienderman) {\n \t\t\t\t\tbackpack = new ItemStack(BetterStorage.enderBackpack);\n \t\t\t\t\t((EntityLiving)entity).setEquipmentDropChance(3, 0.0F); // Remove drop chance for the backpack.\n \t\t\t\t} else {\n \t\t\t\t\tbackpack = new ItemStack(BetterStorage.backpack, 1, RandomUtils.getInt(120, 240));\n \t\t\t\t\tItemBackpack backpackType = (ItemBackpack)Item.itemsList[backpack.itemID];\n \t\t\t\t\tif (RandomUtils.getBoolean(0.15)) {\n \t\t\t\t\t\t// Give the backpack a random color.\n \t\t\t\t\t\tint r = RandomUtils.getInt(32, 224);\n \t\t\t\t\t\tint g = RandomUtils.getInt(32, 224);\n \t\t\t\t\t\tint b = RandomUtils.getInt(32, 224);\n \t\t\t\t\t\tint color = (r << 16) | (g << 8) | b;\n \t\t\t\t\t\tbackpackType.func_82813_b(backpack, color);\n \t\t\t\t\t}\n \t\t\t\t\tcontents = new ItemStack[backpackType.getColumns() * backpackType.getRows()];\n \t\t\t\t\t((EntityLiving)entity).setEquipmentDropChance(3, 1.0F); // Set drop chance for the backpack to 100%.\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// If the entity spawned with enchanted armor,\n \t\t\t\t// move the enchantments over to the backpack.\n \t\t\t\tItemStack armor = entity.getCurrentItemOrArmor(CurrentItem.CHEST);\n \t\t\t\tif (armor != null && armor.isItemEnchanted()) {\n \t\t\t\t\tNBTTagCompound compound = new NBTTagCompound();\n \t\t\t\t\tcompound.setTag(\"ench\", armor.getTagCompound().getTag(\"ench\"));\n \t\t\t\t\tbackpack.setTagCompound(compound);\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tif (contents != null) {\n \t\t\t\t\t// Add random items to the backpack.\n \t\t\t\t\tInventoryStacks inventory = new InventoryStacks(contents);\n \t\t\t\t\t// Add normal random backpack loot\n \t\t\t\t\tWeightedRandomChestContent.generateChestContents(\n \t\t\t\t\t\t\tRandomUtils.random, randomBackpackItems, inventory, 20);\n \t\t\t\t\t// With a chance of 10%, add some random dungeon loot\n \t\t\t\t\tif (RandomUtils.getDouble() < 0.1) {\n \t\t\t\t\t\tChestGenHooks info = ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST);\n \t\t\t\t\t\tWeightedRandomChestContent.generateChestContents(\n \t\t\t\t\t\t\t\tRandomUtils.random, info.getItems(RandomUtils.random), inventory, 5);\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\tItemBackpack.setBackpack(entity, backpack, contents);\n \t\t\t\tbackpackData.spawnsWithBackpack = false;\n \t\t\t\t\n \t\t\t} else {\n \t\t\t\t\n \t\t\t\t// If the entity doesn't have a backpack equipped,\n \t\t\t\t// but still has some backpack data, drop the items.\n \t\t\t\tif (backpackData.contents != null) {\n \t\t\t\t\tfor (ItemStack stack : backpackData.contents)\n \t\t\t\t\t\tWorldUtils.dropStackFromEntity(entity, stack, 1.5F);\n \t\t\t\t\tbackpackData.contents = null;\n \t\t\t\t}\n \t\t\t\t\n \t\t\t}\n \t\t\t\n \t\t\treturn;\n \t\t\t\n \t\t} else backpackData = ItemBackpack.getBackpackData(entity);\n \t\t\n \t\tbackpackData.prevLidAngle = backpackData.lidAngle;\n \t\tfloat lidSpeed = 0.2F;\n \t\tif (ItemBackpack.isBackpackOpen(entity))\n \t\t\tbackpackData.lidAngle = Math.min(1.0F, backpackData.lidAngle + lidSpeed);\n \t\telse backpackData.lidAngle = Math.max(0.0F, backpackData.lidAngle - lidSpeed);\n \t\t\n \t\tString sound = Block.soundSnowFootstep.getStepSound();\n \t\t// Play sound when opening\n \t\tif ((backpackData.lidAngle > 0.0F) && (backpackData.prevLidAngle <= 0.0F))\n \t\t\tentity.worldObj.playSoundEffect(entity.posX, entity.posY, entity.posZ, sound, 1.0F, 0.5F);\n \t\t// Play sound when closing\n \t\tif ((backpackData.lidAngle < 0.2F) && (backpackData.prevLidAngle >= 0.2F))\n \t\t\tentity.worldObj.playSoundEffect(entity.posX, entity.posY, entity.posZ, sound, 0.8F, 0.3F);\n \t\t\n \t}",
"@Override\n\tpublic void eggHatches() {\n\t\t\n\t}",
"float shouldEatOffTheGround(IGeneticMob geneticMob, EntityItem itemEntity);",
"@Override\n public void tick() {\n if (!this.world.isRemote) {\n if (this.angler == null) {\n this.remove();\n return;\n }\n this.setFlag(6, this.isGlowing());\n }\n this.baseTick();\n age++;\n\n if (this.world.isRemote) {\n int i = this.getDataManager().get(cau_ent);\n\n if (i > 0 && this.caughtEntity == null) {\n this.caughtEntity = this.world.getEntityByID(i - 1);\n MinecraftForge.EVENT_BUS.post(new HookReturningEvent(this));\n }\n } else {\n ItemStack itemstack = this.angler.getHeldItemMainhand();\n\n if (age > 80 || !this.angler.isAlive() || itemstack.getItem() != Items.ITEM_GRAB_HOOK || this.getDistanceSq(this.angler) > 4096.0D) {\n this.remove();\n this.angler.fishingBobber = null;\n return;\n }\n }\n\n if (this.caughtEntity != null && this.angler != null) {\n pullEntity();\n return;\n }\n if (this.inGround) {\n if(hasGrappling && this.angler != null){\n pullUser();\n }else{\n this.remove();\n }\n return;\n }\n\n // In the air\n ++this.ticksInAir;\n if (this.ticksInAir == 20) {\n setReturning();\n }\n if (!this.world.isRemote) {\n boolean caughtSomething = checkCollision();\n if(caughtSomething){\n return;\n }\n\n if (this.isReturning) {\n Vector3d target = this.angler.getPositionVec().add(0, this.angler.getEyeHeight(), 0);\n Vector3d v = target.subtract(this.getPositionVec());\n if (v.length() < 3D) {\n this.remove();\n return;\n }\n v = v.normalize().scale(speed).subtract(0, 0.1, 0);\n this.setMotion(v);\n }\n }\n\n this.move(MoverType.SELF, this.getMotion());\n this.setPosition(this.getPosX(), this.getPosY(), this.getPosZ());\n }",
"@Override\r\n\tpublic void onLivingUpdate() {\r\n\t\tsuper.onLivingUpdate();\r\n\t\tthis.field_70888_h = this.field_70886_e;\r\n\t\tthis.field_70884_g = this.destPos;\r\n\t\tthis.destPos = (float)((double)this.destPos + (double)(this.onGround ? -1 : 4) * 0.3D);\r\n\t\t\r\n\t\tif(this.destPos < 0.0F) {\r\n\t\t\tthis.destPos = 0.0F;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.destPos > 1.0F) {\r\n\t\t\tthis.destPos = 1.0F;\r\n\t\t}\r\n\t\t\r\n\t\tif(!this.onGround && this.field_70889_i < 1.0F) {\r\n\t\t\tthis.field_70889_i = 1.0F;\r\n\t\t}\r\n\t\t\r\n\t\tthis.field_70889_i = (float)((double)this.field_70889_i * 0.9D);\r\n\t\t\r\n\t\tif(!this.onGround && this.motionY < 0.0D) {\r\n\t\t\tthis.motionY *= 0.6D;\r\n\t\t}\r\n\t\t\r\n\t\tthis.field_70886_e += this.field_70889_i * 2.0F;\r\n\t\t\r\n\t\tif(!this.isChild() && !this.worldObj.isRemote && --this.timeUntilNextEgg <= 0) {\r\n\t\t\tthis.worldObj.playSoundAtEntity(this, \"mob.chickenplop\", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);\r\n\t\t\tthis.dropItem(SorceryItems.goldegg, 1);\r\n\t\t\tthis.timeUntilNextEgg = this.rand.nextInt(6000) + 6000;\r\n\t\t}\r\n\t}",
"public static boolean renderCustomEffect(RenderItem renderItem, ItemStack itemStack, IBakedModel model) {\n/* 765 */ if (enchantmentProperties == null)\n/* */ {\n/* 767 */ return false;\n/* */ }\n/* 769 */ if (itemStack == null)\n/* */ {\n/* 771 */ return false;\n/* */ }\n/* */ \n/* */ \n/* 775 */ int[][] idLevels = getEnchantmentIdLevels(itemStack);\n/* */ \n/* 777 */ if (idLevels.length <= 0)\n/* */ {\n/* 779 */ return false;\n/* */ }\n/* */ \n/* */ \n/* 783 */ HashSet<Integer> layersRendered = null;\n/* 784 */ boolean rendered = false;\n/* 785 */ TextureManager textureManager = Config.getTextureManager();\n/* */ \n/* 787 */ for (int i = 0; i < idLevels.length; i++) {\n/* */ \n/* 789 */ int id = idLevels[i][0];\n/* */ \n/* 791 */ if (id >= 0 && id < enchantmentProperties.length) {\n/* */ \n/* 793 */ CustomItemProperties[] cips = enchantmentProperties[id];\n/* */ \n/* 795 */ if (cips != null)\n/* */ {\n/* 797 */ for (int p = 0; p < cips.length; p++) {\n/* */ \n/* 799 */ CustomItemProperties cip = cips[p];\n/* */ \n/* 801 */ if (layersRendered == null)\n/* */ {\n/* 803 */ layersRendered = new HashSet();\n/* */ }\n/* */ \n/* 806 */ if (layersRendered.add(Integer.valueOf(id)) && matchesProperties(cip, itemStack, idLevels) && cip.textureLocation != null) {\n/* */ \n/* 808 */ textureManager.bindTexture(cip.textureLocation);\n/* 809 */ float width = cip.getTextureWidth(textureManager);\n/* */ \n/* 811 */ if (!rendered) {\n/* */ \n/* 813 */ rendered = true;\n/* 814 */ GlStateManager.depthMask(false);\n/* 815 */ GlStateManager.depthFunc(514);\n/* 816 */ GlStateManager.disableLighting();\n/* 817 */ GlStateManager.matrixMode(5890);\n/* */ } \n/* */ \n/* 820 */ Blender.setupBlend(cip.blend, 1.0F);\n/* 821 */ GlStateManager.pushMatrix();\n/* 822 */ GlStateManager.scale(width / 2.0F, width / 2.0F, width / 2.0F);\n/* 823 */ float offset = cip.speed * (float)(Minecraft.getSystemTime() % 3000L) / 3000.0F / 8.0F;\n/* 824 */ GlStateManager.translate(offset, 0.0F, 0.0F);\n/* 825 */ GlStateManager.rotate(cip.rotation, 0.0F, 0.0F, 1.0F);\n/* 826 */ renderItem.func_175035_a(model, -1);\n/* 827 */ GlStateManager.popMatrix();\n/* */ } \n/* */ } \n/* */ }\n/* */ } \n/* */ } \n/* */ \n/* 834 */ if (rendered) {\n/* */ \n/* 836 */ GlStateManager.enableAlpha();\n/* 837 */ GlStateManager.enableBlend();\n/* 838 */ GlStateManager.blendFunc(770, 771);\n/* 839 */ GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);\n/* 840 */ GlStateManager.matrixMode(5888);\n/* 841 */ GlStateManager.enableLighting();\n/* 842 */ GlStateManager.depthFunc(515);\n/* 843 */ GlStateManager.depthMask(true);\n/* 844 */ textureManager.bindTexture(TextureMap.locationBlocksTexture);\n/* */ } \n/* */ \n/* 847 */ return rendered;\n/* */ }",
"public interface ILayer {\n}",
"public interface IHitAggro {\n /**\n * shouldAggroOnHit\n * The chance (where 1.0F = 100%) that this mob would be aggroed if struck by this entity\n * Should NOT trigger the aggro itself! That should only occur when actually hit!\n * @param geneticMob the mob being checked\n * @param attacker the entity that could attack\n * @return the chance of aggro (1.0F = 100%, 0.0F = 0%)\n */\n float shouldAggroOnHit(IGeneticMob geneticMob, EntityLiving attacker);\n\n /**\n * aggroHitTimer\n * How long this mob would stay angry at this attacker if aggroed via hit\n * @param geneticMob the mob being checked\n * @param attacker the entity that could attack\n * @return the length, in ticks, of the timer\n */\n int aggroHitTimer(IGeneticMob geneticMob, EntityLiving attacker);\n }",
"public interface BaseLayer{\r\n\t\r\n\t/**\r\n\t * Initialize the layer.\r\n\t */\r\n\tpublic void init();\r\n\t\r\n\t/**\r\n\t * Called during the periodic loops of the Robot.\r\n\t */\r\n\tpublic void periodicUpdate();\r\n\t\r\n\t/**\r\n\t * Get the name of the Layer. Generally used for autonomous command layers. \r\n\t * \r\n\t * @return The name of the Layer.\r\n\t */\r\n\tpublic String getName();\r\n\t\r\n}",
"public void onUsingTick(ItemStack stack, EntityPlayer player, int count) {\n/* 132 */ player.motionX = 0.0D;\n/* 133 */ player.motionZ = 0.0D;\n/* */ \n/* 135 */ int searchRange = 20;\n/* 136 */ List<EntityLivingBase> entities = player.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(player.posX - searchRange, player.posY - searchRange, player.posZ - searchRange, player.posX + searchRange, player.posY + searchRange, player.posZ + searchRange));\n/* */ \n/* 138 */ if (entities.contains(player)) {\n/* 139 */ entities.remove(player);\n/* */ }\n/* 141 */ if (count < getMaxItemUseDuration(stack) - 20) {\n/* 142 */ for (int counter = entities.size() - 1; counter >= 0; counter--) {\n/* 143 */ if (player.getDistanceToEntity((Entity)entities.get(counter)) <= 3.0F && \n/* 144 */ WandManager.consumeVisFromInventory(player, (new AspectList()).add(Aspect.FIRE, (int)(150.0F * RelicsConfigHandler.soulTomeVisMult)).add(Aspect.ENTROPY, (int)(120.0F * RelicsConfigHandler.soulTomeVisMult)))) {\n/* */ \n/* 146 */ EntityLivingBase thrownEntity = entities.get(counter);\n/* */ \n/* 148 */ Vector3 entityVec = Vector3.fromEntityCenter((Entity)thrownEntity);\n/* 149 */ Vector3 playerVec = Vector3.fromEntityCenter((Entity)player);\n/* */ \n/* 151 */ Vector3 diff = entityVec.copy().sub(playerVec).multiply((1.0F / player.getDistanceToEntity((Entity)thrownEntity) * 3.0F));\n/* */ \n/* 153 */ float curve = (float)(1.0D / player.getDistance(entityVec.x, entityVec.y, entityVec.z) * 8.0D);\n/* */ \n/* 155 */ if (!player.worldObj.isRemote)\n/* 156 */ for (int counterZ = 0; counterZ <= 3; counterZ++) {\n/* 157 */ Main.proxy.lightning(player.worldObj, player.posX, player.posY + 1.0D, player.posZ, entityVec.x, entityVec.y, entityVec.z, 40, curve, (int)(player.getDistance(entityVec.x, entityVec.y, entityVec.z) * 6.0D), 0, 0.075F);\n/* */ } \n/* 159 */ player.worldObj.playSoundAtEntity((Entity)player, \"thaumcraft:zap\", 1.0F, 0.8F);\n/* */ \n/* 161 */ thrownEntity.attackEntityFrom((DamageSource)new DamageRegistryHandler.DamageSourceTLightning((Entity)player), (float)(20.0D + 80.0D * Math.random()));\n/* */ \n/* 163 */ thrownEntity.motionX = diff.x;\n/* 164 */ thrownEntity.motionY = diff.y + 1.0D;\n/* 165 */ thrownEntity.motionZ = diff.z;\n/* */ } \n/* */ } \n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 195 */ this; this; this; this; if ((((count < getMaxItemUseDuration(stack) - 20) ? 1 : 0) & ((count % 4 == 0) ? 1 : 0)) != 0 && WandManager.consumeVisFromInventory(player, (new AspectList()).add(Aspect.EARTH, TerraCost).add(Aspect.AIR, AerCost).add(Aspect.FIRE, IgnisCost).add(Aspect.ENTROPY, PerditioCost))) {\n/* */ \n/* 197 */ EntityLivingBase randomEntity = null;\n/* */ \n/* 199 */ if (entities.size() > 0) {\n/* 200 */ randomEntity = entities.get((int)(entities.size() * Math.random()));\n/* */ }\n/* 202 */ if ((((randomEntity != null) ? 1 : 0) & (!player.worldObj.isRemote ? 1 : 0)) != 0) {\n/* */ \n/* 204 */ float soulDamage = randomEntity.getMaxHealth() / RelicsConfigHandler.soulTomeDivisor;\n/* */ \n/* 206 */ if (soulDamage > 20.0F) {\n/* 207 */ soulDamage = 20.0F;\n/* 208 */ } else if (soulDamage < 1.0F) {\n/* 209 */ soulDamage = 1.0F;\n/* */ } \n/* 211 */ randomEntity.attackEntityFrom((DamageSource)new DamageRegistryHandler.DamageSourceSoulDrain((Entity)player), soulDamage);\n/* 212 */ spawnSoul(player.worldObj, randomEntity, (EntityLivingBase)player);\n/* */ } \n/* */ } \n/* */ }",
"@Override\r\n\tpublic void onTravelGearEquip(EntityPlayer player, ItemStack stack)\r\n\t{\n\t}",
"@Override\n public void onEntityUpdate() {\n if (!(world.provider instanceof WorldProviderLimbo || world.provider instanceof WorldProviderDungeonPocket)) {\n setDead();\n super.onEntityUpdate();\n return;\n }\n\n super.onEntityUpdate();\n\n // Check for players and update aggro levels even if there are no players in range\n EntityPlayer player = world.getClosestPlayerToEntity(this, MAX_AGGRO_RANGE);\n boolean visibility = player != null && player.canEntityBeSeen(this);\n updateAggroLevel(player, visibility);\n\n // Change orientation and face a player if one is in range\n if (player != null) {\n facePlayer(player);\n if (!world.isRemote && isDangerous()) {\n // Play sounds on the server side, if the player isn't in Limbo.\n // Limbo is excluded to avoid drowning out its background music.\n // Also, since it's a large open area with many Monoliths, some\n // of the sounds that would usually play for a moment would\n // keep playing constantly and would get very annoying.\n playSounds(player.getPosition());\n }\n\n if (visibility) {\n // Only spawn particles on the client side and outside Limbo\n if (world.isRemote && isDangerous()) {\n spawnParticles(player);\n }\n\n // Teleport the target player if various conditions are met\n if (aggro >= MAX_AGGRO && !world.isRemote && ModConfig.monoliths.monolithTeleportation && !player.isCreative() && isDangerous()) {\n aggro = 0;\n Location destination = WorldProviderLimbo.getLimboSkySpawn(player);\n TeleportUtils.teleport(player, destination, 0, 0);\n player.world.playSound(null, player.getPosition(), ModSounds.CRACK, SoundCategory.HOSTILE, 13, 1);\n }\n }\n }\n }",
"@ForgeSubscribe\n \tpublic void onLivingDeath(LivingDeathEvent event) {\n \t\t\n \t\tEntityLivingBase entity = event.entityLiving;\n \t\tif (entity.worldObj.isRemote) return;\n \t\tItemStack backpack = ItemBackpack.getBackpack(entity);\n \t\tif (backpack == null) return;\n \t\tPropertiesBackpack backpackData = ItemBackpack.getBackpackData(entity);\n \t\tif (backpackData.contents == null) return;\n \t\t\n \t\tboolean keepInventory = entity.worldObj.getGameRules().getGameRuleBooleanValue(\"keepInventory\");\n \t\tif ((entity instanceof EntityPlayer) && keepInventory) {\n \t\t\t\n \t\t\t// If keep inventory is on, instead temporarily save the contents\n \t\t\t// to the persistent NBT tag and get them back when the player respawns.\n \t\t\t\n \t\t\tEntityPlayer player = (EntityPlayer)entity;\n \t\t\tNBTTagCompound compound = player.getEntityData();\n \t\t\tNBTTagCompound persistent;\n \t\t\tif (!compound.hasKey(EntityPlayer.PERSISTED_NBT_TAG)) {\n \t\t\t\tpersistent = new NBTTagCompound();\n \t\t\t\tcompound.setTag(EntityPlayer.PERSISTED_NBT_TAG, persistent);\n \t\t\t} else persistent = compound.getCompoundTag(EntityPlayer.PERSISTED_NBT_TAG);;\n \t\t\t\n \t\t\tNBTTagCompound backpackCompound = new NBTTagCompound();\n \t\t\tbackpackCompound.setInteger(\"count\", backpackData.contents.length);\n \t\t\tbackpackCompound.setTag(\"Items\", NbtUtils.writeItems(backpackData.contents));\n \t\t\tpersistent.setTag(\"Backpack\", backpackCompound);\n \t\t\t\n \t\t} else {\n \t\t\t\n \t\t\tfor (ItemStack stack : backpackData.contents)\n \t\t\t\tWorldUtils.dropStackFromEntity(entity, stack, 4.0F);\n \t\t\tbackpackData.contents = null;\n \t\t\t\n \t\t}\n \t\t\n \t}",
"@Override\n public void render(GameContainer gc, StateBasedGame stateBasedGame, Graphics g) throws SlickException {\n //Loads this seperate, else the map is over-riding all drawn during the game\n loadMap.render(gc, stateBasedGame, g);\n //Render all objects\n for (GameObject obj : objects) {\n obj.render(gc, stateBasedGame, g);\n }\n Input input = gc.getInput();\n int mouseX = input.getMouseX();\n int mouseY = input.getMouseY();\n\n if (sellTower || upgradePressed) {\n if (input.isMousePressed(1)) {\n sellTower = false;\n upgradePressed = false;\n }\n }\n\n //Draws this tower\n for (BasicTower basicTower : basicTowers) {\n basicTower.basicClicked.draw(basicTower.towerX * w, basicTower.towerY * w, w, w);\n }\n //Draws this tower\n for (SniperTower sniperTower : sniperTowers) {\n sniperTower.sniperClicked.draw(sniperTower.towerX * w, sniperTower.towerY * w, w, w);\n }\n //Draws this tower\n for (QuickTower quickTower : quickTowers) {\n quickTower.quickClicked.draw(quickTower.towerX * w, quickTower.towerY * w, w, w);\n }\n //Draws this tower\n for (BomberTower bomberTower : bomberTowers) {\n bomberTower.bomberClicked.draw(bomberTower.bombertowerX * w, bomberTower.bombertowerY * w, w, w);\n }\n\n //This draws for each enemy its healthbar based on it current HP\n for (Enemy enemies : enemies) {\n Rectangle bar = new Rectangle(enemies.getStartPosX() * w + 8,\n enemies.getStartPosY() * w,\n 50 * enemies.getHP() / ((enemy.startHP + currentLevel)), 6);\n GradientFill fill = new GradientFill(enemies.getStartPosX() * w + 8,\n 0, new Color(255, 60, 0),\n enemies.getStartPosX() * w + 60, 0, new Color(255, 180, 0));\n // g.drawString(\"\" + enemies.getHP(), enemies.getStartPosX() * w, enemies.getStartPosY() * w);\n\n g.setColor(Color.darkGray);\n g.fillRect(enemies.getStartPosX() * w + 8, enemies.getStartPosY() * w, 50, 6);\n g.fill(bar, fill);\n\n enemies.e1.draw(enemies.getStartPosX() * w + 8,\n enemies.getStartPosY() * w + 8, w - 16, w - 16);\n }\n\n //Controls the bullets\n for (int i = 0; i < bulletList.size(); i++) {\n Bullets bullets = bulletList.get(i);\n basicbulletSheet.draw(bullets.location.getX(), bullets.location.getY(), 32, 32);\n bulletCircle = new Circle(bullets.location.getX(), bullets.location.getY(), 10);\n for (Enemy enemy : enemies) {\n enemy.Playrect = new Circle(enemy.getStartPosX() * w + r,\n enemy.getStartPosY() * w + r, 25);\n if (bulletList.size() > 0 && bulletCircle.intersects(enemy.Playrect)) {\n bulletCount++;\n collides = true;\n enemy.setHP(enemy.getHP() - 1);\n if (collides) {\n bulletList.remove(i);\n } else {\n collides = false;\n }\n }\n }\n //If the bullet runs out of the screen, remove it\n if (bulletCircle.getX() > (loadMap.HEIGHT - 6) * w || bulletCircle.getY() > loadMap.WIDTH * w) {\n bulletList.remove(i);\n }\n //g.setColor(transparent);\n //g.fill(bulletCircle);\n }\n\n g.setColor(Color.green);\n g.drawString(\"Level: \" + currentLevel, 715, 385);\n\n //SELL TOWERS\n if (loadMap.MAP[mouseY / w][mouseX / w] == 12) {\n if (input.isMousePressed(0)) {\n sellTower = true;\n upgradePressed = false;\n }\n }\n //Remove sellTower or Upgradepressed if mouse is on a tower in the menu\n if (loadMap.MAP[mouseY / w][mouseX / w] == 8 || loadMap.MAP[mouseY / w][mouseX / w] == 6 ||\n loadMap.MAP[mouseY / w][mouseX / w] == 10 || loadMap.MAP[mouseY / w][mouseX / w] == 4) {\n sellTower = false;\n upgradePressed = false;\n }\n\n //Visible if selltower is pressed\n if (sellTower) {\n loadMap.MAP[4][11] = 13;\n } else {\n loadMap.MAP[4][11] = 12;\n }\n //Sell Basic\n if (loadMap.MAP[mouseY / w][mouseX / w] == 5 && basicTowers.listIterator().hasNext()) {\n BasicTower b = getBasicTower(mouseY / w, mouseX / w);\n g.drawString(\"BasicTower\", 715, 445);\n g.drawString(\"Refund value: \" + basicTowers.listIterator().next().refundValue, 715, 475);\n g.drawString(\"Upgrade Cost: \" + basicTowers.listIterator().next().upgradeCost, 715, 505);\n if (b != null) {\n g.drawString(\"Tower Level: \" + b.towerLevel, 715, 535);\n }\n if (sellTower) {\n if (input.isMousePressed(0)) {\n BasicTower t = getBasicTower(mouseY / w, mouseX / w);\n if (t != null) {\n player.addCredits(t.refundValue);\n basicTowers.remove(t);\n }\n loadMap.MAP[mouseY / w][mouseX / w] = 1;\n sellTower = false;\n }\n }\n }\n\n //Sell Bomber\n if (loadMap.MAP[mouseY / w][mouseX / w] == 7 && bomberTowers.listIterator().hasNext()) {\n BomberTower b = getBomberTower(mouseY / w, mouseX / w);\n g.drawString(\"BomberTower\", 715, 445);\n g.drawString(\"Refund value: \" + bomberTowers.listIterator().next().refundValue, 715, 475);\n g.drawString(\"Upgrade Cost: \" + bomberTowers.listIterator().next().upgradeCost, 715, 505);\n if (b != null) {\n g.drawString(\"Tower Level: \" + b.towerLevel, 715, 535);\n }\n if (sellTower) {\n if (input.isMousePressed(0)) {\n BomberTower t = getBomberTower(mouseY / w, mouseX / w);\n if (t != null) {\n player.addCredits(t.refundValue);\n bomberTowers.remove(t);\n }\n loadMap.MAP[mouseY / w][mouseX / w] = 1;\n sellTower = false;\n }\n }\n }\n\n //Sell QuickTower\n if (loadMap.MAP[mouseY / w][mouseX / w] == 9 && quickTowers.listIterator().hasNext()) {\n QuickTower b = getQuickTower(mouseY / w, mouseX / w);\n g.drawString(\"QuickTower\", 715, 445);\n g.drawString(\"Refund value: \" + quickTowers.listIterator().next().refundValue, 715, 475);\n g.drawString(\"Upgrade Cost: \" + quickTowers.listIterator().next().upgradeCost, 715, 505);\n if (b != null) {\n g.drawString(\"Tower Level: \" + b.towerLevel, 715, 535);\n }\n if (sellTower) {\n if (input.isMousePressed(0)) {\n QuickTower t = getQuickTower(mouseY / 64, mouseX / 64);\n if (t != null) {\n player.addCredits(t.refundValue);\n quickTowers.remove(t);\n }\n loadMap.MAP[mouseY / w][mouseX / w] = 1;\n sellTower = false;\n }\n }\n }\n //Sell Sniper\n if (loadMap.MAP[mouseY / w][mouseX / w] == 11 && sniperTowers.listIterator().hasNext()) {\n SniperTower s = getSniperTower(mouseY / w, mouseX / w);\n g.drawString(\"SniperTower\", 715, 445);\n g.drawString(\"Refund Value: \" + sniperTowers.listIterator().next().refundValue, 715, 475);\n g.drawString(\"Upgrade Cost: \" + sniperTowers.listIterator().next().upgradeCost, 715, 505);\n if (s != null) {\n g.drawString(\"Tower Level: \" + s.towerLevel, 715, 535);\n }\n if (sellTower) {\n if (input.isMousePressed(0)) {\n SniperTower t = getSniperTower(mouseY / 64, mouseX / 64);\n if (t != null) {\n player.addCredits(t.refundValue);\n sniperTowers.remove(t);\n }\n loadMap.MAP[mouseY / w][mouseX / w] = 1;\n sellTower = false;\n }\n }\n }\n\n\n //UPGRADE TOWERS\n if (loadMap.MAP[mouseY / w][mouseX / w] == 14) {\n if (input.isMousePressed(0)) {\n upgradePressed = true;\n }\n }\n //Visible if upgradePressed is pressed\n if (upgradePressed) {\n loadMap.MAP[4][13] = 15;\n } else {\n loadMap.MAP[4][13] = 14;\n }\n\n //Upgrade Basic\n if (loadMap.MAP[mouseY / w][mouseX / w] == 5 && basicTowers.listIterator().hasNext()) {\n if (upgradePressed) {\n if (input.isMousePressed(0)) {\n BasicTower t = getBasicTower(mouseY / w, mouseX / w);\n if (t != null) {\n if (t.towerLevel < t.maxTowerLevel) {\n if (player.getCredits() >= t.upgradeCost) {\n t.towerLevel++;\n t.ap = t.ap + 1;\n t.coolDown = t.coolDown - 50;\n\n player.addCredits(-t.upgradeCost);\n }\n }\n upgradePressed = false;\n }\n }\n }\n }\n\n //Upgrade Bomber\n if (loadMap.MAP[mouseY / w][mouseX / w] == 7 && bomberTowers.listIterator().hasNext()) {\n if (upgradePressed) {\n if (input.isMousePressed(0)) {\n BomberTower t = getBomberTower(mouseY / w, mouseX / w);\n if (t != null) {\n if (t.towerLevel < t.maxTowerLevel) {\n if (player.getCredits() >= t.upgradeCost) {\n t.towerLevel++;\n t.attackPower++;\n //t.Radius = t.setRadius();\n t.coolDown = t.coolDown - 300;\n\n player.addCredits(-t.upgradeCost);\n }\n }\n upgradePressed = false;\n }\n }\n }\n }\n\n //Upgrade Quick\n if (loadMap.MAP[mouseY / w][mouseX / w] == 9 && quickTowers.listIterator().hasNext()) {\n if (upgradePressed) {\n if (input.isMousePressed(0)) {\n QuickTower t = getQuickTower(mouseY / w, mouseX / w);\n if (t != null) {\n if (t.towerLevel < t.maxTowerLevel) {\n if (player.getCredits() >= t.upgradeCost) {\n t.towerLevel++;\n t.attackPower++;\n //t.Radius = t.setRadius();\n t.coolDown = t.coolDown - 20;\n\n player.addCredits(-t.upgradeCost);\n }\n }\n upgradePressed = false;\n }\n }\n }\n }\n\n //Upgrade Sniper\n if (loadMap.MAP[mouseY / w][mouseX / w] == 11 && sniperTowers.listIterator().hasNext()) {\n if (upgradePressed) {\n if (input.isMousePressed(0)) {\n SniperTower t = getSniperTower(mouseY / w, mouseX / w);\n if (t != null) {\n if (t.towerLevel < t.maxTowerLevel) {\n if (player.getCredits() >= t.upgradeCost) {\n t.towerLevel++;\n t.attackPower++;\n //t.Radius = t.setRadius();\n t.coolDown = t.coolDown - 500;\n\n player.addCredits(-t.upgradeCost);\n }\n }\n upgradePressed = false;\n }\n }\n }\n }\n\n g.setFont(pauseFont);\n g.setColor(white);\n g.drawString(\"PRESS 'ESC' FOR PAUSE\", 100,8);\n\n }",
"@EventHandler\n\tpublic void onEggThrown(PlayerEggThrowEvent e){\n\t\t\n\t\tEntity egg = e.getEgg();\n\t\t\n\t\tif(e.getEgg().getCustomName().contains(ChatColor.MAGIC + \"lootEgg\")){\n\t\t\te.setHatching(false);\n\t\t\t\n\t\t\tLocation loc = egg.getLocation();\n\t\t\t\n\t\t\tdropItem(loc);\n\t\t\t\n\t\t}\n\t\t\n\t}",
"public static boolean renderCustomArmorEffect(EntityLivingBase entity, ItemStack itemStack, ModelBase model, float limbSwing, float prevLimbSwing, float partialTicks, float timeLimbSwing, float yaw, float pitch, float scale) {\n/* 854 */ if (enchantmentProperties == null)\n/* */ {\n/* 856 */ return false;\n/* */ }\n/* 858 */ if (Config.isShaders() && Shaders.isShadowPass)\n/* */ {\n/* 860 */ return false;\n/* */ }\n/* 862 */ if (itemStack == null)\n/* */ {\n/* 864 */ return false;\n/* */ }\n/* */ \n/* */ \n/* 868 */ int[][] idLevels = getEnchantmentIdLevels(itemStack);\n/* */ \n/* 870 */ if (idLevels.length <= 0)\n/* */ {\n/* 872 */ return false;\n/* */ }\n/* */ \n/* */ \n/* 876 */ HashSet<Integer> layersRendered = null;\n/* 877 */ boolean rendered = false;\n/* 878 */ TextureManager textureManager = Config.getTextureManager();\n/* */ \n/* 880 */ for (int i = 0; i < idLevels.length; i++) {\n/* */ \n/* 882 */ int id = idLevels[i][0];\n/* */ \n/* 884 */ if (id >= 0 && id < enchantmentProperties.length) {\n/* */ \n/* 886 */ CustomItemProperties[] cips = enchantmentProperties[id];\n/* */ \n/* 888 */ if (cips != null)\n/* */ {\n/* 890 */ for (int p = 0; p < cips.length; p++) {\n/* */ \n/* 892 */ CustomItemProperties cip = cips[p];\n/* */ \n/* 894 */ if (layersRendered == null)\n/* */ {\n/* 896 */ layersRendered = new HashSet();\n/* */ }\n/* */ \n/* 899 */ if (layersRendered.add(Integer.valueOf(id)) && matchesProperties(cip, itemStack, idLevels) && cip.textureLocation != null) {\n/* */ \n/* 901 */ textureManager.bindTexture(cip.textureLocation);\n/* 902 */ float width = cip.getTextureWidth(textureManager);\n/* */ \n/* 904 */ if (!rendered) {\n/* */ \n/* 906 */ rendered = true;\n/* */ \n/* 908 */ if (Config.isShaders())\n/* */ {\n/* 910 */ ShadersRender.layerArmorBaseDrawEnchantedGlintBegin();\n/* */ }\n/* */ \n/* 913 */ GlStateManager.enableBlend();\n/* 914 */ GlStateManager.depthFunc(514);\n/* 915 */ GlStateManager.depthMask(false);\n/* */ } \n/* */ \n/* 918 */ Blender.setupBlend(cip.blend, 1.0F);\n/* 919 */ GlStateManager.disableLighting();\n/* 920 */ GlStateManager.matrixMode(5890);\n/* 921 */ GlStateManager.loadIdentity();\n/* 922 */ GlStateManager.rotate(cip.rotation, 0.0F, 0.0F, 1.0F);\n/* 923 */ float texScale = width / 8.0F;\n/* 924 */ GlStateManager.scale(texScale, texScale / 2.0F, texScale);\n/* 925 */ float offset = cip.speed * (float)(Minecraft.getSystemTime() % 3000L) / 3000.0F / 8.0F;\n/* 926 */ GlStateManager.translate(0.0F, offset, 0.0F);\n/* 927 */ GlStateManager.matrixMode(5888);\n/* 928 */ model.render((Entity)entity, limbSwing, prevLimbSwing, timeLimbSwing, yaw, pitch, scale);\n/* */ } \n/* */ } \n/* */ }\n/* */ } \n/* */ } \n/* */ \n/* 935 */ if (rendered) {\n/* */ \n/* 937 */ GlStateManager.enableAlpha();\n/* 938 */ GlStateManager.enableBlend();\n/* 939 */ GlStateManager.blendFunc(770, 771);\n/* 940 */ GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);\n/* 941 */ GlStateManager.matrixMode(5890);\n/* 942 */ GlStateManager.loadIdentity();\n/* 943 */ GlStateManager.matrixMode(5888);\n/* 944 */ GlStateManager.enableLighting();\n/* 945 */ GlStateManager.depthMask(true);\n/* 946 */ GlStateManager.depthFunc(515);\n/* 947 */ GlStateManager.disableBlend();\n/* */ \n/* 949 */ if (Config.isShaders())\n/* */ {\n/* 951 */ ShadersRender.layerArmorBaseDrawEnchantedGlintEnd();\n/* */ }\n/* */ } \n/* */ \n/* 955 */ return rendered;\n/* */ }",
"@Override\n\tpublic int getGameLayer() {\n\t\treturn 0;\n\t}",
"@Override\n\tpublic void addModel(ChunkProcessor obj, ThreadChunkDeligate chunks, int x, int y, int z, BlockData data, NamespaceID biome)\n\t{\n\t\tint eggs = Integer.parseInt(data.state.get(\"eggs\"));\n\t\t\n\t\tNamespaceID[] mtlSides = getMtlSides(data, biome);\n\t\t\n\t\tTransform rotate = new Transform();\n\t\tTransform translate = new Transform();\n\t\tTransform rt;\n\n // Generates a random number between 0 and 3 inclusively. \n Random r = new Random();\n int randomRotation = r.nextInt(4);\n\t\t\n // Creates a rotation such that we will use to randomly rotate the egg(s) with. \n\t\tswitch (randomRotation)\n\t\t{\n\t\t\tcase 0:\n\t\t\t\trotate = Transform.rotation(0, 0, 0);\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\trotate = Transform.rotation(0, 90, 0);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\trotate = Transform.rotation(0, 180, 0);\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\trotate = Transform.rotation(0, 270, 0);\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t\n\t\ttranslate = Transform.translation(x, y, z);\n\t\trt = translate.multiply(rotate);\n\t\t\n\t\tboolean[] drawSides = new boolean[] {true,true,true,true,true,false};\n\t\t\n\t\t// Adds the first egg\n\t\tUV[] uvTop = new UV[] { new UV(0,12/16f), new UV(0,1), new UV(4/16f,1), new UV(4/16f,12/16f) };\n\t\tUV[] uvSide = new UV[] { new UV(5/16f,5/16f), new UV(1/16f,5/16f), new UV(1/16f,12/16f), new UV(5/16f,12/16f) };\n\t\tUV[][] uvSides = new UV[][] { uvTop, uvSide, uvSide, uvSide, uvSide, uvSide };\n\t\taddBox(obj, -4/16f,-8/16f, -3/16f, 1/16f, -1/16f, 2/16f, rt, mtlSides, uvSides, drawSides);\n\t\t\n\t\t// Adds the second egg, if applicable\n\t\tif (eggs > 1) \n\t\t{\n\t\t\tuvTop = new UV[] { new UV(6/16f,5/16f), new UV(6/16f,9/16f), new UV(10/16f,9/16f), new UV(10/16f,5/16f) };\n\t\t\tuvSide = new UV[] { new UV(14/16f,1/16f), new UV(10/16f,1/16f), new UV(10/16f,6/16f), new UV(14/16f,6/16f) };\n\t\t\tuvSides = new UV[][] { uvTop, uvSide, uvSide, uvSide, uvSide, uvSide };\n\t\t\taddBox(obj, -1/16f,-8/16f, -7/16f, 3/16f, -3/16f, -3/16f, rt, mtlSides, uvSides, drawSides);\n\t\t}\n\t\t\n\t\t// Adds the third egg, if applicable\n\t\tif (eggs > 2) \n\t\t{\n\t\t\tuvTop = new UV[] { new UV(8/16f,13/16f), new UV(5/16f,13/16f), new UV(5/16f,1), new UV(8/16f,1) };\n\t\t\tuvSide = new UV[] { new UV(11/16f,9/16f), new UV(8/16f,9/16f), new UV(8/16f,13/16f), new UV(11/16f,13/16f) };\n\t\t\tuvSides = new UV[][] { uvTop, uvSide, uvSide, uvSide, uvSide, uvSide };\n\t\t\taddBox(obj, -1/16f,-8/16f, 3/16f, 2/16f, -4/16f, 6/16f, rt, mtlSides, uvSides, drawSides);\n\t\t}\n\t\t\n\t\t// Adds the fourth egg, if applicable\n\t\tif (eggs > 3) \n\t\t{\n\t\t\tuvTop = new UV[] { new UV(8/16f,1/16f), new UV(4/16f,1/16f), new UV(4/16f,5/16f), new UV(8/16f,5/16f) };\n\t\t\tuvSide = new UV[] { new UV(4/16f,1/16f), new UV(0,1/16f), new UV(0,5/16f), new UV(4/16f,5/16f) };\n\t\t\tuvSides = new UV[][] { uvTop, uvSide, uvSide, uvSide, uvSide, uvSide };\n\t\t\taddBox(obj, 2/16f,-8/16f, -1/16f, 5/16f, -5/16f, 2/16f, rt, mtlSides, uvSides, drawSides);\n\t\t}\n\t}",
"@Override\n public boolean buildIgloo(){\n iglooOn = false;\n Game.log.format(\"! SnowyHole>buildIgloo : SnowyHole (%d, %d) cannot have Igloo! Cannot built 'iglooOn=false'\\n\", x, y);\n return false;\n }",
"public interface IFoodMgr\n{\n /**\n * Update the IBubbleMgr - must be called on each pass thru update loop\n */\n void update(Env world) throws Exception;\n\n}",
"public interface IEnemyFeature {\n\n}",
"private void generateItemEntities(){\n final int NUM_POTIONS = 6;\n final int NUM_IRON_ARMOUR = 1;\n final int NUM_CHESTS = 2;\n final String ITEM_BOX_STYLE = \"volcano\";\n\n\n for (int i = 0; i < NUM_POTIONS; i++) {\n Tile tile = getTile(Item.randomItemPositionGenerator(DEFAULT_WIDTH),\n Item.randomItemPositionGenerator(DEFAULT_HEIGHT));\n if (Integer.parseInt(tile.getTextureName().split(\"_\")[1]) < 5\n && !tile.hasParent()) {\n HealthPotion potion = new HealthPotion(tile,false,\n (PlayerPeon) getPlayerEntity(), ITEM_BOX_STYLE);\n entities.add(potion);\n this.allVolcanoDialogues.add(potion.getDisplay());\n } else {\n i--;\n }\n }\n for (int i =0; i < NUM_IRON_ARMOUR; i++){\n Tile tile = getTile(Item.randomItemPositionGenerator(DEFAULT_WIDTH),\n Item.randomItemPositionGenerator(DEFAULT_HEIGHT));\n if (Integer.parseInt(tile.getTextureName().split(\"_\")[1]) < 5\n && !tile.hasParent()) {\n IronArmour ironArmour = new IronArmour(tile, false,\n (PlayerPeon) getPlayerEntity(),ITEM_BOX_STYLE,200);\n entities.add(ironArmour);\n this.allVolcanoDialogues.add(ironArmour.getDisplay());\n } else {\n i--;\n }\n }\n for (int i = 0; i <NUM_CHESTS; i++){\n Tile tile = getTile(Item.randomItemPositionGenerator(DEFAULT_WIDTH),\n Item.randomItemPositionGenerator(DEFAULT_HEIGHT));\n if (Integer.parseInt(tile.getTextureName().split(\"_\")[1]) < 5\n && !tile.hasParent()) {\n Treasure chest = new Treasure(tile, false,\n (PlayerPeon) getPlayerEntity(),ITEM_BOX_STYLE);\n entities.add(chest);\n this.allVolcanoDialogues.add(chest.getDisplay());\n } else {\n i--;\n }\n }\n\n Tile cooldownring = getTile(20,-7);\n CooldownRing cdring = new CooldownRing(cooldownring, false,\n (PlayerPeon) this.getPlayerEntity(), ITEM_BOX_STYLE,0.5f);\n entities.add(cdring);\n this.allVolcanoDialogues.add(cdring.getDisplay());\n\n Tile attackAmuletTile = getTile(2,14);\n Amulet attackAmulet = new Amulet(attackAmuletTile, false,\n (PlayerPeon) this.getPlayerEntity(), ITEM_BOX_STYLE,10);\n entities.add(attackAmulet);\n this.allVolcanoDialogues.add(attackAmulet.getDisplay());\n\n }",
"public IFog getFog();",
"@GofExample(pattern=\"Flyweight\", stereotype=\"Flyweight\")\r\npublic interface Model\r\n{\r\n\t/**\r\n\t * Visual animation of the model.k\r\n\t * @param lights The actual light conditions when the animation happens.\r\n\t * It can vary in time so it is extrinsic.\r\n\t */\r\n\tvoid animate( LightCondition lights );\r\n}",
"@SuppressWarnings(\"deprecation\")\n\t@EventHandler\n\tpublic void onEggLaunch(ProjectileLaunchEvent e){\n\n\t\tif(!fromDisp){\t\n\t\t\t\n\t\t\tEntity egg = e.getEntity();\n\t\t\tPlayer player = getThrower();\n\t\t\tItemStack item = player.getItemInHand();\n\t\t\tItemMeta meta;\n\t\t\tList<String> lor;\n\t\t\t\n\t\tif(item.hasItemMeta()){\n\t\t\tmeta = item.getItemMeta();\n\t\t\tif(meta.hasLore()){\n\t\t\t\tlor = meta.getLore();\n\t\t\t\tif(lor.contains(ChatColor.MAGIC + \"lootEgg\")){\n\t\t\t\t\tegg.setCustomName(ChatColor.MAGIC + \"lootEgg\");\n\t\t\t\t\tegg.setGlowing(true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t}else{\n\t\t\tfromDisp = false;\n\t\t}\n\t\t\t\n\n\t\t\n\t}",
"protected void renderModel(EntityEnderPig p_77036_1_, float p_77036_2_, float p_77036_3_, float p_77036_4_, float p_77036_5_, float p_77036_6_, float p_77036_7_)\n {\n \tif (p_77036_1_.getSaddled()) {\n \t\tthis.bindTexture(saddledPigTextures);\n \t\tGL11.glPushMatrix();\n \t\tGL11.glScaled(1.1, 1.1, 1.1);\n \t\tGL11.glTranslated(0, -0.08, 0);\n \t\tthis.mainModel.render(p_77036_1_, p_77036_2_, p_77036_3_, p_77036_4_, p_77036_5_, p_77036_6_, p_77036_7_);\n \t\tGL11.glPopMatrix();\n \t}\n \t\n this.bindEntityTexture(p_77036_1_);\n this.mainModel.render(p_77036_1_, p_77036_2_, p_77036_3_, p_77036_4_, p_77036_5_, p_77036_6_, p_77036_7_);\n\n if (p_77036_1_.hurtTime > 0)\n {\n GL11.glDepthFunc(GL11.GL_EQUAL);\n GL11.glDisable(GL11.GL_TEXTURE_2D);\n GL11.glEnable(GL11.GL_BLEND);\n GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);\n GL11.glColor4f(1.0F, 0.0F, 0.0F, 0.5F);\n this.mainModel.render(p_77036_1_, p_77036_2_, p_77036_3_, p_77036_4_, p_77036_5_, p_77036_6_, p_77036_7_);\n GL11.glEnable(GL11.GL_TEXTURE_2D);\n GL11.glDisable(GL11.GL_BLEND);\n GL11.glDepthFunc(GL11.GL_LEQUAL);\n }\n }",
"public EntityItemEmpowerable(World world) {\n super(world);\n }",
"public abstract void attack(Game g);",
"@Override\r\n\tpublic void onThink() {\n\t\tint random = (shotsFired + 1) % 3 - 1;\r\n\t\tVacuumProjectile projectile = new VacuumProjectile(DAMAGE * this.owner.finalDamageOutputModifier, SPEED, this.owner.direction, Point.add(this.owner.gridLoc, new Point(0, random)), this.owner.teamID);\r\n\t\tthis.getMap().addGameElement(projectile);\r\n\t\tthis.shotsFired++;\r\n\t\tif(this.shotsFired >= NUM_SHOTS) {\r\n\t\t\tthis.finishSpell();\r\n\t\t}\r\n\t}",
"public interface IParticleProviderModel extends IBakedModel {\n\n// /**\n// * Gets the textures to use for hit particles at the given face and hit vector.\n// *\n// * @param hitVec The vector.\n// * @param faceHit The face.\n// * @param world The world.\n// * @param pos The position.\n// * @param state The state.\n// * @return The textures to use.\n// */\n// Iterable<TextureAtlasSprite> getHitEffects(Vector3 hitVec, EnumFacing faceHit, IBlockAccess world, BlockPos pos, IBlockState state);\n//\n// /**\n// * Gets the textures to use for destroy particles.\n// *\n// * @param world The world.\n// * @param pos The position.\n// * @param state The state.\n// * @return The textures to use.\n// */\n// Iterable<TextureAtlasSprite> getDestroyEffects(IBlockAccess world, BlockPos pos, IBlockState state);\n\n}",
"@Inject(\n at = @At(\"HEAD\"),\n method = \"tick\",\n cancellable = true)\n\n private void removeWeakenedIfPCEnchant(CallbackInfo ci) {\n if ((Object) this instanceof PlayerEntity) {\n PlayerEntity entity = (PlayerEntity) (Object) this;\n ItemStack mainHand = getMainHandStack();\n\n if (EnchantmentHelper.getLevel(EnchantsRegistry.WEAKENING, mainHand) >= 1\n || mainHand.getItem() == ItemRegistry.getItem(\"sword_nameless_blade\").asItem()) {\n this.removeStatusEffect(StatusEffects.WEAKNESS);\n }\n }\n }",
"public void applyEffects(GoodGuy gg) {\n\t\tif (gemType == 1) {\n\t\t\tgg.addHP(20);\n\t\t} else if (gemType == 2) {\n\t\t\tgg.addHP(50);\n\t\t} else if (gemType == 3) {\n\t\t\tgg.addStamina(20);\n\t\t} else if (gemType == 4) {\n\t\t\tgg.addStamina(50);\n\t\t} else {\n\t\t\tint mhp = gg.getMaxHP();\n\t\t\tint mst = gg.getMaxHP();\n\t\t\tgg.addHP(mhp);\n\t\t\tgg.addStamina(mst);\n\t\t}\n used = true;\n\t}",
"abstract public void triggerExplosion();",
"public interface HullModFleetEffect {\r\n\r\n\t/**\r\n\t * Called for *every* fleet, even fleets that don't have a ship with the specific hullmod.\r\n\t * \r\n\t * Shouldn't try to do a lot here; could have a lot of performance repercussions.\r\n\t * \r\n\t * @param fleet\r\n\t */\r\n\tvoid advanceInCampaign(CampaignFleetAPI fleet);\r\n\t\r\n\t\r\n\t/**\r\n\t * Whether the advanceInCampaign() method should be called for this hullmod.\r\n\t * @return\r\n\t */\r\n\tboolean withAdvanceInCampaign();\r\n\t\r\n\t/**\r\n\t * Whether the withOnFleetSync() method should be called for this hullmod.\r\n\t * @return\r\n\t */\r\n\tboolean withOnFleetSync();\r\n\t\r\n\t\r\n\t/**\r\n\t * Called when anything about the fleet composition changes, including hullmod changes.\r\n\t * Also called for all fleets, including fleets without ships with this hullmod.\r\n\t * @param fleet\r\n\t */\r\n\tvoid onFleetSync(CampaignFleetAPI fleet);\r\n}",
"public void onTick(long i) {\n for (AbstractEntity e : this.getEntities()) {\n e.onTick(0);\n }\n\n checkLavaTileUpdates();\n\n if (notGenerated) {\n createStaticEntities();\n notGenerated = false;\n }\n super.onTick(i);\n }",
"@Override\r\n public void paintWeapon(Graphics g, Player p, ArrayList <Enemies> e) {\r\n\r\n paintProjectile(e, g, p);\r\n deleteProjectiles();\r\n }",
"float shouldAggroOnHit(IGeneticMob geneticMob, EntityLiving attacker);",
"int aggroHitTimer(IGeneticMob geneticMob, EntityLiving attacker);",
"public static void init() {\n GameRegistry.addSmelting(OinkBlocks.OINK_IRON_ORE, new ItemStack(OinkItems.OINK_IRON_INGOT), 1.0F);\n GameRegistry.addSmelting(OinkBlocks.OINK_GOLD_ORE, new ItemStack(OinkItems.OINK_GOLD_INGOT), 1.0F);\n\n //Oink Dust to Ingots\n GameRegistry.addSmelting(OinkItems.OINK_PIG_IRON_DUST, new ItemStack(OinkItems.OINK_IRON_INGOT, 2, 0), 0.7F);\n GameRegistry.addSmelting(OinkItems.OINK_PIG_GOLD_DUST, new ItemStack(OinkItems.OINK_GOLD_INGOT, 2, 0), 0.7F);\n GameRegistry.addSmelting(OinkItems.OINK_PIG_DIAMOND_DUST, new ItemStack(OinkItems.OINK_DIAMOND, 2, 0), 0.7F);\n GameRegistry.addSmelting(OinkItems.OINK_IRON_DUST, new ItemStack(Items.IRON_INGOT, 1, 0), 0.7F);\n GameRegistry.addSmelting(OinkItems.OINK_GOLD_DUST, new ItemStack(Items.GOLD_INGOT, 1, 0), 0.7F);\n GameRegistry.addSmelting(OinkItems.OINK_DIAMOND_DUST, new ItemStack(Items.DIAMOND, 1, 0), 0.7F);\n\n //Oink Ingots to Vanilla Ingots\n GameRegistry.addSmelting(OinkItems.OINK_IRON_INGOT, new ItemStack(Items.IRON_INGOT, 1, 0), 0.7F);\n GameRegistry.addSmelting(OinkItems.OINK_GOLD_INGOT, new ItemStack(Items.GOLD_INGOT, 1, 0), 0.7F);\n GameRegistry.addSmelting(OinkItems.OINK_DIAMOND, new ItemStack(Items.DIAMOND, 1, 0), 0.7F);\n\n //Food\n GameRegistry.addSmelting(OinkItems.OINK_MINCED_PORK, new ItemStack(Items.COOKED_PORKCHOP, 2, 0), 0.5F);\n GameRegistry.addSmelting(OinkItems.OINK_IRON_PORKCHOP_RAW, new ItemStack(OinkItems.OINK_IRON_PORKCHOP, 1, 0), 0.5F);\n GameRegistry.addSmelting(OinkItems.OINK_GOLD_PORKCHOP_RAW, new ItemStack(OinkItems.OINK_GOLD_PORKCHOP, 1, 0), 0.5F);\n GameRegistry.addSmelting(OinkItems.OINK_DIAMOND_PORKCHOP_RAW, new ItemStack(OinkItems.OINK_DIAMOND_PORKCHOP, 1, 0), 0.5F);\n GameRegistry.addSmelting(OinkItems.OINK_ULTIMATE_PORKCHOP_RAW, new ItemStack(OinkItems.OINK_ULTIMATE_PORKCHOP, 1, 0), 3.0F);\n\n //Oink Stuff to MC Stuff\n GameRegistry.addSmelting(OinkItems.OINK_IRON_INGOT, new ItemStack(Items.IRON_INGOT, 2), 1.8F);\n }",
"ILogo getMugShot();",
"public PiecePenguin layEgg(){\n // if this piece hasn't laid max eggs yet - allow it create new piece\n if( this.numEggs < MAX_EGGS){\n this.incrementNumEggs();\n // this creates a new piece that has not laid any eggs\n // and has not attacked any pieces yet it will belong to this team so pass in Color\n return new PiecePenguin(this.symbol, this.color,0,0);\n }\n else{\n return null;\n }\n }",
"protected IProjectile getProjectileEntity(World par1World, IPosition par2IPosition)\n {\n \tEntityBrick brick = new EntityBrick(par1World, par2IPosition.getX(), par2IPosition.getY(), par2IPosition.getZ());\n \tbrick.dispensed = true;\n \treturn brick; \n }",
"@Override\n\tprotected void onImpact(MovingObjectPosition mop)\n\t{\n\t\tif (mop.entityHit != null && !this.fake.cantDamage(mop.entityHit))\n\t\t\tmop.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 22);\n\n\t\tif (!this.worldObj.isRemote)\n\t\t{\n\t\t\t// TODO gamerforEA use ExplosionByPlayer\n\t\t\tExplosionByPlayer.createExplosion(this.fake.get(), this.worldObj, this, this.posX, this.posY, this.posZ, 2, false);\n\n\t\t\tthis.setDead();\n\t\t}\n\t}",
"@Override\n\tpublic ArrayList<GameObject> getGmob() {\n\t\treturn gmob;\n\t}",
"void effect(Entity e, BoardPosition bp);",
"private void onTickInGame()\n \t{\n \n \t\ttry\n \t\t{\n \n \t\t\tif(tickCount>100)\n \t\t\t{\n \t\t\t\ttickCount=0;\n \t\t\t\tint i=0;\n \n \n \t\t\t\twhile (i<15&&FMLCommonHandler.instance().getEffectiveSide()==Side.SERVER)\n \t\t\t\t{\n \t\t\t\t\ti++;\n \t\t\t\t\tLinkData link;\n \n \t\t\t\t\t//actually gets the random rift based on the size of the list\n \t\t\t\t\tlink = (LinkData) dimHelper.instance.getRandomLinkData(true);\n \n \n \n \t\t\t\t\tif(link!=null)\n \t\t\t\t\t{\n \n \t\t\t\t\t\tif(dimHelper.getWorld(link.locDimID)!=null)\n \t\t\t\t\t\t{\n \t\t\t\t\t\t\tWorld world=dimHelper.getWorld(link.locDimID);\n \n \t\t\t\t\t\t\tint blocktoReplace = world.getBlockId(link.locXCoord, link.locYCoord, link.locZCoord);\n \n \t\t\t\t\t\t\tif(!mod_pocketDim.blocksImmuneToRift.contains(blocktoReplace))//makes sure the rift doesn't replace a door or something\n \t\t\t\t\t\t\t{\n \t\t\t\t\t\t\t\tif(dimHelper.instance.getLinkDataFromCoords(link.locXCoord, link.locYCoord, link.locZCoord, link.locDimID)==null)\n \t\t\t\t\t\t\t\t{\n \t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\telse\n \t\t\t\t\t\t\t\t{\n \t\t\t\t\t\t\t\t\tdimHelper.getWorld(link.locDimID).setBlock(link.locXCoord, link.locYCoord, link.locZCoord, properties.RiftBlockID);\n \t\t\t\t\t\t\t\t\tTileEntityRift.class.cast(dimHelper.getWorld(link.locDimID).getBlockTileEntity(link.locXCoord, link.locYCoord, link.locZCoord)).hasGrownRifts=true;\n \t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \n \n \t\t}\n \t\tcatch (Exception e)\n \t\t{\n \t\t\ttickCount++;\n \t\t\tSystem.out.println(\"something on tick went wrong: \" + e);\n \t\t\te.printStackTrace();\n \t\t}\n \t\ttickCount++;\n \n \t\t//this section regulates decay in Limbo- it records any blocks placed by the player and later progresss them through the decay cycle\n \t\tif(tickCount2>10&&dimHelper.blocksToDecay!=null)\n \t\t{\n \t\t\ttickCount2=0;\n \t\t\tif(!dimHelper.blocksToDecay.isEmpty()&&dimHelper.getWorld(properties.LimboDimensionID)!=null)\n \t\t\t{\n \n \n \t\t\t\tif(dimHelper.blocksToDecay.size()>rand.nextInt(400))\n \t\t\t\t{\n \t\t\t\t\tint index = rand.nextInt(dimHelper.blocksToDecay.size());\n \t\t\t\t\tPoint3D point = (Point3D) dimHelper.blocksToDecay.get(index);\n \n \t\t\t\t\tint blockID = dimHelper.getWorld(properties.LimboDimensionID).getBlockId(point.getX(), point.getY(), point.getZ());\n \t\t\t\t\tint idToSet=Block.stone.blockID;\n \n \t\t\t\t\tif(blockID==0||blockID==properties.LimboBlockID)\n \t\t\t\t\t{\n \t\t\t\t\t\tdimHelper.blocksToDecay.remove(index);\n \t\t\t\t\t}\n \t\t\t\t\telse\n \t\t\t\t\t{\n \t\t\t\t\t\tif(Block.blocksList[idToSet] instanceof BlockContainer)\n \t\t\t\t\t\t{\n \t\t\t\t\t\t\tidToSet=-1;\n \t\t\t\t\t\t\tdimHelper.blocksToDecay.remove(index); \n \t\t\t\t\t\t}\n \n \n \n \t\t\t\t\t\tif(blockID==Block.cobblestone.blockID)\n \t\t\t\t\t\t{\n \t\t\t\t\t\t\tidToSet=Block.gravel.blockID;\n \t\t\t\t\t\t}\n \t\t\t\t\t\tif(blockID==Block.stone.blockID)\n \t\t\t\t\t\t{\n \t\t\t\t\t\t\tidToSet=Block.cobblestone.blockID;\n \n \t\t\t\t\t\t}\n \t\t\t\t\t\tif(blockID==Block.gravel.blockID&&!dimHelper.getWorld(properties.LimboDimensionID).isAirBlock(point.getX(), point.getY()-1, point.getZ()))\n \t\t\t\t\t\t{\n \t\t\t\t\t\t\tidToSet=properties.LimboBlockID;\n \t\t\t\t\t\t\tdimHelper.getWorld(properties.LimboDimensionID).scheduleBlockUpdate(point.getX(), point.getY(), point.getZ(),10, idToSet);\n \n \t\t\t\t\t\t}\n \t\t\t\t\t\telse if(blockID==Block.gravel.blockID)\n \t\t\t\t\t\t{\n \t\t\t\t\t\t\tdimHelper.blocksToDecay.remove(index);\n \t\t\t\t\t\t\tidToSet=-1;\n \n \t\t\t\t\t\t}\n \n \t\t\t\t\t\tif(idToSet!=-1)\n \t\t\t\t\t\t{\n \n \t\t\t\t\t\t\tdimHelper.getWorld(properties.LimboDimensionID).setBlock(point.getX(), point.getY(), point.getZ(), idToSet);\n \n \t\t\t\t\t\t} \t\t\n \t\t\t\t\t} \t\t \t\t\n \t\t\t\t} \t\t\n \t\t\t}\n \t\t}\n \n \t\ttickCount2++;\n \n \t\tif(mod_pocketDim.teleTimer>0)\n \t\t{\n \t\t\tmod_pocketDim.teleTimer--;\n \t\t}\n \n \n \n \n \n \n \t}",
"public void addEgg( EggAbstract x ) {\n\t\t//not checking if x is valid because that depends on the coordinate system\n\t\tif (x!=null){\n\t\t\teggs.add(x);\n\t\t}\n\t}",
"public interface IOnAddedToBoardEvent extends IBoardEvent\n{\n public void onAdded(List<ItemStack> layers, ItemStack added, NBTTagCompound specialTagInfo);\n public boolean canAdd(List<ItemStack> currentLayers, ItemStack toAdd, NBTTagCompound specialTagInfo);\n\tpublic ItemStack addedToBoard(List<ItemStack> currentLayers, ItemStack added, NBTTagCompound specialTagInfo);\n\tpublic boolean decrementStackSize(List<ItemStack> currentLayers, ItemStack added, NBTTagCompound specialTagInfo);\n}",
"public ArrayList <EggAbstract> getEggs() {\n\t\t//not checking if x is valid because that depends on the coordinate system\n\t\treturn eggs;\n\t}",
"public boolean processInteract(EntityPlayer entityplayer, EnumHand hand, @Nullable ItemStack stack)\n {\n ItemStack itemstack = entityplayer.inventory.getCurrentItem();\n\n if (!bumgave && angerLevel == 0)\n {\n if (itemstack != null && (itemstack.getItem() == Items.DIAMOND || itemstack.getItem() == Items.GOLD_INGOT || itemstack.getItem() == Items.IRON_INGOT))\n {\n if (itemstack.getItem() == Items.IRON_INGOT)\n {\n value = rand.nextInt(2) + 1;\n }\n else if (itemstack.getItem() == Items.GOLD_INGOT)\n {\n value = rand.nextInt(5) + 1;\n }\n else if (itemstack.getItem() == Items.DIAMOND)\n {\n value = rand.nextInt(10) + 1;\n }\n\n if (itemstack.stackSize - 1 == 0)\n {\n entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, null);\n }\n else\n {\n itemstack.stackSize--;\n }\n\n for (int i = 0; i < 4; i++)\n {\n for (int i1 = 0; i1 < 10; i1++)\n {\n double d1 = rand.nextGaussian() * 0.02D;\n double d3 = rand.nextGaussian() * 0.02D;\n double d6 = rand.nextGaussian() * 0.02D;\n worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_NORMAL, (posX + (double)(rand.nextFloat() * width * 2.0F)) - (double)width, posY + (double)(rand.nextFloat() * height) + (double)i, (posZ + (double)(rand.nextFloat() * width * 2.0F)) - (double)width, d1, d3, d6);\n }\n }\n\n texture = new ResourceLocation(Reference.MODID, Reference.TEXTURE_PATH_ENTITES +\n \t\tReference.TEXTURE_BUM_DRESSED);\n angerLevel = 0;\n //findPlayerToAttack();\n\n if (rand.nextInt(5) == 0)\n {\n // worldObj.playSoundAtEntity(this, \"morecreeps:bumsucker\", 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n worldObj.playSound((EntityPlayer) null, getPosition(), MCSoundEvents.ENTITY_BUM_SUCKER, SoundCategory.NEUTRAL, 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n bumgave = true;\n }\n else\n {\n // worldObj.playSoundAtEntity(this, \"morecreeps:bumthankyou\", 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n worldObj.playSound((EntityPlayer) null, getPosition(), MCSoundEvents.ENTITY_BUM_THANKYOU, SoundCategory.NEUTRAL, 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n bumgave = true;\n\n for (int j = 0; j < 10; j++)\n {\n double d = rand.nextGaussian() * 0.02D;\n double d2 = rand.nextGaussian() * 0.02D;\n double d5 = rand.nextGaussian() * 0.02D;\n worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_NORMAL, (posX + (double)(rand.nextFloat() * width * 2.0F)) - (double)width, posY + (double)(rand.nextFloat() * height), (posZ + (double)(rand.nextFloat() * width * 2.0F)) - (double)width, d, d2, d5);\n }\n\n for (int k = 0; k < value; k++)\n {\n \tif(!worldObj.isRemote) {\n\t dropItem(Item.getItemById(rand.nextInt(95)), 1);\n\t dropItem(Items.IRON_SHOVEL, 1);\n \t}\n }\n\n return true;\n }\n }\n else if (itemstack != null)\n {\n if (timetopee > 0)\n {\n // worldObj.playSoundAtEntity(this, \"morecreeps:bumdontwant\", 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n worldObj.playSound((EntityPlayer) null, getPosition(), MCSoundEvents.ENTITY_BUM_DONTWANT, SoundCategory.NEUTRAL, 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n \n }\n else if (itemstack != null && (itemstack.getItem() == Item.getItemFromBlock(Blocks.YELLOW_FLOWER) || itemstack.getItem() == Item.getItemFromBlock(Blocks.RED_FLOWER)))\n {\n \t/* TODO\n \tif(!((EntityPlayerMP)entityplayer).getStatFile().hasAchievementUnlocked(MoreCreepsAndWeirdos.achievebumflower))\n \t{\n \tworldObj.playSoundAtEntity(entityplayer, \"morecreeps:achievement\", 1.0F, 1.0F);\n \tentityplayer.addStat(MoreCreepsAndWeirdos.achievebumflower, 1);\n \tconfetti(entityplayer);\n \t} */\n\n // worldObj.playSoundAtEntity(this, \"morecreeps:bumthanks\", 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n worldObj.playSound((EntityPlayer) null, getPosition(), MCSoundEvents.ENTITY_BUM_THANKS, SoundCategory.NEUTRAL, 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n timetopee = rand.nextInt(1900) + 1500;\n\n if (itemstack.stackSize - 1 == 0)\n {\n entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, null);\n }\n else\n {\n itemstack.stackSize--;\n }\n }\n else if (itemstack != null && itemstack.getItem() == Items.BUCKET)\n {\n \t/* TODO\n if (!((EntityPlayerMP)entityplayer).getStatFile().hasAchievementUnlocked(MoreCreepsAndWeirdos.achievebumpot) && ((EntityPlayerMP)entityplayer).getStatFile().hasAchievementUnlocked(MoreCreepsAndWeirdos.achievebumflower))\n {\n worldObj.playSoundAtEntity(entityplayer, \"morecreeps:achievement\", 1.0F, 1.0F);\n entityplayer.addStat(MoreCreepsAndWeirdos.achievebumpot, 1);\n confetti(entityplayer);\n } \n entityplayer.addStat(MoreCreepsAndWeirdos.achievebumpot, 1);\n */\n // worldObj.playSoundAtEntity(this, \"morecreeps:bumthanks\", 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n worldObj.playSound((EntityPlayer) null, getPosition(), MCSoundEvents.ENTITY_BUM_THANKS, SoundCategory.NEUTRAL, 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n timetopee = rand.nextInt(1900) + 1500;\n\n if (itemstack.stackSize - 1 == 0)\n {\n entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, null);\n }\n else\n {\n itemstack.stackSize--;\n }\n }\n else if (itemstack != null && itemstack.getItem() == Items.LAVA_BUCKET)\n {\n \t/* \n if (!((EntityPlayerMP)entityplayer).getStatFile().hasAchievementUnlocked(MoreCreepsAndWeirdos.achievebumlava) && ((EntityPlayerMP)entityplayer).getStatFile().hasAchievementUnlocked(MoreCreepsAndWeirdos.achievebumpot))\n {\n worldObj.playSoundAtEntity(entityplayer, \"morecreeps:achievement\", 1.0F, 1.0F);\n entityplayer.addStat(MoreCreepsAndWeirdos.achievebumlava, 1);\n confetti(entityplayer);\n }\n\n entityplayer.addStat(MoreCreepsAndWeirdos.achievebumpot, 1);\n */\n // worldObj.playSoundAtEntity(this, \"morecreeps:bumthanks\", 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n worldObj.playSound((EntityPlayer) null, getPosition(), MCSoundEvents.ENTITY_BUM_THANKS, SoundCategory.NEUTRAL, 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n timetopee = rand.nextInt(1900) + 1500;\n\n if (itemstack.stackSize - 1 == 0)\n {\n entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, null);\n }\n else\n {\n itemstack.stackSize--;\n }\n\n int l = (int)posX;\n int j1 = (int)posY;\n int k1 = (int)posZ;\n\n if (rand.nextInt(4) == 0)\n {\n for (int l1 = 0; l1 < rand.nextInt(3) + 1; l1++)\n {\n Blocks.OBSIDIAN.dropBlockAsItem(worldObj, new BlockPos(l, j1, k1), worldObj.getBlockState(new BlockPos(l, j1, k1)), 0);\n }\n }\n\n for (int i2 = 0; i2 < 15; i2++)\n {\n double d4 = (float)l + worldObj.rand.nextFloat();\n double d7 = (float)j1 + worldObj.rand.nextFloat();\n double d8 = (float)k1 + worldObj.rand.nextFloat();\n double d9 = d4 - posX;\n double d10 = d7 - posY;\n double d11 = d8 - posZ;\n double d12 = MathHelper.sqrt_double(d9 * d9 + d10 * d10 + d11 * d11);\n d9 /= d12;\n d10 /= d12;\n d11 /= d12;\n double d13 = 0.5D / (d12 / 10D + 0.10000000000000001D);\n d13 *= worldObj.rand.nextFloat() * worldObj.rand.nextFloat() + 0.3F;\n d9 *= d13;\n d10 *= d13;\n d11 *= d13;\n worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, (d4 + posX * 1.0D) / 2D, (d7 + posY * 1.0D) / 2D + 2D, (d8 + posZ * 1.0D) / 2D, d9, d10, d11);\n worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d4, d7, d8, d9, d10, d11);\n }\n\n if (rand.nextInt(4) == 0)\n {\n entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, new ItemStack(Items.BUCKET));\n }\n }\n else if (!bumgave)\n {\n // worldObj.playSoundAtEntity(this, \"morecreeps:bumpee\", 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n worldObj.playSound((EntityPlayer) null, getPosition(), MCSoundEvents.ENTITY_BUM_PEE, SoundCategory.NEUTRAL, 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n }\n }\n }\n else\n {\n // worldObj.playSoundAtEntity(this, \"morecreeps:bumleavemealone\", 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n worldObj.playSound((EntityPlayer) null, getPosition(), MCSoundEvents.ENTITY_BUM_LEAVEMEALONE, SoundCategory.NEUTRAL, 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n }\n\n return super.processInteract(entityplayer, hand, stack);\n }",
"public interface GearPieceGeneration {\n\n\t// This function returns a BaseGearPiece or one of its children that's been created by a GearPieceGenerator\n\tpublic BaseGearPiece generateGearPiece();\n}",
"@Override\n \tpublic boolean interactFirst(EntityPlayer player) //interact : change back when Forge updates\n \t{\n \t\tif (gunner != null && (gunner instanceof EntityPlayer) && gunner != player)\n \t\t{\n \t\t\treturn true;\n \t\t}\n \t\tif (!worldObj.isRemote)\n \t\t{\n \t\t\tif (gunner == player)\n \t\t\t{\n \t\t\t\tmountGun(player, false);\n \t\t\t\tPacketDispatcher.sendPacketToAllAround(posX, posY, posZ, 100, dimension, PacketMGMount.buildMGPacket(player, this, false));\n \t\t\t\treturn true;\n \t\t\t}\n \t\t\tif (FlansModPlayerHandler.getPlayerData(player).mountingGun != null && !FlansModPlayerHandler.getPlayerData(player).mountingGun.isDead)\n \t\t\t{\n \t\t\t\treturn true;\n \t\t\t}\n \n \t\t\tmountGun(player, true);\n \t\t\tPacketDispatcher.sendPacketToAllAround(posX, posY, posZ, 100, dimension, PacketMGMount.buildMGPacket(player, this, true));\n \t\t\tif (ammo == null)\n \t\t\t{\n \t\t\t\tint slot = findAmmo(player);\n \t\t\t\tif (slot >= 0)\n \t\t\t\t{\n \t\t\t\t\tammo = player.inventory.getStackInSlot(slot);\n \t\t\t\t\tplayer.inventory.setInventorySlotContents(slot, null);\n \t\t\t\t\treloadTimer = type.reloadTime;\n \t\t\t\t\tworldObj.playSoundAtEntity(this, type.reloadSound, 1.0F, 1.0F / (rand.nextFloat() * 0.4F + 0.8F));\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t}\n \t\treturn true;\n \t}",
"@Override\n public void onSmelting(EntityPlayer player, ItemStack item) \n {\n \n }",
"public void spawnDifficultyIcon( LogicEngine in_logicEngine)\r\n\t{\n\t\tif(Difficulty.isEasy())\r\n\t\t\treturn;\r\n\t\t\r\n\t\tGameObject go = new GameObject(\"data/\"+GameRenderer.dpiFolder+\"/interface.png\",(LogicEngine.SCREEN_WIDTH/2), LogicEngine.SCREEN_HEIGHT/1.5,0);\r\n\t\tgo.stepHandlers.add(new TimedLifeStep(100));\r\n\t\t\r\n\t\tgo.i_animationFrameSizeHeight=50;\r\n\t\tgo.i_animationFrameSizeWidth=50;\r\n\t\tgo.i_animationFrame=0;\r\n\t\tgo.f_forceScaleX=4;\r\n\t\tgo.f_forceScaleY=4;\r\n\t\t\r\n\t\tif(Difficulty.isMedium())\r\n\t\t\tgo.i_animationFrameRow=7;\r\n\t\tif(Difficulty.isHard())\r\n\t\t\tgo.i_animationFrameRow=8;\r\n\t\t\r\n\t\tin_logicEngine.objectsOverlay.add(go);\r\n\t\r\n\t}",
"void setMugShot(ILogo mugShot);",
"@Override\r\n\tpublic void render(GameContainer gc, Graphics g) {\n\r\n\t\tg.drawImage(image, drawX - 16, drawY - 24); \r\n\t}",
"public abstract void gameObjectAwakens();",
"@Override\n public void onDisplayLayer(GPLayerBean layerBean) {\n super.displayLayer(layerBean);\n }",
"public void onAgress(IPokemob mob, EntityLivingBase target)\r\n {\r\n }",
"public BopeAutoGG() {\n\t\tsuper(BopeCategory.BOPE_CHAT);\n\n\t\t// Info.\n\t\tthis.name = \"Auto GG\";\n\t\tthis.tag = \"AutoGG\";\n\t\tthis.description = \"Automaticaly say good game paceaful or no!\";\n\n\t\t// Release.\n\t\trelease(\"B.O.P.E - Module - B.O.P.E\");\n\t}",
"private void generateItemEntities(){\n\t\tfinal int NUM_POTIONS = 6;\n\t\tfinal int NUM_IRON_ARMOUR = 1;\n\t\tfinal int NUM_CHESTS = 2;\n\t\tfinal String ITEM_BOX_STYLE = \"tundra\";\n\t\t\n\n\t\tfor (int i = 0; i < NUM_POTIONS; i++) {\n\t\t\tTile tile = getTile(Item.randomItemPositionGenerator(DEFAULT_WIDTH),\n\t\t\t\t\tItem.randomItemPositionGenerator(DEFAULT_HEIGHT));\n\t\t\tif (!tile.hasParent()) {\n\t\t\t\tHealthPotion potion = new HealthPotion(tile, false,(PlayerPeon) getPlayerEntity(), ITEM_BOX_STYLE);\n\t\t\t\tentities.add(potion);\n\t\t\t\tthis.allTundraDialogues.add(potion.getDisplay());\n\t\t\t} else {\n\t\t\t\ti--;\n\t\t\t}\n\n\t\t}\n\t\tfor (int i = 0; i < NUM_IRON_ARMOUR; i++) {\n\t\t\tTile tile = getTile(Item.randomItemPositionGenerator(DEFAULT_WIDTH),\n\t\t\t\t\tItem.randomItemPositionGenerator(DEFAULT_HEIGHT));\n\t\t\tif (!tile.hasParent()) {\n\t\t\t\tIronArmour ironArmour = new IronArmour(tile, false,\n\t\t\t\t\t\t(PlayerPeon) getPlayerEntity(), ITEM_BOX_STYLE,200);\n\t\t\t\tentities.add(ironArmour);\n\t\t\t\tthis.allTundraDialogues.add(ironArmour.getDisplay());\n\t\t\t} else {\n\t\t\t\ti--;\n\t\t\t}\n\n\t\t}\n\t\tfor (int i = 0; i < NUM_CHESTS; i++) {\n\t\t\tTile tile = getTile(Item.randomItemPositionGenerator(DEFAULT_WIDTH),\n\t\t\t\t\tItem.randomItemPositionGenerator(DEFAULT_HEIGHT));\n\t\t\tif (!tile.hasParent()) {\n\t\t\t\tTreasure chest = new Treasure(tile, false,(PlayerPeon) getPlayerEntity(), ITEM_BOX_STYLE);\n\t\t\t\tentities.add(chest);\n\t\t\t\tthis.allTundraDialogues.add(chest.getDisplay());\n\t\t\t} else {\n\t\t\t\ti--;\n\t\t\t}\n\t\t}\n\n\t\tTile cooldownring = getTile(18,17);\n\t\tCooldownRing cdring = new CooldownRing(cooldownring, false,\n\t\t\t\t(PlayerPeon) this.getPlayerEntity(), ITEM_BOX_STYLE,0.5f);\n\t\tentities.add(cdring);\n\t\tthis.allTundraDialogues.add(cdring.getDisplay());\n\n\t\tTile attackAmuletTile = getTile(-19,14);\n\t\tAmulet attackAmulet = new Amulet(attackAmuletTile, false,\n\t\t\t\t(PlayerPeon) this.getPlayerEntity(), ITEM_BOX_STYLE,10);\n\t\tentities.add(attackAmulet);\n\t\tthis.allTundraDialogues.add(attackAmulet.getDisplay());\n\n\t}",
"public abstract void fire(Player holder);",
"public interface MapEvent extends GameEvent {\n GameMap getMap();\n}",
"public void onLivingUpdate() {\n if (!this.onGround && this.motionY < 0.0D)\n this.motionY *= 0.6D;\n\n\n if (this.ticksExisted % 20 == 0 && this.getHealth() != this.getMaxHealth() && this.getHealth() >= 1)\n this.setHealth(this.getHealth() + 1);\n\n if (worldObj.isRemote) {\n if (this.isSitting())\n worldObj.spawnParticle(EnumParticleTypes.REDSTONE, posX, posY + 1.5, posZ, 0, 0, 0);\n }\n\n if (worldObj.isRemote) {\n MoWitchAndWizard.proxy.spawnParticles(\"air_normal\", this);\n }\n\n super.onLivingUpdate();\n }",
"@Override\n\tprotected void onPlayerDamage(EntityDamageEvent evt, Player p) {\n\t\tsuper.onPlayerDamage(evt, p);\n\t\tif(evt.getCause() == DamageCause.WITHER){\n\t\t\tGUtils.healDamageable(getOwnerPlayer(), evt.getDamage() * 1.5);\n\t\t\tVector v = Utils.CrearVector(getOwnerPlayer().getLocation(), getPlayer().getLocation()).multiply(0.5D);\n\t\t\tdouble max = 7;\n\t\t\tfor (int i = 0; i < max; i++) {\n//\t\t\t\tgetWorld().playEffect(getPlayer().getEyeLocation().add(0, -0.8, 0).add(v.clone().multiply(i/max)),\n//\t\t\t\t\t\tEffect.HEART, 0);\n\t\t\t}\n\t\t}\n\t}",
"public interface iPhisycs<E extends WolEntity> extends iEventGenerator<E>,iEventObserver<E>,Runnable,Serializable{\r\n public void insert(E entity,Position coordinate);\r\n public void castAwayEntities(Position coordinate,long radius);//Cast away all entities in thre radius near the position\r\n //public Acceleration calcAcceleration(E entity,Collection<Force> forces);\r\n public void applyForce(E entity,Force force);\r\n public void removeForce(E entity,Force force);\r\n public Velocity getVelocity(E entity);\r\n public Rotation<E> getAngularVelocity(E entity);\r\n}",
"public interface EntityLiving extends Entity {\n /**\n * Sets whether or not this entity is sprinting.\n *\n * @param sprinting {@code true} to start sprinting,\n * {@code false} to stop sprinting\n */\n void setSprinting(boolean sprinting);\n\n /**\n * Checks to see whether or not the entity is currently\n * sprinting.\n *\n * @return {@code true} if the entity is sprinting,\n * {@code false} if the player is not\n */\n boolean isSprinting();\n\n /**\n * Sets this entity's crouching/sneaking state.\n *\n * @param crouching {@code true} to begin crouching,\n * {@code false} to stop crouching\n */\n void setCrouching(boolean crouching);\n\n /**\n * Checks this entity's crouch/sneak state.\n *\n * @return {@code true} if the entity is crouching,\n * {@code false} if the player is not\n */\n boolean isCrouching();\n}",
"@Override\n public void init(GameContainer gc, StateBasedGame stateBasedGame) throws SlickException {\n //Clear all all objects & add them again\n objects.clear();\n objects.add(new Tower());\n objects.add(new Player());\n objects.add(new Enemy());\n\n //Clear the lists\n bulletList.clear();\n enemies.clear();\n basicTowers.clear();\n sniperTowers.clear();\n quickTowers.clear();\n bomberTowers.clear();\n\n //Set the variables when the state is initialized\n enemyCounter = 10;\n enemyHPCounter = 5;\n currentLevel = 0;\n sellTower = false;\n upgradePressed = false;\n timePassedEnemy = 0;\n\n //Loads this seperate, else the map is over-riding all drawn during the game\n loadMap.init(gc, stateBasedGame);\n\n //Run init for all objects\n for (GameObject obj : objects) {\n obj.init(gc, stateBasedGame);\n }\n\n java.awt.Font font = new java.awt.Font(\"Agency FB\", java.awt.Font.BOLD, 16);\n pauseFont = new TrueTypeFont(font,false);\n\n }",
"@Override\n public void onSmelting(EntityPlayer player, ItemStack item) {\n }",
"@ForgeSubscribe\r\n\tpublic void OnBonemealUse(net.minecraftforge.event.entity.player.BonemealEvent e)\r\n\t{\n\t\tif (!e.world.isRemote && e.entityPlayer.dimension == YC_Mod.d_astralDimID)\r\n\t\t{\r\n\t\t\tif (e.world.getBlockId(e.X, e.Y, e.Z) == YC_Mod.b_astralCrystals.blockID && e.world.getBlockId(e.X, e.Y-1, e.Z) == Block.grass.blockID)//crystal in center and grass beneath them\r\n\t\t\t\tif (e.world.getBlockId(e.X+1, e.Y, e.Z) == Block.sapling.blockID && \r\n\t\t\t\t\te.world.getBlockId(e.X-1, e.Y, e.Z) == Block.sapling.blockID && \r\n\t\t\t\t\te.world.getBlockId(e.X, e.Y, e.Z+1) == Block.sapling.blockID && \r\n\t\t\t\t\te.world.getBlockId(e.X, e.Y, e.Z-1) == Block.sapling.blockID)//4 sapplings on sides\r\n\t\t\t\t{\r\n\t\t\t\t\tint iron = 0, gold = 0;\r\n\t\t\t\t\tint id = 0;\r\n\t\t\t\t\t//============================================2 blocks of iron and gold each diagonally===================================================\r\n\t\t\t\t\tid = e.world.getBlockId(e.X+1, e.Y, e.Z+1);\r\n\t\t\t\t\tif (id == Block.blockSteel.blockID) iron++;\r\n\t\t\t\t\tif (id == Block.blockGold.blockID) gold++;\r\n\t\t\t\t\t\r\n\t\t\t\t\tid = e.world.getBlockId(e.X+1, e.Y, e.Z-1);\r\n\t\t\t\t\tif (id == Block.blockSteel.blockID) iron++;\r\n\t\t\t\t\tif (id == Block.blockGold.blockID) gold++;\r\n\t\t\t\t\t\r\n\t\t\t\t\tid = e.world.getBlockId(e.X-1, e.Y, e.Z-1);\r\n\t\t\t\t\tif (id == Block.blockSteel.blockID) iron++;\r\n\t\t\t\t\tif (id == Block.blockGold.blockID) gold++;\r\n\t\t\t\t\t\r\n\t\t\t\t\tid = e.world.getBlockId(e.X-1, e.Y, e.Z+1);\r\n\t\t\t\t\tif (id == Block.blockSteel.blockID) iron++;\r\n\t\t\t\t\tif (id == Block.blockGold.blockID) gold++;\r\n\t\t\t\t\tif (iron == 2 && gold == 2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (HasCoalCount(e.world, e.X, e.Y, e.Z, 64))//stack of coal for it\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tDecrCoalCount(e.world, e.X, e.Y, e.Z, 64);\r\n\t\t\t\t\t\t\tYC_WorldGenAstral.GenerateTree(e.world, new Random(), e.X, e.Y-1, e.Z);\r\n\t\t\t\t\t\t\te.world.setBlockAndMetadataWithNotify(e.X, e.Y, e.Z-1, 0, 0, 3);\r\n\t\t\t\t\t\t\te.world.setBlockAndMetadataWithNotify(e.X+1, e.Y, e.Z-1, 0, 0, 3);\r\n\t\t\t\t\t\t\te.world.setBlockAndMetadataWithNotify(e.X-1, e.Y, e.Z-1, 0, 0, 3);\r\n\t\t\t\t\t\t\te.world.setBlockAndMetadataWithNotify(e.X+1, e.Y, e.Z, 0, 0, 3);\r\n\t\t\t\t\t\t\te.world.setBlockAndMetadataWithNotify(e.X-1, e.Y, e.Z, 0, 0, 3);\r\n\t\t\t\t\t\t\te.world.setBlockAndMetadataWithNotify(e.X+1, e.Y, e.Z+1, 0, 0, 3);\r\n\t\t\t\t\t\t\te.world.setBlockAndMetadataWithNotify(e.X, e.Y, e.Z+1, 0, 0, 3);\r\n\t\t\t\t\t\t\te.world.setBlockAndMetadataWithNotify(e.X-1, e.Y, e.Z+1, 0, 0, 3);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t}\r\n\t\t//System.out.println(e.X+\" ; \" + e.Y + \" ; \" + e.Z + \" ; \" + FMLCommonHandler.instance().getEffectiveSide());\r\n\t}",
"public MapGenWoodChest()\n {\n// this.scatteredFeatureSpawnList = Lists.<Biome.SpawnListEntry>newArrayList();\n this.maxChunkDistanceBetweenF = 32;\n// this.minChunkDistanceBetweenF = 8;\n// this.scatteredFeatureSpawnList.add(new Biome.SpawnListEntry(EntityWitch.class, 1, 1, 1));\n }",
"public interface UpdateAwareGObject extends GObject {\n\n\tvoid update(GameContext gameContext);\n\n}",
"public void render(GameContainer gc, Graphics g){\n\n for(Renderable r:renderables){\n r.render(gc, g);\n }\n\n if(this.gameData.getCurrentRoom().getRoomType() == MasarRoom.VICTORYROOM) {\n this.gameData.getImageList().get(2).draw(226, 284);\n }\n\n if(this.gameData.getCurrentRoom().getRoomType() == MasarRoom.DEFEATROOM) {\n this.gameData.getImageList().get(3).draw(120, 288);\n }\n\n\n if(roomType == GAMEROOM){\n\n for(Renderable l: this.gameData.getLinkList()){\n l.render(gc, g);\n }\n for(Renderable s: this.gameData.getSystemList()){\n s.render(gc, g);\n }\n\n this.gameData.getImageList().get(0).draw(300, 5);\n this.gameData.getImageList().get(1).draw(800, 5);\n this.gameData.getButtonsImages().get(\"Enemy\").drawNextSubimage(600, 16);\n this.gameData.getButtonsImages().get(\"Allied\").drawNextSubimage(500, 16);\n\n TrueTypeFont font = this.gameData.getFont(\"UITopFont\");\n font.drawString(536, 0, \"VS\" , Color.green);\n\n int popa = this.gameData.getPopA();\n int pope = this.gameData.getPopE();\n int resa = this.gameData.getResA();\n int rese = this.gameData.getResE();\n\n if ( popa > 1000000 ) font.drawString(480 - font.getWidth(\"\"+popa/1000000 + \"M\"), 0, \"\"+popa/1000000 + \"M\" , Color.cyan);\n else if ( popa > 1000 ) font.drawString(480 - font.getWidth(\"\"+popa/1000 + \"K\"), 0, \"\"+popa/1000 + \"K\" , Color.cyan);\n else font.drawString(480 - font.getWidth(\"\"+popa), 0, \"\"+popa , Color.cyan);\n font.drawString(295 - font.getWidth(\"\"+resa), 0, \"\"+resa , Color.cyan);\n\n if ( pope > 1000000 ) font.drawString(620, 0, \"\"+pope/1000000 + \"M\" , Color.red);\n else if ( pope > 1000 ) font.drawString(620, 0, \"\"+pope/1000 + \"K\" , Color.red);\n else font.drawString(620, 0, \"\"+pope , Color.red);\n font.drawString(830, 0, \"\"+rese , Color.red);\n\n for(WindowSystem w: this.gameData.getWindowList()){\n if(w.getMs().isShowWindow())\n w.render(gc, g);\n }\n\n //this.getClickManager().renderHitboxes(gc, g);\n\n }\n\n //this.getClickManager().renderHitboxes(gc, g);\n }",
"void use(ATile clickedTile, GodSim g);",
"@Override\r\n\tpublic void render(GameContainer gameContainer, Graphics g, Object renderingParameter) {\n\t\tDrawingContext geigerCounterDrawingContext = DrawingContextProviderHolder.get().getDrawingContextProvider().geigerCounterDrawingContext();\r\n\t\t\r\n\t\t\r\n\t\tif (Features.getInstance().featureOn(Features.FEATURE_INTERFACE) == false) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tPlayer player = ApplicationContextUtils.getPlayer();\r\n\t\tCosmodogMap map = ApplicationContextUtils.getCosmodogMap();\t\r\n\r\n\t\t//Calculate radiation around the player.\r\n\t\tboolean radiationAdjacent = false;\r\n\t\tboolean[][] radiationInfos = new boolean[3][3];\r\n\t\tint posX = player.getPositionX();\r\n\t\tint posY = player.getPositionY();\r\n\t\tint xMin = posX - 1;\r\n\t\tint xMax = posX + 1;\r\n\t\tint yMin = posY - 1;\r\n\t\tint yMax = posY + 1;\r\n\t\tfor (int i = xMin; i <= xMax; i++) {\r\n\t\t\tfor (int j = yMin; j <= yMax; j++) {\r\n\t\t\t\tradiationInfos[i - xMin][j - yMin] = false;\r\n\t\t\t\tint radiationTileId = map.getTileId(i, j, Layers.LAYER_META_RADIATION);\r\n\t\t\t\tif (TileType.RADIATION.getTileId() == radiationTileId) {\r\n\t\t\t\t\tradiationInfos[i - xMin][j - yMin] = true;\r\n\t\t\t\t\tradiationAdjacent = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tlong timestamp = System.currentTimeMillis();\r\n\t\t\r\n\t\t//Does the player have the Geiger counter?\r\n\t\tGeigerZaehlerInventoryItem geigerZaehler = (GeigerZaehlerInventoryItem)player.getInventory().get(InventoryItemType.GEIGERZAEHLER);\r\n\t\t\r\n\t\tif (geigerZaehler != null) {\r\n\t\t\tfor (int i = 0; i < 3; i++) {\r\n\t\t\t\tfor (int j = 0; j < 3; j++) {\r\n\t\t\t\t\tColor color;\r\n\t\t\t\t\tif (radiationInfos[i][j] == true) {\r\n\t\t\t\t\t\tif ((timestamp / 250) % 2 == 0) {\r\n\t\t\t\t\t\t\tcolor = Color.red;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tcolor = Color.white;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcolor = Color.green;\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tg.setColor(color);\r\n\t\t\t\t\tTileDrawingContext tileDc = new TileDrawingContext(geigerCounterDrawingContext, 3, 3, i, j);\r\n\t\t\t\t\tg.fillRect(tileDc.x(), tileDc.y(), tileDc.w(), tileDc.h());\r\n\t\t\t\t\tg.setColor(Color.white);\r\n\t\t\t\t\tg.setLineWidth(1);\r\n\t\t\t\t\tg.drawRect(tileDc.x(), tileDc.y(), tileDc.w(), tileDc.h());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tTileDrawingContext tileDc = new TileDrawingContext(geigerCounterDrawingContext, 3, 3, 1, 1);\r\n\t\t\tg.setColor(Color.orange);\r\n\t\t\tg.fillRect(tileDc.x(), tileDc.y(), tileDc.w(), tileDc.h());\r\n\t\t\tg.setColor(Color.white);\r\n\t\t\tg.setLineWidth(1);\r\n\t\t\tg.drawRect(tileDc.x(), tileDc.y(), tileDc.w(), tileDc.h());\r\n\t\t} else { \r\n\t\t\tif (radiationAdjacent) {\r\n\t\t\t\tColor color;\r\n\t\t\t\tif ((timestamp / 250) % 2 == 0) {\r\n\t\t\t\t\tcolor = Color.red;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcolor = Color.white;\r\n\t\t\t\t}\r\n\t\t\t\tg.setColor(color);\r\n\t\t\t\tg.fillRect(geigerCounterDrawingContext.x(), geigerCounterDrawingContext.y(), geigerCounterDrawingContext.w(), geigerCounterDrawingContext.h());\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}",
"public void Boom()\r\n {\r\n image1 = new GreenfootImage(\"Explosion1.png\");\r\n image2 = new GreenfootImage(\"Explosion2.png\");\r\n image3 = new GreenfootImage(\"Explosion3.png\");\r\n image4 = new GreenfootImage(\"Explosion4.png\");\r\n image5 = new GreenfootImage(\"Explosion5.png\");\r\n image6 = new GreenfootImage(\"Explosion6.png\");\r\n setImage(image1);\r\n\r\n }",
"protected void addTacticalGraphics()\r\n {\n RenderableLayer layer = new RenderableLayer();\r\n layer.setName(\"Tactical Graphics\");\r\n \r\n // Define the control point positions for the tactical graphic we create below.\r\n List<Position> positions = Arrays.asList(\r\n Position.fromDegrees(34.4980, -117.5541, 0),\r\n Position.fromDegrees(34.4951, -117.4667, 0),\r\n Position.fromDegrees(34.4733, -117.4303, 0),\r\n Position.fromDegrees(34.4217, -117.4056, 0),\r\n Position.fromDegrees(34.4780, -117.5300, 0));\r\n \r\n // Create a tactical graphic for the MIL-STD-2525 symbology set. The graphic identifies a MIL-STD-2525\r\n // friendly Supporting Attack.\r\n TacticalGraphicFactory factory = new MilStd2525GraphicFactory();\r\n TacticalGraphic graphic = factory.createGraphic(\"GFGPOLAGS-----X\", positions, null);\r\n graphic.setValue(AVKey.DISPLAY_NAME, \"MIL-STD-2525 Tactical Graphic\"); // Tool tip text.\r\n layer.addRenderable(graphic);\r\n \r\n // Create point placemarks to mark each of the control points used to define the tactical graphic. This\r\n // provides a visualization of how the control point positions affect the displayed graphic.\r\n this.addControlPoints(positions, layer);\r\n \r\n // Add the graphic layer to the World Wind model.\r\n this.getWwd().getModel().getLayers().add(layer);\r\n \r\n // Update the layer panel to display the graphic layer.\r\n this.getLayerPanel().update(this.getWwd());\r\n }",
"@Override\n FeatureMapLayer getLayer();",
"@Override\n\tpublic void updateEntity() {\n\t\t\n\t\tif (this.mobID != null && !this.worldObj.isRemote) {\n\t\t\t\n\t\t\tif (this.delay > 0) {\n\t\t\t\tthis.delay--;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tEntity entity = EntityList.createEntityByName(this.mobID, this.worldObj);\n\t\t\t\n\t\t\t// L'entity n'existe pas\n\t\t\tif (entity == null) {\n\t\t\t\tModGollumCoreLib.log.warning(\"This mob \"+this.mobID+\" isn't register\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tthis.worldObj.setBlockToAir(this.xCoord , this.yCoord , this.zCoord);\n\t\t\t\n\t\t\tdouble x = (double)this.xCoord + 0.5D;\n\t\t\tdouble y = (double)(this.yCoord);// + this.worldObj.rand.nextInt(3) - 1);\n\t\t\tdouble z = (double)this.zCoord + 0.5D;\n\t\t\tEntityLiving entityLiving = entity instanceof EntityLiving ? (EntityLiving)entity : null;\n\t\t\tentity.setLocationAndAngles(x, y, z, this.worldObj.rand.nextFloat() * 360.0F, this.worldObj.rand.nextFloat() * 360.0F);\n\t\t\tthis.worldObj.spawnEntityInWorld(entity);\n\t\t\t\n\t\t\tif (entityLiving == null || entityLiving.getCanSpawnHere()) {\n\t\t\t\t\n\t\t\t\tthis.worldObj.playSoundEffect (this.xCoord, this.yCoord, this.zCoord, \"dig.stone\", 0.5F, this.worldObj.rand.nextFloat() * 0.25F + 0.6F);\n\t\t\t\t\n\t\t\t\tif (entityLiving != null) {\n\t\t\t\t\tentityLiving.spawnExplosionParticle();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"@Override\n public void interact(Object obj) {\n // TODO: Cave Code - Add additional Agility to the player while on this Tile\n }",
"public void render(GameContainer gc, Graphics g) throws SlickException {\n \tg.translate(512-viewport.getX(), 300-viewport.getY());\r\n \t//Draw world from tmx file.\r\n \tmap1.render(0, 0);\r\n \t\r\n \t//\"CLIP\" an area of 1280x720 to improve performance. This will cause it to only render what's visible on my screen.\r\n \tg.setClip(0, 0, 1280, 720);\r\n \t\r\n \t//Draw animations for our 2 players.\r\n \tg.drawAnimation(player1.getAnimation(player1.direction()), player1.getX()*8, player1.getY()*8);\r\n \tg.drawAnimation(player2.getAnimation(player2.direction()), player2.getX()*8, player2.getY()*8);\r\n \t\r\n \t//Draw all the bullets.\r\n\t for(Bullet b : bulletList) {\r\n\t \tb.getImg().draw(b.x*8, b.y*8);\r\n\t }\r\n\t \r\n\t \r\n\t //DEPRECATED\r\n \t//world.drawDebugData();\r\n\t \r\n\t //Draw a status & chat string.\r\n\t g.setColor(Color.white);\r\n\t g.drawString(status, viewport.getX()+300, viewport.getY()+250);\r\n\t if(chatUp) {\r\n\t \tg.setColor(Color.white);\r\n\t \tg.drawString(\"> \"+chatMessage+\"_\", viewport.getX()-500, viewport.getY()+250);\r\n\t }\r\n\t //Draw chatmessages if there are any, for a short period of time only.\r\n\t if(myPlayer.getTimer()<2000) {\r\n\t \tmyPlayer.getImg().draw(myPlayer.getX()*8-75, myPlayer.getY()*8-60);\r\n\t \tg.setColor(Color.black);\r\n\t \tg.drawString(myPlayer.getChatMessage(), myPlayer.getX()*8-67, myPlayer.getY()*8-50);\r\n\t }\r\n\t if(hisPlayer.getTimer()<2000) {\r\n\t \thisPlayer.getImg().draw(hisPlayer.getX()*8-75, hisPlayer.getY()*8-60);\r\n\t \tg.setColor(Color.black);\r\n\t \tg.drawString(hisPlayer.getChatMessage(), hisPlayer.getX()*8-67, hisPlayer.getY()*8-50);\r\n\t }\r\n \t\r\n\t //Draw hp bar\r\n\t g.setColor(new Color(0, 195, 0));\r\n\t Rectangle hpb = new Rectangle(viewport.getX()-436, viewport.getY()-289, 198*myPlayer.getHealth(), 26);\r\n\t g.fill(hpb);\r\n\t //Hpbar background img.\r\n\t g.drawImage(hpbar, viewport.getX()-450, viewport.getY()-295);\r\n \r\n }",
"public interface IAttackAbility\n{\n public void attack(Entity target, EntityLivingBase source);\n}",
"public interface Gamble extends Game {\n\n}",
"public interface HealingObject {}",
"@Override\r\n\tpublic boolean readyInit(GameEngine engine, int playerID) {\r\n\t\tsuper.readyInit(engine, playerID);\r\n\t\tengine.blockColors = BLOCK_COLORS;\r\n\t\tengine.numColors = 4;\r\n\t\tdropPattern[playerID] = DROP_PATTERNS[dropSet[playerID]][dropMap[playerID]];\r\n\t\tattackMultiplier[playerID] = getAttackMultiplier(dropSet[playerID], dropMap[playerID]);\r\n\t\tdefendMultiplier[playerID] = getDefendMultiplier(dropSet[playerID], dropMap[playerID]);\r\n\t\treturn false;\r\n\t}",
"public interface iGame {\n\n public abstract ArrayList<UUID> getListOfPlanets();\n\n public abstract String getName(UUID uuid);\n\n public abstract String getDescription(UUID uuid);\n\n public abstract int getPid(UUID uuid);\n\n public abstract String getImgPath(UUID uuid);\n\n public abstract String getImgPath(UUID uuid, boolean bool);\n\n public abstract ArrayList<UUID> getInventory();\n\n public abstract void startConversation(UUID uuid);\n\n public abstract ArrayList<UUID> getAvailableNpcs(UUID uuid);\n\n public abstract UUID getPlayerPosition();\n\n public abstract ArrayList<UUID> getPossiblePlanets();\n\n public abstract void travelToPlanet(UUID planet);\n\n public abstract int getFuel();\n\n public abstract int getWarpFuel();\n\n public abstract boolean canWarp();\n\n public abstract int getReputation();\n\n public abstract int getInGameTime();\n\n public abstract UUID getMoonId(UUID uuid);\n\n public abstract String getDashboardUpdate();\n\n public abstract void dropItem(UUID uuid);\n\n public abstract void processWarp(UUID nextPosition);\n\n public abstract void processAnswer(String userAns);\n\n public abstract String[] getAnswers();\n\n public abstract int[] getPositionCoordinates(UUID uuid);\n\n public abstract ArrayList<UUID> getPossibleScenarios();\n\n public abstract void setScenario(UUID uuid);\n\n public abstract long getPlayedMillis();\n\n public abstract void startGame(UUID scenario, String playerName);\n\n public abstract String getDeliveryPlanet(UUID uuid);\n\n public abstract String getDeliveryNpc(UUID uuid);\n\n public abstract boolean isWar(UUID uuid);\n\n public abstract ArrayList<String> quitGame();\n\n public abstract boolean isDead();\n\n public abstract int getItemDeliveryTime(UUID itemUuid);\n\n public abstract boolean getItemPapers(UUID itemUuid);\n\n public abstract UUID getStartNpc();\n}",
"@Override\r\n\tpublic void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) {\r\n\t\tsuper.onBlockPlacedBy(worldIn, pos, state, placer, stack);\r\n\t\tTileEntity tileentity = worldIn.getTileEntity(pos);\r\n\t\tif (tileentity instanceof TileEntityGemOfLight) { // prevent a crash if not the right type, or is null\r\n\t\t\tTileEntityGemOfLight tileEntityMBE21 = (TileEntityGemOfLight)tileentity;\r\n\r\n\t\t\t// chose a random colour for the gem:\r\n\t\t\t//Color [] colorChoices = {Color.BLUE, Color.CYAN, Color.YELLOW, Color.GREEN, Color.WHITE, Color.ORANGE, Color.RED};\r\n\t\t\t//Random random = new Random();\r\n\t\t\t//Color gemColor = colorChoices[random.nextInt(colorChoices.length)];\r\n\t\t\ttileEntityMBE21.setGemColour(Color.RED);//gemColor);\r\n\t\t}\r\n\t}",
"public void onLivingUpdate()\n {\n super.onLivingUpdate();\n double moveSpeed = this.getAttributeMap().getAttributeInstance(SharedMonsterAttributes.MOVEMENT_SPEED).getAttributeValue();\n if (timetopee-- < 0 && !bumgave)\n {\n isJumping = false;\n\n if (bumrotation == 999F)\n {\n bumrotation = rotationYaw;\n }\n\n rotationYaw = bumrotation;\n moveSpeed = 0.0F;\n\n if (!onGround)\n {\n motionY -= 0.5D;\n }\n \n /* TODO\n if(worldObj.isRemote)\n {\n \tMCW.proxy.pee(worldObj, posX, posY, posZ, rotationYaw, modelsize);\n } */\n\n if (timetopee < -200)\n {\n timetopee = rand.nextInt(600) + 600;\n bumrotation = 999F;\n int j = MathHelper.floor_double(posX);\n int k = MathHelper.floor_double(posY);\n int l = MathHelper.floor_double(posZ);\n\n for (int i1 = -1; i1 < 2; i1++)\n {\n for (int j1 = -1; j1 < 2; j1++)\n {\n if (rand.nextInt(3) != 0)\n {\n continue;\n }\n\n Block k1 = worldObj.getBlockState(new BlockPos(j + j1, k - 1, l - i1)).getBlock();\n Block l1 = worldObj.getBlockState(new BlockPos(j + j1, k, l - i1)).getBlock();\n\n if (rand.nextInt(2) == 0)\n {\n if ((k1 == Blocks.GRASS || k1 == Blocks.DIRT) && l1 == Blocks.AIR)\n {\n worldObj.setBlockState(new BlockPos(j + j1, k, l - i1), Blocks.YELLOW_FLOWER.getDefaultState());\n }\n\n continue;\n }\n\n if ((k1 == Blocks.GRASS || k1 == Blocks.DIRT) && l1 == Blocks.AIR)\n {\n \tworldObj.setBlockState(new BlockPos(j + j1, k, l - i1), Blocks.RED_FLOWER.getDefaultState());\n }\n }\n }\n }\n }\n }",
"@Inject(\n at = @At(\"HEAD\"),\n method = \"tick\",\n cancellable = true)\n\n private void removePoisonIfPCEnchant(CallbackInfo ci) {\n if ((Object) this instanceof PlayerEntity) {\n PlayerEntity entity = (PlayerEntity) (Object) this;\n ItemStack mainHand = getMainHandStack();\n\n\n if (EnchantmentHelper.getLevel(EnchantsRegistry.POISON_CLOUD, mainHand) >= 1\n || mainHand.getItem() == ItemRegistry.getItem(\"sickle_nightmares_bite\").asItem()\n || mainHand.getItem() == ItemRegistry.getItem(\"spear_venom_glaive\").asItem())\n {\n this.removeStatusEffect(StatusEffects.POISON);\n }\n }\n }",
"public void customizeMob(LivingEntity mob, LeveledMonster leveledMonster, CreatureSpawnEvent.SpawnReason spawnReason){\n mob.getPersistentDataContainer().set(monsterIdKey, PersistentDataType.STRING, leveledMonster.getName());\n assert mob.getEquipment() != null;\n mob.getEquipment().setHelmet(leveledMonster.getHelmet());\n mob.getEquipment().setChestplate(leveledMonster.getChestPlate());\n mob.getEquipment().setLeggings(leveledMonster.getLeggings());\n mob.getEquipment().setBoots(leveledMonster.getBoots());\n mob.getEquipment().setItemInMainHand(leveledMonster.getMainHand());\n mob.getEquipment().setItemInOffHand(leveledMonster.getOffHand());\n\n mob.getEquipment().setHelmetDropChance((float) leveledMonster.getHelmetDropChance());\n mob.getEquipment().setChestplateDropChance((float) leveledMonster.getChestplateDropChance());\n mob.getEquipment().setLeggingsDropChance((float) leveledMonster.getLeggingsDropChance());\n mob.getEquipment().setBootsDropChance((float) leveledMonster.getBootsDropChance());\n mob.getEquipment().setItemInMainHandDropChance((float) leveledMonster.getMainHandDropChance());\n mob.getEquipment().setItemInOffHandDropChance((float) leveledMonster.getOffHandDropChance());\n\n if (leveledMonster.getMainHand() != null){\n mob.setCanPickupItems(false);\n }\n\n AttributeInstance attribute = mob.getAttribute(Attribute.GENERIC_MAX_HEALTH);\n assert attribute != null;\n if (mob instanceof Slime){\n Slime slime = (Slime) mob;\n attribute.setBaseValue(leveledMonster.getBaseHealth() / (16/Math.pow(slime.getSize(), 2)));\n mob.setHealth(leveledMonster.getBaseHealth() / (16/Math.pow(slime.getSize(), 2)));\n } else {\n attribute.setBaseValue(leveledMonster.getBaseHealth());\n mob.setHealth(leveledMonster.getBaseHealth());\n }\n if (leveledMonster.getDisplayName() != null){\n if (!leveledMonster.getDisplayName().equals(\"null\")){\n mob.setCustomName(leveledMonster.getDisplayName());\n mob.setCustomNameVisible(leveledMonster.isDisplayNameVisible());\n }\n }\n if (leveledMonster.isBoss()){\n String title = leveledMonster.getDisplayName();\n if (leveledMonster.getDisplayName() == null){\n title = Utils.chat(\"&c&lBoss\");\n } else if (leveledMonster.getDisplayName().equals(\"null\")){\n title = Utils.chat(\"&c&lBoss\");\n }\n Utils.createBossBar(Main.getInstance(), mob, title, BarColor.RED, BarStyle.SOLID, Main.getInstance().getConfig().getInt(\"boss_bar_view_distance\"));\n }\n\n for (String key : leveledMonster.getAbilities()){\n Ability instantAbility = AbilityManager.getInstance().getInstantAbilities().get(key);\n if (instantAbility != null){\n instantAbility.execute(mob, null, new CreatureSpawnEvent(mob, spawnReason));\n }\n Ability runningAbility = AbilityManager.getInstance().getRunningAbilities().get(key);\n if (runningAbility != null){\n runningAbility.execute(mob, null, new CreatureSpawnEvent(mob, spawnReason));\n }\n }\n }",
"@SubscribeEvent\r\n public static void on(TickEvent.WorldTickEvent event){\r\n\t if(!event.world.isRemote){\r\n\t\t for(EntityPlayer player : event.world.playerEntities){\r\n\t\t\t WrapperWorld worldWrapper = getWrapperFor(event.world);\r\n\t\t\t //Need to use wrapper here as the player equality tests don't work if there are two players with the same ID.\r\n\t\t\t WrapperPlayer playerWrapper = WrapperPlayer.getWrapperFor(player);\r\n\t\t\t if(worldWrapper.activePlayerFollowers.containsKey(playerWrapper)){\r\n\t\t\t\t //Follower exists, check if world is the same and it is actually updating.\r\n\t\t\t\t //We check basic states, and then the watchdog bit that gets reset every tick.\r\n\t\t\t\t //This way if we're in the world, but not valid we will know.\r\n\t\t\t\t BuilderEntityRenderForwarder follower = worldWrapper.activePlayerFollowers.get(playerWrapper);\r\n\t\t\t\t if(follower.world != player.world || follower.playerFollowing != player || player.isDead || follower.isDead || follower.idleTickCounter == 20){\r\n\t\t\t\t\t //Follower is not linked. Remove it and re-create in code below.\r\n\t\t\t\t\t follower.setDead();\r\n\t\t\t\t\t worldWrapper.activePlayerFollowers.remove(playerWrapper);\r\n\t\t\t\t\t worldWrapper.ticksSincePlayerJoin.remove(playerWrapper);\r\n\t\t\t\t }else{\r\n\t\t\t\t\t ++follower.idleTickCounter;\r\n\t\t\t\t\t continue;\r\n\t\t\t\t }\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t if(!worldWrapper.activePlayerFollowers.containsKey(playerWrapper)){\r\n\t\t\t\t //Follower does not exist, check if player has been present for 3 seconds and spawn it.\r\n\t\t\t\t int totalTicksWaited = 0;\r\n\t\t\t\t if(worldWrapper.ticksSincePlayerJoin.containsKey(playerWrapper)){\r\n\t\t\t\t\t totalTicksWaited = worldWrapper.ticksSincePlayerJoin.get(playerWrapper); \r\n\t\t\t\t }\r\n\t\t\t\t if(++totalTicksWaited == 60){\r\n\t\t\t\t\t //Spawn fowarder and gun.\r\n\t\t\t\t\t BuilderEntityRenderForwarder follower = new BuilderEntityRenderForwarder(player);\r\n\t\t\t\t\t follower.loadedFromSavedNBT = true;\r\n\t\t\t\t\t event.world.spawnEntity(follower);\r\n\t\t\t\t\t worldWrapper.activePlayerFollowers.put(playerWrapper, follower);\r\n\t\t\t\t\t \r\n\t\t\t\t\t EntityPlayerGun entity = new EntityPlayerGun(worldWrapper, playerWrapper, new WrapperNBT());\r\n\t\t\t\t\t worldWrapper.spawnEntity(entity);\r\n\t\t\t\t\t \r\n\t\t\t\t\t //If the player is new, also add handbooks.\r\n\t\t\t\t\t if(!ConfigSystem.configObject.general.joinedPlayers.value.contains(playerWrapper.getID())){\r\n\t\t\t\t\t\t player.addItemStackToInventory(PackParserSystem.getItem(\"mts\", \"handbook_car\").getNewStack());\r\n\t\t\t\t\t\t player.addItemStackToInventory(PackParserSystem.getItem(\"mts\", \"handbook_plane\").getNewStack());\r\n\t\t\t\t\t\t ConfigSystem.configObject.general.joinedPlayers.value.add(playerWrapper.getID());\r\n\t\t\t\t\t\t ConfigSystem.saveToDisk();\r\n\t\t\t\t\t }\r\n\t\t\t\t }else{\r\n\t\t\t\t\t worldWrapper.ticksSincePlayerJoin.put(playerWrapper, totalTicksWaited);\r\n\t\t\t\t }\r\n\t\t\t }\r\n\t\t }\r\n\t }\r\n }",
"public interface HeadTimerLayerPresenter extends BasePresenter {\n\n void loadHeadLayer();\n\n void removeHeadLayer();\n}"
] | [
"0.7057573",
"0.67806756",
"0.619054",
"0.5913889",
"0.5820711",
"0.58069754",
"0.57917666",
"0.5697959",
"0.56947106",
"0.5689847",
"0.5610967",
"0.5552688",
"0.55395246",
"0.5490565",
"0.546897",
"0.5446012",
"0.5420287",
"0.53651756",
"0.5346135",
"0.53326386",
"0.5319351",
"0.5319056",
"0.53180766",
"0.53133076",
"0.5310894",
"0.52790976",
"0.5262912",
"0.5261845",
"0.52611357",
"0.52384686",
"0.52239037",
"0.521016",
"0.52008593",
"0.5198233",
"0.51978403",
"0.5196659",
"0.5190052",
"0.5187761",
"0.51743144",
"0.5168052",
"0.51486105",
"0.5146883",
"0.5142543",
"0.5136105",
"0.51295644",
"0.51192594",
"0.51192373",
"0.5116721",
"0.5114049",
"0.5110661",
"0.51040196",
"0.5099429",
"0.5098081",
"0.50957763",
"0.50947434",
"0.5089052",
"0.5050884",
"0.5042049",
"0.5041223",
"0.5033592",
"0.5031731",
"0.502955",
"0.502563",
"0.5025498",
"0.5023954",
"0.5017299",
"0.50169903",
"0.50118935",
"0.50109863",
"0.50032246",
"0.5002207",
"0.5001942",
"0.49976704",
"0.49878785",
"0.49845064",
"0.49791726",
"0.4972633",
"0.49725246",
"0.49659926",
"0.49603269",
"0.49590176",
"0.49557456",
"0.49550915",
"0.49531943",
"0.4953111",
"0.4949144",
"0.49471745",
"0.49416885",
"0.4941364",
"0.4940968",
"0.49391657",
"0.49382025",
"0.49377373",
"0.49341437",
"0.49321976",
"0.49296665",
"0.49247673",
"0.492296",
"0.49165693",
"0.49086717"
] | 0.8539025 | 0 |
canLayEgg Whether this mob can currently lay an egg. | boolean canLayEgg(IGeneticMob geneticMob); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface IEggLayer {\n /**\n * canLayEgg\n * Whether this mob can currently lay an egg.\n * @param geneticMob the mob being checked\n * @return true if egglaying is possible\n */\n boolean canLayEgg(IGeneticMob geneticMob);\n\n /**\n * getEggItem\n * The ItemStack that this mob would currently drop as an egg.\n * @param geneticMob the mob being checked\n * @return the egg\n */\n ItemStack getEggItem(IGeneticMob geneticMob);\n\n /**\n * willEggHatch\n * Whether an egg laid right now by this mob is fertilized and will hatch into a baby mob.\n * @param geneticMob the mob being checked\n * @return true if it will eventually hatch\n */\n boolean willEggHatch(IGeneticMob geneticMob);\n }",
"@Override\n\tpublic boolean canBePushed() {\n\t\treturn super.canBePushed() && isEgg();\n\t}",
"public boolean canFly() {\n\t\treturn !isEgg() && !isHatchling();\n\t}",
"public boolean getEasterEgg() {\n\t\treturn easterEgg;\n\t}",
"@Override\n\tpublic void laysEgg() {\n\t\t\n\t}",
"public final boolean canUse(){\n\t\tmaintain();\n\t\t//check if grown if not try to grow\n\t\tif(grown){\t\n\t\t\tif(host.getStrength()>USE_COST){\n\t\t\t\thost.expend(USE_COST);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\thost.expend(host.getStrength());\n\t\t\t}\n\t\t}\n\t\telse{\t\t\t\n\t\t\tcanGrow(host, this);\n\t\t}\t\n\t\treturn false;\n\t}",
"public void setEasterEgg(boolean easterEgg){\n\t\tthis.easterEgg = easterEgg;\n\t}",
"public boolean canDropFromExplosion(Explosion explosionIn)\n {\n return false;\n }",
"@Override\n public boolean shouldDropItemsOnExplosion(Explosion explosion) {\n return super.shouldDropItemsOnExplosion(explosion);\n }",
"private boolean canSmelt()\n {\n ItemStack var1 = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0]);\n if (var1 == null) return false;\n if (this.furnaceItemStacks[2] == null) return true;\n if (!this.furnaceItemStacks[2].isItemEqual(var1)) return false;\n int result = furnaceItemStacks[2].stackSize + var1.stackSize;\n return (result <= getInventoryStackLimit() && result <= var1.getMaxStackSize());\n }",
"public boolean canBike() {\r\n\t\tif (location == Location.SAFARI || location == Location.TOWN || location == Location.CAVE) {\r\n\t\t\treturn items.containsKey(Bicycle.getBicycleInstance());\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public boolean getCanSpawnHere()\n {\n return this.isValidLightLevel() && super.getCanSpawnHere();\n }",
"boolean willEggHatch(IGeneticMob geneticMob);",
"public void act() \n {\n EggFactory eggFactory = new EggFactory();\n \n move(4);\n int random = Greenfoot.getRandomNumber(5000);\n if((random>200 & random<300) || ((Farm)getWorld()).atWorldEdge(this))\n {\n turn(180);\n getImage().mirrorVertically();\n move(4);\n \n }\n\n if( Greenfoot.getRandomNumber(100) ==0)\n {\n\n Farm farm = (Farm)getWorld();\n Egg egg = null; \n int eggPicker = Greenfoot.getRandomNumber(80);\n //DropEggStrategy dropEgg = new DropEggStrategy(); //Strategy pattern\n\n IEggStrategy whiteStrategy = new WhiteEggStrategy(eggFactory);\n IEggStrategy blackStrategy = new BlackEggStrategy(eggFactory);\n IEggStrategy goldenStrategy = new GoldenEggStrategy(eggFactory);\n \n DropEggContext context = new DropEggContext();\n \n if(eggPicker >= 50 && eggPicker <= 60){\n \n context.setIEggStrategy(goldenStrategy);\n egg = context.dropEgg();\n getWorld().addObject(egg, this.getX(), this.getY()+45);\n }\n else if(eggPicker >= 60 && eggPicker <= 70){\n\n context.setIEggStrategy(blackStrategy);\n egg = context.dropEgg();\n getWorld().addObject(egg, this.getX(), this.getY()+45);\n }\n else{\n context.setIEggStrategy(whiteStrategy);\n egg = context.dropEgg();\n getWorld().addObject(egg, this.getX(), this.getY()+45);\n }\n \n egg.register(farm.getLifeObserver());//register life creator observer into egg subject \n\n \n\n }\n\n }",
"public boolean canSpawnLightningBolt()\n {\n return this.func_150559_j() ? false : this.enableRain;\n }",
"public boolean checkExplode() {\n\t\tlong currentFuse = System.nanoTime() - this.getDropTime();\n\t\t\n\t\tif (currentFuse >= this.getFuseLength() || explode)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}",
"boolean hasDamage();",
"boolean hasDamage();",
"boolean hasDamage();",
"boolean hasDamage();",
"boolean hasDamage();",
"protected abstract boolean canUpdateGrowth(World world, BlockPos pos);",
"public boolean isAnimal(Entity e){\r\n\t\tif(e instanceof Cow || e instanceof Chicken || e instanceof Sheep || e instanceof Horse\r\n\t\t\t\t|| e instanceof Wolf || e instanceof Ocelot ||e instanceof Pig || e instanceof Mushroom){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public PiecePenguin layEgg(){\n // if this piece hasn't laid max eggs yet - allow it create new piece\n if( this.numEggs < MAX_EGGS){\n this.incrementNumEggs();\n // this creates a new piece that has not laid any eggs\n // and has not attacked any pieces yet it will belong to this team so pass in Color\n return new PiecePenguin(this.symbol, this.color,0,0);\n }\n else{\n return null;\n }\n }",
"public boolean checkPet() {\r\n return this.player.pet.getIsAlive();\r\n }",
"public boolean getCanSpawnHere()\r\n {\r\n return false;\r\n }",
"boolean hasArmor();",
"public void eatEgg(Egg egg) {\n raiseFoodLevel(10);\n }",
"@EventHandler\n\tpublic void onEggThrown(PlayerEggThrowEvent e){\n\t\t\n\t\tEntity egg = e.getEgg();\n\t\t\n\t\tif(e.getEgg().getCustomName().contains(ChatColor.MAGIC + \"lootEgg\")){\n\t\t\te.setHatching(false);\n\t\t\t\n\t\t\tLocation loc = egg.getLocation();\n\t\t\t\n\t\t\tdropItem(loc);\n\t\t\t\n\t\t}\n\t\t\n\t}",
"@Override\n\tpublic boolean shouldExecute() {\n\t\tif (!theEntity.isTamed())\n\t\t\treturn false;\n\t\telse if (theEntity.isInWater())\n\t\t\treturn false;\n\t\telse if (!theEntity.onGround)\n\t\t\treturn false;\n\t\telse {\n\t\t\tfinal EntityLivingBase var1 = theEntity.getOwner();\n\t\t\treturn var1 == null ? true\n\t\t\t\t\t: theEntity.getDistanceSqToEntity(var1) < 144.0D\n\t\t\t\t\t\t\t&& var1.getAITarget() != null ? false : isSitting;\n\t\t}\n\t}",
"public boolean canSmelt() {\n\t\tif (this.slots[0] == null) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\tItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(\n\t\t\t\t\tthis.slots[0]);\n\n\t\t\tif (itemstack == null)\n\t\t\t\treturn false;\n\t\t\tif (this.slots[1] == null)\n\t\t\t\treturn true;\n\t\t\tif (!this.slots[1].isItemEqual(itemstack))\n\t\t\t\treturn false;\n\n\t\t\tint result = slots[1].stackSize + itemstack.stackSize;\n\n\t\t\treturn result <= getInventoryStackLimit()\n\t\t\t\t\t&& result <= itemstack.getMaxStackSize();\n\t\t}\n\t}",
"boolean isOccupiedByAnimal(Vector2d position);",
"public boolean canSpawnMore() {\n for(int e: enemiesLeft) {\n if(e > 0) {\n return true;\n }\n }\n\n return false;\n }",
"public boolean isWaterAnimal() {\n return false;\n }",
"public boolean shouldExecute() {\n if (this.runDelay <= 0) {\n if (!net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(bean.world, bean)) {\n return false;\n }\n\n this.currentTask = -1;\n if(plantAndCollect)\n this.hasFarmItem = ((EntityWorkBean)bean).isFarmItemInInventory();\n else this.hasFarmItem = false;\n this.wantsToReapStuff = true; //this.villager.wantsMoreFood();\n }\n\n return super.shouldExecute();\n }",
"boolean hasGroupPlacementView();",
"@Override\n public boolean equipped() {\n\treturn this.equipped;\n }",
"public boolean shouldExecute() {\n LivingEntity livingentity = ShulkerEntity.this.getAttackTarget();\n if (livingentity != null && livingentity.isAlive()) {\n return ShulkerEntity.this.world.getDifficulty() != Difficulty.PEACEFUL;\n } else {\n return false;\n }\n }",
"public static final void canGrow(Creature host, Organ g){\n\t\tif(host.getStrength()>g.CREATION_COST){\n\t\t\thost.expend(g.CREATION_COST);\n\t\t\tgrown = true;\n\t\t}\n\t}",
"@Override\r\n\tpublic boolean condition(WorldManager worldManager, WorldObjectManager gameObjectManager, BombManager bombManager,\r\n\t\t\tPlantManager plantManager, Player player) {\n\t\treturn bombManager.canPlace(player.transform);\r\n\t}",
"protected boolean canBreed()\n {\n return age >= breeding_age;\n }",
"public ArrayList <EggAbstract> getEggs() {\n\t\t//not checking if x is valid because that depends on the coordinate system\n\t\treturn eggs;\n\t}",
"public boolean hasExtendedRetractableBlade() {\n for (Mounted m : getEquipment()) {\n if (!m.isInoperable() && (m.getType() instanceof MiscType) && m.getType().hasFlag(MiscType.F_CLUB) && m.getType().hasSubType(MiscType.S_RETRACTABLE_BLADE) && m.curMode().equals(\"extended\")) {\n return true;\n }\n }\n return false;\n }",
"@Override\n public final boolean canStand(Playery player) {\n return true;\n }",
"public boolean canHit(Figure entity) {\n return true;\n }",
"default boolean canEquip(@Nonnull ItemStack stack)\n {\n return stack.getCapability(ExtensionSlotItemCapability.INSTANCE, null)\n .map((extItem) -> IExtensionSlot.isAcceptableSlot(this, stack, extItem) && extItem.canEquip(stack, this)).orElse(false);\n }",
"public void addEgg( EggAbstract x ) {\n\t\t//not checking if x is valid because that depends on the coordinate system\n\t\tif (x!=null){\n\t\t\teggs.add(x);\n\t\t}\n\t}",
"protected void checkMeteor()\n {\n e= (Explosion)getOneObjectAtOffset(getImage().getWidth()/20, 0, Explosion.class);\n \n if (e!=null)\n {\n if (meteorInflicted == false)\n {\n health = health - 1000;\n meteorInflicted = true;\n }\n \n }\n else{\n meteorInflicted = false;\n }\n }",
"public boolean isSpawn()\n\t{\n\t\treturn block == Block.FRUIT_SPAWN || block == Block.GHOST_SPAWN || block == Block.PAC_SPAWN;\n\t}",
"public boolean hitPaddle (Paddle myPaddle){\n Bounds ivPower = myExtendedPaddle.getBoundsInParent();\n Bounds ivPaddle = myPaddle.getView().getBoundsInParent();\n if(ivPower.intersects(ivPaddle)){\n return true;\n }\n return false;\n }",
"public boolean toGrass() {\n\t\treturn (goldilocksTime >= 25 + goldilocksVariance);\r\n\t}",
"@Override\r\n\tprotected boolean canDropLoot() {\r\n\t\treturn false;\r\n\t}",
"boolean canCharge(ItemStack me);",
"public boolean isChest() {\n return this.type == Type.CHEST;\n }",
"private boolean handleCollisionWithAntOrNest()\n {\n ArrayList<GameObject> collisions = this.getCollisions();\n if(!collisions.isEmpty() && (collisions.get(0) instanceof Ant || collisions.get(0) instanceof Nest))\n {\n this.opponent = collisions.get(0);\n return true;\n }\n\n return false;\n }",
"public boolean hasCheese() {\n return cheese;\n }",
"public boolean goalAchieve(LoopManiaWorld world) {\n return world.getDoggieKilledValue() >= this.doggie;\n }",
"public boolean isSpawnable(Location loc) {\n Block block = loc.getBlock();\n Block under = loc.getBlock().getRelative(BlockFace.DOWN);\n Block above = loc.getBlock().getRelative(BlockFace.UP);\n if (block.getType().equals(Material.AIR) && !under.getType().equals(Material.AIR) && above.getType().equals(Material.AIR)) {\n if (block.getLightLevel() <= plugin.CONFIG.SPAWNING_LIGHT) {\n return true;\n }\n }\n return false;\n }",
"public boolean canFish() {\r\n\t\tif (location == Location.SAFARI || location == Location.CAVE) {\r\n\t\t\treturn items.containsKey(FishingRod.getFishingRodInstance());\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"boolean hasPlayerBag();",
"protected boolean isCanCheckDurability(Action action, Material heldItemType) {\n boolean canRun = false;\n if ((heldItemType.toString().contains(\"_HOE\")\n || heldItemType.toString().contains(\"_SPADE\"))\n && action == Action.RIGHT_CLICK_BLOCK) {\n canRun = true;\n } else if ((heldItemType.toString().contains(\"_AXE\")\n //Pickaxe\n || heldItemType.toString().contains(\"_PICKAXE\")\n\n //Hoe\n || heldItemType.toString().contains(\"_HOE\")\n\n //Spade\n || heldItemType.toString().contains(\"_SPADE\")\n\n //Sword\n || heldItemType.toString().contains(\"_SWORD\")) && (action == Action.LEFT_CLICK_BLOCK)) {\n canRun = true;\n }\n return canRun;\n }",
"public boolean canPlaceEntity() {\n boolean blocked = this.mapCoordinatesForEntityToPlace.stream().anyMatch(c -> c.placeableState == PlaceableState.BLOCKED);\n if (blocked) return false;\n\n return this.mapCoordinatesForEntityToPlace.stream().anyMatch(c -> c.placeableState == PlaceableState.PLACEABLE);\n }",
"public boolean canAttackWithItem() {\n/* 215 */ return false;\n/* */ }",
"public boolean plantBlock(Point3d position, ItemStack stack){\r\n\t\t//Check for valid seeds.\r\n\t\tItem item = stack.getItem();\r\n\t\tif(item instanceof IPlantable){\r\n\t\t\tIPlantable plantable = (IPlantable) item;\r\n\t\t\t\r\n\t\t\t//Check if we have farmland below and air above.\r\n\t\t\tBlockPos farmlandPos = new BlockPos(position.x, position.y, position.z);\r\n\t\t\tIBlockState farmlandState = world.getBlockState(farmlandPos);\r\n\t\t\tBlock farmlandBlock = farmlandState.getBlock();\r\n\t\t\tif(farmlandBlock.equals(Blocks.FARMLAND)){\r\n\t\t\t\tBlockPos cropPos = farmlandPos.up();\r\n\t\t\t\tif(world.isAirBlock(cropPos)){\r\n\t\t\t\t\t//Check to make sure the block can sustain the plant we want to plant.\r\n\t\t\t\t\tIBlockState plantState = plantable.getPlant(world, cropPos);\r\n\t\t\t\t\tif(farmlandBlock.canSustainPlant(plantState, world, farmlandPos, EnumFacing.UP, plantable)){\r\n\t\t\t\t\t\tworld.setBlockState(cropPos, plantState, 11);\r\n\t\t\t\t\t\tworld.playSound(farmlandPos.getX(), farmlandPos.getY(), farmlandPos.getZ(), plantState.getBlock().getSoundType(plantState, world, farmlandPos, null).getPlaceSound(), SoundCategory.BLOCKS, 1.0F, 1.0F, false);\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"private boolean blowBlockUp(final Location at, String eventTypeRep) {\n if (at == null) {\n return false;\n }\n Block block = at.getBlock();\n if (block == null) {\n return false;\n }\n if (block.getType() == Material.AIR) {\n return false;\n }\n\n if (!MaterialManager.getInstance().contains(block.getType().name())) {\n return false;\n }\n\n if (eventTypeRep.equals(\"CraftTNTPrimed\") && !MaterialManager.getInstance().getTntEnabled(block.getType().name())) {\n return false;\n }\n if (eventTypeRep.equals(\"CraftSnowball\") && !MaterialManager.getInstance().getCannonsEnabled(block.getType().name())) {\n return false;\n }\n if (eventTypeRep.equals(\"CraftCreeper\") && !MaterialManager.getInstance().getCreepersEnabled(block.getType().name())) {\n return false;\n }\n if (eventTypeRep.equals(\"CraftWither\") && !MaterialManager.getInstance().getWithersEnabled(block.getType().name())) {\n return false;\n }\n if (eventTypeRep.equals(\"CraftMinecartTNT\") && !MaterialManager.getInstance().getTntMinecartsEnabled(block.getType().name())) {\n return false;\n }\n if ((eventTypeRep.equals(\"CraftFireball\") || eventTypeRep.equals(\"CraftGhast\")) && !MaterialManager.getInstance().getGhastsEnabled(block.getType().name())) {\n return false;\n }\n\n if (MaterialManager.getInstance().getDurabilityEnabled(block.getType().name()) && MaterialManager.getInstance().getDurability(block.getType().name()) > 1) {\n TimerState state = checkDurabilityActive(block.getLocation());\n if (ConfigManager.getInstance().getEffectsEnabled()) {\n final double random = Math.random();\n if (random <= ConfigManager.getInstance().getEffectsChance()) {\n block.getWorld().playEffect(at, Effect.MOBSPAWNER_FLAMES, 0);\n }\n }\n if (state == TimerState.RUN || state == TimerState.INACTIVE) {\n int currentDurability = getMaterialDurability(block);\n currentDurability++;\n if (checkIfMax(currentDurability, block.getType().name())) {\n // counter has reached max durability, remove and drop an item\n dropBlockAndResetTime(at);\n } else {\n // counter has not reached max durability damage yet\n if (!MaterialManager.getInstance().getDurabilityResetTimerEnabled(block.getType().name())) {\n addBlock(block, currentDurability);\n } else {\n startNewTimer(block, currentDurability, state);\n }\n }\n } else {\n if (!MaterialManager.getInstance().getDurabilityResetTimerEnabled(block.getType().name())) {\n addBlock(block, 1);\n } else {\n startNewTimer(block, 1, state);\n }\n if (checkIfMax(1, block.getType().name())) {\n dropBlockAndResetTime(at);\n }\n }\n } else {\n destroyBlockAndDropItem(at);\n }\n return true;\n }",
"boolean haveAnySpawn();",
"public boolean checkItem () {\r\n\t\tfor (Entity e : getLocation().getWorld().getEntities())\r\n\t\t{\r\n\t\t\tdouble x = e.getLocation().getX();\r\n\t\t\tdouble z = e.getLocation().getZ();\r\n\t\t\tdouble yDiff = getSpawnLocation().getY() - e.getLocation().getY();\r\n \r\n\t\t\tif (yDiff < 0)\r\n\t\t\t\tyDiff *= -1;\r\n\r\n\t\t\tif (x == getSpawnLocation().getX() && yDiff <= 1.5 && z == getSpawnLocation().getZ()) {\r\n \r\n ShowCaseStandalone.slog(Level.FINEST, \"Potential hit on checkItem()\");\r\n\t\t\t\ttry {\r\n\t\t\t\t\tItem itemE = (Item)e;\r\n\t\t\t\t\tif (ItemStackHandler.itemsEqual(itemE.getItemStack(), getItemStack(), true)) {\r\n ShowCaseStandalone.slog(Level.FINEST, \"Existing stack: \" + itemE.getItemStack().toString());\r\n itemE.getItemStack().setAmount(1); //Removes duped items, which can occur.\r\n\t\t\t\t\t\tthis.item = itemE;\r\n\t\t\t\t\t\tscs.log(Level.FINER, \"Attaching to existing item.\");\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (Exception ex) {}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"@Override\n public boolean CanArmor() {\n return false;\n }",
"boolean canExportManaToItem(ItemStack otherStack);",
"public boolean isPushedByFluid() {\n/* 1974 */ return !this.abilities.flying;\n/* */ }",
"public boolean isCat() {\r\n\t\tboolean isCat = false;\r\n\r\n\t\tif (numOfLeg == 4 && mammal == true && sound.equals(\"meow\")) {\r\n\r\n\t\t\tisCat = true;\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\tisCat = false;\r\n\t\t}\r\n\r\n\t\treturn isCat;\r\n\t}",
"public boolean checkIfPlayerHoldsExplosive () { return noOfExplosives > 0; }",
"public boolean onEntitySpawned(Entity e, ItemStack stack, @Nullable Player player) {\n return true;\n }",
"boolean getIsEventLegendary();",
"public abstract boolean isEdible(final Inhabitant inhabitant);",
"public boolean onGround() {\n return getLocation().getY() <= 0 || (interactingWithY != null && interactingWithY.getLocation().getY() + interactingWithY.size.height <= getLocation().getY());\n }",
"public boolean canAttackWithItem() {\n/* 253 */ return false;\n/* */ }",
"public boolean canAddEPC(ItemStack stack, int amountOfEPC);",
"public boolean canDespawn()\n {\n return true;\n }",
"public boolean isEnderChest() {\n return this.type == Type.ENDERCHEST;\n }",
"public boolean checkPlantCanHarvest() {\n\t\tint l = 0;//check Harvest\n\t\tfor(Plant p : getListofplant()){\n\t\t\tif(p.canHarvest()){\n\t\t\t\tl++;\n\t\t\t}\n\t\t}\n\t\tif(l == 0){\n\t\t\treturn false;\n\t\t}\n\t\telse return true;\n\t}",
"private void checkExplosionKill() {\n\t\t\n\t\texplosion.expand();\n\t\t\n\t\tfor (ArrayList<Invader> row : enemyArray) {\n\t\t\tfor (Invader a : row) {\n\t\t\t\tif (explosion.detectDownwardCollision(a.getX(), a.getY())) {\n\t\t\t\t\ta.setVisibility(false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"@Override\n\tpublic boolean isPlantable(CityWorldGenerator generator, SupportBlocks chunk, int x, int y, int z) {\n\t\tif (y < generator.shapeProvider.findFloodY(generator, x, z)) {\n\t\t\tif (!chunk.isWater(x, y + 1, z))\n\t\t\t\treturn false;\n\t\t} else {\n\t\t\tif (!chunk.isEmpty(x, y + 1, z))\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// depends on the block's type and what the world is like\n\t\tif (!generator.settings.includeAbovegroundFluids && y <= generator.seaLevel)\n\t\t\treturn chunk.isType(x, y, z, Material.SAND);\n\t\telse\n\t\t\treturn chunk.isPlantable(x, y, z);\n\t}",
"private boolean shouldAttackPlayer(EntityPlayer player) {\n ItemStack itemStack = player.inventory.armorInventory[3];\n if (itemStack != null && itemStack.getItem() == Item.getItemFromBlock(Blocks.pumpkin))\n return false;\n Vec3 lookVec = player.getLook(1.0F).normalize();\n Vec3 posVec = Vec3.createVectorHelper(this.posX - player.posX, this.boundingBox.minY + this.height / 2.0 - player.posY - player.getEyeHeight(), this.posZ - player.posZ);\n double distance = posVec.lengthVector();\n posVec = posVec.normalize();\n double dotProduct = lookVec.dotProduct(posVec);\n return dotProduct > 1.0 - 0.025 / distance ? player.canEntityBeSeen(this) : false;\n }",
"@Override\n public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, net.minecraftforge.common.IPlantable plantable)\n {\n return true;\n }",
"public boolean hasChameleonShield() {\n for (Mounted mEquip : getMisc()) {\n MiscType mtype = (MiscType) mEquip.getType();\n if (mtype.hasFlag(MiscType.F_CHAMELEON_SHIELD)) {\n // The Mek has Chameleon Light Polarization Field\n return true;\n }\n }\n return false;\n }",
"public boolean isWood() {\n return this.type == Type.WOOD;\n }",
"public void livingTick() {\n super.livingTick();\n this.oFlap = this.wingRotation;\n this.oFlapSpeed = this.destPos;\n this.destPos = (float)((double)this.destPos + (double)(this.onGround ? -1 : 4) * 0.3D);\n this.destPos = MathHelper.clamp(this.destPos, 0.0F, 1.0F);\n if (!this.onGround && this.wingRotDelta < 1.0F) {\n this.wingRotDelta = 1.0F;\n }\n\n this.wingRotDelta = (float)((double)this.wingRotDelta * 0.9D);\n Vec3d vec3d = this.getMotion();\n if (!this.onGround && vec3d.y < 0.0D) {\n this.setMotion(vec3d.mul(1.0D, 0.6D, 1.0D));\n }\n\n this.wingRotation += this.wingRotDelta * 2.0F;\n if (!this.world.isRemote && this.isAlive() && !this.isChild() && getGender()==Gender.FEMALE && --this.timeUntilNextEgg <= 0) {\n this.playSound(SoundEvents.ENTITY_CHICKEN_EGG, 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);\n this.entityDropItem(Items.EGG);\n this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000;\n }\n\n ++this.eatTicks;\n ItemStack itemstack = this.getItemStackFromSlot(EquipmentSlotType.MAINHAND);\n if (this.canEatItem(itemstack)) {\n if (this.eatTicks > 600) {\n ItemStack itemstack1 = itemstack.onItemUseFinish(this.world, this);\n if (!itemstack1.isEmpty()) {\n this.setItemStackToSlot(EquipmentSlotType.MAINHAND, itemstack1);\n }\n\n this.eatTicks = 0;\n } else if (this.eatTicks > 560 && this.rand.nextFloat() < 0.1F) {\n this.playSound(this.getEatSound(itemstack), 1.0F, 1.0F);\n this.world.setEntityState(this, (byte)45);\n }\n }\n\n }",
"public boolean eat() {\n\n if (this.hungerLevel > 0) {\n --this.hungerLevel; // Lower hunger after eating.\n return true;\n }\n return false;\n }",
"public boolean isDropped(){\r\n\t\treturn getDirectHolder() == World.world;\r\n\t}",
"default boolean canUnequip(@Nonnull ItemStack stack)\n {\n return stack.getCapability(ExtensionSlotItemCapability.INSTANCE, null)\n .map((extItem) -> extItem.canUnequip(stack, this) && EnchantmentHelper.getEnchantmentLevel(Enchantments.BINDING_CURSE, stack) <= 0).orElse(true);\n }",
"private boolean checkBurgerContainer(final Food food)\r\n {\r\n //if the food is still in the playing area no need to check if it hit the burger container\r\n if (food.getRow() <= VALID_ROWS)\r\n return false;\r\n \r\n //now check if hit another piece of food in the burger container\r\n for (Food tmp : super.getFoods())\r\n {\r\n //don't check the same food piece, and don't check if the food is not at the bottom\r\n if (food.getId() == tmp.getId() || tmp.getRow() <= VALID_ROWS)\r\n continue;\r\n\r\n //food must also be in the same column\r\n if ((int)food.getCol() != (int)tmp.getCol())\r\n continue;\r\n\r\n //if the food row is greater than another food row it will be stacked\r\n if (food.getRow() >= tmp.getRow())\r\n {\r\n //set the new row\r\n food.setRow(tmp.getRow() - .5);\r\n\r\n //place food appropriately\r\n placeFood(food, tmp);\r\n\r\n //we found a destination no need to check anything else\r\n return true;\r\n }\r\n }\r\n\r\n //check if hit burger container\r\n LevelObject container = this.getObject(Type.BurgerContainer, food);\r\n\r\n //if container exists then we hit it\r\n if (container != null)\r\n {\r\n //place food appropriately\r\n placeFood(food, container);\r\n \r\n //no need to check anything else\r\n return true;\r\n }\r\n \r\n //food was not placed in container\r\n return false;\r\n }",
"@Override\n public boolean canSmelt()\n {\n super.canSmelt();\n \n // Check if we have all the genome slots filled and internal tank is not null.\n if (this.getStackInSlotByType(SlotContainerTypeEnum.INPUT_INGREDIENT1) == null ||\n this.getStackInSlotByType(SlotContainerTypeEnum.INPUT_INGREDIENT2) == null ||\n this.getStackInSlotByType(SlotContainerTypeEnum.INPUT_EXTRA) == null)\n {\n return false;\n }\n \n // Check to make sure we are not overheating, this stops the computer from working.\n if (this.isOverheating())\n {\n return false;\n }\n\n // Check for empty reel inside input slot 4.\n ItemStack emptyDataReel = ItemFactory.instance().getItemStackByFullyQualifiedName(\"components\", \"DataReelEmpty\", 1);\n if (!emptyDataReel.isItemEqual(this.getStackInSlotByType(SlotContainerTypeEnum.INPUT_EXTRA)))\n {\n return false;\n }\n\n // Check if input slots 2 and 3 which should be genome data reels are compatible with each other.\n ItemStack currentRecipe = this.getRecipeResult(\n SlotContainerTypeEnum.INPUT_INGREDIENT1,\n SlotContainerTypeEnum.INPUT_INGREDIENT2,\n SlotContainerTypeEnum.INPUT_EXTRA,\n SlotContainerTypeEnum.OUTPUT_RESULT1);\n \n if (currentRecipe == null)\n {\n return false;\n }\n\n // Check if there is fluid inside our internal tank for cleaning the needles.\n if (this.isFluidTankEmpty())\n {\n return false;\n }\n\n // Check if output slots are empty and ready to be filled with items.\n if (this.getStackInSlotByType(SlotContainerTypeEnum.OUTPUT_RESULT1) == null)\n {\n return true;\n }\n\n // Check if output is above stack limit.\n int slot2Result = this.getStackInSlotByType(SlotContainerTypeEnum.OUTPUT_RESULT1).stackSize + emptyDataReel.stackSize;\n return (slot2Result <= getInventoryStackLimit() && slot2Result <= emptyDataReel.getMaxStackSize());\n }",
"public boolean canDespawn()\n {\n return false;\n }",
"protected boolean isAlwaysExperienceDropper() {\n/* 1849 */ return true;\n/* */ }",
"public boolean isCastOverLayShown() {\n if (currentContext != null) {\n SharedPreferences sharedPrefs = currentContext.getSharedPreferences(CASTING_OVERLAY_PREF_NAME, 0);\n return sharedPrefs.getBoolean(CAST_SHARED_PREF_NAME, false);\n }\n return false;\n }",
"public boolean hasTreasure() {\n Item[] items = getRoomContents();\n for (int i = 0; i < items.length; i++) {\n if (items[i].getDesc().equals(\"A bag filled with ten thousand Galleons.\")) {\n return true;\n }\n }\n return false;\n }",
"public boolean goldilocksCheck() {\n\t\treturn (waterConcentration > 0.25 && heat > 32);\r\n\t}",
"public boolean isCheese();",
"private void spawnStuff(PlayScreen screen, float delta) {\n if (stageId!=3 && stageId!=5) {\n isCombatEnabled = true;\n int where;\n boolean spawnRight = true;\n float speed;\n\n\n //Alien Spawn\n if (System.currentTimeMillis() - lastASpawn >= SpawnATimer + extraTimer) {\n speed = (float)(Utils.doRandom(250,400));\n lastASpawn = System.currentTimeMillis();\n int count = 3;\n if (stageId==4) count = 1;\n for (int i = 0; i < count; i++) {\n if (stageId==4){\n speed = (float) (speed*0.75);\n where = Utils.doRandom(0,100);\n if (where < 50){\n spawnRight = true;\n }else{\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n int x = (int) screen.gameViewport.getWorldWidth();\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - Alien.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - Alien.width, y, Alien.width, Alien.height)))\n hits = true;\n }\n }\n screen.entities.add(new Alien(new Vector2(x, y), 1, screen.alienImages, speed, screen.player));\n }else{\n int x = 0 - Alien.width;\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - Alien.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x + Alien.width*2 , y, Alien.width, Alien.height)))\n hits = true;\n }\n }\n screen.entities.add(new Alien(new Vector2(x, y), 1, screen.alienImages, speed, screen.player,false));\n }\n }\n }\n //AcidAlien Spawn\n if (System.currentTimeMillis() - lastBSpawn >= SpawnBTimer + extraTimer) {\n speed = 200;\n lastBSpawn = System.currentTimeMillis();\n if (stageId==4){\n speed = speed/2;\n where = Utils.doRandom(0,100);\n if (where < 50){\n spawnRight = true;\n }else{\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n int x = (int) screen.gameViewport.getWorldWidth();\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - AcidAlien.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - AcidAlien.width, y, AcidAlien.width, AcidAlien.height)))\n hits = true;\n }\n }\n screen.entities.add(new AcidAlien(new Vector2(x, y), screen.alien2Images, screen.acidImage, speed, screen.player));\n }else{\n int x = 0 - AcidAlien.width;\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - AcidAlien.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x + AcidAlien.width*2, y, AcidAlien.width, AcidAlien.height)))\n hits = true;\n }\n }\n screen.entities.add(new AcidAlien(new Vector2(x, y), screen.alien2Images, screen.acidImage, speed, screen.player,false));\n }\n }\n //FastAlien Spawn\n if (System.currentTimeMillis() - lastCSpawn >= SpawnCTimer + extraTimer) {\n speed= Utils.doRandom(250,400);\n lastCSpawn = System.currentTimeMillis();\n if (stageId==4){\n speed = speed/2;\n where = Utils.doRandom(0,100);\n if (where < 50){\n spawnRight = true;\n }else{\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n int x = (int) screen.gameViewport.getWorldWidth();\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - FastAlien.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - FastAlien.width, y, FastAlien.width, FastAlien.height)))\n hits = true;\n }\n }\n screen.entities.add(new FastAlien(new Vector2(x, y), 1, screen.alien3Images,speed, screen.player));\n }else{\n int x = 0 - FastAlien.width;\n int y =0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - FastAlien.height);\n for (int h=0;h<collisions.size();h++){\n if (Collision.checkWalls(collisions.get(h),new Rectangle(x-FastAlien.width*2,y,FastAlien.width,FastAlien.height))) hits = true;\n }\n }\n screen.entities.add(new FastAlien(new Vector2(x, y), 1, screen.alien3Images, speed,screen.player,false));\n }\n\n }\n\n //Item Spawn\n if (System.currentTimeMillis() - lastCapsuleSpawn >= SpawnTimerCapsule ) {\n speed = 500;\n int x = 0;\n int y = 0;\n lastCapsuleSpawn = System.currentTimeMillis();\n if (stageId==4){\n speed = speed/2;\n where = Utils.doRandom(0,100);\n if (where < 50){\n spawnRight = true;\n }else{\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n x = (int) screen.gameViewport.getWorldWidth();\n y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - BlueBulletItem.width, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n }else{\n x = 0 - BlueBulletItem.width;\n y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x + BlueBulletItem.width *2, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n }\n\n int capsule = screen.random.nextInt(2);\n\n if (capsule == 0) {\n if (spawnRight) {\n screen.items.add(new RedBulletItem(x, y, speed, screen.itemRedImages));\n }else{\n screen.items.add(new RedBulletItem(x, y, speed, screen.itemRedImages,false));\n }\n } else if (capsule == 1) {\n if (spawnRight) {\n screen.items.add(new BlueBulletItem(x, y, speed, screen.itemBlueImages));\n }else{\n screen.items.add(new BlueBulletItem(x, y, speed, screen.itemBlueImages,false));\n }\n }\n\n }\n if (System.currentTimeMillis() - lastHealthSpawn >= SpawnTimerHealth) {\n speed = 500;\n lastHealthSpawn = System.currentTimeMillis();\n if (stageId==4){\n speed = speed/2;\n where = Utils.doRandom(0,100);\n if (where < 50){\n spawnRight = true;\n }else{\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n int x = (int) screen.gameViewport.getWorldWidth();\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - BlueBulletItem.width, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n screen.items.add(new GreenCapsuleItem(x, y, speed, screen.itemGreenImages));\n }else{\n int x = 0 - BlueBulletItem.width;\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x + BlueBulletItem.width*2, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n screen.items.add(new GreenCapsuleItem(x, y, speed, screen.itemGreenImages,false));\n }\n }\n /*if (System.currentTimeMillis() - lastBombSpawn >= SpawnTimerBomb) {\n lastBombSpawn = System.currentTimeMillis();\n int x = (int) screen.gameViewport.getWorldWidth();\n int y =0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - PurpleCapsuleItem.height);\n for (int h=0;h<collisions.size();h++){\n if (Collision.checkWalls(collisions.get(h),new Rectangle(x,y,PurpleCapsuleItem.width,PurpleCapsuleItem.height))) hits = true;\n }\n }\n screen.items.add(new PurpleCapsuleItem(x, y, 500, screen.itemPurpleImages));\n }*/\n }else{\n if (stageId==3) {\n //SPACE STAGE\n ///SPAWN ENEMY SHIP:\n //TODO\n if (PlayScreen.entities.size() == 1) {\n isCombatEnabled = false;\n //no enemy spawned, so spawn:\n if (spawnIterator >= killCount) {\n //TODO END STAGE\n } else {\n System.out.println(\"SPAWNS SHIP\");\n spawnIterator++;\n screen.entities.add(new EnemyShipOne(new Vector2(0, 0), 100, screen.enemyShipOne, true, screen.player));\n\n }\n }\n //Items:\n //Item Spawn\n if (System.currentTimeMillis() - lastCapsuleSpawn >= SpawnTimerCapsule) {\n lastCapsuleSpawn = System.currentTimeMillis();\n int x = (int) screen.gameViewport.getWorldWidth();\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n screen.items.add(new BlackBulletItem(x, y, 1000, screen.itemBlackImages));\n\n\n }\n }else{\n if (stageId == 5){\n isCombatEnabled = true;\n float speed;\n boolean spawnRight=true;\n int where=0;\n //TODO FINAL STAGE\n if (!isBossSpawned){\n //TODO\n screen.entities.add(new Boss(new Vector2(PlayScreen.gameViewport.getWorldWidth(),PlayScreen.gameViewport.getWorldHeight()/2 - Boss.height/2),screen.player));\n isBossSpawned=true;\n }\n //Item Spawn\n if (System.currentTimeMillis() - lastCapsuleSpawn >= SpawnTimerCapsule ) {\n speed = 500;\n int x = 0;\n int y = 0;\n lastCapsuleSpawn = System.currentTimeMillis();\n if (stageId==4){\n speed = speed/2;\n where = Utils.doRandom(0,100);\n if (where < 50){\n spawnRight = true;\n }else{\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n x = (int) screen.gameViewport.getWorldWidth();\n y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - BlueBulletItem.width, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n }else{\n x = 0 - BlueBulletItem.width;\n y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x + BlueBulletItem.width *2, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n }\n\n int capsule = screen.random.nextInt(2);\n\n if (capsule == 0) {\n if (spawnRight) {\n screen.items.add(new RedBulletItem(x, y, speed, screen.itemRedImages));\n }else{\n screen.items.add(new RedBulletItem(x, y, speed, screen.itemRedImages,false));\n }\n } else if (capsule == 1) {\n if (spawnRight) {\n screen.items.add(new BlueBulletItem(x, y, speed, screen.itemBlueImages));\n }else{\n screen.items.add(new BlueBulletItem(x, y, speed, screen.itemBlueImages,false));\n }\n }\n\n }\n if (System.currentTimeMillis() - lastHealthSpawn >= SpawnTimerHealth) {\n speed = 500;\n lastHealthSpawn = System.currentTimeMillis();\n if (stageId == 4) {\n speed = speed / 2;\n where = Utils.doRandom(0, 1);\n if (where < 50) {\n spawnRight = true;\n } else {\n spawnRight = false;\n }\n\n }\n if (spawnRight) {\n int x = (int) screen.gameViewport.getWorldWidth();\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x - BlueBulletItem.width, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n screen.items.add(new GreenCapsuleItem(x, y, speed, screen.itemGreenImages));\n } else {\n int x = 0 - BlueBulletItem.width;\n int y = 0;\n boolean hits = true;\n while (hits) {\n hits = false;\n y = screen.random.nextInt((int) screen.gameViewport.getWorldHeight() - BlueBulletItem.height);\n for (int h = 0; h < collisions.size(); h++) {\n if (Collision.checkWalls(collisions.get(h), new Rectangle(x + BlueBulletItem.width * 2, y, BlueBulletItem.width, BlueBulletItem.height)))\n hits = true;\n }\n }\n screen.items.add(new GreenCapsuleItem(x, y, speed, screen.itemGreenImages, false));\n }\n }\n //TODO\n }\n }\n }\n\n //run .update(delta) on all objects\n for (int i=0; i<screen.entities.size();i++){\n screen.entities.get(i).update(delta);\n }\n\n for (int i=0; i<screen.items.size();i++){\n screen.items.get(i).update(delta);\n }\n\n //labels set:\n screen.labelHealth.setText(\"Health: \" + screen.player.health + \"/\" + screen.player.maxHealth);\n if (scoreBased) {\n screen.labelInfo.setText(\"Score: \" + screen.player.score + \"/\" + scoreGoal);\n }else{\n if (killCount>0){\n screen.labelInfo.setText(\"Score: \" + screen.player.score + \"/\" + killCount);\n }else{\n if (boss){\n screen.labelInfo.setText(\"Boss: \"+screen.player.score + \"/\" + Boss.bossHealth);\n }else{\n screen.labelInfo.setText(\"\");\n }\n\n }\n }\n if (this.stageId == 999) {\n screen.labelInfo.setText(\"Score: \" + screen.player.score);\n }\n\n\n }"
] | [
"0.6522236",
"0.6019913",
"0.60091484",
"0.5702493",
"0.5669842",
"0.56093735",
"0.557863",
"0.5562793",
"0.5536217",
"0.5522876",
"0.5370208",
"0.53461325",
"0.5333508",
"0.52498436",
"0.5204012",
"0.51795024",
"0.51634336",
"0.51634336",
"0.51634336",
"0.51634336",
"0.51634336",
"0.51506585",
"0.5124245",
"0.51101565",
"0.5087313",
"0.5062873",
"0.5023348",
"0.5019738",
"0.50095403",
"0.50042295",
"0.49999508",
"0.4973319",
"0.49713066",
"0.49706823",
"0.49629816",
"0.49346006",
"0.49139237",
"0.48950312",
"0.48724604",
"0.48711616",
"0.4871043",
"0.48683065",
"0.48655185",
"0.48629954",
"0.48590735",
"0.48562792",
"0.48526946",
"0.48516983",
"0.48512927",
"0.48497054",
"0.48464587",
"0.48459443",
"0.48366186",
"0.4834996",
"0.48318812",
"0.48272315",
"0.4823209",
"0.4819575",
"0.48059094",
"0.48031318",
"0.47909376",
"0.47803238",
"0.47747022",
"0.47734648",
"0.47688237",
"0.47636893",
"0.47584412",
"0.4739776",
"0.4734435",
"0.47308406",
"0.47282872",
"0.4728115",
"0.47270337",
"0.47249448",
"0.47242036",
"0.47225857",
"0.4720494",
"0.47138292",
"0.47109428",
"0.47099173",
"0.47065046",
"0.46907425",
"0.46863028",
"0.4682341",
"0.46800652",
"0.46797246",
"0.4679712",
"0.46775886",
"0.46722504",
"0.46715596",
"0.466756",
"0.46671435",
"0.4665348",
"0.46502373",
"0.4643979",
"0.46427158",
"0.4635765",
"0.46349904",
"0.46340945",
"0.46316108"
] | 0.6969838 | 0 |
getEggItem The ItemStack that this mob would currently drop as an egg. | ItemStack getEggItem(IGeneticMob geneticMob); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private ItemStack getToolWhenHasnt() {\r\n\t\treturn this.item;\r\n\t}",
"public ItemStack getItem() {\n return this.item;\n }",
"public ItemStack getItem() {\r\n\t\treturn item;\r\n\t}",
"protected Item getDropItem() {\r\n\t\treturn SorceryItems.goldfeather;\r\n\t}",
"ItemStack getItem();",
"public ItemStack getCartItem() {\n return new ItemStack(ModItems.fluxLevitatorItem);\n }",
"public int getDamage() {\n\t\treturn itemDamage;\n\t}",
"public ItemStack getItemStack() {\n\t\treturn this.itemStack;\n\t}",
"public Item getItemDropped(int meta, Random p_149650_2_, int p_149650_3_)\n\t {\n\t \treturn MGHouseItems.item_boat_door;\n\t }",
"InventoryItem getInventoryItem();",
"public ItemStack getItem() {\n ItemStack item = new ItemStack(material, 1);\n ItemMeta meta = item.getItemMeta();\n meta.setDisplayName(displayName);\n item.setItemMeta(meta);\n return item;\n }",
"Optional<ItemStack> getItemStack();",
"public float getBonusItemDrop() {\n return bonusItemDrop_;\n }",
"public float getBonusItemDrop() {\n return bonusItemDrop_;\n }",
"public static ArmorSlot getItemSlotEquiping(ItemStack item){\n\t\tif(item == null){\n\t\t\treturn ArmorSlot.NONE;\n\t\t}\n\t\t\n\t\tswitch(item.getType()){\n\t\t\t//Helmets:\t\n\t\t\tcase LEATHER_HELMET:\n\t\t\tcase GOLD_HELMET:\n\t\t\tcase CHAINMAIL_HELMET:\n\t\t\tcase IRON_HELMET:\n\t\t\tcase DIAMOND_HELMET: return ArmorSlot.HELMET;\n\t\t\t\n\t\t\t//Chest:\t\n\t\t\tcase LEATHER_CHESTPLATE:\n\t\t\tcase GOLD_CHESTPLATE:\n\t\t\tcase CHAINMAIL_CHESTPLATE:\n\t\t\tcase IRON_CHESTPLATE:\n\t\t\tcase DIAMOND_CHESTPLATE: return ArmorSlot.CHESTPLATE;\n\t\t\t\n\t\t\t//Legs:\t\n\t\t\tcase LEATHER_LEGGINGS:\n\t\t\tcase GOLD_LEGGINGS:\n\t\t\tcase CHAINMAIL_LEGGINGS:\n\t\t\tcase IRON_LEGGINGS:\n\t\t\tcase DIAMOND_LEGGINGS: return ArmorSlot.LEGGINGS;\n\t\t\t\n\t\t\t//feet:\t\n\t\t\tcase LEATHER_BOOTS:\n\t\t\tcase GOLD_BOOTS:\n\t\t\tcase CHAINMAIL_BOOTS:\n\t\t\tcase IRON_BOOTS:\n\t\t\tcase DIAMOND_BOOTS: return ArmorSlot.BOOTS;\n\t\t\n\t\t\n\t\t\tdefault: return ArmorSlot.NONE;\n\t\t}\n\t}",
"ItemStack get(final Player player) {\r\n\t\tthis.update(player);\r\n\r\n\t\treturn this.playerHasTool ? this.getToolWhenHas() : this.getToolWhenHasnt();\r\n\t}",
"@SideOnly(Side.CLIENT)\n public EntityEquipmentSlot getEquipmentSlot()\n {\n return this.armorType;\n }",
"@EventHandler\n\tpublic void onEggThrown(PlayerEggThrowEvent e){\n\t\t\n\t\tEntity egg = e.getEgg();\n\t\t\n\t\tif(e.getEgg().getCustomName().contains(ChatColor.MAGIC + \"lootEgg\")){\n\t\t\te.setHatching(false);\n\t\t\t\n\t\t\tLocation loc = egg.getLocation();\n\t\t\t\n\t\t\tdropItem(loc);\n\t\t\t\n\t\t}\n\t\t\n\t}",
"public ItemStack getItemOnCursor ( ) {\n\t\treturn extract ( handle -> handle.getItemOnCursor ( ) );\n\t}",
"@Override\n public Item getItemDropped(IBlockState state, Random rand, int fortune) {\n return this == BlockHandler.rubyore ? ItemHandler.ruby : (this == BlockHandler.sapphireore ? ItemHandler.sapphire : (this == BlockHandler.topazore ? ItemHandler.topaz : (this == BlockHandler.peridotore ? ItemHandler.peridot : (this == BlockHandler.amethystore ? ItemHandler.amethyst : (this == BlockHandler.berylore ? ItemHandler.beryl : (this == BlockHandler.citrineore ? ItemHandler.citrine : Item.getItemFromBlock(this)))))));\n }",
"public ArrayList <EggAbstract> getEggs() {\n\t\t//not checking if x is valid because that depends on the coordinate system\n\t\treturn eggs;\n\t}",
"public Integer getItemDamage(Material material)\r\n\t{\treturn this.itemDamage.get(material);\t}",
"public String getCheese() {\n return this.hold.getType();\n }",
"@Override\n\tprotected Item getDropItem() {\n\t\treturn ZollernItems.enderShard;\n\t}",
"public ItemStack getItemInHand ( ) {\n\t\tPlayer handle = handle ( );\n\t\t\n\t\tif ( handle != null ) {\n\t\t\ttry {\n\t\t\t\treturn ( ItemStack ) safeGetMethod (\n\t\t\t\t\t\tPlayerInventory.class , \"getItemInMainHand\" , new Class[ 0 ] ).invoke (\n\t\t\t\t\t\thandle.getInventory ( ) );\n\t\t\t} catch ( Exception e ) {\n\t\t\t\ttry {\n\t\t\t\t\treturn ( ItemStack ) safeGetMethod (\n\t\t\t\t\t\t\tPlayerInventory.class , \"getItemInHand\" , new Class[ 0 ] ).invoke (\n\t\t\t\t\t\t\thandle.getInventory ( ) );\n\t\t\t\t} catch ( IllegalAccessException | InvocationTargetException ex ) {\n\t\t\t\t\tex.printStackTrace ( );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn null;\n\t}",
"private void tryEquipItem() {\n if (fakePlayer.get().getHeldItem(EnumHand.MAIN_HAND).isEmpty()) {\n ItemStack unbreakingPickaxe = new ItemStack(Items.DIAMOND_PICKAXE, 1);\n unbreakingPickaxe.addEnchantment(Enchantments.EFFICIENCY, 3);\n unbreakingPickaxe.setTagCompound(new NBTTagCompound());\n unbreakingPickaxe.getTagCompound().setBoolean(\"Unbreakable\", true);\n fakePlayer.get().setItemStackToSlot(EntityEquipmentSlot.MAINHAND, unbreakingPickaxe);\n }\n }",
"public ItemStack getItemStack(int index) {\n return this.ITEMS.get(index);\n }",
"public String getMaterial () {\r\n return getItemStack().getTypeId()+ \":\" + getItemStack().getDurability(); \r\n\t}",
"private ItemStack getToolWhenHas() {\r\n\t\treturn ItemCreator\r\n\t\t\t\t.of(this.item)\r\n\t\t\t\t.glow(true)\r\n\t\t\t\t.lore(\"\", \"&6You already have this item.\", \"&6Click to take it away.\")\r\n\t\t\t\t.makeMenuTool();\r\n\t}",
"public boolean getEasterEgg() {\n\t\treturn easterEgg;\n\t}",
"public String getArmorPicture() {\r\n\t\treturn super.getItemPicture();\r\n\t}",
"public Item getItemDropped(IBlockState state, Random rand, int fortune)\n {\n \treturn this == InitBlocksEA.arcanite_ore ? InitItemsEA.arcanite : (this == InitBlocksEA.draconium_ore ? InitItemsEA.draconium_dust : (this == InitBlocksEA.velious_ore ? InitItemsEA.velious : (this == InitBlocksEA.katcheen_ore ? InitItemsEA.katcheen : (this == InitBlocksEA.necrocite_ore ? InitItemsEA.necrocite : (this == InitBlocksEA.soularite_ore ? InitItemsEA.soularite : Item.getItemFromBlock(this))))));\n \t\n //return this == EbonArtsBlocks.arcanite_ore ? EbonArtsItems.arcanite_shard : (this == Blocks.diamond_ore ? Items.diamond : (this == Blocks.lapis_ore ? Items.dye : (this == Blocks.emerald_ore ? Items.emerald : (this == Blocks.quartz_ore ? Items.quartz : Item.getItemFromBlock(this)))));\n }",
"public BoxItem.Info getItem() {\n return this.item;\n }",
"@Override\n public long getEnergy(ItemStack itemStack)\n {\n return NBTUtility.getNBTTagCompound(itemStack).getLong(\"electricity\");\n }",
"public int getKeySellItem() {\r\n return getKeyShoot();\r\n }",
"public ItemStack getIconItemStack()\n {\n return new ItemStack(Item.writableBook, 1, 0);\n }",
"public ItemStack getIconItemStack()\n {\n return new ItemStack(Item.writableBook, 1, 0);\n }",
"@SideOnly(Side.CLIENT)\r\n public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_)\r\n {\r\n return Item.getItemFromBlock(MainRegistry.blockCampfireUnlit);\r\n }",
"public int getKeyBuyItem() {\r\n return getKeyShoot();\r\n }",
"public void getAttackedByDarknessMagicBook(IEquipableItem item){item.strongAttackTo(this.getOwner());}",
"public String takeChestItem(String itemName) {\r\n\t\t\tif(this.getCurrentChest().getItem(itemName) == null) {\r\n\t\t\t\treturn \"There is no \" + itemName + \" in \" + this.getCurrentChest().getName() + \".\";\r\n\t\t\t} else if (this.getCurrentChest().getItem(itemName).isRemovable() == false) {\r\n\t\t\t\treturn \"You cannot take this item.\";\r\n\t\t\t} else if (this.getPlayer().getCarryCapacity() < this.getCurrentChest().getItem(itemName).getWeight()) {\r\n\t\t\t\treturn \"This item is to heavy, drop some items you don't want to carry.\";\r\n\t\t\t}\r\n\t\t\telse if(this.getCurrentChest().getItem(itemName).getClassName().equals(\"game.Purse\")) {\r\n\t\t\t\tint gold = ((Purse)this.getCurrentChest().getItem(itemName)).getGold();\r\n\t\t\t\tthis.getPlayer().changeGold(((Purse)this.getCurrentChest().getItem(itemName)).getGold());\r\n\t\t\t\tthis.getCurrentChest().removeItem(itemName);\r\n\t\t\t\treturn \"You gain \" + gold + \" gold.\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.handleIncQuestrelatedItem(this.getCurrentChest().getItem(itemName));\r\n\t\t\t\tthis.getPlayer().addItem(this.getCurrentChest().getItem(itemName));\r\n\t\t\t\tthis.getCurrentChest().removeItem(itemName);\r\n\t\t\t\treturn \"You take \" + itemName + \". \\n\"\r\n\t\t\t\t\t\t+ \"You can carry \" + this.getPlayer().getCarryCapacity() + \" more units of weight. \\n\"\r\n\t\t\t\t\t\t+ this.getCurrentChest().getName() + \" now contains: \"\r\n\t\t\t\t\t\t+ this.getCurrentChest().getContent().keySet().toString() + \".\";\r\n\t\t\t}\r\n\t\t}",
"float getBonusItemDrop();",
"public List<ItemStack> getItems() {\n return this.items;\n }",
"public Entity getDamageDealer();",
"public int getItemEnchantability()\r\n {\r\n return this.toolMaterial.getEnchantability();\r\n }",
"@Override\n\tpublic boolean isBreedingItem(ItemStack item) {\n\t\treturn getBreed().getBreedingItem() == item.getItem();\n\t}",
"public EntityEquipment getEquipment ( ) {\n\t\treturn extract ( handle -> handle.getEquipment ( ) );\n\t}",
"public Item getItem ()\n\t{\n\t\treturn item;\n\t}",
"@Override\n\tpublic Item getItemDropped(int par1, Random par2Random, int par3) {\n\t\treturn Item.getItemFromBlock(this);\n\t}",
"protected ItemStack getDroppedItemStack(BlockState state, HitResult target, BlockGetter world,\n BlockPos blockPos, Player player, ItemStack originalItemStack) {\n return originalItemStack;\n }",
"public Item getItem() {\n\t\treturn this.item;\n\t}",
"public Item getItem() {\n\t\treturn this.item;\n\t}",
"public ItemStack generateItem(){\n\t\tItemStack item = new ItemStack(material);\n\t\tif(damage >= 0) item.setDurability(damage);\n\t\t\n\t\tif(itemName.isEmpty() && loreLine.isEmpty()) return item;\n\t\t\n\t\tItemMeta meta = item.getItemMeta();\n\t\tif(meta == null) return item;\n\t\t\n\t\tmeta.setDisplayName(itemName);\n\t\tmeta.setLore(Arrays.asList(loreLine));\n\t\titem.setItemMeta(meta);\n\t\t\n\t\treturn item;\n\t}",
"public Item getItem() {\r\n\t\treturn this.item;\r\n\t}",
"public static ItemStack getItemInMainHand(Player player) {\n try {\n // 1.9+\n return player.getInventory().getItemInMainHand();\n } catch (Throwable ex) {\n // pre 1.9\n return player.getItemInHand();\n }\n }",
"public ItemStack getItemInUse ( ) {\n\t\treturn extract ( handle -> handle.getItemInUse ( ) );\n\t}",
"@ZenCodeType.Method\n @ZenCodeType.Getter(\"itemDamage\")\n public static int getItemDamage(ItemFishedEvent internal) {\n \n return internal.getRodDamage();\n }",
"public Item getItem() {\n\t\treturn item;\n\t}",
"public List<ItemStack> getItems()\n {\n return items;\n }",
"public String getKeyBuyItemName() {\r\n return getKeyShootName();\r\n }",
"public ItemType getItem() {\n\t return this.item;\n\t}",
"public ItemType getItem() {\n\t return this.item;\n\t}",
"@Override\n\tpublic Integer getInventoryForAIngredient(Ingredient ingredient){\n\t\treturn beverageInventoryMap.get(ingredient);\n\t}",
"@Override\r\n\tpublic final ItemStack getItemAt(final int slot) {\r\n\t\treturn slot < this.tools.size() ? this.tools.get(slot).get(this.getViewer()) : null;\r\n\t}",
"public RepositoryItem getItem() {\n\t\t\treturn item;\n\t\t}",
"public org.bukkit.inventory.ItemStack getBossDrop(String killer) {\n\t\tint number = random.nextInt(100);\r\n\t\tfor(Entry<SpecialItem, Integer> item: drops.entrySet()) {\r\n\t\t\tLog.info(item.getKey().getChance(), item.getValue(),\"ITEM\",number);\r\n\t\t\tif(item.getValue() > number) {\r\n\t\t\t\treturn item.getKey().getItem(killer,name);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn(new org.bukkit.inventory.ItemStack(Material.BONE));\r\n\t}",
"@Override\r\n public ItemStack getItemStack(PartItemStack type) {\n return new ItemStack(this.item);\r\n }",
"public Item getItem() {\n return Bootstrap.getInstance().getItemRepository().fetchAll().stream()\n .filter(i -> i.getId() == this.itemId)\n .findFirst().orElse(null);\n }",
"public int getDamage () {\n\t\treturn (this.puissance + stuff.getDegat());\n\t}",
"public int getWeaponDamage()\n {\n \t\treturn mystuff.getWepDmg();\n }",
"@java.lang.Override\n public POGOProtos.Rpc.HoloInventoryItemProto getInventoryItemData() {\n if (inventoryItemCase_ == 3) {\n return (POGOProtos.Rpc.HoloInventoryItemProto) inventoryItem_;\n }\n return POGOProtos.Rpc.HoloInventoryItemProto.getDefaultInstance();\n }",
"public Entity getTreasure() {\n return treasure;\n }",
"public String getItem() {\r\n\t\treturn item;\r\n\t}",
"public Item getItem() {\n return item;\n }",
"public int getEquippedWeaponDamage() {\n return 0;\n }",
"@Override\n public Optional<FridgeItemEntity> getFridgeItem(String fridgeItemId) {\n return Optional.empty();\n }",
"public int getArmorPrice() {\r\n\t\treturn super.getItemPrice();\r\n\t}",
"public void dropItem(Location loc){\n\t\t\n\t\tPlayer p = getThrower();\n\t\tItemStack droppedItem;\n\t\t\n\t\tdroppable.clear();\n\t\t\n\t\taddItem(Material.IRON_INGOT, 8, 8, 3); //Item, weight, maximum stack size, minimum stack size\n\t\taddItem(Material.GOLD_INGOT, 5, 5, 1);\n\t\taddItem(Material.DIAMOND, 3, 3, 1);\n\t\taddItem(Material.GOLDEN_APPLE, 1, 1, 1);\n\t\taddItem(Material.ROTTEN_FLESH, 10, 5, 1);\n\t\taddItem(Material.BREAD, 15, 32, 15);\n\t\taddItem(Material.BONE, 10, 5, 1);\n\t\taddItem(Material.SULPHUR, 10, 5, 1);\n\t\taddItem(Material.SADDLE, 1, 1, 1);\n\t\t\n\t\tint Size = droppable.size();\n\t\trandNum = ThreadLocalRandom.current().nextInt(Size);\n\t\t\n\t\tdroppedItem = droppable.get(randNum);\n\t\t\n\t\tp.getWorld().dropItem(loc, droppedItem);\n\t\tp.getWorld().dropItem(loc, new ItemStack(Material.GOLD_NUGGET, rand.nextInt(10) + 1));\n\t\t\n\t}",
"public int getDamage() {\n\t\treturn (int) (Math.random() * damageVariance) + damage;\n\t}",
"public static ItemStack getCactusJuice() {\n\t\tItemStack juice = new ItemStack(Material.POTION, 1);\n\t\tPotionMeta meta = (PotionMeta) juice.getItemMeta();\n\t\tmeta.addCustomEffect(new PotionEffect(PotionEffectType.CONFUSION, 2400, 4), true);\n\t\tmeta.addCustomEffect(new PotionEffect(PotionEffectType.SLOW, 3600, 2), true);\n\t\tmeta.addCustomEffect(new PotionEffect(PotionEffectType.WEAKNESS, 3600, 4), true);\n\t\tmeta.addCustomEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 200, 0), true);\n\t\tmeta.setColor(Color.YELLOW);\n\t\tjuice.setItemMeta(meta);\n\t\tArrayList<String> s = new ArrayList<>();\n\t\tmeta.setDisplayName(ChatUtils.translateToColor(\"&2Cactus Juice\"));\n \t s.add(ChatUtils.translateToColor(\"&a&oDesperate times call for desperate measures...\"));\n \t meta.setLore(s);\n \t juice.setItemMeta(meta);\n\t\treturn juice;\n\t}",
"public Item getItemBack(Player character) {\n itemPlacedRoom = false;\n Item item = character.items.get(character.getItemOwned2().getName());\n if(item != null) {\n if(canReceiveItem(character) == true) {\n items.put(item.getName(), item);\n } else {\n currentRoom.addItem(item);\n itemPlacedRoom = true;\n }\n character.setItemOwned2(null);\n }\n return item;\n }",
"ItemStack getItemstackWithMaterial(Material material);",
"public String getKeyEquipName() {\r\n return getKeyShootName();\r\n }",
"public String e_(ItemStack paramamj)\r\n/* 14: */ {\r\n/* 15:19 */ if (paramamj.getDamage2() == 1) {\r\n/* 16:20 */ return \"item.charcoal\";\r\n/* 17: */ }\r\n/* 18:22 */ return \"item.coal\";\r\n/* 19: */ }",
"public String getEquippedWeapon()\n\t{\n\t\treturn strEquippedWeapon;\n\t\t\n\t}",
"public Item pickup(){\n\t\tfor(int i= 0; i< this.Items.length;i++){\n\t\t\tfor(int p = 0; p < this.Items.length; p++){\n\t\t\t\tif(this.Items[i][p] != null && this.position[i][p] == 1){\n\t\t\t\t\tItem loot = Items[i][p];\n\t\t\t\t\tItems[i][p] = null;\n\t\t\t\t\treturn loot;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn new Item(ItemType.other, \"dust\", 0,0,0);\n\t}",
"@SideOnly(Side.CLIENT)\n\t public Item getItem(World wordl, int x, int y, int z)\n\t {\n//\t return this.blockMaterial == Material.iron ? Items.iron_door : Items.wooden_door;\n\t \t return MGHouseItems.item_boat_door;\n\t }",
"public Item getItem() { \n return myItem;\n }",
"@Override\n public int getDamageToComponent(ItemStack itemStack) {\n return 0;\n }",
"@Override\n public ItemStack getButtonItem(Player player) {\n ItemStack superItem = super.getButtonItem(player);\n\n superItem.setDurability(durability);\n\n return superItem;\n }",
"public Item getItem() { return this; }",
"@Override\n public void onSmelting(EntityPlayer player, ItemStack item) \n {\n \n }",
"public Item getItem() {\n return item;\n }",
"@Override\n public void onSmelting(EntityPlayer player, ItemStack item) {\n }",
"public Inventory getEquipment() {\n return equipment;\n }",
"public String unequipItem(String itemName) {\r\n\t\t\tif(itemName == \"unarmored\") {\r\n\t\t\t\treturn \"You do not have any armor to unequip.\"; // handles unarmored situation\r\n\t\t\t}\r\n\t\t\telse if(itemName.equals(this.getPlayer().getBodyArmor().getName())) {\r\n\t\t\t\tthis.getPlayer().changeMaxHealth(0-this.getPlayer().getBodyArmor().getArmor());\r\n\t\t\t\tthis.getPlayer().addUnequippedItemToInventory(this.getPlayer().getBodyArmor());\r\n\t\t\t\tthis.getPlayer().setBodyArmor(this.getDefaultBodyArmor());\t\t// set armor to default on unequip\r\n\t\t\t\treturn \"You unequip \" + itemName + \".\";\r\n\t\t\t}\r\n\t\t\telse if (itemName.equals(this.getPlayer().getHeadgear().getName())) {\r\n\t\t\t\tthis.getPlayer().changeMaxHealth(0-this.getPlayer().getHeadgear().getArmor());\r\n\t\t\t\tthis.getPlayer().addUnequippedItemToInventory(this.getPlayer().getHeadgear());\r\n\t\t\t\tthis.getPlayer().setHeadgear(this.getDefaultHeadgear());\t\t// set headgear to default on unequip \r\n\t\t\t\treturn \"You unequip \" + itemName + \".\";\r\n\t\t\t}\r\n\t\t\telse if (itemName.equals(this.getPlayer().getGloves().getName())) {\r\n\t\t\t\tthis.getPlayer().changeMaxHealth(0-this.getPlayer().getGloves().getArmor());\r\n\t\t\t\tthis.getPlayer().addUnequippedItemToInventory(this.getPlayer().getGloves());\r\n\t\t\t\tthis.getPlayer().setGloves(this.getDefaultGloves());\t\t\t// set gloves to default on unequip \r\n\t\t\t\treturn \"You unequip \" + itemName + \".\";\r\n\t\t\t}\r\n\t\t\telse if (itemName.equals(this.getPlayer().getBoots().getName())) {\r\n\t\t\t\tthis.getPlayer().changeMaxHealth(0-this.getPlayer().getBoots().getArmor());\r\n\t\t\t\tthis.getPlayer().addUnequippedItemToInventory(this.getPlayer().getBoots());\r\n\t\t\t\tthis.getPlayer().setBoots(this.getDefaultBoots());\t\t\t\t// set boots to default on unequip \r\n\t\t\t\treturn \"You unequip \" + itemName + \".\";\r\n\t\t\t}\r\n\t\t\telse if (itemName.equals(this.getPlayer().getWeapon().getName())) {\r\n\t\t\t\tthis.getPlayer().addUnequippedItemToInventory(this.getPlayer().getWeapon());\r\n\t\t\t\tthis.getPlayer().setWeapon(this.getDefaultWeapon());\t\t\t// set weapon to default on unequip \r\n\t\t\t\treturn \"You unequip \" + itemName + \".\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn \"You cannot unequip an item you are not wearing.\";\r\n\t\t\t}\r\n\t\t}",
"@java.lang.Override\n public POGOProtos.Rpc.HoloInventoryItemProto getInventoryItemData() {\n if (inventoryItemDataBuilder_ == null) {\n if (inventoryItemCase_ == 3) {\n return (POGOProtos.Rpc.HoloInventoryItemProto) inventoryItem_;\n }\n return POGOProtos.Rpc.HoloInventoryItemProto.getDefaultInstance();\n } else {\n if (inventoryItemCase_ == 3) {\n return inventoryItemDataBuilder_.getMessage();\n }\n return POGOProtos.Rpc.HoloInventoryItemProto.getDefaultInstance();\n }\n }",
"public Number getInventoryItemId() {\n return (Number)getAttributeInternal(INVENTORYITEMID);\n }",
"public Number getInventoryItemId() {\n return (Number)getAttributeInternal(INVENTORYITEMID);\n }",
"public int getItemEnchantability()\n {\n return this.field_77878_bZ.func_78045_a();\n }"
] | [
"0.6986963",
"0.68693334",
"0.68264997",
"0.6769484",
"0.66745627",
"0.6486993",
"0.64372724",
"0.6388022",
"0.62935346",
"0.6282115",
"0.612678",
"0.60289335",
"0.6026195",
"0.6005827",
"0.59885335",
"0.59791404",
"0.5965559",
"0.5957119",
"0.5903732",
"0.5893404",
"0.588192",
"0.5862678",
"0.5851172",
"0.5831168",
"0.5802949",
"0.57890517",
"0.57851374",
"0.5783387",
"0.5783106",
"0.5779428",
"0.5776755",
"0.5761545",
"0.57569456",
"0.5751784",
"0.5724455",
"0.57101357",
"0.57101357",
"0.5686054",
"0.56816983",
"0.56709874",
"0.5670977",
"0.56684005",
"0.56560683",
"0.563879",
"0.5630575",
"0.5603325",
"0.5600614",
"0.5596709",
"0.559372",
"0.558831",
"0.5583147",
"0.5583147",
"0.5582967",
"0.55628306",
"0.5558464",
"0.55560946",
"0.5553348",
"0.5543967",
"0.55281925",
"0.5523486",
"0.5521396",
"0.5521396",
"0.55187577",
"0.5511145",
"0.5506348",
"0.54889697",
"0.5480406",
"0.5477845",
"0.5477607",
"0.5473351",
"0.5470535",
"0.5468242",
"0.54620045",
"0.545179",
"0.5448511",
"0.5434162",
"0.54322296",
"0.5430543",
"0.5428965",
"0.54277956",
"0.5426044",
"0.54231477",
"0.54226404",
"0.5422319",
"0.5421906",
"0.5416395",
"0.54104185",
"0.5407605",
"0.54038155",
"0.53981566",
"0.53956026",
"0.5391506",
"0.5386411",
"0.5384468",
"0.53775865",
"0.53681916",
"0.5358613",
"0.535828",
"0.535828",
"0.5355882"
] | 0.75630265 | 0 |
willEggHatch Whether an egg laid right now by this mob is fertilized and will hatch into a baby mob. | boolean willEggHatch(IGeneticMob geneticMob); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"float shouldEatOffTheGround(IGeneticMob geneticMob, EntityItem itemEntity);",
"public void makeHappy() {\n while (statusEnum() != TamagotchiMood.HAPPY) {\n if (!isHungry() && !isTired()) {\n play();\n } else if (isHungry() && !isTired()) {\n eat();\n } else {\n sleep();\n }\n }\n\n if (!muted) {\n System.out.println(\"I can do thing on my own now and will rule the world! MUHAHAHA!\");\n }\n }",
"boolean canLayEgg(IGeneticMob geneticMob);",
"public boolean eat() {\n\n if (this.hungerLevel > 0) {\n --this.hungerLevel; // Lower hunger after eating.\n return true;\n }\n return false;\n }",
"public boolean heatPotion() \n\t{\n\t\tint count=0;\n\t\tfor (int i=0; i < ingredients.length(); i++) \n\t\t{\n\t\t\tif (ingredients.charAt(i)=='w') \n\t\t\t{\n\t\t\t\t//take out the water and count that it was there\n\t\t\t\tingredients = ingredients.replace(\"w\", \"\");\n\t\t\t\tcount+=1;\n\t\t\t}\n\t\t}\n\t\t//check that there was water in the potion in order to have it properly heated\n\t\tif (count > 0) \n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\telse\n\t\t\treturn false;\n\t}",
"@Override\n public void chew() {\n MessageUtility.logSound(name,\"Bleats and Stomps its legs, then chews\");\n }",
"private boolean hasEatenApple() {\r\n return snake.getHead().equals(apple);\r\n }",
"static boolean getMauled(){\n\t\t\tif (Person.player.inventory.contains(Item.repellent)) //if you have the goose repellent...\n\t\t\t\treturn (MainFile.getRandomNumber(240) == 12); //drastically lowers your chance of being mauled.\n\t\t\treturn (MainFile.getRandomNumber(20) == 12);//generates a random number for if you don't have it, and if it's 12 you get mauled\n\t\t}",
"public void eat() {\n if (!isTired()) {\n hunger -= 3;\n fatigue += 2;\n\n if (!muted) {\n System.out.println(\"eat\\t\\t|\\tYummy this is tasty!\");\n }\n }\n }",
"private void selfHeal() {\n\t\t\n\t\t//IF the Droid is carrying an item...\n\t\tif (this.getItemCarried() != null){\n\t\t\t\n\t\t\t//If the item is an oil can...\n\t\t\tif (this.getItemCarried().getShortDescription() == \"an oil can\" ) {\n\t\t\t\n\t\t\t\t//If the Droids health is LOWER than half...\n\t\t\t\tif((this.getInitialHP()/2) > this.getHitpoints()) {\n\t\t\t\t\tsay(this.getShortDescription() + \" is at or below half HP. \"\n\t\t\t\t\t\t\t+ \" Healing itself...\");\n\t\t\t\t\t\n\t\t\t\t\t//Implementing a new HealDroid method (Droid heals on itself)\n\t\t\t\t\t//public HealDroid(SWEntityInterface theTarget, MessageRenderer m) {\n\t\t\t\t\tHealDroid droidHeal = new HealDroid(this, messageRenderer);\n\t\t\t\t\t\n\t\t\t\t\tscheduler.schedule(droidHeal, this, 1);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\n\t}",
"public void hasHeartPower(){\n shipVal.setHealth(shipVal.getHealth()+1);\n updateHearts(new ImageView(cacheHeart));\n score_val += 1000;\n }",
"public boolean didEatKibble(Kibble kibble) {\n if (kibble.getKibbleX() == snakeHeadX && kibble.getKibbleY() == snakeHeadY) {\n justAteMustGrowThisMuch += growthIncrement;\n return true;\n }\n return false;\n }",
"public boolean canFly() {\n\t\treturn !isEgg() && !isHatchling();\n\t}",
"public void act() \n {\n EggFactory eggFactory = new EggFactory();\n \n move(4);\n int random = Greenfoot.getRandomNumber(5000);\n if((random>200 & random<300) || ((Farm)getWorld()).atWorldEdge(this))\n {\n turn(180);\n getImage().mirrorVertically();\n move(4);\n \n }\n\n if( Greenfoot.getRandomNumber(100) ==0)\n {\n\n Farm farm = (Farm)getWorld();\n Egg egg = null; \n int eggPicker = Greenfoot.getRandomNumber(80);\n //DropEggStrategy dropEgg = new DropEggStrategy(); //Strategy pattern\n\n IEggStrategy whiteStrategy = new WhiteEggStrategy(eggFactory);\n IEggStrategy blackStrategy = new BlackEggStrategy(eggFactory);\n IEggStrategy goldenStrategy = new GoldenEggStrategy(eggFactory);\n \n DropEggContext context = new DropEggContext();\n \n if(eggPicker >= 50 && eggPicker <= 60){\n \n context.setIEggStrategy(goldenStrategy);\n egg = context.dropEgg();\n getWorld().addObject(egg, this.getX(), this.getY()+45);\n }\n else if(eggPicker >= 60 && eggPicker <= 70){\n\n context.setIEggStrategy(blackStrategy);\n egg = context.dropEgg();\n getWorld().addObject(egg, this.getX(), this.getY()+45);\n }\n else{\n context.setIEggStrategy(whiteStrategy);\n egg = context.dropEgg();\n getWorld().addObject(egg, this.getX(), this.getY()+45);\n }\n \n egg.register(farm.getLifeObserver());//register life creator observer into egg subject \n\n \n\n }\n\n }",
"public void setupGame() {\n\t\t// Re-spawn the appropriate number of sheep\n\t\tint numSheep = 31;\n\t\t\n\t\tif (!SheepPhysicsState.PRODUCTION) {\n\t\t\tnumSheep = 1;\n\t\t}\n\t\t\n\t\t// It takes half the sheep to win.\n\t\t_scoreToWin = numSheep / 2;\n\t\tp(\"It takes \" + _scoreToWin + \" sheep to win.\");\n\t\t\n\t\t_hasBeenWon = false;\n\t\t\n\t\t// Non-infrastructural entities.\n\t\t//////////////////////////\n\t\t\n\t\t// Don't create this stuff if I'm replaying.\n\t\tint mod = 1;\n\t\tfor (int i = 0; i < numSheep; i++) {\n\t\t\t//int x = _generator.nextInt(40) - 20;\n\t\t\t//int z = _generator.nextInt(80) - 40;\n\t\t\tmod *= -1;\n\t\t\tint x = i/2 * mod;\n\t\t\tint z = 0;\n\n\t\t\tSheep s = new Sheep(\"sheep-\" + i + \"[\" + _sheepID + \"]\", x, 2, z);\n\t\t\t\n\t\t\tif (!SheepPhysicsState.PRODUCTION) {\n\t\t\t\ts.setBehaviorActive(false);\n\t\t\t}\n\t\t\t\n\t\t\t_sheepID++;\n\t\t}\n\t\t\n\t\t// Add a wubble for testing.\n\t\tif (!_isJimboSpawned && !SheepPhysicsState.PRODUCTION) {\n\t\t\tSystem.out.println(\"Adding Jimbo.\");\n\t\t\t_isJimboSpawned = true;\n\t\t\taddWubble(\"Jimbo\", (short)100, (Integer)1);\n\t\t\taddSidekick(\"Jimbo\");\n\t\t\t//addWubble(\"Bimbo\", (short)101, (Integer)0);\n\t\t}\n\t\t\n\t\t//////////////////////////\n\n\t\t// Add some wrenches in the appropriate spots.\n\t\tnew Wrench(\"blueWrench1\", -8, 5, -20);\n\t\tnew Wrench(\"blueWrench2\", 8, 5, -20);\n\t\tnew Wrench(\"redWrench1\", -8, 5, 20);\n\t\tnew Wrench(\"redWrench2\", 8, 5, 20);\n\t\t\n\t\t// Save the start of the me.\n\t\t_gameStart = System.currentTimeMillis();\n\t\tSystem.out.println(\"Started game at \" + _gameStart);\n\t\t\n\t\t// Make some predicates.\n\t\t//Predicate p = new Predicate(\"baseClassPred\");\n\t\t//GoPred g = new GoPred(\"derivedGoClass\", 1);\n\t\t\n\t\t//new PowerUp(\"PowerUpS\", -1, PowerUpInfo.PowerUpType.SPEEDY, new Vector3f(0, 0.4f, 0));\n\t\t//new PowerUp(\"PowerUpE\", -1, PowerUpInfo.PowerUpType.EATER, new Vector3f(2, 0.4f, 0));\n\t\t//new PowerUp(\"PowerUpS\", -1, PowerUpInfo.PowerUpType.STICKY, new Vector3f(2, 0.4f, 2));\n\t}",
"float shouldAggroOnHit(IGeneticMob geneticMob, EntityLiving attacker);",
"public void livingTick() {\n super.livingTick();\n this.oFlap = this.wingRotation;\n this.oFlapSpeed = this.destPos;\n this.destPos = (float)((double)this.destPos + (double)(this.onGround ? -1 : 4) * 0.3D);\n this.destPos = MathHelper.clamp(this.destPos, 0.0F, 1.0F);\n if (!this.onGround && this.wingRotDelta < 1.0F) {\n this.wingRotDelta = 1.0F;\n }\n\n this.wingRotDelta = (float)((double)this.wingRotDelta * 0.9D);\n Vec3d vec3d = this.getMotion();\n if (!this.onGround && vec3d.y < 0.0D) {\n this.setMotion(vec3d.mul(1.0D, 0.6D, 1.0D));\n }\n\n this.wingRotation += this.wingRotDelta * 2.0F;\n if (!this.world.isRemote && this.isAlive() && !this.isChild() && getGender()==Gender.FEMALE && --this.timeUntilNextEgg <= 0) {\n this.playSound(SoundEvents.ENTITY_CHICKEN_EGG, 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);\n this.entityDropItem(Items.EGG);\n this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000;\n }\n\n ++this.eatTicks;\n ItemStack itemstack = this.getItemStackFromSlot(EquipmentSlotType.MAINHAND);\n if (this.canEatItem(itemstack)) {\n if (this.eatTicks > 600) {\n ItemStack itemstack1 = itemstack.onItemUseFinish(this.world, this);\n if (!itemstack1.isEmpty()) {\n this.setItemStackToSlot(EquipmentSlotType.MAINHAND, itemstack1);\n }\n\n this.eatTicks = 0;\n } else if (this.eatTicks > 560 && this.rand.nextFloat() < 0.1F) {\n this.playSound(this.getEatSound(itemstack), 1.0F, 1.0F);\n this.world.setEntityState(this, (byte)45);\n }\n }\n\n }",
"public boolean getEasterEgg() {\n\t\treturn easterEgg;\n\t}",
"public void eatApple() {\n\t\teaten = peeled && !eaten ? true : false;\n\t}",
"public void baptism() {\n for (Card targetCard : Battle.getInstance().getActiveAccount().getActiveCardsOnGround().values()) {\n if (targetCard instanceof Minion) {\n targetCard.setHolyBuff(2, 1);\n }\n }\n }",
"public static void reproduce (Species [][] map, int sheepHealth, int wolfHealth, int plantHealth) {\n \n // Place the baby\n int babyY, babyX;\n \n // Check if the baby has been placed\n int spawned = 0;\n \n for (int y = 0; y < map[0].length; y++){\n for (int x = 0; x < map.length; x++){\n \n boolean [][] breeding = breedChoice (map, x, y, plantHealth);\n \n // Sheep upwards to breed with\n if (breeding[0][0]) {\n ((Sheep)map[y][x]).reproduceHealthLost(10);\n ((Sheep)map[y-1][x]).reproduceHealthLost(10);\n \n // Make baby sheep\n Sheep sheep = new Sheep(sheepHealth, x, y);\n \n // Place the baby sheep\n do {\n babyY = (int)(Math.random() * map.length);\n babyX = (int)(Math.random() * map.length);\n if (map[babyY][babyX] == null) {\n map[babyY][babyX] = sheep;\n spawned = 1;\n }\n } while (spawned == 0);\n \n // Sheep downwards to breed with\n } else if (breeding[1][0]) {\n ((Sheep)map[y][x]).reproduceHealthLost(10);\n ((Sheep)map[y+1][x]).reproduceHealthLost(10);\n \n // Make baby sheep\n Sheep sheep = new Sheep(sheepHealth, x, y);\n \n // Place the baby sheep\n do {\n babyY = (int)(Math.random() * map.length);\n babyX = (int)(Math.random() * map.length);\n if (map[babyY][babyX] == null) {\n map[babyY][babyX] = sheep;\n spawned = 1;\n }\n } while (spawned == 0);\n \n // Sheep to the left to breed with\n } else if (breeding[2][0]) {\n ((Sheep)map[y][x]).reproduceHealthLost(10);\n ((Sheep)map[y][x-1]).reproduceHealthLost(10);\n \n // Make baby sheep\n Sheep sheep = new Sheep(sheepHealth, x, y);\n \n // Place the baby sheep\n do {\n babyY = (int)(Math.random() * map.length);\n babyX = (int)(Math.random() * map.length);\n if (map[babyY][babyX] == null) {\n map[babyY][babyX] = sheep;\n spawned = 1;\n }\n } while (spawned == 0);\n \n // Sheep to the right to breed with\n } else if (breeding[3][0]) {\n ((Sheep)map[y][x]).reproduceHealthLost(10);\n ((Sheep)map[y][x+1]).reproduceHealthLost(10);\n \n // Make baby sheep\n Sheep sheep = new Sheep(sheepHealth, x, y);\n \n // Place the baby sheep\n do {\n babyY = (int)(Math.random() * map.length);\n babyX = (int)(Math.random() * map.length);\n if (map[babyY][babyX] == null) {\n map[babyY][babyX] = sheep;\n spawned = 1;\n }\n } while (spawned == 0);\n \n // Wolf upwards to breed with\n } else if (breeding[0][1]) {\n ((Wolf)map[y][x]).reproduceHealthLost(10);\n ((Wolf)map[y-1][x]).reproduceHealthLost(10);\n \n // Make baby wolf\n Wolf wolf = new Wolf(wolfHealth, x, y);\n \n // Place the baby wolf\n do { \n babyY = (int)(Math.random() * map.length);\n babyX = (int)(Math.random() * map.length);\n if (map[babyY][babyX] == null) {\n map[babyY][babyX] = wolf;\n spawned = 1; \n }\n } while (spawned == 0);\n \n // Wolf downwards to breed with\n } else if (breeding[1][1]) {\n ((Wolf)map[y][x]).reproduceHealthLost(10);\n ((Wolf)map[y+1][x]).reproduceHealthLost(10);\n \n // Make baby wolf\n Wolf wolf = new Wolf(wolfHealth, x, y);\n \n // Place the baby wolf\n do { \n babyY = (int)(Math.random() * map.length);\n babyX = (int)(Math.random() * map.length);\n if (map[babyY][babyX] == null) {\n map[babyY][babyX] = wolf;\n spawned = 1; \n }\n } while (spawned == 0);\n \n // Wolf to the left to breed with\n } else if (breeding[2][1]) {\n ((Wolf)map[y][x]).reproduceHealthLost(10);\n ((Wolf)map[y][x-1]).reproduceHealthLost(10);\n \n // Make baby wolf\n Wolf wolf = new Wolf(wolfHealth, x, y);\n \n // Place the baby wolf\n do { \n babyY = (int)(Math.random() * map.length);\n babyX = (int)(Math.random() * map.length);\n if (map[babyY][babyX] == null) {\n map[babyY][babyX] = wolf;\n spawned = 1; \n }\n } while (spawned == 0);\n \n // Wolf to the right to breed with\n } else if (breeding[3][1]) {\n ((Wolf)map[y][x]).reproduceHealthLost(10);\n ((Wolf)map[y][x+1]).reproduceHealthLost(10);\n \n // Make baby wolf\n Wolf wolf = new Wolf(wolfHealth, x, y);\n \n // Place the baby wolf\n do { \n babyY = (int)(Math.random() * map.length);\n babyX = (int)(Math.random() * map.length);\n if (map[babyY][babyX] == null) {\n map[babyY][babyX] = wolf;\n spawned = 1; \n }\n } while (spawned == 0);\n \n }\n \n }\n }\n \n }",
"@Test\n void doEffectheatseeker() {\n ArrayList<Player> pl = new ArrayList<>();\n AlphaGame g = new AlphaGame(1, pl,false, 8);\n WeaponFactory wf = new WeaponFactory(\"heatseeker\");\n Weapon w4 = new Weapon(\"heatseeker\", wf.getBooleans(), wf.getCosts(), wf.getRequestedNum(), wf.getApplier(), wf.getEffects(), wf.getDescriptions());\n WeaponDeck wd = new WeaponDeck();\n wd.addWeapon(w4);\n RealPlayer p = new RealPlayer('b', \"ciccia\");\n wd.addWeapon(w4);\n p.setPlayerPosition(Board.getSquare(0));\n p.getPh().drawWeapon(wd, w4.getName());\n RealPlayer victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(10));\n ArrayList<Player> players = new ArrayList<>();\n players.add(victim);\n try{\n p.getPh().getWeaponDeck().getWeapon(w4.getName()).doEffect(\"base\", null, null, p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 3);\n }",
"boolean shouldAutoAggro(IGeneticMob geneticMob, EntityLiving otherEntity);",
"public boolean isSwimming() {\n/* 1967 */ return (!this.abilities.flying && !isSpectator() && super.isSwimming());\n/* */ }",
"public boolean isFireDamage();",
"private void hatch(Location currentLocation) {\n GameWorld.getPlayer().earnEcoPoints(hatchEarnings);\n currentLocation.addActor(babyDinosaur);\n currentLocation.removeItem(this);\n }",
"public void eatEgg(Egg egg) {\n raiseFoodLevel(10);\n }",
"public boolean isHappy() {\n return _happy;\n }",
"boolean hasGemReward();",
"private static void berserkerMelee(Player player) {\n\t\tbankInventoryAndEquipment(player);\n\t\tspawnInventory(player, BerserkerMelee.inventory);\n\t\tspawnEquipment(player, BerserkerMelee.equipmentSet(player));\n\t\tupdateEquipment(player);\n\t\theal(player, true, true);\n\t\tsetCombatSkills(player, \"BERSERKER\", false, null);\n\t\tsetPrayerAndMagicBook(player, \"LUNAR\");\n\t\tPresets.isPresetFlagged(player, player.bankIsFullWhileUsingPreset);\n\t}",
"private boolean blowBlockUp(final Location at, String eventTypeRep) {\n if (at == null) {\n return false;\n }\n Block block = at.getBlock();\n if (block == null) {\n return false;\n }\n if (block.getType() == Material.AIR) {\n return false;\n }\n\n if (!MaterialManager.getInstance().contains(block.getType().name())) {\n return false;\n }\n\n if (eventTypeRep.equals(\"CraftTNTPrimed\") && !MaterialManager.getInstance().getTntEnabled(block.getType().name())) {\n return false;\n }\n if (eventTypeRep.equals(\"CraftSnowball\") && !MaterialManager.getInstance().getCannonsEnabled(block.getType().name())) {\n return false;\n }\n if (eventTypeRep.equals(\"CraftCreeper\") && !MaterialManager.getInstance().getCreepersEnabled(block.getType().name())) {\n return false;\n }\n if (eventTypeRep.equals(\"CraftWither\") && !MaterialManager.getInstance().getWithersEnabled(block.getType().name())) {\n return false;\n }\n if (eventTypeRep.equals(\"CraftMinecartTNT\") && !MaterialManager.getInstance().getTntMinecartsEnabled(block.getType().name())) {\n return false;\n }\n if ((eventTypeRep.equals(\"CraftFireball\") || eventTypeRep.equals(\"CraftGhast\")) && !MaterialManager.getInstance().getGhastsEnabled(block.getType().name())) {\n return false;\n }\n\n if (MaterialManager.getInstance().getDurabilityEnabled(block.getType().name()) && MaterialManager.getInstance().getDurability(block.getType().name()) > 1) {\n TimerState state = checkDurabilityActive(block.getLocation());\n if (ConfigManager.getInstance().getEffectsEnabled()) {\n final double random = Math.random();\n if (random <= ConfigManager.getInstance().getEffectsChance()) {\n block.getWorld().playEffect(at, Effect.MOBSPAWNER_FLAMES, 0);\n }\n }\n if (state == TimerState.RUN || state == TimerState.INACTIVE) {\n int currentDurability = getMaterialDurability(block);\n currentDurability++;\n if (checkIfMax(currentDurability, block.getType().name())) {\n // counter has reached max durability, remove and drop an item\n dropBlockAndResetTime(at);\n } else {\n // counter has not reached max durability damage yet\n if (!MaterialManager.getInstance().getDurabilityResetTimerEnabled(block.getType().name())) {\n addBlock(block, currentDurability);\n } else {\n startNewTimer(block, currentDurability, state);\n }\n }\n } else {\n if (!MaterialManager.getInstance().getDurabilityResetTimerEnabled(block.getType().name())) {\n addBlock(block, 1);\n } else {\n startNewTimer(block, 1, state);\n }\n if (checkIfMax(1, block.getType().name())) {\n dropBlockAndResetTime(at);\n }\n }\n } else {\n destroyBlockAndDropItem(at);\n }\n return true;\n }",
"public void raiseFoodFlag(){\n\t\tif(foodFlag != true && amountWorms > 0){\n\t\t\tfoodFlag = true;\n\t\t\tsw.getInstance(this);\n\t\t\tamountWorms--;\n\t\t\tAquaFrame.initWormStatus(amountWorms);\n\t\t}\n\t\telse{\n\t\t\tint num = 0;\n\t\t\tif(amountWorms == 0){\n\t\t\t\tupdate();\n\t\t\t}\n\t\t}\n\t}",
"private Egg(String name, int turnsToHatch, int hatchEarnings, Dinosaur babyDinosaur) {\n super(name, 'O', true);\n this.turnsToHatch = turnsToHatch;\n this.hatchEarnings = hatchEarnings;\n this.babyDinosaur = babyDinosaur;\n this.age = 0;\n }",
"public static boolean calcBlowSuccess(L2Character activeChar, L2Character target, L2Skill skill)\n\t{\n\t\tint blowChance = skill.getBlowChance();\n\n\t\t// Skill is blow and it has 0% to make dmg... thats just wrong\n\t\tif (blowChance == 0)\n\t\t{\n\t\t\tLog.log(Level.WARNING, \"Skill \" + skill.getId() + \" - \" + skill.getName() +\n\t\t\t\t\t\" has 0 blow land chance, yet its a blow skill!\");\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!isBehind(target, activeChar))\n\t\t{\n\t\t\tif (skill.getId() == 10508 || skill.getId() == 30)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tif (isBehind(target, activeChar))\n\t\t{\n\t\t\tif ((skill.getCondition() & L2Skill.COND_FRONT) != 0)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tblowChance *= 2; //double chance from behind\n\t\t}\n\t\telse if (isInFrontOf(target, activeChar))\n\t\t{\n\t\t\tif ((skill.getCondition() & L2Skill.COND_BEHIND) != 0)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t//base chance from front\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ((skill.getCondition() & L2Skill.COND_BEHIND) != 0 || (skill.getCondition() & L2Skill.COND_FRONT) != 0)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tblowChance *= 1.5; //50% better chance from side\n\t\t}\n\n\t\tdouble blowRate =\n\t\t\t\tactiveChar.calcStat(Stats.BLOW_RATE, blowChance * (1.0 + activeChar.getDEX() / 100.0), target, null);\n\t\treturn blowRate > Rnd.get(100);\n\t}",
"@Override\n\tpublic void eggHatches() {\n\t\t\n\t}",
"private void collision(){\n\t\tboolean touched = false;\n\t\tboolean hit;\n\t\tint j =0;\n\t\twhile ( j< this.game_.getSaveBaby().size() && !touched){\n\t\t\tBabyBunnies b = this.game_.getSaveBaby().get(j);\n\t\t\ttouched = this.game_.getBunnyHood().getPosition().dst(b.getPosition())<=80;\n\t\t\thit = this.game_.getWolf().getPosition().dst(b.getPosition())<=80;\n\t\t\tif (touched){\n\t\t\t\tthis.game_.setBabySaved(b);\n\t\t\t}\n\t\t\tif (hit){\n\t\t\t\tthis.game_.wolfCatchBunnies(b);\n\t\t\t\t/**\n\t\t\t\t * Test de callback, retour vers l app android\n\t\t\t\t */\n\t\t\t\tif(this.game_.getScoreWolf()==3){\n\t\t\t\t\tif (this.gameCallBack != null) {\n\n this.gameCallBack.gameOverActivity(this.game_.getScoreBunny());\n\t\t\t\t\t\tthis.isGameOver=true;\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tGdx.app.log(\"MyGame\", \"To use this class you must implement MyGameCallback!\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tj++;\n\t\t}\n\t}",
"boolean hasDamage();",
"boolean hasDamage();",
"boolean hasDamage();",
"boolean hasDamage();",
"boolean hasDamage();",
"public boolean isByeMatch()\r\n\t{\r\n\t\treturn isByeMatch;\r\n\t}",
"public boolean shouldExecute() {\n if (this.runDelay <= 0) {\n if (!net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(bean.world, bean)) {\n return false;\n }\n\n this.currentTask = -1;\n if(plantAndCollect)\n this.hasFarmItem = ((EntityWorkBean)bean).isFarmItemInInventory();\n else this.hasFarmItem = false;\n this.wantsToReapStuff = true; //this.villager.wantsMoreFood();\n }\n\n return super.shouldExecute();\n }",
"public boolean didWin(){\n\t\tswitch(winCondition){\n\t\tcase \"catchEmAll\":\n\t\t\treturn caughtEmAll();\n\t\tdefault:\n\t\t\treturn caughtTwenty();\n\t\t}\n\t}",
"boolean monkeyBusiness(Monkey[] monkeys) {\n boolean allSmiles;\n int smiles = 0;\n for(Monkey monkey: monkeys) {\n if(monkey.smile) {\n smiles++;\n }\n }\n allSmiles = smiles >= (double) monkeys.length / 2;\n return allSmiles;\n }",
"@Override\n\tprotected String getHurtSound() {\n\t\treturn \"mob.creeper.say\";\n\t}",
"public static boolean getMobGriefing(World world) {\n return world.getGameRules().getGameRuleBooleanValue(\"mobGriefing\");\n }",
"@SuppressWarnings(\"deprecation\")\n\tpublic void gameTick() {\n\t\tBukkit.getScheduler().runTask(Plugin_MineTime.Plugin, new Runnable() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t\tfor (Block b: beacons) {\n\t\t\t\t\tw.playEffect(b.getLocation(), Effect.ENDER_SIGNAL, 0);\n\t\t\t\t}\n\t\t\t\tfor (Block b: gold_blocks) {\n\t\t\t\t\tw.playEffect(b.getLocation().add(0, 2, 0), Effect.FLYING_GLYPH, 100);\n\t\t\t\t\tw.playEffect(b.getLocation().add(0, 2, 0), Effect.FLYING_GLYPH, 100);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tsynchronized (timers) {\n\t\t\t\t\tfor (final byte data: timers.keySet()) {\n\t\t\t\t\t\tif (timers.get(data) > 0) {\n\t\t\t\t\t\t\ttimers.put(data, timers.get(data)-1);\n\t\t\t\t\t\t\tif (!extended.get(data)) {\n\t\t\t\t\t\t\t\textended.put(data, true);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tBukkit.getScheduler().runTaskAsynchronously(Plugin_MineTime.Plugin, new Runnable() {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\t\tDirection d = getDirection(glass_blocks.get(data));\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tboolean wand = false;\n\t\t\t\t\t\t\t\t\t\tLocation l = glass_blocks.get(data).getLocation().add(d.getVector());\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\twhile (!wand) {\n\t\t\t\t\t\t\t\t\t\t\tfinal Block change = w.getBlockAt(l);\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tBukkit.getScheduler().runTask(Plugin_MineTime.Plugin, new Runnable() {\n\t\t\t\t\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\t\t\t\t\tchange.setType(Material.STAINED_GLASS);\n\t\t\t\t\t\t\t\t\t\t\t\t\tchange.setData(data);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tl = l.add(d.getVector());\n\t\t\t\t\t\t\t\t\t\t\tif (!(w.getBlockAt(l).getType() == Material.AIR || w.getBlockAt(l).getType() == Material.STAINED_GLASS)) {\n\t\t\t\t\t\t\t\t\t\t\t\twand = true;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\tThread.sleep(50);\n\t\t\t\t\t\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else {\t\t\n\t\t\t\t\t\t\tif (extended.get(data)) {\n\t\t\t\t\t\t\t\textended.put(data, false);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tBukkit.getScheduler().runTaskAsynchronously(Plugin_MineTime.Plugin, new Runnable() {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\t\tDirection d = getDirection(glass_blocks.get(data));\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tboolean wand = false;\n\t\t\t\t\t\t\t\t\t\tLocation l = glass_blocks.get(data).getLocation().add(d.getVector());\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\twhile (!wand) {\n\t\t\t\t\t\t\t\t\t\t\tfinal Block change = w.getBlockAt(l);\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tBukkit.getScheduler().runTask(Plugin_MineTime.Plugin, new Runnable() {\n\t\t\t\t\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\t\t\t\t\tchange.setType(Material.AIR);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tl = l.add(d.getVector());\n\t\t\t\t\t\t\t\t\t\t\tif (!(w.getBlockAt(l).getType() == Material.AIR || w.getBlockAt(l).getType() == Material.STAINED_GLASS)) {\n\t\t\t\t\t\t\t\t\t\t\t\twand = true;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\tThread.sleep(100);\n\t\t\t\t\t\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}",
"public boolean throwPokeball(AbstractPokemon wildPokemon)\n {\n System.out.println(toString() + \" threw a \" + pokeball.toString() + \"!\");\n int ballFactor = pokeball.getFactor();\n if(pokeball instanceof Masterball)\n return true;\n int d = wildPokemon.getCatchRate() / ballFactor;\n if (d >= 256)\n return false;\n else\n {\n int pokemonsHP = wildPokemon.getHealth();\n if (pokemonsHP == 0)\n pokemonsHP = 4;\n int factor1 = (wildPokemon.getMaxHealth() * 255) / ballFactor;\n int factor2 = wildPokemon.getHealth() / 4;\n if (factor2 == 0)\n factor2 = 1;\n int factorTotal = factor1 / factor2;\n if (factorTotal > 255)\n factorTotal = 255;\n int probabilityOfCapture = (d * factorTotal) / 255;\n if (probabilityOfCapture > 70)\n return true;\n else\n return false;\n }\n }",
"Faucet startWashingHands(String person);",
"private boolean shouldBecomeCombatEngineer() {\r\n\t\tdouble machineUnitsCount = this.getNumberOfMachineUnits();\r\n\t\tdouble combatEngineers = this.informationStorage.getWorkerConfig().getTotalCombatEngineerCount();\r\n\r\n\t\treturn combatEngineers / machineUnitsCount <= this.combatEngineerTriggerPercentageEnroll;\r\n\t}",
"public boolean servesLunch() {\n return convertBool(mLunch);\n }",
"@SuppressWarnings(\"static-method\")\n private boolean isFightWon(final LogBlock block)\n {\n for (final String line : block.getBlockLines())\n {\n if (line.endsWith(WINS_THE_FIGHT))\n {\n return true;\n }\n }\n return false;\n }",
"@Override\r\n\tpublic void collisionReaction(GameObject collidedWith)\r\n\t{\r\n\t\tif (\"Enemy\".equals(collidedWith.getName()))\r\n\t\t{\r\n\t\t\trandom = PFRandom.randomRange(0,2);\r\n\t\t\tshakeActivated = true;\r\n\t\t\tcollidedWith.kill();\r\n\t\t\tShipHealth -= PFRandom.randomRange(30,40);\r\n\t\t\tSystem.out.println(\"Health: \" + ShipHealth);\r\n\t\t\tSoundManager.playBackgroundSound(\"Explode\");\r\n\t\t}\r\n\r\n\t\tif (\"StarBurst\".equals(collidedWith.getName()))\r\n\t\t{\r\n\t\t\trandom = PFRandom.randomRange(0,2);\r\n\t\t\tshakeActivated = true;\r\n\t\t\tcollidedWith.kill();\r\n\t\t\tShipHealth -= PFRandom.randomRange(20,40);\r\n\t\t\tSystem.out.println(\"Health: \" + ShipHealth);\r\n\t\t\tSoundManager.playBackgroundSound(\"Explode\");\r\n\t\t}\r\n\t\tif (\"GeneralEnemyBullet\".equals(collidedWith.getName()))\r\n\t\t{\r\n\t\t\trandom = PFRandom.randomRange(0,2);\r\n\t\t\tshakeActivated = true;\r\n\t\t\tcollidedWith.kill();\r\n\t\t\tShipHealth -= PFRandom.randomRange(10,20);\r\n\t\t\tSystem.out.println(\"Health: \" + ShipHealth);\r\n\t\t\tSoundManager.playBackgroundSound(\"Explode\");\r\n\t\t}\r\n\t\tif (\"AimedShot\".equals(collidedWith.getName()))\r\n\t\t{\r\n\t\t\trandom = PFRandom.randomRange(0,2);\r\n\t\t\tshakeActivated = true;\r\n\t\t\tcollidedWith.kill();\r\n\t\t\tShipHealth -= PFRandom.randomRange(1,5);\r\n\t\t\tSystem.out.println(\"Health: \" + ShipHealth);\r\n\t\t\tSoundManager.playBackgroundSound(\"Explode\");\r\n\t\t}\r\n\r\n\r\n\t\tif (\"Asteroid\".equals(collidedWith.getName()))\r\n\t\t{\r\n\t\t\trandom = PFRandom.randomRange(0,2);\r\n\t\t\tshakeActivated = true;\r\n\t\t\tcollidedWith.kill();\r\n\t\t\tShipHealth -= PFRandom.randomRange(20, 45);\r\n\t\t\tSystem.out.println(\"Health: \" + ShipHealth);\r\n\r\n\t\t\t//DESTROYED ASTEROID CODE! NEEDS TO BE REUSED WITH SHOOTING!\r\n\t\t\tVec2 deathSpot = collidedWith.getPosition();\r\n\r\n\r\n\t\t\tint healthdropNum = 0;\r\n\t\t\twhile(healthdropNum <= 4)\r\n\t\t\t{\r\n\t\t\t\thealthdropNum++;\r\n\t\t\t\tGameObject healthDrop = new HealthDrops();\r\n\t\t\t\thealthDrop.setPosition(deathSpot.getX() + getRandomValue(-5, 5), deathSpot.getY() + getRandomValue(-5, 5));\r\n\t\t\t\tObjectManager.addGameObject(healthDrop);\r\n\r\n\t\t\t}\r\n\t\t\tSoundManager.playBackgroundSound(\"Explode\");\r\n\r\n\t\t\tif (ShipHealth <= 30)\r\n\t\t\t{\r\n\t\t\t\tSoundManager.playBackgroundSound(\"LowHealth\");\r\n\t\t\t}\r\n\r\n\r\n\t\t}\r\n\r\n\t\tif (\"HealthDrop\".equals(collidedWith.getName()))\r\n\t\t{\r\n\t\t\tscore = score + 1;\r\n\t\t\tSystem.out.println(\"Score: \"+ score);\r\n\t\t\tif (ShipHealth < 100)\r\n\t\t\t{\r\n\r\n\t\t\t\tShipHealth += 1;\r\n\t\t\t\tSystem.out.println(\"Health: \" + ShipHealth);\r\n\r\n\t\t\t\tif (ShipHealth > 30)\r\n\t\t\t\t{\r\n\t\t\t\t\tSoundManager.stopBackgroundSound(\"LowHealth\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcollidedWith.kill();\r\n\t\t}\r\n\t\tif (\"EnemyHealthDrop\".equals(collidedWith.getName()))\r\n\t\t{\r\n\t\t\tscore = score + 2;\r\n\t\t\tSystem.out.println(\"Score: \"+ score);\r\n\t\t\tif (ShipHealth < 100)\r\n\t\t\t{\r\n\r\n\t\t\t\tShipHealth += 2;\r\n\t\t\t\tSystem.out.println(\"Health: \" + ShipHealth);\r\n\t\t\t\tif (ShipHealth > 30)\r\n\t\t\t\t{\r\n\t\t\t\t\tSoundManager.stopBackgroundSound(\"LowHealth\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcollidedWith.kill();\r\n\t\t}\r\n\t\tif (\"HealthPickup\".equals(collidedWith.getName()))\r\n\t\t{\r\n\r\n\t\t\t//System.out.println(\"Score: \" + score);\r\n\t\t\tcollidedWith.kill();\r\n\t\t\tShipHealth = 100;\r\n\t\t\tSystem.out.println(\"HEALTH RESTORED\");\r\n\t\t\tSoundManager.stopBackgroundSound(\"LowHealth\");\r\n\r\n\t\t}\r\n\t\tif (\"FollowBullet\".equals(collidedWith.getName()))\r\n\t\t{\r\n\t\t\trandom = PFRandom.randomRange(0,2);\r\n\t\t\tshakeActivated = true;\r\n\t\t\tcollidedWith.kill();\r\n\t\t\tShipHealth -= PFRandom.randomRange(10, 30);\r\n\t\t\tSystem.out.println(\"Health: \" + ShipHealth);\r\n\t\t\tSoundManager.playBackgroundSound(\"Explode\");\r\n\t\t\tif (ShipHealth <= 30)\r\n\t\t\t{\r\n\t\t\t\tSoundManager.playBackgroundSound(\"LowHealth\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (\"BossFollower\".equals(collidedWith.getName()))\r\n\t\t{\r\n\t\t\tsetPositionY(165.7f);\r\n\t\t}\r\n\t}",
"public void customizeMob(LivingEntity mob, LeveledMonster leveledMonster, CreatureSpawnEvent.SpawnReason spawnReason){\n mob.getPersistentDataContainer().set(monsterIdKey, PersistentDataType.STRING, leveledMonster.getName());\n assert mob.getEquipment() != null;\n mob.getEquipment().setHelmet(leveledMonster.getHelmet());\n mob.getEquipment().setChestplate(leveledMonster.getChestPlate());\n mob.getEquipment().setLeggings(leveledMonster.getLeggings());\n mob.getEquipment().setBoots(leveledMonster.getBoots());\n mob.getEquipment().setItemInMainHand(leveledMonster.getMainHand());\n mob.getEquipment().setItemInOffHand(leveledMonster.getOffHand());\n\n mob.getEquipment().setHelmetDropChance((float) leveledMonster.getHelmetDropChance());\n mob.getEquipment().setChestplateDropChance((float) leveledMonster.getChestplateDropChance());\n mob.getEquipment().setLeggingsDropChance((float) leveledMonster.getLeggingsDropChance());\n mob.getEquipment().setBootsDropChance((float) leveledMonster.getBootsDropChance());\n mob.getEquipment().setItemInMainHandDropChance((float) leveledMonster.getMainHandDropChance());\n mob.getEquipment().setItemInOffHandDropChance((float) leveledMonster.getOffHandDropChance());\n\n if (leveledMonster.getMainHand() != null){\n mob.setCanPickupItems(false);\n }\n\n AttributeInstance attribute = mob.getAttribute(Attribute.GENERIC_MAX_HEALTH);\n assert attribute != null;\n if (mob instanceof Slime){\n Slime slime = (Slime) mob;\n attribute.setBaseValue(leveledMonster.getBaseHealth() / (16/Math.pow(slime.getSize(), 2)));\n mob.setHealth(leveledMonster.getBaseHealth() / (16/Math.pow(slime.getSize(), 2)));\n } else {\n attribute.setBaseValue(leveledMonster.getBaseHealth());\n mob.setHealth(leveledMonster.getBaseHealth());\n }\n if (leveledMonster.getDisplayName() != null){\n if (!leveledMonster.getDisplayName().equals(\"null\")){\n mob.setCustomName(leveledMonster.getDisplayName());\n mob.setCustomNameVisible(leveledMonster.isDisplayNameVisible());\n }\n }\n if (leveledMonster.isBoss()){\n String title = leveledMonster.getDisplayName();\n if (leveledMonster.getDisplayName() == null){\n title = Utils.chat(\"&c&lBoss\");\n } else if (leveledMonster.getDisplayName().equals(\"null\")){\n title = Utils.chat(\"&c&lBoss\");\n }\n Utils.createBossBar(Main.getInstance(), mob, title, BarColor.RED, BarStyle.SOLID, Main.getInstance().getConfig().getInt(\"boss_bar_view_distance\"));\n }\n\n for (String key : leveledMonster.getAbilities()){\n Ability instantAbility = AbilityManager.getInstance().getInstantAbilities().get(key);\n if (instantAbility != null){\n instantAbility.execute(mob, null, new CreatureSpawnEvent(mob, spawnReason));\n }\n Ability runningAbility = AbilityManager.getInstance().getRunningAbilities().get(key);\n if (runningAbility != null){\n runningAbility.execute(mob, null, new CreatureSpawnEvent(mob, spawnReason));\n }\n }\n }",
"boolean hasHealMyChunk();",
"private void beat() {\n\t\t\tSystem.out.println(\"Heart beating\");\n\t\t}",
"public static boolean addColdWound(@Nullable Creature performer, @Nonnull Creature defender, int pos, double damage, float armourMod, float infection, float poison, boolean noMinimumDamage, boolean spell) {\n/* 2032 */ if (performer != null && performer.getTemplate().getCreatureAI() != null)\n/* */ {\n/* 2034 */ damage = performer.getTemplate().getCreatureAI().causedWound(performer, defender, (byte)8, pos, armourMod, damage);\n/* */ }\n/* */ \n/* 2037 */ if (defender.getTemplate().getCreatureAI() != null)\n/* */ {\n/* 2039 */ damage = defender.getTemplate().getCreatureAI().receivedWound(defender, performer, (byte)8, pos, armourMod, damage);\n/* */ }\n/* */ \n/* 2042 */ if (defender.getCultist() != null && defender.getCultist().hasNoElementalDamage())\n/* 2043 */ return false; \n/* 2044 */ boolean dead = false;\n/* 2045 */ if (damage * armourMod > 500.0D || noMinimumDamage) {\n/* */ DbWound dbWound;\n/* 2047 */ if (defender.hasSpellEffect((byte)68)) {\n/* */ \n/* 2049 */ defender.reduceStoneSkin();\n/* 2050 */ return false;\n/* */ } \n/* 2052 */ Wound wound = null;\n/* 2053 */ boolean foundWound = false;\n/* 2054 */ if (performer != null) {\n/* */ \n/* 2056 */ ArrayList<MulticolorLineSegment> segments = new ArrayList<>();\n/* 2057 */ segments.add(new MulticolorLineSegment(\"Your weapon\", (byte)3));\n/* 2058 */ segments.add(new MulticolorLineSegment(\" freezes \", (byte)3));\n/* 2059 */ segments.add(new CreatureLineSegment(defender));\n/* 2060 */ segments.add(new MulticolorLineSegment(\".\", (byte)3));\n/* */ \n/* 2062 */ performer.getCommunicator().sendColoredMessageCombat(segments);\n/* */ \n/* 2064 */ segments.set(0, new CreatureLineSegment(performer));\n/* 2065 */ for (MulticolorLineSegment s : segments) {\n/* 2066 */ s.setColor((byte)7);\n/* */ }\n/* 2068 */ defender.getCommunicator().sendColoredMessageCombat(segments);\n/* */ } \n/* */ \n/* */ \n/* */ \n/* */ \n/* 2074 */ if (defender.getBody().getWounds() != null) {\n/* */ \n/* 2076 */ wound = defender.getBody().getWounds().getWoundTypeAtLocation((byte)pos, (byte)8);\n/* 2077 */ if (wound != null)\n/* */ {\n/* 2079 */ if (wound.getType() == 8) {\n/* */ \n/* 2081 */ defender.setWounded();\n/* 2082 */ wound.setBandaged(false);\n/* 2083 */ dead = wound.modifySeverity((int)(damage * armourMod), (performer != null && performer.isPlayer()), spell);\n/* 2084 */ foundWound = true;\n/* */ } else {\n/* */ \n/* 2087 */ wound = null;\n/* */ } } \n/* */ } \n/* 2090 */ if (wound == null)\n/* */ {\n/* 2092 */ if (WurmId.getType(defender.getWurmId()) == 1) {\n/* 2093 */ TempWound tempWound = new TempWound((byte)8, (byte)pos, (float)damage * armourMod, defender.getWurmId(), poison, infection, spell);\n/* */ } else {\n/* */ \n/* 2096 */ dbWound = new DbWound((byte)8, (byte)pos, (float)damage * armourMod, defender.getWurmId(), poison, infection, (performer != null && performer.isPlayer()), spell);\n/* */ } \n/* */ }\n/* 2099 */ if (!foundWound)\n/* 2100 */ dead = defender.getBody().addWound((Wound)dbWound); \n/* */ } \n/* 2102 */ return dead;\n/* */ }",
"public void onSkillUse(L2Player player, int skill_id)\n\t{\n\t\tint npcId = getNpcId();\n\t\t// check if the npc and skills used are valid\n\t\tif(!feedableBeasts.contains(npcId))\n\t\t\treturn;\n\t\tif(skill_id != SKILL_GOLDEN_SPICE && skill_id != SKILL_CRYSTAL_SPICE)\n\t\t\treturn;\n\n\t\tint food = GOLDEN_SPICE;\n\t\tif(skill_id == SKILL_CRYSTAL_SPICE)\n\t\t\tfood = CRYSTAL_SPICE;\n\n\t\tint objectId = getObjectId();\n\t\t// display the social action of the beast eating the food.\n\t\tbroadcastPacket(new SocialAction(objectId, 2));\n\n\t\t// if this pet can't grow, it's all done.\n\t\tif(growthCapableMobs.containsKey(npcId))\n\t\t{\n\t\t\t// do nothing if this mob doesn't eat the specified food (food gets consumed but has no effect).\n\t\t\tif(growthCapableMobs.get(npcId).spice[food].length == 0)\n\t\t\t\treturn;\n\n\t\t\t// more value gathering on local variables\n\t\t\tint growthLevel = growthCapableMobs.get(npcId).growth_level;\n\n\t\t\tif(growthLevel > 0)\n\t\t\t\t// check if this is the same player as the one who raised it from growth 0.\n\t\t\t\t// if no, then do not allow a chance to raise the pet (food gets consumed but has no effect).\n\t\t\t\tif(feedInfo.get(objectId) != null && feedInfo.get(objectId) != player.getObjectId())\n\t\t\t\t\treturn;\n\n\t\t\t// Polymorph the mob, with a certain chance, given its current growth level\n\t\t\tif(Rnd.chance(growthCapableMobs.get(npcId).growth_chance))\n\t\t\t\tspawnNext(player, growthLevel, food);\n\t\t}\n\t\telse if(tamedBeasts.contains(npcId))\n\t\t\tif(skill_id == ((L2TamedBeastInstance) this).getFoodType())\n\t\t\t{\n\t\t\t\t((L2TamedBeastInstance) this).onReceiveFood();\n\t\t\t\tFunctions.npcSayCustomMessage(this, mytext[Rnd.get(mytext.length)]);\n\t\t\t}\n\t}",
"public void setEasterEgg(boolean easterEgg){\n\t\tthis.easterEgg = easterEgg;\n\t}",
"public boolean getGotLucky()\n {\n return (die1.getFacevalue() == 6 && die2.getFacevalue() == 6 && lastThrow[0] == 6 && lastThrow[1] == 6);\n }",
"public boolean tick(){\n\t\tif(System.currentTimeMillis() - time > TICK_TIME){\n\t\t\tif(this.getSprite().equals(\"bomb1.gif\")){\n\t\t\t\tthis.setSprite(\"bomb2.gif\");\n\t\t\t}else{\n\t\t\t\tthis.setSprite(\"bomb1.gif\");\n\t\t\t}\n\t\t\ttime = System.currentTimeMillis();\n\t\t\tif(--maxTicks <= 0){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn exploded;\n\t}",
"@Override\n\tpublic boolean isHungry() {\n\t\treturn false;\n\t}",
"public void sleep() {\n hunger += 1;\n fatigue = 0;\n\n if (isHungry()) {\n mood -= 1;\n } else {\n mood += 1;\n }\n\n if (!muted) {\n System.out.println(\"sleep\\t|\\tzzzZZZ *sheep*\");\n }\n }",
"public Boolean checkBust() {\n\t\tif (getHandValue() > 21) {\n\t\t\tSystem.out.println(name + \" Busted!\");\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"void fire(WarParticipant target, WarParticipant attacker, int noOfShooters);",
"public void goAdventuring() {\n\n game.createRandomMonster(4);\n if(RandomClass.getRandomTenPercent() == 5) {\n System.out.println(\"Your are walking down the road... Everything looks peaceful and calm.. Hit enter to continue!\");\n sc.nextLine();\n\n } else {\n game.battle();\n p.checkXp();\n }\n }",
"@EventHandler\n\tpublic void attackMobs(EntityDamageByEntityEvent e) {\n\t\tMessages messagesConfig = plugin.getMsgs();\n\n\t\tif (e.getCause().equals(EntityDamageEvent.DamageCause.PROJECTILE)) { //Just my magic code w(o.o)w\n\t\t\treturn;\n\t\t}else if (e.getDamager() instanceof Player) {\n\t\t\tPlayer p = (Player) e.getDamager();\n\t\t\tItemStack pInv = p.getInventory().getItemInMainHand();\n\n\t\t\tif (!pInv.getType().name().contains(\"SWORD\") && !pInv.getType().name().contains(\"AXE\")) {\n\t\t\t\tif (!(e.getEntity() instanceof Chicken)) {\n\t\t\t\t\te.setCancelled(true);\n\n\t\t\t\t\tif (canSendMessage(p.getUniqueId()))\n\t\t\t\t\t\tp.sendMessage(StringUtil.inColor(messagesConfig.getCantHitWithoutSword()));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public void caughtCheating(){\n\t\tinGoodStanding = false;\n\t}",
"public void checkBombs(final Integer tile){\n if(bombs_location.contains(tile)){\n if(invulnerable){\n showTimedAlertDialog(\"PHEW!\", \"Your GODMODE saved your life\", 5);\n invulnerable = false;\n return;\n }\n invulnerable = false;\n Lejos.makeSound_Boom();\n hp = hp-1;\n DrawHP();\n bombs_location.remove(tile);\n final Handler handler = new Handler();\n handler.postDelayed(new Runnable() {\n @Override\n public void run() {\n MultiplayerManager.getInstance().SendMessage(\"bomb_remove \" + revertTile(tile).toString());\n }\n }, 1000);\n if(hp==0){\n onLose();\n }\n showTimedAlertDialog(\"PWNED!\", \"You just stepped on a mine\", 3);\n }\n }",
"public static void bullyAttack(){\n int punch = player.getHealth() - bullyHitPoints ;\n player.setHealth(punch);\n //Step 2: Conditional dialogue\n if(bullyHitPoints > 50) {\n System.out.println(textparser.getMassiveDamage() + bullyHitPoints + textparser.getToYou());\n }else if(bullyHitPoints > 25){\n System.out.println(textparser.getPunch() + bullyHitPoints + textparser.getToYou());\n }else{\n System.out.println(textparser.getDidntHurtMuch() + bullyHitPoints + textparser.getToYou());\n }\n }",
"public void bake() {\n\t\twhile(true) {\n\t\t\tSystem.out.print(\"attempting to bake 1 souffle...\");\n\t\t\tif(Math.random() < 0.5) {\n\t\t\t\tSystem.out.println(\"success!\");\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"but it didn't rise\");\n\t\t\t\tprepare();\n\t\t\t}\n\t\t}\n\t}",
"public boolean hitBy(Pweapon weapon, Tower tower) {\r\n\t\tif (!spawned)\r\n\t\t\treturn false;\r\n\r\n\t\t// System.out.println(\"Tir avec arme : \" + weapon.getNameWeapon());\r\n\t\tif (!tower.isControledByPlayer()) {\r\n\t\t\t// if (decideShootMiss(tower)) {\r\n\t\t\tthis.health -= weapon.getDamage();\r\n\t\t\t// }\r\n\t\t} else {\r\n\t\t\tthis.health -= weapon.getDamage();\r\n\t\t}\r\n\t\tif (this.health <= 0) {\r\n\t\t\tthis.health = 0;\r\n\t\t\tthis.spawned = false;\r\n\t\t}\r\n\t\treturn this.health == 0;\r\n\t}",
"public void eatHay(Hay hay) {\n raiseFoodLevel(20);\n }",
"public void hungry()\r\n {\r\n \tSystem.out.println(\"I'm hungry!! Feed me!!\");\r\n \tbarking();\r\n }",
"protected String t() {\n return this.isAngry() ? \"mob.wolf.growl\" : (this.random.nextInt(3) == 0 ? (this.isTamed() && this.datawatcher.getFloat(18) < (this.getMaxHealth() / 2) ? \"mob.wolf.whine\" : \"mob.wolf.panting\") : \"mob.wolf.bark\");\n }",
"@Override\r\n\tpublic void onLivingUpdate() {\r\n\t\tsuper.onLivingUpdate();\r\n\t\tthis.field_70888_h = this.field_70886_e;\r\n\t\tthis.field_70884_g = this.destPos;\r\n\t\tthis.destPos = (float)((double)this.destPos + (double)(this.onGround ? -1 : 4) * 0.3D);\r\n\t\t\r\n\t\tif(this.destPos < 0.0F) {\r\n\t\t\tthis.destPos = 0.0F;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.destPos > 1.0F) {\r\n\t\t\tthis.destPos = 1.0F;\r\n\t\t}\r\n\t\t\r\n\t\tif(!this.onGround && this.field_70889_i < 1.0F) {\r\n\t\t\tthis.field_70889_i = 1.0F;\r\n\t\t}\r\n\t\t\r\n\t\tthis.field_70889_i = (float)((double)this.field_70889_i * 0.9D);\r\n\t\t\r\n\t\tif(!this.onGround && this.motionY < 0.0D) {\r\n\t\t\tthis.motionY *= 0.6D;\r\n\t\t}\r\n\t\t\r\n\t\tthis.field_70886_e += this.field_70889_i * 2.0F;\r\n\t\t\r\n\t\tif(!this.isChild() && !this.worldObj.isRemote && --this.timeUntilNextEgg <= 0) {\r\n\t\t\tthis.worldObj.playSoundAtEntity(this, \"mob.chickenplop\", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);\r\n\t\t\tthis.dropItem(SorceryItems.goldegg, 1);\r\n\t\t\tthis.timeUntilNextEgg = this.rand.nextInt(6000) + 6000;\r\n\t\t}\r\n\t}",
"public boolean processInteract(EntityPlayer entityplayer, EnumHand hand, @Nullable ItemStack stack)\n {\n ItemStack itemstack = entityplayer.inventory.getCurrentItem();\n\n if (!bumgave && angerLevel == 0)\n {\n if (itemstack != null && (itemstack.getItem() == Items.DIAMOND || itemstack.getItem() == Items.GOLD_INGOT || itemstack.getItem() == Items.IRON_INGOT))\n {\n if (itemstack.getItem() == Items.IRON_INGOT)\n {\n value = rand.nextInt(2) + 1;\n }\n else if (itemstack.getItem() == Items.GOLD_INGOT)\n {\n value = rand.nextInt(5) + 1;\n }\n else if (itemstack.getItem() == Items.DIAMOND)\n {\n value = rand.nextInt(10) + 1;\n }\n\n if (itemstack.stackSize - 1 == 0)\n {\n entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, null);\n }\n else\n {\n itemstack.stackSize--;\n }\n\n for (int i = 0; i < 4; i++)\n {\n for (int i1 = 0; i1 < 10; i1++)\n {\n double d1 = rand.nextGaussian() * 0.02D;\n double d3 = rand.nextGaussian() * 0.02D;\n double d6 = rand.nextGaussian() * 0.02D;\n worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_NORMAL, (posX + (double)(rand.nextFloat() * width * 2.0F)) - (double)width, posY + (double)(rand.nextFloat() * height) + (double)i, (posZ + (double)(rand.nextFloat() * width * 2.0F)) - (double)width, d1, d3, d6);\n }\n }\n\n texture = new ResourceLocation(Reference.MODID, Reference.TEXTURE_PATH_ENTITES +\n \t\tReference.TEXTURE_BUM_DRESSED);\n angerLevel = 0;\n //findPlayerToAttack();\n\n if (rand.nextInt(5) == 0)\n {\n // worldObj.playSoundAtEntity(this, \"morecreeps:bumsucker\", 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n worldObj.playSound((EntityPlayer) null, getPosition(), MCSoundEvents.ENTITY_BUM_SUCKER, SoundCategory.NEUTRAL, 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n bumgave = true;\n }\n else\n {\n // worldObj.playSoundAtEntity(this, \"morecreeps:bumthankyou\", 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n worldObj.playSound((EntityPlayer) null, getPosition(), MCSoundEvents.ENTITY_BUM_THANKYOU, SoundCategory.NEUTRAL, 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n bumgave = true;\n\n for (int j = 0; j < 10; j++)\n {\n double d = rand.nextGaussian() * 0.02D;\n double d2 = rand.nextGaussian() * 0.02D;\n double d5 = rand.nextGaussian() * 0.02D;\n worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_NORMAL, (posX + (double)(rand.nextFloat() * width * 2.0F)) - (double)width, posY + (double)(rand.nextFloat() * height), (posZ + (double)(rand.nextFloat() * width * 2.0F)) - (double)width, d, d2, d5);\n }\n\n for (int k = 0; k < value; k++)\n {\n \tif(!worldObj.isRemote) {\n\t dropItem(Item.getItemById(rand.nextInt(95)), 1);\n\t dropItem(Items.IRON_SHOVEL, 1);\n \t}\n }\n\n return true;\n }\n }\n else if (itemstack != null)\n {\n if (timetopee > 0)\n {\n // worldObj.playSoundAtEntity(this, \"morecreeps:bumdontwant\", 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n worldObj.playSound((EntityPlayer) null, getPosition(), MCSoundEvents.ENTITY_BUM_DONTWANT, SoundCategory.NEUTRAL, 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n \n }\n else if (itemstack != null && (itemstack.getItem() == Item.getItemFromBlock(Blocks.YELLOW_FLOWER) || itemstack.getItem() == Item.getItemFromBlock(Blocks.RED_FLOWER)))\n {\n \t/* TODO\n \tif(!((EntityPlayerMP)entityplayer).getStatFile().hasAchievementUnlocked(MoreCreepsAndWeirdos.achievebumflower))\n \t{\n \tworldObj.playSoundAtEntity(entityplayer, \"morecreeps:achievement\", 1.0F, 1.0F);\n \tentityplayer.addStat(MoreCreepsAndWeirdos.achievebumflower, 1);\n \tconfetti(entityplayer);\n \t} */\n\n // worldObj.playSoundAtEntity(this, \"morecreeps:bumthanks\", 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n worldObj.playSound((EntityPlayer) null, getPosition(), MCSoundEvents.ENTITY_BUM_THANKS, SoundCategory.NEUTRAL, 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n timetopee = rand.nextInt(1900) + 1500;\n\n if (itemstack.stackSize - 1 == 0)\n {\n entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, null);\n }\n else\n {\n itemstack.stackSize--;\n }\n }\n else if (itemstack != null && itemstack.getItem() == Items.BUCKET)\n {\n \t/* TODO\n if (!((EntityPlayerMP)entityplayer).getStatFile().hasAchievementUnlocked(MoreCreepsAndWeirdos.achievebumpot) && ((EntityPlayerMP)entityplayer).getStatFile().hasAchievementUnlocked(MoreCreepsAndWeirdos.achievebumflower))\n {\n worldObj.playSoundAtEntity(entityplayer, \"morecreeps:achievement\", 1.0F, 1.0F);\n entityplayer.addStat(MoreCreepsAndWeirdos.achievebumpot, 1);\n confetti(entityplayer);\n } \n entityplayer.addStat(MoreCreepsAndWeirdos.achievebumpot, 1);\n */\n // worldObj.playSoundAtEntity(this, \"morecreeps:bumthanks\", 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n worldObj.playSound((EntityPlayer) null, getPosition(), MCSoundEvents.ENTITY_BUM_THANKS, SoundCategory.NEUTRAL, 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n timetopee = rand.nextInt(1900) + 1500;\n\n if (itemstack.stackSize - 1 == 0)\n {\n entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, null);\n }\n else\n {\n itemstack.stackSize--;\n }\n }\n else if (itemstack != null && itemstack.getItem() == Items.LAVA_BUCKET)\n {\n \t/* \n if (!((EntityPlayerMP)entityplayer).getStatFile().hasAchievementUnlocked(MoreCreepsAndWeirdos.achievebumlava) && ((EntityPlayerMP)entityplayer).getStatFile().hasAchievementUnlocked(MoreCreepsAndWeirdos.achievebumpot))\n {\n worldObj.playSoundAtEntity(entityplayer, \"morecreeps:achievement\", 1.0F, 1.0F);\n entityplayer.addStat(MoreCreepsAndWeirdos.achievebumlava, 1);\n confetti(entityplayer);\n }\n\n entityplayer.addStat(MoreCreepsAndWeirdos.achievebumpot, 1);\n */\n // worldObj.playSoundAtEntity(this, \"morecreeps:bumthanks\", 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n worldObj.playSound((EntityPlayer) null, getPosition(), MCSoundEvents.ENTITY_BUM_THANKS, SoundCategory.NEUTRAL, 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n timetopee = rand.nextInt(1900) + 1500;\n\n if (itemstack.stackSize - 1 == 0)\n {\n entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, null);\n }\n else\n {\n itemstack.stackSize--;\n }\n\n int l = (int)posX;\n int j1 = (int)posY;\n int k1 = (int)posZ;\n\n if (rand.nextInt(4) == 0)\n {\n for (int l1 = 0; l1 < rand.nextInt(3) + 1; l1++)\n {\n Blocks.OBSIDIAN.dropBlockAsItem(worldObj, new BlockPos(l, j1, k1), worldObj.getBlockState(new BlockPos(l, j1, k1)), 0);\n }\n }\n\n for (int i2 = 0; i2 < 15; i2++)\n {\n double d4 = (float)l + worldObj.rand.nextFloat();\n double d7 = (float)j1 + worldObj.rand.nextFloat();\n double d8 = (float)k1 + worldObj.rand.nextFloat();\n double d9 = d4 - posX;\n double d10 = d7 - posY;\n double d11 = d8 - posZ;\n double d12 = MathHelper.sqrt_double(d9 * d9 + d10 * d10 + d11 * d11);\n d9 /= d12;\n d10 /= d12;\n d11 /= d12;\n double d13 = 0.5D / (d12 / 10D + 0.10000000000000001D);\n d13 *= worldObj.rand.nextFloat() * worldObj.rand.nextFloat() + 0.3F;\n d9 *= d13;\n d10 *= d13;\n d11 *= d13;\n worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, (d4 + posX * 1.0D) / 2D, (d7 + posY * 1.0D) / 2D + 2D, (d8 + posZ * 1.0D) / 2D, d9, d10, d11);\n worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d4, d7, d8, d9, d10, d11);\n }\n\n if (rand.nextInt(4) == 0)\n {\n entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, new ItemStack(Items.BUCKET));\n }\n }\n else if (!bumgave)\n {\n // worldObj.playSoundAtEntity(this, \"morecreeps:bumpee\", 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n worldObj.playSound((EntityPlayer) null, getPosition(), MCSoundEvents.ENTITY_BUM_PEE, SoundCategory.NEUTRAL, 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n }\n }\n }\n else\n {\n // worldObj.playSoundAtEntity(this, \"morecreeps:bumleavemealone\", 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n worldObj.playSound((EntityPlayer) null, getPosition(), MCSoundEvents.ENTITY_BUM_LEAVEMEALONE, SoundCategory.NEUTRAL, 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n }\n\n return super.processInteract(entityplayer, hand, stack);\n }",
"private void checkIfHungry(){\r\n\t\tif (myRC.getEnergonLevel() * 2.5 < myRC.getMaxEnergonLevel()) {\r\n\t\t\tmission = Mission.HUNGRY;\r\n\t\t}\r\n\t}",
"public void checkGrowth() {\n if (age == 100) {\n double h = ((Growable)delegate).currentHealth;\n delegate = new Sprout(gc, x, y, h);\n }\n if (age == 200) {\n double h = ((Growable)delegate).currentHealth;\n delegate = new Bud(gc, x, y, h);\n }\n if (age == 300) {\n double h = ((Growable)delegate).currentHealth;\n delegate = new Blossom(gc, x, y, h);\n }\n if (age == 400) {\n double h = ((Growable)delegate).currentHealth;\n delegate = new Bloom(gc, x, y, h);\n }\n if (age == 500) {\n delegate = new Seed(gc, x, y);\n age = 0;\n GameManager.score += 100;\n }\n\n if (getCurrentHealth() <= 0) {\n delegate = new Seed(gc, x, y);\n GameManager.lives--;\n }\n delegate.wilt();\n delegate.update();\n }",
"public boolean hasChameleonShield() {\n for (Mounted mEquip : getMisc()) {\n MiscType mtype = (MiscType) mEquip.getType();\n if (mtype.hasFlag(MiscType.F_CHAMELEON_SHIELD)) {\n // The Mek has Chameleon Light Polarization Field\n return true;\n }\n }\n return false;\n }",
"private boolean canMageHarrasing(Creature m) {\n return (heroC.getX() - m.getX()) * (heroC.getX() - m.getX()) == (heroC.getY() - m.getY()) * (heroC.getY() - m.getY());\n }",
"public boolean isBurning()\n {\n return this.fuel > 0 && this.canSmelt();\n }",
"private void checkLoosePLayer(){\n if (hero.getHp()<=0){\n loose();\n }\n\n }",
"void testBigBang(Tester t) {\r\n initData();\r\n FloodItWorld g = this.runGame;\r\n int worldWidth = 1000;\r\n int worldHeight = 1000;\r\n double tickRate = .012;\r\n g.bigBang(worldWidth, worldHeight, tickRate);\r\n }",
"public boolean damage(Item weapon) {\n\t\tif (weapon instanceof assets.Sword) {\n\t\t\tSystem.out.println(\"The jubjub bird falls to the ground, dead.\");\n\t\t\tisAlive = false;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean shouldExecute() {\n\t\tif (!theEntity.isTamed())\n\t\t\treturn false;\n\t\telse if (theEntity.isInWater())\n\t\t\treturn false;\n\t\telse if (!theEntity.onGround)\n\t\t\treturn false;\n\t\telse {\n\t\t\tfinal EntityLivingBase var1 = theEntity.getOwner();\n\t\t\treturn var1 == null ? true\n\t\t\t\t\t: theEntity.getDistanceSqToEntity(var1) < 144.0D\n\t\t\t\t\t\t\t&& var1.getAITarget() != null ? false : isSitting;\n\t\t}\n\t}",
"@EventHandler\n\tpublic void onEggThrown(PlayerEggThrowEvent e){\n\t\t\n\t\tEntity egg = e.getEgg();\n\t\t\n\t\tif(e.getEgg().getCustomName().contains(ChatColor.MAGIC + \"lootEgg\")){\n\t\t\te.setHatching(false);\n\t\t\t\n\t\t\tLocation loc = egg.getLocation();\n\t\t\t\n\t\t\tdropItem(loc);\n\t\t\t\n\t\t}\n\t\t\n\t}",
"public boolean bedwars() {\n return bedwars;\n }",
"public void onLivingUpdate()\n {\n if (this.worldObj.isDaytime() && !this.worldObj.isRemote && !this.isChild())\n {\n float var1 = this.getBrightness(100.0F);\n\n if (var1 > 0.5F && this.rand.nextFloat() * 30.0F < (var1 - 0.4F) * 2.0F && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)))\n {\n boolean var2 = true;\n ItemStack var3 = this.getEquipmentInSlot(4);\n\n if (var3 != null)\n {\n if (var3.isItemStackDamageable())\n {\n var3.setItemDamage(var3.getItemDamageForDisplay() + this.rand.nextInt(2));\n\n if (var3.getItemDamageForDisplay() >= var3.getMaxDamage())\n {\n this.renderBrokenItemStack(var3);\n this.setCurrentItemOrArmor(4, (ItemStack)null);\n }\n }\n\n var2 = false;\n }\n\n if (var2)\n {\n this.setFire(-99);\n }\n }\n }\n\n super.onLivingUpdate();\n }",
"public static boolean addFireWound(@Nullable Creature performer, @Nonnull Creature defender, int pos, double damage, float armourMod, float infection, float poison, boolean noMinimumDamage, boolean spell) {\n/* 1798 */ if (performer != null && performer.getTemplate().getCreatureAI() != null)\n/* */ {\n/* 1800 */ damage = performer.getTemplate().getCreatureAI().causedWound(performer, defender, (byte)4, pos, armourMod, damage);\n/* */ }\n/* */ \n/* 1803 */ if (defender.getTemplate().getCreatureAI() != null)\n/* */ {\n/* 1805 */ damage = defender.getTemplate().getCreatureAI().receivedWound(defender, performer, (byte)4, pos, armourMod, damage);\n/* */ }\n/* */ \n/* 1808 */ if (defender.getCultist() != null && defender.getCultist().hasNoElementalDamage())\n/* 1809 */ return false; \n/* 1810 */ boolean dead = false;\n/* 1811 */ if (damage * armourMod > 500.0D || noMinimumDamage) {\n/* */ DbWound dbWound;\n/* 1813 */ if (defender.hasSpellEffect((byte)68)) {\n/* */ \n/* 1815 */ defender.reduceStoneSkin();\n/* 1816 */ return false;\n/* */ } \n/* 1818 */ Wound wound = null;\n/* 1819 */ boolean foundWound = false;\n/* 1820 */ if (performer != null) {\n/* */ \n/* 1822 */ ArrayList<MulticolorLineSegment> segments = new ArrayList<>();\n/* 1823 */ segments.add(new MulticolorLineSegment(\"Your weapon\", (byte)3));\n/* 1824 */ segments.add(new MulticolorLineSegment(\" burns \", (byte)3));\n/* 1825 */ segments.add(new CreatureLineSegment(defender));\n/* 1826 */ segments.add(new MulticolorLineSegment(\".\", (byte)3));\n/* */ \n/* 1828 */ performer.getCommunicator().sendColoredMessageCombat(segments);\n/* */ \n/* 1830 */ segments.set(0, new CreatureLineSegment(performer));\n/* 1831 */ for (MulticolorLineSegment s : segments) {\n/* 1832 */ s.setColor((byte)7);\n/* */ }\n/* 1834 */ defender.getCommunicator().sendColoredMessageCombat(segments);\n/* */ } \n/* */ \n/* */ \n/* */ \n/* */ \n/* 1840 */ if (defender.getBody().getWounds() != null) {\n/* */ \n/* 1842 */ wound = defender.getBody().getWounds().getWoundTypeAtLocation((byte)pos, (byte)4);\n/* 1843 */ if (wound != null)\n/* */ {\n/* 1845 */ if (wound.getType() == 4) {\n/* */ \n/* 1847 */ defender.setWounded();\n/* 1848 */ wound.setBandaged(false);\n/* 1849 */ dead = wound.modifySeverity((int)(damage * armourMod), (performer != null && performer.isPlayer()), spell);\n/* 1850 */ foundWound = true;\n/* */ } else {\n/* */ \n/* 1853 */ wound = null;\n/* */ } } \n/* */ } \n/* 1856 */ if (wound == null)\n/* */ {\n/* 1858 */ if (WurmId.getType(defender.getWurmId()) == 1) {\n/* 1859 */ TempWound tempWound = new TempWound((byte)4, (byte)pos, (float)damage * armourMod, defender.getWurmId(), poison, infection, spell);\n/* */ } else {\n/* */ \n/* 1862 */ dbWound = new DbWound((byte)4, (byte)pos, (float)damage * armourMod, defender.getWurmId(), poison, infection, (performer != null && performer.isPlayer()), spell);\n/* */ } \n/* */ }\n/* 1865 */ if (!foundWound)\n/* 1866 */ dead = defender.getBody().addWound((Wound)dbWound); \n/* */ } \n/* 1868 */ return dead;\n/* */ }",
"public boolean hasBust() {\n\t\treturn this.hand.countValue().first() > 21;\n\t}",
"public boolean isFlyingAnimal() {\n return true;\n }",
"public static boolean [][] breedChoice (Species [][] map, int x, int y, int plantHealth) {\n // First int: direction\n // Second int: sheep or wolf\n boolean [][] breeding = {\n {false, false},\n {false, false},\n {false, false},\n {false, false},\n };\n \n // Check null pointer exceptions\n if (map[y][x] != null) {\n\n // Breed sheep\n if ((map[y][x] instanceof Sheep) && (y > 0) && (map[y-1][x] instanceof Sheep)) {\n if ((((Sheep)map[y][x]).getGender() != ((Sheep)map[y-1][x]).getGender()) && (map[y][x].getHealth() > 20) && (map[y-1][x].getHealth() > 20) && (((Sheep)map[y][x]).getAge() > 5) && (((Sheep)map[y-1][x]).getAge() > 5)) {\n breeding[0][0] = true;\n }\n } else if ((map[y][x] instanceof Sheep) && (y < map[0].length - 2) && (map[y+1][x] instanceof Sheep)) {\n if ((((Sheep)map[y][x]).getGender() != ((Sheep)map[y+1][x]).getGender()) && (map[y][x].getHealth() > 20) && (map[y+1][x].getHealth() > 20) && (((Sheep)map[y][x]).getAge() > 5) && (((Sheep)map[y+1][x]).getAge() > 5)) {\n breeding[1][0] = true;\n }\n } else if ((map[y][x] instanceof Sheep) && (x > 0) && (map[y][x-1] instanceof Sheep)) {\n if ((((Sheep)map[y][x]).getGender() != ((Sheep)map[y][x-1]).getGender()) && (map[y][x].getHealth() > 20) && (map[y][x-1].getHealth() > 20) && (((Sheep)map[y][x]).getAge() > 5) && (((Sheep)map[y][x-1]).getAge() > 5)) {\n breeding[2][0] = true;\n }\n } else if ((map[y][x] instanceof Sheep) && (x < map.length - 2) && (map[y][x+1] instanceof Sheep)) {\n if ((((Sheep)map[y][x]).getGender() != ((Sheep)map[y][x+1]).getGender()) && (map[y][x].getHealth() > 20) && (map[y][x+1].getHealth() > 20) && (((Sheep)map[y][x]).getAge() > 5) && (((Sheep)map[y][x+1]).getAge() > 5)) {\n breeding[3][0] = true;\n }\n \n // Breed wolves\n } else if ((map[y][x] instanceof Wolf) && (y > 0) && (map[y-1][x] instanceof Wolf)) {\n if ((((Wolf)map[y][x]).getGender() != ((Wolf)map[y-1][x]).getGender()) && (map[y][x].getHealth() > 20) && (map[y-1][x].getHealth() > 20) && (((Wolf)map[y][x]).getAge() > 5) && (((Wolf)map[y-1][x]).getAge() > 5)) {\n breeding[0][1] = true;\n }\n } else if ((map[y][x] instanceof Wolf) && (y < map[0].length - 2) && (map[y+1][x] instanceof Wolf)) {\n if ((((Wolf)map[y][x]).getGender() != ((Wolf)map[y+1][x]).getGender()) && (map[y][x].getHealth() > 20) && (map[y+1][x].getHealth() > 20) && (((Wolf)map[y][x]).getAge() > 5) && (((Wolf)map[y+1][x]).getAge() > 5)) {\n breeding[1][1] = true;\n }\n } else if ((map[y][x] instanceof Wolf) && (x > 0) && (map[y][x-1] instanceof Wolf)) {\n if ((((Wolf)map[y][x]).getGender() != ((Wolf)map[y][x-1]).getGender()) && (map[y][x].getHealth() > 20) && (map[y][x-1].getHealth() > 20) && (((Wolf)map[y][x]).getAge() > 5) && (((Wolf)map[y][x-1]).getAge() > 5)) {\n breeding[2][1] = true;\n }\n } else if ((map[y][x] instanceof Wolf) && (x < map.length - 2) && (map[y][x+1] instanceof Wolf)) {\n if ((((Wolf)map[y][x]).getGender() != ((Wolf)map[y][x+1]).getGender()) && (map[y][x].getHealth() > 20) && (map[y][x+1].getHealth() > 20) && (((Wolf)map[y][x]).getAge() > 5) && (((Wolf)map[y][x+1]).getAge() > 5)) {\n breeding[3][1] = true;\n }\n }\n \n }\n return breeding;\n }",
"public boolean whatNow (String action, player friday, player you){ // Method which will allow the ia to choose his action\n\t\tString testAction = \"Tank\"; // Create a String we will use a lot to test other string\n\t\tint actionIa; // If the ia is a Tank, forbid him to use his special attack. The purpose is to prevent him from useless turns\n\t\tif (friday.getName().equals(testAction)){ // If the name of the ia's class is Tank\n\t\t\t actionIa = (int)(Math.random() * 2); // His random will be between 0 or 1\n\t\t}\n\t\t\n\t\telse {\n\t\t\t actionIa = (int)(Math.random() * 3); // Else, his random will be between 0, 1 and 2\n\t\t}\n\t\t\n\t\ttestAction = \"attack\"; // Will be use to test if you attacked\n\t\t\n\t\t\n\t\tswitch (actionIa){ // Test ia's action\n\t\t\tcase 0: // 0, the enemy attack\n\t\t\t\tfriday.setSprite(\"attack\");\n\t\t\t\tSystem.out.println(\"The enemy attack\\n\"); // Warns the user\n\t\t\t\ttestAction = \"block\"; // Will be use to test if you block\n\t\t\t\tif (action.equals(testAction)){ // If you block\n\t\t\t\t\tSystem.out.println(\"You blocked the enemy's attack.\"); // Warns the user\n\t\t\t\t\tyou.setHp(you.getHp() - you.getDp()); // You loose as much hp as your dp\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse{\n\t\t\t\t\tyou.setHp(you.getHp() - friday.getAp()); // Else, you loose as much hp as your enemy's ap\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 1: // 1, the enemy block\n\t\t\t\tfriday.setSprite(\"block\");\n\t\t\t\tif (action.equals(testAction)){ // If you attacked\n\t\t\t\t\tfriday.setHp(friday.getHp() - friday.getDp()); // The enemy loose as much hp as his dp\n\t\t\t\t\taction = \"\"; // Prevent you from attack a second time\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"The enemy blocked your attack\\n\"); // Warns the user\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 2: // 2, the enemy use his special power if he isn't a tank\n\t\t\t\tfriday.setSprite(\"special\");\n\t\t\t\tSystem.out.println(\"The enemy uses his special power.\"); // Warns the user\n\t\t\t\tfriday.special(); // Execute ia's special attack\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t}\n\t\t\n\t\ttestAction = \"attack\"; // Reset testAction\n\t\t\n\t\tif (action.equals(testAction)){ // If you attacked\n\t\t\tfriday.setHp(friday.getHp() - you.getAp()); // The enemy loose as much hp as your ap\n\t\t} // Nota Bene : if the enemy blocked your attack, this won't be executed because 'action = \"\";'\n\t\t\n\t\tSystem.out.println(\"You have \" + you.getHp() + \" HP left.\"); // Warns the user\n\t\tSystem.out.println(\"The ennemy have \" + friday.getHp() + \" HP left.\\n\"); // Warns the user\n\t\t\n\t\tif(you.getHp() <= 0){ // If you or the ia has no hp left, warn the system that the fight is over by setting 'end' on true and tell who died\n\t\t\tend = true;\n\t\t\tSystem.out.println(\"You died!\");\n\t\t\tyou.setSprite(\"dead\");\n\t\t}\n\t\t\n\t\telse if(friday.getHp() <= 0){\n\t\t\tend = true;\n\t\t\tSystem.out.println(\"You killed the ennemy!\");\n\t\t\tfriday.setSprite(\"dead\");\n\t\t}\n\t\t\n\t\telse { // Else, it just asks you what you want to do\n\t\t\tSystem.out.println(\"What do you want to do, attack, block or use your special power ?\"); // Asks what you want to do\n\t\t}\n\t\treturn end;\n\t}",
"public float onAbsorbHeat(float rfAbsorbed) {\n\t\tif(getFluidAmount(COLD) <= 0 || rfAbsorbed <= 0) { return rfAbsorbed; }\n\n\t\tFluid coolantType = getCoolantType();\n\t\tint coolantAmt = getFluidAmount(COLD);\n\n\t\tfloat heatOfVaporization = getHeatOfVaporization(coolantType);\n\t\t\n\t\tint mbVaporized = Math.min(coolantAmt, (int)(rfAbsorbed / heatOfVaporization));\n\n\t\t// Cap by the available space in the vapor chamber\n\t\tmbVaporized = Math.min(mbVaporized, getRemainingSpaceForFluid(HOT));\n\t\t\n\t\t// We don't do partial vaporization. Just return all the heat.\n\t\tif(mbVaporized < 1) { return rfAbsorbed; }\n\n\t\t// Make sure we either have an empty vapor chamber or the vapor types match\n\t\tFluid newVaporType = getVaporizedCoolantFluid(coolantType);\n\t\tif(newVaporType == null) {\n\t\t\tBRLog.warning(\"Coolant in tank (%s) has no registered vapor type!\", coolantType.getName());\n\t\t\treturn rfAbsorbed;\n\t\t}\n\t\t\n\t\tFluid existingVaporType = getVaporType();\n\t\tif(existingVaporType != null && !newVaporType.getName().equals(existingVaporType.getName())) {\n\t\t\t// Can't vaporize anything with incompatible vapor in the vapor tank\n\t\t\treturn rfAbsorbed;\n\t\t}\n\t\t\n\t\t// Vaporize! -- POINT OF NO RETURN\n\t\tfluidVaporizedLastTick = mbVaporized;\n\t\tthis.drainCoolant(mbVaporized);\n\t\t\n\t\tif(existingVaporType != null) {\n\t\t\taddFluidToStack(HOT, mbVaporized);\n\t\t}\n\t\telse {\n\t\t\tfill(HOT, new FluidStack(newVaporType, mbVaporized), true);\n\t\t}\n\t\t\n\t\t// Calculate how much we actually absorbed via vaporization\n\t\tfloat energyConsumed = (float)mbVaporized * heatOfVaporization;\n\t\t\n\t\t// And return energy remaining after absorption\n\t\treturn Math.max(0f, rfAbsorbed - energyConsumed);\n\t}",
"int checkCollision(Tumbleweed tumbleweed) {\n int retVal = 0;\n if (collidesWith(tumbleweed, true)) {\n retVal = 1;\n // once the cowboy has collided with the tumbleweed,\n // that tumbleweed is done for now, so we call reset\n // which makes it invisible and ready to be reused.\n tumbleweed.reset();\n }\n return (retVal);\n }",
"public boolean fire(RobotInfo enemy) throws GameActionException {\n if (rc.getType() == RobotType.LUMBERJACK) return strike(enemy);\n if (rc.hasAttacked()) return false; //One such check (just in case)\n Direction toEnemy = rc.getLocation().directionTo(enemy.location);\n if (shouldFirePentad(enemy)){\n rc.firePentadShot(toEnemy);\n }\n else if(shouldFireTriad(enemy)){\n rc.fireTriadShot(toEnemy);\n }\n else{\n if (rc.canFireSingleShot()){\n rc.fireSingleShot(toEnemy);\n }\n }\n return false;\n }",
"public boolean eat(Player player) {\n\t\t//TODO check if called correctly\n\t\tPacmanColor color = player.getPacman().getColor();\n\n\t\tif (this.pacman.getColor().equals(color)) {\n\t\t\tthrow new RuntimeException(\"Encountered two pacmans with the same color.\");\n\t\t}\n\n\t\t//TODO refactor switch statement into Pacman class -> currently switch + eat method redundant\n\t\tswitch (this.pacman.getColor()) {\n\t\t\tcase RED:\n\t\t\t\tif (PacmanColor.BLUE.equals(color)) {\n\t\t\t\t\tthis.sendBounty(player);\n\t\t\t\t} else if (PacmanColor.GREEN.equals(color)) {\n\t\t\t\t\tplayer.sendBounty(this);\n\t\t\t\t} else {\n\t\t\t\t\tthrow new RuntimeException(\"Unknown color\");\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase BLUE:\n\t\t\t\tif (PacmanColor.GREEN.equals(color)) {\n\t\t\t\t\tthis.sendBounty(player);\n\t\t\t\t} else if (PacmanColor.RED.equals(color)) {\n\t\t\t\t\tplayer.sendBounty(this);\n\t\t\t\t} else {\n\t\t\t\t\tthrow new RuntimeException(\"Unknown color\");\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase GREEN:\n\t\t\t\tif (PacmanColor.BLUE.equals(color)) {\n\t\t\t\t\tplayer.sendBounty(this);\n\t\t\t\t} else if (PacmanColor.RED.equals(color)) {\n\t\t\t\t\tthis.sendBounty(player);\n\t\t\t\t} else {\n\t\t\t\t\tthrow new RuntimeException(\"Unknown color\");\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new RuntimeException(\"Unknown color\");\n\t\t}\n\t\t\n\t\tGame.getCurrentInstance().endRound();\n return false; //TODO: return correct boolean\n\t}",
"@Override\n public void eat() {\n System.out.println(\"Now doggo is eating\");\n chew();\n super.eat();\n }"
] | [
"0.62969786",
"0.62842077",
"0.6239384",
"0.6228483",
"0.6195542",
"0.6174463",
"0.6114921",
"0.60999835",
"0.60918343",
"0.60904145",
"0.60732335",
"0.6065542",
"0.6057931",
"0.6024476",
"0.6022533",
"0.59921",
"0.5990436",
"0.5965221",
"0.5946043",
"0.59203887",
"0.58854026",
"0.5868027",
"0.58420366",
"0.5826597",
"0.580697",
"0.58030343",
"0.5800953",
"0.580053",
"0.5790576",
"0.5718365",
"0.57135546",
"0.56885374",
"0.5683807",
"0.56776625",
"0.56747836",
"0.56612307",
"0.5659691",
"0.5659691",
"0.5659691",
"0.5659691",
"0.5659691",
"0.5649961",
"0.5608978",
"0.5606112",
"0.55899704",
"0.5580769",
"0.5563709",
"0.555484",
"0.55545366",
"0.5551232",
"0.5538062",
"0.5532168",
"0.55274093",
"0.5522604",
"0.55188525",
"0.55180496",
"0.5514338",
"0.5511254",
"0.55106694",
"0.55027914",
"0.5495505",
"0.5494239",
"0.54934037",
"0.54921365",
"0.5489248",
"0.5487296",
"0.54844564",
"0.54841495",
"0.54821354",
"0.5479938",
"0.54787254",
"0.54786533",
"0.547598",
"0.5474557",
"0.5471784",
"0.5469349",
"0.5462176",
"0.54599136",
"0.54584694",
"0.54546446",
"0.54443",
"0.5442368",
"0.54415953",
"0.54364353",
"0.5433131",
"0.5431686",
"0.5428655",
"0.5426438",
"0.54216343",
"0.54207075",
"0.5419892",
"0.5410171",
"0.5408807",
"0.5404586",
"0.5403838",
"0.540144",
"0.54008216",
"0.53987736",
"0.5397462",
"0.5397173"
] | 0.7793979 | 0 |
IHitAggro Should be implemented if the mob has the chance to strike back at an attacker. | public interface IHitAggro {
/**
* shouldAggroOnHit
* The chance (where 1.0F = 100%) that this mob would be aggroed if struck by this entity
* Should NOT trigger the aggro itself! That should only occur when actually hit!
* @param geneticMob the mob being checked
* @param attacker the entity that could attack
* @return the chance of aggro (1.0F = 100%, 0.0F = 0%)
*/
float shouldAggroOnHit(IGeneticMob geneticMob, EntityLiving attacker);
/**
* aggroHitTimer
* How long this mob would stay angry at this attacker if aggroed via hit
* @param geneticMob the mob being checked
* @param attacker the entity that could attack
* @return the length, in ticks, of the timer
*/
int aggroHitTimer(IGeneticMob geneticMob, EntityLiving attacker);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"float shouldAggroOnHit(IGeneticMob geneticMob, EntityLiving attacker);",
"@Override\n\t\tpublic void hit(Npc attacker, Mob defender, Hit hit) {\n\t\t}",
"int aggroHitTimer(IGeneticMob geneticMob, EntityLiving attacker);",
"public void addDamageHate(final L2Character attacker, final int damage, int aggro)\n\t{\n\t\tif (attacker == null /* || aggroList == null */)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Get the AggroInfo of the attacker L2Character from the aggroList of the L2Attackable\n\t\tAggroInfoHolder ai = getAggroListRP().get(attacker);\n\t\t\n\t\tif (ai == null)\n\t\t{\n\t\t\tai = new AggroInfoHolder(attacker);\n\t\t\tai.init();\n\t\t\tgetAggroListRP().put(attacker, ai);\n\t\t}\n\t\t\n\t\t// If aggro is negative, its comming from SEE_SPELL, buffs use constant 150\n\t\tif (aggro < 0)\n\t\t{\n\t\t\tai.decHate(aggro * 150 / (getLevel() + 7));\n\t\t\taggro = -aggro;\n\t\t}\n\t\t// if damage == 0 -> this is case of adding only to aggro list, dont apply formula on it\n\t\telse if (damage == 0)\n\t\t{\n\t\t\tai.incHate(aggro);\n\t\t\t// else its damage that must be added using constant 100\n\t\t}\n\t\telse\n\t\t{\n\t\t\tai.incHate(aggro * 100 / (getLevel() + 7));\n\t\t}\n\t\t\n\t\t// Add new damage and aggro (=damage) to the AggroInfo object\n\t\tai.incDmg(damage);\n\t\t\n\t\t// Set the intention to the L2Attackable to AI_INTENTION_ACTIVE\n\t\tif (getAI() != null && aggro > 0 && getAI().getIntention() == CtrlIntention.AI_INTENTION_IDLE)\n\t\t{\n\t\t\tgetAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);\n\t\t}\n\t\t\n\t\tai = null;\n\t\t// Notify the L2Attackable AI with EVT_ATTACKED\n\t\tif (damage > 0)\n\t\t{\n\t\t\tif (getAI() != null)\n\t\t\t{\n\t\t\t\tgetAI().notifyEvent(CtrlEvent.EVT_ATTACKED, attacker);\n\t\t\t}\n\t\t\t\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (attacker instanceof L2PcInstance || attacker instanceof L2Summon)\n\t\t\t\t{\n\t\t\t\t\tL2PcInstance player = attacker instanceof L2PcInstance ? (L2PcInstance) attacker : ((L2Summon) attacker).getOwner();\n\t\t\t\t\t\n\t\t\t\t\tfor (final Quest quest : getTemplate().getEventQuests(Quest.QuestEventType.ON_ATTACK))\n\t\t\t\t\t{\n\t\t\t\t\t\tquest.notifyAttack(this, player, damage, attacker instanceof L2Summon);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tplayer = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (final Exception e)\n\t\t\t{\n\t\t\t\tLOGGER.error(\"\", e);\n\t\t\t}\n\t\t}\n\t}",
"@Override\n public void hit(int atk) {\n hp = hp - atk;\n }",
"@Override\n public void attack(Entity e) {\n e.hit(atk);\n }",
"@Override\n\tpublic void takeHit(int attack) {\n\n\t}",
"boolean shouldAutoAggro(IGeneticMob geneticMob, EntityLiving otherEntity);",
"public void Hit()\n {\n this.numLives--;\n //Oscillate visible and not if the number of lives is greater than zero\n if(this.numLives > 0)\n {\n this.damaged = true;\n this.Blink(1);\n\n }\n }",
"@Override\n\tpublic void onDamage(WorldObj obj, Items item) {\n\n\t\tif(is_stunned) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tint dmg = (int) item.type.ATK;\n\t\t\n\t\tOnScreenText.AddText(\"\"+dmg, bounds.x , bounds.y + 1.1f);\n\t\t\n\t\tvelX = obj.direction * 5;\n\t\tvelY = 5;\n\t\tgrounded = false;\n\t\t\n\t\tHP -= dmg;\n\t\t\n\n\t\tstun_counter = 0;\n\t\t\n\t\tif(HP <= 0 && !isDead) {\n\t\t\tonDeath();\n\t\t}\n\t\t\n\t}",
"public void takesHit()\n {\n // TODO: replace this line with your code\n }",
"@Override\n\tpublic void processIncommingHit(Hit hit, Entity target) {\n\t\tif (hit.getLook() == HitLook.MELEE_DAMAGE)\n\t\t\tmeleeDamage += hit.getDamage();\n\t\telse if (hit.getLook() == HitLook.RANGE_DAMAGE)\n\t\t\trangeDamage += hit.getDamage();\n\t\tif (hit.getLook() == HitLook.MAGIC_DAMAGE)\n\t\t\tmageDamage += hit.getDamage();\n\t}",
"public void onHit() {\n //override this to provide extra functionality\n }",
"@Override\n\tpublic void onHit() {\n\t\t\n\t}",
"public boolean isHit() { return hit; }",
"@Override\n public void hit(int damage)\n {\n state.hit(damage, this);\n }",
"@Override\n\tpublic void getHit(int damage) {\n\t\tsuper.getHit(damage);\n\t}",
"public void hit(Graphics g) {\r\n\t\tthis.myDraw(g);\r\n\t\tsuper.loseHealth();\r\n\t\tg.drawImage(sprite,super.X(),super.Y(), null);\r\n\t\tfor(int i = 0; i < spits.size();i++) {\r\n\t\t\tspits.get(i).myDraw(g);\r\n\t\t}\r\n\t}",
"@Override\n\tpublic void onHitted(EntityDamageByEntityEvent e, Player damager, Player victim) {\n\t\t\n\t}",
"public void AIDamage() {\r\n\t\tif (attackStyle == 2) {\r\n\t\t\tfor(int i = 0; i < AIObject.length; i++) {\r\n\t\t\t\tif ((inFlight) && (Math.abs(aX-AIObject[i].getAIX()) < 5) && (Math.abs(aY-AIObject[i].getAIY())) < 4 ) {\r\n\t\t\t\t\tAIObject[i].setHealth(-25 * damageReduction);\r\n\t\t\t\t\tdrawArrow = false;\r\n\t\t\t\t\tcooldown = 15;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\tif (mouseLeft) {\r\n\t\t\t\tfor(int i = 0; i < AIObject.length; i++){\r\n\t\t\t\t\tif ((drawSword) && (cooldown == 0) && (playerObject[0].getX() -AIObject[i].getAIX() <85) && (playerObject[0].getX()-AIObject[i].getAIX() >-1) && (playerObject[0].getY() - AIObject[i].getAIY() < 20) && (playerObject[0].getY()-AIObject[i].getAIY()>-5)) {\r\n\t\t\t\t\t\tAIObject[i].setHealth(-50 * damageReduction);\r\n\t\t\t\t\t\tcooldown = 5;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else {\r\n\t\t\t\tfor(int i=0; i < AIObject.length; i++){\r\n\t\t\t\t\tif ((drawSword) && (cooldown == 0) && (AIObject[i].getAIX()-playerObject[0].getX() <85) && (AIObject[i].getAIX() - playerObject[0].getX() > -1) && (playerObject[0].getY() - AIObject[i].getAIY() < 20) && (playerObject[0].getY()-AIObject[i].getAIY()>-5)) {\r\n\t\t\t\t\t\tAIObject[i].setHealth(-50 * damageReduction);\r\n\t\t\t\t\t\tcooldown = 5;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int i=0; i < AIObject.length; i++){\r\n\t\t\t//checks if AI is close enough to attack with melee\r\n\t\t\tfor (int j = 0; j < playerObject.length; j++) {\r\n\t\t\t\tif ((!shield) && (Math.abs(AIObject[i].getAIX() - playerObject[j].getX()) <= 10) && (Math.abs(AIObject[i].getAIY() - playerObject[j].getY())) <= 3) {\r\n\t\t\t\t\tplayerObject[j].setHealth(DAMAGE_AMOUNT * difficulty);\r\n\t\t\t\t\tif (playerObject[j].getHealth() <= 0) {\r\n\t\t\t\t\t\tdead = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"@Override\n\tpublic void processIngoingHit(Hit hit) {\n\t\tdamageReceived += hit.getDamage();\n\t}",
"public void attackEntity(Entity entityToHit) {\n ItemStack item = tinkerProjectile.getItemStack();\n ItemStack launcher = tinkerProjectile.getLaunchingStack();\n\n // deal damage if we have everything\n if(item.getItem() instanceof ToolCore && this.attacker != null) {\n EntityLivingBase attacker = (EntityLivingBase) this.attacker;\n //EntityLivingBase target = (EntityLivingBase) raytraceResult.entityHit;\n\n // find the actual itemstack in the players inventory\n ItemStack inventoryItem = AmmoHelper.getMatchingItemstackFromInventory(tinkerProjectile.getItemStack(), attacker, false);\n if(inventoryItem.isEmpty() || inventoryItem.getItem() != item.getItem()) {\n // backup, use saved itemstack\n inventoryItem = item;\n }\n\n // for the sake of dealing damage we always ensure that the impact itemstack has the correct broken state\n // since the ammo stack can break while the arrow travels/if it's the last arrow\n boolean brokenStateDiffers = ToolHelper.isBroken(inventoryItem) != ToolHelper.isBroken(item);\n if(brokenStateDiffers) {\n toggleBroken(inventoryItem);\n }\n\n Multimap<String, AttributeModifier> projectileAttributes = null;\n // remove stats from held items\n if(!world.isRemote) {\n unequip(attacker, EntityEquipmentSlot.OFFHAND);\n unequip(attacker, EntityEquipmentSlot.MAINHAND);\n\n // apply stats from projectile\n if(item.getItem() instanceof IProjectile) {\n projectileAttributes = ((IProjectile) item.getItem()).getProjectileAttributeModifier(inventoryItem);\n\n if(launcher.getItem() instanceof ILauncher) {\n ((ILauncher) launcher.getItem()).modifyProjectileAttributes(projectileAttributes, tinkerProjectile.getLaunchingStack(), tinkerProjectile.getItemStack(), tinkerProjectile.getPower());\n }\n\n // factor in power\n projectileAttributes.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(),\n new AttributeModifier(PROJECTILE_POWER_MODIFIER, \"Weapon damage multiplier\", tinkerProjectile.getPower() - 1f, 2));\n\n attacker.getAttributeMap().applyAttributeModifiers(projectileAttributes);\n }\n // deal the damage\n// ToolHelper.attackEntity(item, (ToolCore) item.getItem(), attacker, entityToHit, null);\n// float speed = MathHelper.sqrt(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);\n\n boolean attack = ToolHelper.attackEntity(item, (ToolCore) item.getItem(), attacker, entityToHit, null);\n// if(attack) {\n//// for(IProjectileTrait trait : tinkerProjectile.getProjectileTraits()) {\n//// trait.afterHit(tinkerProjectile.get, this.world, inventoryItem, attacker, entityToHit, (double) 0.0);\n//// }\n//\n// // if on fire, set the entity on fire, like vanilla arrows\n//// if (this.isBurning() && !(entityToHit instanceof EntityEnderman)) {\n//// entityToHit.setFire(5);\n//// }\n// }\n if(brokenStateDiffers) {\n toggleBroken(inventoryItem);\n }\n\n // remove stats from projectile\n // apply stats from projectile\n if(item.getItem() instanceof IProjectile) {\n assert projectileAttributes != null;\n attacker.getAttributeMap().removeAttributeModifiers(projectileAttributes);\n }\n\n // readd stats from held items\n equip(attacker, EntityEquipmentSlot.MAINHAND);\n equip(attacker, EntityEquipmentSlot.OFFHAND);\n }\n }else {\n System.out.println(\"something failed with attacking.\");\n }\n }",
"@Override\n\tpublic void onHitPlayer(EntityDamageByEntityEvent e, Player damager, Player victim) {\n\t\t\n\t}",
"public void hit(int melee_dmg,int range_dmg) {\n melee_dmg=this.current_atk-30;\n range_dmg=this.current_atk-60;\n }",
"@Override\r\n\tpublic void heal() {\n\t\tSystem.out.println(\"Paladin \" + super.getName() + \" heals for 50 points.\");\r\n\t\tsuper.setHitPoints(super.getHitPoints() + 50);\r\n\t}",
"@Override\r\n\tpublic void onEntityHit(LivingEntity ent) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void onEntityHit(LivingEntity ent) {\n\t\t\r\n\t}",
"public void OnDamage(AI ai, int aTK, float f) {\n\tif(DamagedTimer < 0.8f)\n\t\treturn;\n\tvel.x = f;\n\tvel.y = 3;\n\tDamagedTimer = 0;\n\tgrounded = false;\n\taTK -= (getDEF()*0.8f);\n\tif(aTK <= 0)\n\t\taTK = 1;\n\tHP -= aTK;\n\tInventory.CurrentInventory.dmgTxts.add(new dmgText(pos.x, pos.y+1, aTK));\n\t\n\tSoundManager.PlaySound(\"playerHurt\",3);\n\t\n\t\n}",
"@Override\r\n public void hitEvent(Block beingHit, Ball hitter) {\n this.currentScore.increase(5);\r\n if (beingHit.getHitPoints() == 1) {\r\n this.currentScore.increase(10);\r\n }\r\n }",
"public void hit() throws CellPlayedException{\r\n if(!hit){\r\n this.hit = true;\r\n if(ship != null){\r\n ship.hit();\r\n }\r\n }else{\r\n throw new CellPlayedException(row, column);\r\n }\r\n }",
"public void onAgress(IPokemob mob, EntityLivingBase target)\r\n {\r\n }",
"@Override\r\n public void onHit(int damage){\n if(box2body != null){\r\n hp -= damage;\r\n screen.getGameManager().get(\"Sounds/orc-34-hit.wav\", Sound.class).play();\r\n if(this.hp <= 0) {\r\n screen.bodiesToDelete.add(box2body);\r\n deleteFlag = true;\r\n screen.spawnedCreatures.remove(this);\r\n screen.getGameManager().get(\"Sounds/orc-32-death.wav\", Sound.class).play();\r\n\r\n //Award Experience\r\n screen.getPlayer().awardExperience(this.experienceValue);\r\n screen.getPlayer().increaseKillCount();\r\n }\r\n }\r\n //Attack player when damaged\r\n //Prevents player from sniping monsters using Wander AI\r\n if(currentState != State.ATTACKING){\r\n Vector2 orcPosition = new Vector2(box2body.getPosition().x, box2body.getPosition().y);\r\n Vector2 playerPosition = new Vector2(screen.getPlayer().box2body.getPosition().x, screen.getPlayer().box2body.getPosition().y);\r\n\r\n currentState = State.HASBEENATTACKED;\r\n velocity = new Vector2(playerPosition.x - orcPosition.x, playerPosition.y - orcPosition.y);\r\n box2body.setLinearVelocity(velocity.scl(speed));\r\n }\r\n }",
"public void Hitting(Monsters opponent) throws Exception {\n\t\tassert (this != opponent);\n\t\tRandom rand = new Random();\n\t\tint hit = rand.nextInt(30);\n\t\tif(hit >= this.getHitpoints()) \n\t\t\thit = this.getHitpoints();\n\t\tif (hit >= opponent.getProtection()) {\n\t\t\tint power;\n\t\t\tif (this.getAnchor(1) == null)\n\t\t\t\tpower = this.getDamage() + (this.getStrength() - 5) / 3;\n\t\t\telse\n\t\t\t\tpower = this.getDamage() + (this.getStrength() - 5) / 3 + ((Weapons)this.getAnchor(1)).getDamage();\n\t\t\topponent.setHitpoints(opponent.getHitpoints() - power);\n\t\t\tSystem.out.println(this.getName() + \" Deals \" + power + \" damage over \" + opponent.getName());\n\t\t}\n\t\telse\n\t\t\tSystem.out.println(this.getName() + \" attack failed!\");\n\t}",
"void hitEvent(Block beingHit, Ball hitter);",
"void hitEvent(Block beingHit, Ball hitter);",
"@Override\n\tpublic int attack( ){\n\t\treturn enemy.attack();\n\t}",
"public int attack(Character target){ //hw3E#0 //hw46#moreThinking\n lowerHP((int)(strength * attack / 10)); //hw3E#0 //hw46#moreThinking\n return super.attack(target); //hw3E#0 //hw44#3,4 //hw46#moreThinking\n }",
"public void hitEvent(Block beingHit, Ball hitter) {\r\n this.currentScore.increase(5);\r\n if (beingHit.getHitPoints() == 0) {\r\n this.currentScore.increase(10);\r\n }\r\n }",
"protected boolean isAHit( int code )\n\t{\n\treturn true;\n\t}",
"@Override\n\tpublic void hit(Direction dir) {\n\t\t\n\t}",
"@Override\r\n\tpublic void onEntityHit(LivingEntity ent) {\n\r\n\t}",
"public void hitEvent(Block beingHit, Ball hitter) {\r\n if (beingHit.getHitPoints() == 0) {\r\n this.currentScore.increase(10);\r\n return;\r\n }\r\n\r\n this.currentScore.increase(5);\r\n }",
"public void weaken(float hit) {\n if (!isInvincible()) {\n hp -= hit;\n invincible = true;\n if (hp < 0) {\n hp = 0;\n }\n\n if(isWeak()){ //Play the death animation\n currentAnimation = deathAnimation;\n }\n }\n }",
"@Override\r\n public void hitEvent(Block beingHit, Ball hitter) {\n this.currentScore.increase(5);\r\n // and destroying a block is worth and additional 10 points\r\n if (beingHit.getHitPointsNumber() == 0) {\r\n this.currentScore.increase(10);\r\n }\r\n }",
"@Override\r\n\tpublic void recieveHit() {\n\t\tif(armour <= 0) {\r\n\t\t\tSystem.out.println(\"Enemy Destroyed\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdouble calculateHitDamage = shot * basicDamage;\r\n\t\t\tif(calculateHitDamage == armour) {\r\n\t\t\t\tarmour = armour - calculateHitDamage;\r\n\t\t\t\tSystem.out.println(\"Enemy Armour Destroyed!!!\");\r\n\t\t\t}\r\n\t\t\telse if(calculateHitDamage > armour) {\r\n\t\t\t\tarmour = armour - calculateHitDamage;\r\n\t\t\t\tSystem.out.println(\"Enemy is Dead!!\");\r\n\t\t\t}\r\n\t\t\telse if(calculateHitDamage < armour) {\r\n\t\t\t\tarmour = armour - calculateHitDamage;\r\n\t\t\t\tSystem.out.println(\"Enemy not detroyed!! \\n\");\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"Current Enemy life: \"+ armour);\r\n\t\t}\r\n\t}",
"public abstract int doDamage(int time, GenericMovableUnit unit, Unit target);",
"protected void onImpact(RayTraceResult result) {\n\t\tif (result.entityHit != null) {\n\t\t\tfloat i = 2.5F;\n\n\t\t\tif (result.entityHit instanceof EntityBlizzard) {\n\t\t\t\ti = 0;\n\t\t\t}\n\n result.entityHit.attackEntityFrom(WorldsRetold.HAIL, i);\n\n\t\t\tif (result.entityHit instanceof EntityLivingBase) {\n\t\t\t\tEntityLivingBase target = (EntityLivingBase) result.entityHit;\n\t\t\t\tif (!this.world.isRemote) {\n\t\t\t\t\ttarget.addPotionEffect(new PotionEffect(HailstormPotions.FREEZING, 100, 0));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (!this.world.isRemote) {\n\t\t\tthis.world.setEntityState(this, (byte) 3);\n\t\t\tthis.setDead();\n\t\t}\n\t}",
"void evadeAttack(IUnit attacker, int incomingDamage);",
"public abstract void attack(Game g);",
"@Override\n public void interact(Object obj) {\n // TODO: Cave Code - Add additional Agility to the player while on this Tile\n }",
"private static void attack(RobotInfo target) throws GameActionException {\n if (SOLDIER_DEBUG) {\n System.out.println(\"attacking\");\n }\n BulletInfo[] bullets = rc.senseNearbyBullets(EvasiveSoldier.BULLET_DETECT_RADIUS);\n RobotInfo[] robots = rc.senseNearbyRobots(EvasiveSoldier.ENEMY_DETECT_RADIUS);\n MapLocation targetLocation = target.getLocation();\n move(bullets, robots, targetLocation);\n //RobotUtils.tryMoveDestination(targetLocation);\n if (TargetingUtils.clearShot(here, target) || (rc.getType() == RobotType.GARDENER && rc.getOpponentVictoryPoints() > 10)) {\n if (SOLDIER_DEBUG) {\n System.out.println(\"clearShot to target\");\n }\n Direction towardsEnemy = here.directionTo(targetLocation);\n float distanceEnemy = here.distanceTo(targetLocation);\n if (distanceEnemy <= 3.5 && rc.canFirePentadShot() && rc.getTeamBullets() > 200) {\n rc.firePentadShot(towardsEnemy);\n }\n else {\n if (rc.canFireTriadShot() && rc.getTeamBullets() > 50) {\n rc.fireTriadShot(towardsEnemy);\n }\n else if (rc.canFireSingleShot()) {\n rc.fireSingleShot(towardsEnemy);\n }\n }\n }\n }",
"void hit(GameObject o){\r\n\t\tif (!shield){ // if sheild is on all hits do nothing\r\n\t\t\tif (!(o instanceof UpPower)){ // if didnt hit a power up the ship loses a life\r\n\t\t\t\tif (lives > 1) {\r\n\t\t\t\t\tlives--;\r\n\t\t\t\t\treset();\r\n\t\t\t\t}\r\n\t\t\t\telse { // once there is no life left the ship dies\r\n\t\t\t\t\tdead = true;\r\n\t\t\t\t\tlives--;\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t}",
"@Override\n\t\t\tpublic void hit(DamageEvent e) {\n\t\t\t\tonHit(e.dmged, e.item);\n\t\t\t}",
"public void battleAllyAttack() {\n if(battleAlly instanceof Character){\n battleTickStatuses();\n updateBattleSides();\n }\n\n // battleAlly now attacks targetEnemy or preference based on the type of battleAlly\n if(battleAlly != null){ // If all allies have attacked, they cannot attack anymore for this round\n MovingEntity target = battleAlly.getAttackPreference(targetEnemies);\n // if not picky, get preference is the default next target\n if(target == null) {\n target = targetEnemy;\n }\n battleAlly.attack(target, targetAllies, targetEnemies);\n //System.out.println(battleAlly.getID() + \" is attacking \" + target.getID() + \" remaining hp: \" + target.getCurrHP());\n if (updateTarget(target) == false) {\n // if target still alive, check if its still unfriendly\n targetEnemy = checkSideSwap(targetEnemy, true, battleAllies, targetAllies, battleEnemies, targetEnemies);\n }\n battleAlly = nextAttacker(battleAlly, battleAllies);\n\n }\n }",
"@Override\r\n\tpublic void ArrowHit(Player arg0, Entity arg1) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void ArrowHit(Player arg0, Entity arg1) {\n\t\t\r\n\t}",
"public void hit() {\n if (explodeTime == 0) {\n if (isExplosive) {\n region = explodeAnimation.getKeyFrame(explodeTime, false);\n explodeTime += Gdx.graphics.getDeltaTime();\n width = region.getRegionWidth();\n height = region.getRegionHeight();\n position.sub(width / 2, height / 2);\n direction = new Vector2(1, 0);\n explosionSound.play();\n } else {\n impactSound.play();\n active = false;\n }\n }\n }",
"@Override\n\tpublic void heal() {\n\t\tboolean canHeal;\n\t\tint healPoints;\n\n\t\tcanHeal = (Math.random() <= chanceToHeal) && (hitPoints > 0);\n\n\t\tif (canHeal) {\n\t\t\thealPoints = (int) (Math.random() * (maxHeal - minHeal + 1)) + minHeal;\n\t\t\taddHitPoints(healPoints);\n\t\t\tSystem.out.println(name + \" healed itself for \" + healPoints + \" points.\\n\"\n\t\t\t\t\t+ \"Total hit points remaining are: \" + hitPoints);\n\t\t\tSystem.out.println();\n\t\t} // end can heal\n\n\t}",
"@Override\n\t\t\tpublic void attack(Base enemy) {\n\t\t\t}",
"public boolean attack(Combatant target) {\r\n for (int i = 0; i < numAttacks; i++) {\r\n int attackRoll = this.basicAttackToHit();\r\n\r\n if (attackRoll == (20 + toHit)) { //Critical case, double number of damage dice\r\n target.setCurrentHitPoints(target.getHitPoints() - (this.basicAttackDamage() + damageDice.roll()));\r\n } else if (attackRoll == 1 + toHit) { //Natural 1 case, auto miss\r\n continue;\r\n } else if (attackRoll > target.getAC()) { //Regular hit case\r\n target.setCurrentHitPoints(target.getHitPoints() - this.basicAttackDamage());\r\n } else { //Miss case\r\n continue;\r\n }\r\n\r\n if (target.getHitPoints() <= 0) {\r\n this.win();\r\n return true;\r\n }\r\n }\r\n return false;\r\n }",
"public boolean isOverhit()\n\t{\n\t\treturn overhit;\n\t}",
"public boolean wasHit() {\n return(_hit);\n }",
"@Override\r\n\tboolean shootAt(int row, int column) {\r\n\t\t\r\n\t\t\tthis.getHit()[0]=true;\r\n\t\t\treturn false;\r\n\t\t\t\r\n\t}",
"@Override\n\t\t\tpublic void shotHere(boolean wasHit, int shipMod, Coordinate c) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void shotHere(boolean wasHit, int shipMod, Coordinate c) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void shotHere(boolean wasHit, int shipMod, Coordinate c) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tpublic String performAttack(Entity target)\n\t{\n\t if(Math.random() <= this.accuracy)\n\t {\n\t\t Random rand = new Random(); \n\t Attack atk = new Attack();\n\t atk.addDamage(new Damage(20+rand.nextInt(6), true, \"bludgeon\"));\n\t atk.addDamage(new Damage(5+rand.nextInt(6), true, \"slash\"));\n\t atk.applyPower(this.power);\n\n\t return target.takeDamage(atk);\n\t }\n\t else\n\t {\n\t\t return (\"The attack failed!\");\n\n\t }\n\t}",
"public interface Hittable extends VisitableGameElement {\n /**\n * Defines that an object have been hit.\n * Implementations should consider the events that a hit to an object can trigger.\n *\n * @return the score the player obtained hitting the object\n */\n int hit();\n\n /**\n * Defines that a hittable object has to have a score when it is hit.\n *\n * @return the current score of the object when hit\n */\n int getScore();\n\n /**\n * Gives the object the capacity to remember if it's been hit at some point, for testing purposes.\n *\n * @author Diego Ortego Prieto\n *\n * @return true only if the hittable has been hit before.\n */\n boolean wasHit();\n}",
"float shouldEatOffTheGround(IGeneticMob geneticMob, EntityItem itemEntity);",
"@Override\n\tpublic boolean performsAttackAnimation() {\n\t\tif (phase == AbyssalSirePhase.MAGIC_COMBAT && attack == AbyssalSireAttack.POISON) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"public void makeRangedAttack(int goalx, int goaly, ParentWeapon weapon) {\n int startx = xposition;\n int starty = yposition;\n \n //Initialize algorithm variables\n int x0 = startx;\n int y0 = starty;\n int x1 = goalx;\n int y1 = goaly;\n \n //Initialize object to hold what we hit\n ParentGameObject object = null;\n \n //Create list to store points on line\n List<int[]> points = new ArrayList<>();\n \n //Line generation via Bresenham's complete line algorithm\n int dx = Math.abs(x1 - x0);\n int sx = x0 < x1 ? 1 : -1;\n int dy = -Math.abs(y1 - y0);\n int sy = y0 < y1 ? 1 : -1;\n int err = dx + dy;\n \n while (true){\n points.add(new int[]{x0,y0});\n if (x0 == x1 && y0 == y1){\n break;\n }\n int e2 = 2*err;\n if (e2 >= dy){\n err += dy;\n x0 += sx;\n }\n if (e2 <= dx){\n err += dx;\n y0 += sy;\n }\n }\n\n //Check each point in line for solid object\n for (int[] i : points){\n \n if (!((i[0] == x1 && i[1] == y1) || (i[0] == startx && i[1] == starty))){\n \n //Check if square isn't null\n if (gameboard.getTile(i[0], i[1]) != null){\n \n //Check if a solid object is occupying the square\n for (Object o : gameboard.getObjectsAtSquare(i[0], i[1])) {\n \n if (((ParentGameObject)o).isSolid == true) {\n\n object = (ParentGameObject) o;\n \n break;\n \n }\n \n }\n \n }\n \n }\n \n }\n\n //If we did not hit any object, exit\n if (object == null) {\n\n return;\n\n }\n\n //Perform contextual behavior based on object in square\n switch (object.getType()){\n\n case \"enemy\":\n\n ParentEntity entity = (ParentEntity)object;\n\n entity.takeDamage(this, weapon.getDamage(), weapon.getAccuracy(statDexterity));\n\n break;\n\n\n }\n \n }",
"@Override\n\tprotected void onImpact(MovingObjectPosition mop)\n\t{\n\t\tif (mop.entityHit != null && !this.fake.cantDamage(mop.entityHit))\n\t\t\tmop.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 22);\n\n\t\tif (!this.worldObj.isRemote)\n\t\t{\n\t\t\t// TODO gamerforEA use ExplosionByPlayer\n\t\t\tExplosionByPlayer.createExplosion(this.fake.get(), this.worldObj, this, this.posX, this.posY, this.posZ, 2, false);\n\n\t\t\tthis.setDead();\n\t\t}\n\t}",
"public boolean attackAlly(Ally target) {\n\t\tLog.d(TAG, \"Attacking!\");\n\t\tif (target.takeDamage(damage)) {\n\t\t\treturn true;\n\t\t} else\n\t\t\treturn false;\n\t}",
"public void heal(){\n\t\thp += potion.getHpBoost();\n\t\tif(hp > max_hp)hp = max_hp;\n\t}",
"void defendAttack(IUnit attacker, int incomingDamage);",
"public boolean shouldHit() {\r\n\t\tif(getHandVal() < 17) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false; \r\n\t}",
"public boolean getHit() {\r\n\t\treturn hit;\r\n\t}",
"@Override\n public int damage() {\n int newDamage=criticalStrike();\n return newDamage;\n }",
"public void damage(int damageTaken) {\n //TODO: Create specific damage methods instead of damage calls everywhere(see damagedByBullet())\n if (!invincible) {\n this.hp -= damageTaken;\n }\n }",
"public void battleEnemyAttack() {\n if(battleEnemy != null){ // If all enemies have attacked, they cannot attack anymore for this round\n\n MovingEntity target = battleEnemy.getAttackPreference(targetAllies);\n if(target == null){\n target = targetAlly;\n }\n\n battleEnemy.attack(target, targetEnemies, targetAllies);\n //System.out.println(battleEnemy.getID() + \" is attacking \" + target.getID() + \" remaining hp: \" + target.getCurrHP());\n if (updateTarget(target) == false) {\n // if target still alive, check if its still friendly incase of zombify\n targetAlly = checkSideSwap(targetAlly, false, battleEnemies, targetEnemies, battleAllies, targetAllies);\n }\n\n battleEnemy = nextAttacker(battleEnemy, battleEnemies);\n\n }\n }",
"public void shootGun() {\n\t\tammo--;\n\t}",
"public void attack() {\n if (activeWeapon == null) {\n return;\n }\n attacking = true;\n }",
"public void attack(Entity entity, boolean aoe) {\n if(aoe) entity.damaged((int) (this.damage*0.6));\n else entity.damaged(this.damage);\n if(entity.isDead()){\n incExp(entity.getLevel()*9);\n if(entity instanceof Boss) {\n this.bossesDefeated++;\n }\n }\n }",
"public boolean onActivated(EntityPlayer player, QRayTraceResult hit, ItemStack item);",
"public int giveDamage();",
"public void doAi(){\n\t\t\tif(MathHelper.getRandom(0, Game.FRAMERATE * 5) == 5){\n\t\t\t\tsetScared(true);\n\t\t\t}\n\t\t\n\t\t//Update rectangle\n\t\tsetRectangle(getX(), getY(), getTexture().getWidth(), getTexture().getHeight());\n\t\t\n\t\trect = new Rectangle(getDestinationX(), getDestinationY(), 10, 10);\n\t\t\n\t\tif(rect.intersects(getRectangle())){\n\t\t\t\n\t\t\tif(StateManager.getState() == StateManager.STATE_BOSSTWO){\n\t\t\t\t\n\t\t\t\t\tsetDestinationX(StateGame.player.getX());\n\t\t\t\t\t\n\t\t\t\t\tsetDestinationY(StateGame.player.getY());\n\t\t\t\t\t\n\t\t\t\t\trect = new Rectangle(getDestinationX(), getDestinationY(), 10, 10);\n\t\t\t\t\treachedDestination = (true);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Check for collision with jelly\n\t\tint checkedJelly = (0);\n\t\twhile(checkedJelly < EntityJelly.JELLY.size() && EntityJelly.JELLY.get(checkedJelly) != null){\n\t\t\tif(EntityJelly.JELLY.get(checkedJelly).getDead() == false){\n\t\t\t\tif(getRectangle().intersects(EntityJelly.JELLY.get(checkedJelly).getRectangle())){\n\t\t\t\t\tsetHealth(getHealth() - 2);\n\t\t\t\t\tif(MathHelper.getRandom(1, 10) == 10){\n\t\t\t\t\tAnnouncer.addAnnouncement(\"-2\", 60, EntityJelly.JELLY.get(checkedJelly).getX(), EntityJelly.JELLY.get(checkedJelly).getY());\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t\tcheckedJelly++;\n\t\t}\n\t\t\n\t\t//If we're out of health, kill the entity\n\t\tif(getHealth() < 0){\n\t\t\tsetDead(true);\n\t\t}\n\t\t\n\t\tif(StateManager.getState() == StateManager.STATE_BOSSTWO){\n\t\t\tif(reachedDestination == true){\n\t\t\t\tif(getScared() == false){\n\t\t\t\tsetY(getY() + getSpeed());\n\t\t\t\t}else{\n\t\t\t\t\tsetY(getY() - getSpeed() * 3);\n\t\t\t\t\tsetX(getX() - getSpeed() * 3);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tif(getScared() == false){\n\t\t\t\tif(getX() < getDestinationX())\n\t\t\t\t\tsetX(getX() + getSpeed());\n\t\t\t\tif(getX() > getDestinationX())\n\t\t\t\t\tsetX(getX() - getSpeed());\n\t\t\t\tif(getY() < getDestinationY())\n\t\t\t\t\tsetY(getY() + getSpeed());\n\t\t\t\tif(getY() > getDestinationY())\n\t\t\t\t\tsetY(getY() - getSpeed());\n\t\t\t\t}else{\n\t\t\t\t\t\tsetY(getY() - getSpeed() * 3);\n\t\t\t\t\t\tsetX(getX() - getSpeed() * 3);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"protected boolean attackTargetWith(Weapon weapon) {\r\n\t\tint cth = getChanceToHit(character, target, weapon);\r\n\t\tint roll = GameState.getRandomGenerator().nextInt(100);\r\n\t\tboolean hit = roll < cth;\r\n\r\n\t\tString weaponName = weapon != null ? weapon.getName() : \"fists\";\r\n\t\t\r\n\t\tLog.logLocalized(\"AttackRoll\", LogType.COMBAT, character.getName(), cth, target.getName(),weaponName, roll,hit? Strings.getString(CombatManager.STRING_TABLE, \"hit\") : Strings.getString(CombatManager.STRING_TABLE, \"miss\"));\r\n\t\t\r\n\t\tif (hit) {\r\n\t\t\t// ((Weapon Damage + Weapon Bonus + Weapon Skill) / 100) * Enemy Armor Rating\r\n\t\t\tfloat damage = calculateDamage(weapon, character, target);\r\n\t\t\t\r\n\t\t\tLog.logLocalized(\"attackHit\",LogType.COMBAT, character.getName(), target.getName(), MathUtil.toUIString(damage),weaponName);\r\n\t\t\t\r\n\t\t\ttarget.dealDamage(damage, character);\r\n\t\t\tif (weapon != null) {\r\n\t\t\t\tweapon.executeEffects(character, target);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\ttarget.onAttack(character);\r\n\t\t}\r\n\t\tif (++attackedWeaponCount >= attackingWeapons.size) {\r\n\t\t\tattackFinished = true;\r\n\t\t}\r\n\t\treturn hit;\r\n\t}",
"@Override\n\tpublic void OnAttackCommand() {\n\t\tsuper.OnAttackCommand();\n\t\tSoundManage.playSound(atkSound1);\n\t}",
"public void takeDamage(int dmg){ \r\n\t\tif(hitPoints - dmg >= 0){\r\n\t\t\tSystem.out.print(this.getName() + \" took \" + dmg + \" damage! \\n\");\r\n\t\t\tSystem.out.print(this.name + \"'s Hit Points: \" + hitPoints + \" ---> \" + (hitPoints-dmg) + \"\\n\");\r\n\t\t\thitPoints -= dmg;\r\n\r\n\t\t}\r\n\t\telse{\r\n\t\t\tSystem.out.print(this.getName() + \" took \" + dmg + \" damage! \\n\");\r\n\t\t\tSystem.out.print(this.name + \"'s Hit Points: \" + hitPoints + \" ---> \" + 0 + \"\\n\");\r\n\t\t\thitPoints = 0;\r\n\t\t}\r\n\t\tif(hitPoints == 0){\r\n\t\t\tthis.isAlive = false;\r\n\t\t\tSystem.out.print(this.name + \" has been incapacitated.\\n\");\r\n\t\t}\r\n\r\n\t}",
"public void drawHit(){\n image(explode[5],posX,posY,10,10);\n }",
"default void onHitPlayer(@NotNull String name, int damage) {}",
"private void enemyAttack() {\n\t\t\n\t\tRandom rand = new Random();\t\n\t\t\n\t\tint roll = rand.nextInt(101);\n\t\t\n\t\tint sroll = rand.nextInt(101);\n\t\t\n\t\tevents.appendText(e.getName() + \" attacks!\\n\");\n\t\t\n\t\tif(roll <= p.getEV()) { // Player evades\n\t\t\t\n\t\t\tevents.appendText(\"You evaded \"+e.getName()+\"\\'s Attack!\\n\");\n\t\t\t\n\t\t}else if(roll > p.getEV()) { // Player is hit and dies if HP is 0 or less\n\t\t\t\n\t\t\tp.setHP(p.getHP() - e.getDMG());\n\t\t\t\n\t\t\tString newHp = p.getHP()+\"/\"+p.getMaxHP();\n\t\t\t\n\t\t\tString effect = e.getSpecial(); // Stats are afflicted\n\t\t\t\n\t\t\tif(sroll < 51){\n\t\t\t\t\n\t\t\tif(effect == \"Bleed\") { // Bleed Special\n\t\t\t\t\n\t\t\t\tp.setHP(p.getHP() - 100);\n\t\t\t\t\n\t\t\t\tevents.appendText(\"You bleed profusely. - 100 HP\\n\");\n\t\t\t\t\n\t\t\t\tnewHp = String.valueOf(p.getHP()+\"/\"+p.getMaxHP());\n\t\t\t}\n\t\t\tif(effect == \"Break\") { // Break Special \n\t\t\t\t\n\t\t\t\tif(p.getEV()-5>0)\n\t\t\t\t\tp.setEV(p.getEV() - 5);\n\t\t\t\telse\n\t\t\t\t\tp.setEV(0);\n\t\t\t\t\n\t\t\t\tevents.appendText(\"You feel a bone break restricting movement. - 5 EV\\n\");\n\t\t\t\t\n\t\t\t\tString newEV = String.valueOf(p.getEV());\n\t\t\t\t\n\t\t\t\tgev.setText(newEV);\n\t\t\t\t\n\t\t\t}\n\t\t\tif(effect == \"Fear\") { // Fear Special \n\t\t\t\t\n\t\t\t\tif(p.getDMG()-40>0)\n\t\t\t\t\tp.setDMG(p.getDMG() - 40);\n\t\t\t\telse\n\t\t\t\t\tp.setDMG(0);\n\t\t\t\t\n\t\t\t\tevents.appendText(\"A crippling fear rattles your resolve. - 40 DMG\\n\");\n\t\t\t\t\n\t\t\t\tString newDMG = String.valueOf(p.getDMG());\n\t\t\t\t\n\t\t\t\tgdmg.setText(newDMG);\n\t\t\t\t\n\t\t\t}\n\t\t\tif(effect == \"Rend\") { // Rend Special \n\t\t\t\t\n\t\t\t\tif(p.getDMG()-30>0)\n\t\t\t\t\tp.setDMG(p.getDMG() - 30);\n\t\t\t\telse\n\t\t\t\t\tp.setDMG(0);\n\t\t\t\t\n\t\t\t\tif(p.getEV()-5>0)\n\t\t\t\t\tp.setEV(p.getEV() - 5);\n\t\t\t\telse\n\t\t\t\t\tp.setEV(0);\n\t\t\t\t\n\t\t\t\tevents.appendText(\"Morthar unleashes a pillar of flame! - 30 DMG and - 5 EV\\n\");\n\t\t\t\t\n\t\t\t\tString newDMG = String.valueOf(p.getDMG());\n\t\t\t\t\n\t\t\t\tString newEV = String.valueOf(p.getEV());\n\t\t\t\t\n\t\t\t\tgdmg.setText(newDMG);\n\t\t\t\t\n\t\t\t\tgev.setText(newEV);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\t\n\t\t\tif(p.getHP() <= 0) {\n\t\t\t\t\n\t\t\t\tp.setDead(true);\n\t\t\t\t\n\t\t\t\tcurrentHp.setText(0+\"/\"+e.getMaxHP());\n\t\t\t\tplayerHPBar.setProgress((double)0);\n\t\t\t}else {\n\t\t\t\t\n\t\t\t\tcurrentHp.setText(newHp);\n\t\t\t\tplayerHPBar.setProgress((double)p.getHP()/p.getMaxHP());\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tif(p.isDead()) { // Game over if player dies\n\t\t\t\n\t\t\ttry {\n\t\t\t\tLoadGO();\n\t\t\t} catch (IOException e1) {\n\t\t\t\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\tcombat = false;\n\t\t}\n\t}",
"public void chase() throws GameActionException {\n\t\tRobotInfo closestEnemy = dc.getClosestEnemy();\n\t\tif (closestEnemy == null) {\n\t\t\tcurrState = RobotState.RUSH;\n\t\t\treturn;\n\t\t}\n\t\t// attack closest enemy\n\t\tmi.setObjective(closestEnemy.location);\n\t\tmi.setChargeMode();\n\t\tmi.attackMove();\n\t\t// send dead enemy archon IDs\n\t\tsendDeadEnemyArchonIDs();\n\t}",
"public void Attack(){\n float randomx = (float)(Math.random()-0.5)*attackRange*GameView.instance.cameraSize/10;\n float randomy = (float)(Math.random()-0.5)*attackRange*GameView.instance.cameraSize/5;\n Vector2 target = GameView.instance.player.aimFor();\n float dx = target.x-creationPoint.x;\n float dy =target.y-creationPoint.y;\n float l= (float)Math.sqrt(dx*dx+dy*dy);\n dx = dx/l-((float)Math.random()-0.5f)/2;\n dy = dy/l-(float)(Math.random())/10;\n ProjectilePool.instance.shootArrow(creationPoint.x, creationPoint.y, 1, dx, dy, 3);\n }",
"int hit();",
"public void setHit(boolean b) {\r\n\t\tthis.hit = b;\r\n\t\t\r\n\t}",
"public Answer shoot(){\n if (this.isOccuped()){\n this.ship.hit();\n if (this.ship.hasBeenSunk()){\n\tthis.hasBeenShot = true;\n return Answer.SUNK;\n }\n else{\n\tthis.hasBeenShot = true;\n return Answer.HIT;\n }\n }\n else{\n this.hasBeenShot = true;\n return Answer.MISSED;\n }\n }",
"boolean willEggHatch(IGeneticMob geneticMob);",
"@Override\n public boolean strikeFirst(Battle b, ActivePokemon striker) {\n return RandomUtils.chanceTest(20);\n }",
"void doGun() {\r\n\t\tlong time = getTime()\r\n\t\t\t\t+ (int) Math\r\n\t\t\t\t\t\t.round((getRange(getX(), getY(), target.x, target.y) / (20 - (3 * firePower))));\r\n\t\tPoint2D.Double p = target.guessPosition(time);\r\n\r\n\t\t// offsets the gun by the angle to the next shot based on linear\r\n\t\t// targeting provided by the enemy class\r\n\t\tdouble gunOffset = getGunHeadingRadians()\r\n\t\t\t\t- (Math.PI / 2 - Math.atan2(p.y - getY(), p.x - getX()));\r\n\t\tsetTurnGunLeftRadians(normaliseBearing(gunOffset));\r\n\t}"
] | [
"0.749741",
"0.6768815",
"0.6624469",
"0.64954394",
"0.64746946",
"0.6432647",
"0.6313851",
"0.6288893",
"0.6263491",
"0.6259145",
"0.6171664",
"0.61462003",
"0.6104907",
"0.61030376",
"0.6045125",
"0.5997147",
"0.59819573",
"0.59786975",
"0.5972618",
"0.59584165",
"0.59432876",
"0.59423035",
"0.59059215",
"0.58791745",
"0.58780974",
"0.58750683",
"0.58750683",
"0.5860536",
"0.58468354",
"0.58289146",
"0.57945776",
"0.57923186",
"0.5790068",
"0.57716596",
"0.57716596",
"0.5759311",
"0.5751699",
"0.5751237",
"0.57473814",
"0.5745283",
"0.57420665",
"0.5740016",
"0.5735217",
"0.5728544",
"0.57202494",
"0.57201594",
"0.5700373",
"0.5699879",
"0.56952405",
"0.5688154",
"0.5687002",
"0.56842995",
"0.5683508",
"0.5660633",
"0.56584877",
"0.56584877",
"0.5654483",
"0.5654077",
"0.56536096",
"0.5639663",
"0.5639402",
"0.56385547",
"0.5637924",
"0.56293243",
"0.56293243",
"0.56293243",
"0.56227654",
"0.5621026",
"0.5619057",
"0.5617956",
"0.5615713",
"0.5614802",
"0.5606033",
"0.5603812",
"0.5600387",
"0.5592724",
"0.55901057",
"0.558735",
"0.5586763",
"0.5586196",
"0.5578905",
"0.55734766",
"0.5562711",
"0.556132",
"0.5541045",
"0.55399144",
"0.55396307",
"0.5535098",
"0.5521582",
"0.5517423",
"0.5506607",
"0.5504031",
"0.5500719",
"0.5495726",
"0.54917157",
"0.54848",
"0.5484419",
"0.54840106",
"0.5474458",
"0.5474059"
] | 0.80859953 | 0 |
shouldAggroOnHit The chance (where 1.0F = 100%) that this mob would be aggroed if struck by this entity Should NOT trigger the aggro itself! That should only occur when actually hit! | float shouldAggroOnHit(IGeneticMob geneticMob, EntityLiving attacker); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface IHitAggro {\n /**\n * shouldAggroOnHit\n * The chance (where 1.0F = 100%) that this mob would be aggroed if struck by this entity\n * Should NOT trigger the aggro itself! That should only occur when actually hit!\n * @param geneticMob the mob being checked\n * @param attacker the entity that could attack\n * @return the chance of aggro (1.0F = 100%, 0.0F = 0%)\n */\n float shouldAggroOnHit(IGeneticMob geneticMob, EntityLiving attacker);\n\n /**\n * aggroHitTimer\n * How long this mob would stay angry at this attacker if aggroed via hit\n * @param geneticMob the mob being checked\n * @param attacker the entity that could attack\n * @return the length, in ticks, of the timer\n */\n int aggroHitTimer(IGeneticMob geneticMob, EntityLiving attacker);\n }",
"boolean shouldAutoAggro(IGeneticMob geneticMob, EntityLiving otherEntity);",
"float shouldEatOffTheGround(IGeneticMob geneticMob, EntityItem itemEntity);",
"public boolean shouldHit() {\r\n\t\tif(getHandVal() < 17) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false; \r\n\t}",
"public boolean isHit() { return hit; }",
"boolean hasDamage();",
"boolean hasDamage();",
"boolean hasDamage();",
"boolean hasDamage();",
"boolean hasDamage();",
"@Override\n\tpublic boolean shouldExecute() {\n\t\tif (!theEntity.isTamed())\n\t\t\treturn false;\n\t\telse if (theEntity.isInWater())\n\t\t\treturn false;\n\t\telse if (!theEntity.onGround)\n\t\t\treturn false;\n\t\telse {\n\t\t\tfinal EntityLivingBase var1 = theEntity.getOwner();\n\t\t\treturn var1 == null ? true\n\t\t\t\t\t: theEntity.getDistanceSqToEntity(var1) < 144.0D\n\t\t\t\t\t\t\t&& var1.getAITarget() != null ? false : isSitting;\n\t\t}\n\t}",
"int aggroHitTimer(IGeneticMob geneticMob, EntityLiving attacker);",
"public boolean shouldExecute() {\n return ShulkerEntity.this.getAttackTarget() == null && ShulkerEntity.this.rand.nextInt(40) == 0;\n }",
"@Override\n\t\tpublic void hit(Npc attacker, Mob defender, Hit hit) {\n\t\t}",
"public boolean isOverhit()\n\t{\n\t\treturn overhit;\n\t}",
"boolean willEggHatch(IGeneticMob geneticMob);",
"public boolean isFireDamage();",
"@Override\n\tpublic void onDamage(WorldObj obj, Items item) {\n\n\t\tif(is_stunned) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tint dmg = (int) item.type.ATK;\n\t\t\n\t\tOnScreenText.AddText(\"\"+dmg, bounds.x , bounds.y + 1.1f);\n\t\t\n\t\tvelX = obj.direction * 5;\n\t\tvelY = 5;\n\t\tgrounded = false;\n\t\t\n\t\tHP -= dmg;\n\t\t\n\n\t\tstun_counter = 0;\n\t\t\n\t\tif(HP <= 0 && !isDead) {\n\t\t\tonDeath();\n\t\t}\n\t\t\n\t}",
"public boolean canHit() {\n\t\treturn this.hand.countValue().first() < 17;\n\t}",
"public boolean handleAttack(Action action) {\n ActorState a = action.getActor();\n if (a.getActor() == actor) {\n // Attacks on oneself always succeed, and we don't want to add ourselves as an enemy\n return true;\n }\n \n //maybeCounter(Augmentation.Type.ATTACK, a, combatants);\n enemies.add(a);\n \n double weaponAccuracy = 1.0; //source.getWeaponAccuracy(action);\n double chance = a.getAccuracy() * weaponAccuracy * (1.0 - getDefense());\n boolean success = Math.random() < chance;\n return success;\n }",
"public boolean attack(Combatant target) {\r\n for (int i = 0; i < numAttacks; i++) {\r\n int attackRoll = this.basicAttackToHit();\r\n\r\n if (attackRoll == (20 + toHit)) { //Critical case, double number of damage dice\r\n target.setCurrentHitPoints(target.getHitPoints() - (this.basicAttackDamage() + damageDice.roll()));\r\n } else if (attackRoll == 1 + toHit) { //Natural 1 case, auto miss\r\n continue;\r\n } else if (attackRoll > target.getAC()) { //Regular hit case\r\n target.setCurrentHitPoints(target.getHitPoints() - this.basicAttackDamage());\r\n } else { //Miss case\r\n continue;\r\n }\r\n\r\n if (target.getHitPoints() <= 0) {\r\n this.win();\r\n return true;\r\n }\r\n }\r\n return false;\r\n }",
"boolean takeDamage(int dmg);",
"public boolean canHit(Figure entity) {\n return true;\n }",
"public boolean onImpact(EntityDamageByEntityEvent evt) {\r\n onImpact();\r\n return true;\r\n }",
"@Override\n\tpublic void heal() {\n\t\tboolean canHeal;\n\t\tint healPoints;\n\n\t\tcanHeal = (Math.random() <= chanceToHeal) && (hitPoints > 0);\n\n\t\tif (canHeal) {\n\t\t\thealPoints = (int) (Math.random() * (maxHeal - minHeal + 1)) + minHeal;\n\t\t\taddHitPoints(healPoints);\n\t\t\tSystem.out.println(name + \" healed itself for \" + healPoints + \" points.\\n\"\n\t\t\t\t\t+ \"Total hit points remaining are: \" + hitPoints);\n\t\t\tSystem.out.println();\n\t\t} // end can heal\n\n\t}",
"@Override\r\n public void hitEvent(Block beingHit, Ball hitter) {\n this.currentScore.increase(5);\r\n if (beingHit.getHitPoints() == 1) {\r\n this.currentScore.increase(10);\r\n }\r\n }",
"public void Hit()\n {\n this.numLives--;\n //Oscillate visible and not if the number of lives is greater than zero\n if(this.numLives > 0)\n {\n this.damaged = true;\n this.Blink(1);\n\n }\n }",
"void hit(GameObject o){\r\n\t\tif (!shield){ // if sheild is on all hits do nothing\r\n\t\t\tif (!(o instanceof UpPower)){ // if didnt hit a power up the ship loses a life\r\n\t\t\t\tif (lives > 1) {\r\n\t\t\t\t\tlives--;\r\n\t\t\t\t\treset();\r\n\t\t\t\t}\r\n\t\t\t\telse { // once there is no life left the ship dies\r\n\t\t\t\t\tdead = true;\r\n\t\t\t\t\tlives--;\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t}",
"public boolean shouldExecute()\n {\n return !super.shouldExecute() ? false : (!this.theEntity.worldObj.getGameRules().getGameRuleBooleanValue(\"mobGriefing\") ? false : !this.field_151504_e.func_150015_f(this.theEntity.worldObj, this.entityPosX, this.entityPosY, this.entityPosZ));\n }",
"public boolean wasHit() {\n return(_hit);\n }",
"@Override\n public void hit(int atk) {\n hp = hp - atk;\n }",
"public boolean hit() {\r\n add(deck.deal());\r\n return getHandValue() <= 21;\r\n }",
"@Test\n\tpublic void TestCalculateDamage() \n\t{\n\t\tWeapon gun = new Gun();\n\t\t// 0<=distance between the range<=30\n\t\tgun.calculateDamage(10);\n\t\tassertEquals(15,gun.getDamage());\n\t\tassertEquals(3,((Gun) gun).gettRateofFire(),.1);\n\t\tassertEquals(39,((Gun) gun).getActualAmmo(),.1);\n\t\t//distance out of the range\n\t\tgun.calculateDamage(50);\n\t\tassertEquals(15,gun.getDamage());\n\t\tassertEquals(2,((Gun) gun).gettRateofFire(),.1);\n\t\tassertEquals(38,((Gun) gun).getActualAmmo(),.1);\n\t\t //reload when actual ammo is 0\n\t\t((Gun) gun).setActualAmmo(0);\n\t ((Gun) gun).reload();\n\t\tassertEquals(40,((Gun) gun).getActualAmmo(),.1);\n\t\t\n\t}",
"@Override\n public boolean act() {\n float variation = (random.nextFloat() / 2f) - 1;\n\n // Reconfigure the time to wait before spawning another enemy.\n this.deltaLimit = Math.max(100, INITIAL_SPAWN_TIME + variation - (100 * round));\n\n spawnEnemy();\n return false;\n }",
"@Override\n\t\t\tpublic void hit(DamageEvent e) {\n\t\t\t\tonHit(e.dmged, e.item);\n\t\t\t}",
"protected boolean isAHit( int code )\n\t{\n\treturn true;\n\t}",
"@Override\n\tpublic boolean performsAttackAnimation() {\n\t\tif (phase == AbyssalSirePhase.MAGIC_COMBAT && attack == AbyssalSireAttack.POISON) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"public void OnDamage(AI ai, int aTK, float f) {\n\tif(DamagedTimer < 0.8f)\n\t\treturn;\n\tvel.x = f;\n\tvel.y = 3;\n\tDamagedTimer = 0;\n\tgrounded = false;\n\taTK -= (getDEF()*0.8f);\n\tif(aTK <= 0)\n\t\taTK = 1;\n\tHP -= aTK;\n\tInventory.CurrentInventory.dmgTxts.add(new dmgText(pos.x, pos.y+1, aTK));\n\t\n\tSoundManager.PlaySound(\"playerHurt\",3);\n\t\n\t\n}",
"public void hit(int melee_dmg,int range_dmg) {\n melee_dmg=this.current_atk-30;\n range_dmg=this.current_atk-60;\n }",
"public void weaken(float hit) {\n if (!isInvincible()) {\n hp -= hit;\n invincible = true;\n if (hp < 0) {\n hp = 0;\n }\n\n if(isWeak()){ //Play the death animation\n currentAnimation = deathAnimation;\n }\n }\n }",
"@Override\n\tpublic void processIncommingHit(Hit hit, Entity target) {\n\t\tif (hit.getLook() == HitLook.MELEE_DAMAGE)\n\t\t\tmeleeDamage += hit.getDamage();\n\t\telse if (hit.getLook() == HitLook.RANGE_DAMAGE)\n\t\t\trangeDamage += hit.getDamage();\n\t\tif (hit.getLook() == HitLook.MAGIC_DAMAGE)\n\t\t\tmageDamage += hit.getDamage();\n\t}",
"@Override\n\tpublic boolean shouldExecute() {\n\t\tif (!theEntityTameable.isTamed())\n\t\t\treturn false;\n\t\telse {\n\t\t\tfinal EntityLivingBase var1 = theEntityTameable.getOwner();\n\n\t\t\tif (var1 == null)\n\t\t\t\treturn false;\n\t\t\telse {\n\t\t\t\ttheTarget = var1.getLastAttacker();\n\t\t\t\tfinal int var2 = var1.getLastAttackerTime();\n\t\t\t\treturn var2 != field_142050_e\n\t\t\t\t\t\t&& isSuitableTarget(theTarget, false)\n\t\t\t\t\t\t&& theEntityTameable.func_142018_a(theTarget, var1);\n\t\t\t}\n\t\t}\n\t}",
"public static boolean calcHitMiss(L2Character attacker, L2Character target)\n\t{\n\t\tdouble chance = 800 + 20 * (attacker.getAccuracy() - target.getEvasionRate(attacker));\n\n\t\t//if (attacker instanceof L2PcInstance && target instanceof L2PcInstance)\n\t\t//\tLog.info(\"P: \" + attacker.getAccuracy() + \" \" + target.getEvasionRate(attacker) + \": \" + chance);\n\n\t\t// Get additional bonus from the conditions when you are attacking\n\t\tchance *= hitConditionBonus.getConditionBonus(attacker, target);\n\n\t\tchance = Math.max(chance, 200);\n\t\tchance = Math.min(chance, 980);\n\n\t\tif (attacker instanceof L2PcInstance)\n\t\t{\n\t\t\tfinal L2PcInstance player = (L2PcInstance) attacker;\n\t\t\tif (player.getExpertiseWeaponPenalty() != 0)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn chance < Rnd.get(1000);\n\t}",
"@Override\n\tpublic void onHitted(EntityDamageByEntityEvent e, Player damager, Player victim) {\n\t\t\n\t}",
"public void hitEvent(Block beingHit, Ball hitter) {\r\n this.currentScore.increase(5);\r\n if (beingHit.getHitPoints() == 0) {\r\n this.currentScore.increase(10);\r\n }\r\n }",
"public void takesHit()\n {\n // TODO: replace this line with your code\n }",
"@Override\n\tpublic void didContact(GameEntity entity){\n\t\tif (entity.getClass() == Enemy.class){\n\n\t\t\tentity.receiveDamage(100);\n\t\t\tthis.receiveDamage(10);\n\t\t\tSystem.out.println(\"hit enemy\");\n\t\t}\n\t}",
"public boolean getHit() {\r\n\t\treturn hit;\r\n\t}",
"public void attack(Entity entity, boolean aoe) {\n if(aoe) entity.damaged((int) (this.damage*0.6));\n else entity.damaged(this.damage);\n if(entity.isDead()){\n incExp(entity.getLevel()*9);\n if(entity instanceof Boss) {\n this.bossesDefeated++;\n }\n }\n }",
"public void setHit(boolean b) {\r\n\t\tthis.hit = b;\r\n\t\t\r\n\t}",
"@Override\r\n\tpublic void collisionReaction(GameObject collidedWith)\r\n\t{\r\n\t\tif (\"Enemy\".equals(collidedWith.getName()))\r\n\t\t{\r\n\t\t\trandom = PFRandom.randomRange(0,2);\r\n\t\t\tshakeActivated = true;\r\n\t\t\tcollidedWith.kill();\r\n\t\t\tShipHealth -= PFRandom.randomRange(30,40);\r\n\t\t\tSystem.out.println(\"Health: \" + ShipHealth);\r\n\t\t\tSoundManager.playBackgroundSound(\"Explode\");\r\n\t\t}\r\n\r\n\t\tif (\"StarBurst\".equals(collidedWith.getName()))\r\n\t\t{\r\n\t\t\trandom = PFRandom.randomRange(0,2);\r\n\t\t\tshakeActivated = true;\r\n\t\t\tcollidedWith.kill();\r\n\t\t\tShipHealth -= PFRandom.randomRange(20,40);\r\n\t\t\tSystem.out.println(\"Health: \" + ShipHealth);\r\n\t\t\tSoundManager.playBackgroundSound(\"Explode\");\r\n\t\t}\r\n\t\tif (\"GeneralEnemyBullet\".equals(collidedWith.getName()))\r\n\t\t{\r\n\t\t\trandom = PFRandom.randomRange(0,2);\r\n\t\t\tshakeActivated = true;\r\n\t\t\tcollidedWith.kill();\r\n\t\t\tShipHealth -= PFRandom.randomRange(10,20);\r\n\t\t\tSystem.out.println(\"Health: \" + ShipHealth);\r\n\t\t\tSoundManager.playBackgroundSound(\"Explode\");\r\n\t\t}\r\n\t\tif (\"AimedShot\".equals(collidedWith.getName()))\r\n\t\t{\r\n\t\t\trandom = PFRandom.randomRange(0,2);\r\n\t\t\tshakeActivated = true;\r\n\t\t\tcollidedWith.kill();\r\n\t\t\tShipHealth -= PFRandom.randomRange(1,5);\r\n\t\t\tSystem.out.println(\"Health: \" + ShipHealth);\r\n\t\t\tSoundManager.playBackgroundSound(\"Explode\");\r\n\t\t}\r\n\r\n\r\n\t\tif (\"Asteroid\".equals(collidedWith.getName()))\r\n\t\t{\r\n\t\t\trandom = PFRandom.randomRange(0,2);\r\n\t\t\tshakeActivated = true;\r\n\t\t\tcollidedWith.kill();\r\n\t\t\tShipHealth -= PFRandom.randomRange(20, 45);\r\n\t\t\tSystem.out.println(\"Health: \" + ShipHealth);\r\n\r\n\t\t\t//DESTROYED ASTEROID CODE! NEEDS TO BE REUSED WITH SHOOTING!\r\n\t\t\tVec2 deathSpot = collidedWith.getPosition();\r\n\r\n\r\n\t\t\tint healthdropNum = 0;\r\n\t\t\twhile(healthdropNum <= 4)\r\n\t\t\t{\r\n\t\t\t\thealthdropNum++;\r\n\t\t\t\tGameObject healthDrop = new HealthDrops();\r\n\t\t\t\thealthDrop.setPosition(deathSpot.getX() + getRandomValue(-5, 5), deathSpot.getY() + getRandomValue(-5, 5));\r\n\t\t\t\tObjectManager.addGameObject(healthDrop);\r\n\r\n\t\t\t}\r\n\t\t\tSoundManager.playBackgroundSound(\"Explode\");\r\n\r\n\t\t\tif (ShipHealth <= 30)\r\n\t\t\t{\r\n\t\t\t\tSoundManager.playBackgroundSound(\"LowHealth\");\r\n\t\t\t}\r\n\r\n\r\n\t\t}\r\n\r\n\t\tif (\"HealthDrop\".equals(collidedWith.getName()))\r\n\t\t{\r\n\t\t\tscore = score + 1;\r\n\t\t\tSystem.out.println(\"Score: \"+ score);\r\n\t\t\tif (ShipHealth < 100)\r\n\t\t\t{\r\n\r\n\t\t\t\tShipHealth += 1;\r\n\t\t\t\tSystem.out.println(\"Health: \" + ShipHealth);\r\n\r\n\t\t\t\tif (ShipHealth > 30)\r\n\t\t\t\t{\r\n\t\t\t\t\tSoundManager.stopBackgroundSound(\"LowHealth\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcollidedWith.kill();\r\n\t\t}\r\n\t\tif (\"EnemyHealthDrop\".equals(collidedWith.getName()))\r\n\t\t{\r\n\t\t\tscore = score + 2;\r\n\t\t\tSystem.out.println(\"Score: \"+ score);\r\n\t\t\tif (ShipHealth < 100)\r\n\t\t\t{\r\n\r\n\t\t\t\tShipHealth += 2;\r\n\t\t\t\tSystem.out.println(\"Health: \" + ShipHealth);\r\n\t\t\t\tif (ShipHealth > 30)\r\n\t\t\t\t{\r\n\t\t\t\t\tSoundManager.stopBackgroundSound(\"LowHealth\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcollidedWith.kill();\r\n\t\t}\r\n\t\tif (\"HealthPickup\".equals(collidedWith.getName()))\r\n\t\t{\r\n\r\n\t\t\t//System.out.println(\"Score: \" + score);\r\n\t\t\tcollidedWith.kill();\r\n\t\t\tShipHealth = 100;\r\n\t\t\tSystem.out.println(\"HEALTH RESTORED\");\r\n\t\t\tSoundManager.stopBackgroundSound(\"LowHealth\");\r\n\r\n\t\t}\r\n\t\tif (\"FollowBullet\".equals(collidedWith.getName()))\r\n\t\t{\r\n\t\t\trandom = PFRandom.randomRange(0,2);\r\n\t\t\tshakeActivated = true;\r\n\t\t\tcollidedWith.kill();\r\n\t\t\tShipHealth -= PFRandom.randomRange(10, 30);\r\n\t\t\tSystem.out.println(\"Health: \" + ShipHealth);\r\n\t\t\tSoundManager.playBackgroundSound(\"Explode\");\r\n\t\t\tif (ShipHealth <= 30)\r\n\t\t\t{\r\n\t\t\t\tSoundManager.playBackgroundSound(\"LowHealth\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (\"BossFollower\".equals(collidedWith.getName()))\r\n\t\t{\r\n\t\t\tsetPositionY(165.7f);\r\n\t\t}\r\n\t}",
"private boolean shouldApplyGFTGun(double aimedEnemyDistance, int enemiesCount) {\n double totalIncreasePercentageDistance = enemiesCount * PERCENTAGE_INCREASING_DISTANCE_FOR_EACH_ADDITIONAL_ENEMY;\n boolean result = aimedEnemyDistance <= FURTHEST_DISTANCE_TO_FIRE_ONE_ON_ONE * (1 + totalIncreasePercentageDistance);\n return result;\n }",
"boolean takeDamage(DamageCount damage);",
"public void addDamageHate(final L2Character attacker, final int damage, int aggro)\n\t{\n\t\tif (attacker == null /* || aggroList == null */)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Get the AggroInfo of the attacker L2Character from the aggroList of the L2Attackable\n\t\tAggroInfoHolder ai = getAggroListRP().get(attacker);\n\t\t\n\t\tif (ai == null)\n\t\t{\n\t\t\tai = new AggroInfoHolder(attacker);\n\t\t\tai.init();\n\t\t\tgetAggroListRP().put(attacker, ai);\n\t\t}\n\t\t\n\t\t// If aggro is negative, its comming from SEE_SPELL, buffs use constant 150\n\t\tif (aggro < 0)\n\t\t{\n\t\t\tai.decHate(aggro * 150 / (getLevel() + 7));\n\t\t\taggro = -aggro;\n\t\t}\n\t\t// if damage == 0 -> this is case of adding only to aggro list, dont apply formula on it\n\t\telse if (damage == 0)\n\t\t{\n\t\t\tai.incHate(aggro);\n\t\t\t// else its damage that must be added using constant 100\n\t\t}\n\t\telse\n\t\t{\n\t\t\tai.incHate(aggro * 100 / (getLevel() + 7));\n\t\t}\n\t\t\n\t\t// Add new damage and aggro (=damage) to the AggroInfo object\n\t\tai.incDmg(damage);\n\t\t\n\t\t// Set the intention to the L2Attackable to AI_INTENTION_ACTIVE\n\t\tif (getAI() != null && aggro > 0 && getAI().getIntention() == CtrlIntention.AI_INTENTION_IDLE)\n\t\t{\n\t\t\tgetAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);\n\t\t}\n\t\t\n\t\tai = null;\n\t\t// Notify the L2Attackable AI with EVT_ATTACKED\n\t\tif (damage > 0)\n\t\t{\n\t\t\tif (getAI() != null)\n\t\t\t{\n\t\t\t\tgetAI().notifyEvent(CtrlEvent.EVT_ATTACKED, attacker);\n\t\t\t}\n\t\t\t\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (attacker instanceof L2PcInstance || attacker instanceof L2Summon)\n\t\t\t\t{\n\t\t\t\t\tL2PcInstance player = attacker instanceof L2PcInstance ? (L2PcInstance) attacker : ((L2Summon) attacker).getOwner();\n\t\t\t\t\t\n\t\t\t\t\tfor (final Quest quest : getTemplate().getEventQuests(Quest.QuestEventType.ON_ATTACK))\n\t\t\t\t\t{\n\t\t\t\t\t\tquest.notifyAttack(this, player, damage, attacker instanceof L2Summon);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tplayer = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (final Exception e)\n\t\t\t{\n\t\t\t\tLOGGER.error(\"\", e);\n\t\t\t}\n\t\t}\n\t}",
"@Override\r\n public void hitEvent(Block beingHit, Ball hitter) {\n this.currentScore.increase(5);\r\n // and destroying a block is worth and additional 10 points\r\n if (beingHit.getHitPointsNumber() == 0) {\r\n this.currentScore.increase(10);\r\n }\r\n }",
"int getMinigameDefenseChancesLeft();",
"public void setFoodHit(boolean b) {\n this.foodHit = b;\n }",
"public boolean hitOrStand(){\r\n\t\treturn hitOrStand;\r\n\t}",
"@Override\n public void hit(int damage)\n {\n state.hit(damage, this);\n }",
"public boolean isHit(int value){\n return (value == SHIP);\n }",
"public void hit() {\n if (explodeTime == 0) {\n if (isExplosive) {\n region = explodeAnimation.getKeyFrame(explodeTime, false);\n explodeTime += Gdx.graphics.getDeltaTime();\n width = region.getRegionWidth();\n height = region.getRegionHeight();\n position.sub(width / 2, height / 2);\n direction = new Vector2(1, 0);\n explosionSound.play();\n } else {\n impactSound.play();\n active = false;\n }\n }\n }",
"boolean wasHit();",
"@Override\n public boolean shouldExecute()\n {\n if (!this.mustUpdate)\n {\n if (this.entity.getRNG().nextInt(this.executionChance) != 0)\n {\n return false;\n }\n }\n\n Vec3d vec3d = RandomPositionGenerator.findRandomTarget(this.entity, 10, 7);\n int attempts = 0;\n while (attempts < 10 && entity.getHomePosition().getDistance(vec3d != null ? (int)vec3d.xCoord : (int)entity.posX, vec3d != null ? (int)vec3d.yCoord : (int)entity.posY, vec3d != null ? (int)vec3d.zCoord : (int)entity.posZ) > entity.getMaximumHomeDistance()) {\n vec3d = RandomPositionGenerator.findRandomTarget(this.entity, 12, 8);\n attempts++;\n }\n\n if (vec3d == null || attempts >= 10)\n {\n return false;\n }\n else\n {\n this.xPosition = vec3d.xCoord;\n this.yPosition = vec3d.yCoord;\n this.zPosition = vec3d.zCoord;\n this.mustUpdate = false;\n return true;\n }\n }",
"public void hitEvent(Block beingHit, Ball hitter) {\r\n if (beingHit.getHitPoints() == 0) {\r\n this.currentScore.increase(10);\r\n return;\r\n }\r\n\r\n this.currentScore.increase(5);\r\n }",
"private void checkIfHungry(){\r\n\t\tif (myRC.getEnergonLevel() * 2.5 < myRC.getMaxEnergonLevel()) {\r\n\t\t\tmission = Mission.HUNGRY;\r\n\t\t}\r\n\t}",
"public void Hitting(Monsters opponent) throws Exception {\n\t\tassert (this != opponent);\n\t\tRandom rand = new Random();\n\t\tint hit = rand.nextInt(30);\n\t\tif(hit >= this.getHitpoints()) \n\t\t\thit = this.getHitpoints();\n\t\tif (hit >= opponent.getProtection()) {\n\t\t\tint power;\n\t\t\tif (this.getAnchor(1) == null)\n\t\t\t\tpower = this.getDamage() + (this.getStrength() - 5) / 3;\n\t\t\telse\n\t\t\t\tpower = this.getDamage() + (this.getStrength() - 5) / 3 + ((Weapons)this.getAnchor(1)).getDamage();\n\t\t\topponent.setHitpoints(opponent.getHitpoints() - power);\n\t\t\tSystem.out.println(this.getName() + \" Deals \" + power + \" damage over \" + opponent.getName());\n\t\t}\n\t\telse\n\t\t\tSystem.out.println(this.getName() + \" attack failed!\");\n\t}",
"public void asteroidShot()\n\t{\n\t\t//collision can only occur if at least 1 asteroid\n\t\t//and one missile are currently spawned\n\t\tif(gameObj[0].size() > 0 && gameObj[4].size() > 0)\n\t\t{\n\t\t\tint ast = new Random().nextInt(gameObj[0].size());\n\t\t\tint mis = new Random().nextInt(gameObj[4].size());\n\t\t\tgameObj[0].remove(ast);\n\t\t\tgameObj[4].remove(mis);\n\t\t\tscore += 100;\n\t\t\tSystem.out.println(\"A friendly missile has struck an asteroid! +100 points\");\n\t\t}else\n\t\t\tSystem.out.println(\"An asteroid and a friendly missile are not spawned\");\n\t}",
"public int CriticalHit(int start)\r\n {\r\n damage = ((int)(Math.random() * 100) % 50 + 80);\r\n int hp = start - damage;\r\n \r\n //modified to turn hp to 0 once it drops below or equals 0.\r\n if(hp <= 0)\r\n hp = 0;\r\n return hp;\r\n }",
"public synchronized boolean HaveWon() {\n if (maxScore <= score) {\n return true;\n }\n return false;\n }",
"boolean canLayEgg(IGeneticMob geneticMob);",
"@Override\n protected void doCheckEffect ()\n {\n List<LivingEntity> entities = getLivingEntities(1.5);\n if (entities.size() > 0)\n {\n for (LivingEntity entity : entities)\n {\n if (entity.getUniqueId() == player.getUniqueId())\n continue;\n\n entity.damage(usesModifier * 2, player);\n\n kill();\n return;\n }\n }\n\n // if the spell has hit a solid block, the projectile is stopped and wont go further so kill the spell\n if (hasHitTarget())\n kill();\n }",
"public void roam(){\r\n Random rand = new Random();\r\n String aniName = this.getName();\r\n String aniType = this.getAniType();\r\n //Chance will be a number between 1 and 100\r\n int chance = rand.nextInt(100) + 1;\r\n //25% chance that the pachyderm will charge\r\n if (chance <= 25){\r\n System.out.println(aniName + \" the \" + aniType + \" charges.\");\r\n }\r\n //75% chance the method works as originally intended.\r\n else{\r\n System.out.println(aniName + \" the \" + aniType + \" roams.\");\r\n }\r\n }",
"public abstract boolean isHit(int x, int y);",
"public boolean successfulHit(CreatureAttack attack, Creature attacked){\r\n return attack.attacker.attributes.health.accuracy.next() >= attacked.attributes.health.evasion.next();\r\n }",
"static boolean getMauled(){\n\t\t\tif (Person.player.inventory.contains(Item.repellent)) //if you have the goose repellent...\n\t\t\t\treturn (MainFile.getRandomNumber(240) == 12); //drastically lowers your chance of being mauled.\n\t\t\treturn (MainFile.getRandomNumber(20) == 12);//generates a random number for if you don't have it, and if it's 12 you get mauled\n\t\t}",
"@Override\n protected boolean preUseCheck(Event event, ItemStack item) {\n return event instanceof EntityShootBowEvent && new Random().nextDouble()<level/20 && ((EntityShootBowEvent)event).getEntity().hasPermission(\"rayken.unsafe\");\n }",
"public void goAdventuring() {\n\n game.createRandomMonster(4);\n if(RandomClass.getRandomTenPercent() == 5) {\n System.out.println(\"Your are walking down the road... Everything looks peaceful and calm.. Hit enter to continue!\");\n sc.nextLine();\n\n } else {\n game.battle();\n p.checkXp();\n }\n }",
"@Override\r\n public void onHit(int damage){\n if(box2body != null){\r\n hp -= damage;\r\n screen.getGameManager().get(\"Sounds/orc-34-hit.wav\", Sound.class).play();\r\n if(this.hp <= 0) {\r\n screen.bodiesToDelete.add(box2body);\r\n deleteFlag = true;\r\n screen.spawnedCreatures.remove(this);\r\n screen.getGameManager().get(\"Sounds/orc-32-death.wav\", Sound.class).play();\r\n\r\n //Award Experience\r\n screen.getPlayer().awardExperience(this.experienceValue);\r\n screen.getPlayer().increaseKillCount();\r\n }\r\n }\r\n //Attack player when damaged\r\n //Prevents player from sniping monsters using Wander AI\r\n if(currentState != State.ATTACKING){\r\n Vector2 orcPosition = new Vector2(box2body.getPosition().x, box2body.getPosition().y);\r\n Vector2 playerPosition = new Vector2(screen.getPlayer().box2body.getPosition().x, screen.getPlayer().box2body.getPosition().y);\r\n\r\n currentState = State.HASBEENATTACKED;\r\n velocity = new Vector2(playerPosition.x - orcPosition.x, playerPosition.y - orcPosition.y);\r\n box2body.setLinearVelocity(velocity.scl(speed));\r\n }\r\n }",
"public void hit() throws CellPlayedException{\r\n if(!hit){\r\n this.hit = true;\r\n if(ship != null){\r\n ship.hit();\r\n }\r\n }else{\r\n throw new CellPlayedException(row, column);\r\n }\r\n }",
"@Override\n public void onEntityUpdate() {\n if (!(world.provider instanceof WorldProviderLimbo || world.provider instanceof WorldProviderDungeonPocket)) {\n setDead();\n super.onEntityUpdate();\n return;\n }\n\n super.onEntityUpdate();\n\n // Check for players and update aggro levels even if there are no players in range\n EntityPlayer player = world.getClosestPlayerToEntity(this, MAX_AGGRO_RANGE);\n boolean visibility = player != null && player.canEntityBeSeen(this);\n updateAggroLevel(player, visibility);\n\n // Change orientation and face a player if one is in range\n if (player != null) {\n facePlayer(player);\n if (!world.isRemote && isDangerous()) {\n // Play sounds on the server side, if the player isn't in Limbo.\n // Limbo is excluded to avoid drowning out its background music.\n // Also, since it's a large open area with many Monoliths, some\n // of the sounds that would usually play for a moment would\n // keep playing constantly and would get very annoying.\n playSounds(player.getPosition());\n }\n\n if (visibility) {\n // Only spawn particles on the client side and outside Limbo\n if (world.isRemote && isDangerous()) {\n spawnParticles(player);\n }\n\n // Teleport the target player if various conditions are met\n if (aggro >= MAX_AGGRO && !world.isRemote && ModConfig.monoliths.monolithTeleportation && !player.isCreative() && isDangerous()) {\n aggro = 0;\n Location destination = WorldProviderLimbo.getLimboSkySpawn(player);\n TeleportUtils.teleport(player, destination, 0, 0);\n player.world.playSound(null, player.getPosition(), ModSounds.CRACK, SoundCategory.HOSTILE, 13, 1);\n }\n }\n }\n }",
"public boolean hit(Bullet bullet) {\n //System.out.println(\"A golyo nem csapodott meg be semmibe.\");\n return false;\n }",
"void hitEvent(Block beingHit, Ball hitter);",
"void hitEvent(Block beingHit, Ball hitter);",
"int maxHit(Player player, Entity target);",
"public boolean hit()\n\t{\n\t\taddCardToHand(new BlackJackCard());\n\t\treturn getHandValue() <= 21;\n\t}",
"boolean isGameOver() {\n\t\treturn Hit;\n\t}",
"public static boolean calcMagicAffected(L2Character actor, L2Character target, L2Skill skill)\n\t{\n\t\tL2SkillType type = skill.getSkillType();\n\t\tdouble defence = 0;\n\t\tif (skill.isActive() && skill.isOffensive() && !skill.isNeutral())\n\t\t{\n\t\t\tdefence = target.getMDef(actor, skill);\n\t\t}\n\n\t\tdouble attack = 2 * actor.getMAtk(target, skill) * (1.0 - calcSkillResistance(actor, target, skill) / 100);\n\t\tdouble d = (attack - defence) / (attack + defence);\n\t\tif (target.isRaid())\n\t\t{\n\t\t\tswitch (type)\n\t\t\t{\n\t\t\t\tcase DEBUFF:\n\t\t\t\tcase AGGDEBUFF:\n\t\t\t\tcase CONTINUOUS_DEBUFF:\n\t\t\t\t\treturn d > 0 && Rnd.get(1000) == 1;\n\t\t\t}\n\t\t}\n\n\t\td += 0.5 * Rnd.nextGaussian();\n\t\treturn d > 0;\n\t}",
"public boolean isBonusShotAllowed() {\n\t\treturn isLastFrame() && (isStrike() || isSpare());\n\t}",
"public static void hit_sound() {\n\t\tif (!hit1) {\n\t\t\thit1 = true;\n\t\t\tm_player_hit.setMediaTime(new Time(0));\n\t\t\tm_player_hit.start();\n\t\t} else if (!hit2) {\n\t\t\thit2 = true;\n\t\t\tm_player_hit2.setMediaTime(new Time(0));\n\t\t\tm_player_hit2.start();\n\t\t} else if (!hit3) {\n\t\t\thit3 = true;\n\t\t\tm_player_hit3.setMediaTime(new Time(0));\n\t\t\tm_player_hit3.start();\n\t\t} else if (!hit4) {\n\t\t\thit4 = true;\n\t\t\tm_player_hit4.setMediaTime(new Time(0));\n\t\t\tm_player_hit4.start();\n\t\t} else if (!hit5) {\n\t\t\thit5 = true;\n\t\t\tm_player_hit5.setMediaTime(new Time(0));\n\t\t\tm_player_hit5.start();\n\t\t} else {\n\t\t\thit1 = hit2 = hit3 = hit4 = hit5 = false;\n\t\t\tm_player_hit6.setMediaTime(new Time(0));\n\t\t\tm_player_hit6.start();\n\t\t}\n\n\t}",
"public static boolean isDealingBattleDamageAndContinuingGame (boolean isBurnDamage, int battleDamage, boolean isHittingPlayer) {\r\n String damageKind = \" battle\";\r\n if (isBurnDamage) {damageKind = \" burn\";}\r\n if (isHittingPlayer) {\r\n YuGiOhJi.informationDialog(\"You take \" + battleDamage + damageKind + \" damage.\", \"\");\r\n if (battleDamage >= Game.lifePointsPlayer) {\r\n Game.lifePointsPlayer=0;\r\n YuGiOhJi.informationDialog(\"The opponent reduced your life points to zero.\", \"YOU LOSE!\");\r\n Game.over(false);\r\n return false; // GAME OVER\r\n }\r\n else {Game.lifePointsPlayer = Game.lifePointsPlayer-battleDamage;\r\n YuGiOhJi.updateDisplayedLP();\r\n return true; // game continues\r\n }\r\n }\r\n else {\r\n YuGiOhJi.informationDialog(\"Computer takes \" + battleDamage + damageKind + \" damage.\", \"\");\r\n if (battleDamage >= Game.lifePointsCPU) {\r\n Game.lifePointsCPU=0;\r\n YuGiOhJi.informationDialog(\"You reduced the Opponent's life points to zero.\", \"YOU WIN!\");\r\n // display some hidden achievements here, if unlocked\r\n if (battleDamage>=Game.initialLP) {YuGiOhJi.informationDialog(\"Hidden achievement found: \\\"One Shot\\\". You have won by one single attack or burn effect.\", \"\"); Game.unlockTrophy(Game.trophyOneUnlocked);}\r\n // end of listing of achievements\r\n Game.over(true);\r\n return false; // GAME OVER\r\n }\r\n else {Game.lifePointsCPU = Game.lifePointsCPU-battleDamage;\r\n YuGiOhJi.updateDisplayedLP();\r\n return true; // game continues\r\n }\r\n }\r\n }",
"public boolean hitDealer() {\r\n while (getHandValue() <= 16) {\r\n hit();\r\n }\r\n return getHandValue() <= 21;\r\n }",
"public Answer shot (){\n if (this.is_shot()){\n return Answer.MISSED;\n }\n this.shot=true;\n if (this.is_Empty()){\n return Answer.MISSED;\n }\n this.ship.hitted();\n if (this.ship.isSunk()){\n return Answer.SUNK;\n }\n else {\n return Answer.HIT;\n }\n }",
"@Override\n\tpublic void onHitPlayer(EntityDamageByEntityEvent e, Player damager, Player victim) {\n\t\t\n\t}",
"private boolean isMovementCausedByEntityBump(Player p) {\n double requiredDistance = 0.5;\n\n //If both bump and hurt by mob protections are disabled then we can just ignore this\n if (!(plugin.getConfig().getBoolean(\"Protections.Bump\") || plugin.getConfig().getBoolean(\"Protections.HurtByMob\")))\n return false;\n\n //Check if the player has been attacked by a mob in bump range\n boolean playerAttacked = false;\n EntityDamageEvent event = p.getLastDamageCause();\n Entity damager = null;\n if (event instanceof EntityDamageByEntityEvent) {\n damager = ((EntityDamageByEntityEvent) event).getDamager();\n }\n\n boolean isEntityClose = false;\n //Find all entities within the required range\n for (Entity e : p.getNearbyEntities(requiredDistance, requiredDistance, requiredDistance)) {\n if (e instanceof Monster || e instanceof Player) {\n if (e.equals(damager)) {\n playerAttacked = true;\n }\n isEntityClose = true;\n break;\n }\n }\n //If bump is enabled and the player was bumped by an entity then we report as a bump\n if (plugin.getConfig().getBoolean(\"Protections.Bump\") && isEntityClose)\n return true;\n //Report as bump is mob protection is on and they were attacked or a mob is close\n return plugin.getConfig().getBoolean(\"Protections.HurtByMob\") && (playerAttacked || isEntityClose);\n }",
"public final boolean doAreaDamage(Creature aCreature) {\n/* 1079 */ boolean dead = false;\n/* 1080 */ if (!aCreature.isInvulnerable() && !aCreature.isGhost() && !aCreature.isUnique()) {\n/* */ \n/* 1082 */ AreaSpellEffect aes = getAreaEffect();\n/* */ \n/* 1084 */ if (aes != null) {\n/* */ \n/* 1086 */ System.out.println(\"AREA DAMAGE \" + aCreature.getName());\n/* */ \n/* 1088 */ if (aes.getFloorLevel() != aCreature.getFloorLevel()) {\n/* */ \n/* 1090 */ int heightOffset = aes.getHeightOffset();\n/* 1091 */ if (heightOffset != 0) {\n/* */ \n/* 1093 */ int pz = aCreature.getPosZDirts();\n/* 1094 */ if (Math.abs(pz - heightOffset) > 10) {\n/* */ \n/* 1096 */ System.out.println(\"AREA DAMAGE FAILED\");\n/* 1097 */ return false;\n/* */ } \n/* */ } \n/* */ } \n/* */ \n/* */ \n/* */ \n/* 1104 */ byte type = getAreaEffect().getType();\n/* 1105 */ Creature caster = null;\n/* */ \n/* */ try {\n/* 1108 */ caster = Server.getInstance().getCreature(aes.getCreator());\n/* */ }\n/* 1110 */ catch (NoSuchCreatureException noSuchCreatureException) {\n/* */ \n/* */ \n/* */ }\n/* 1114 */ catch (NoSuchPlayerException noSuchPlayerException) {}\n/* */ \n/* */ \n/* */ \n/* 1118 */ if (caster != null) {\n/* */ \n/* */ try {\n/* */ \n/* 1122 */ if (aCreature.getAttitude(caster) == 2 || (caster\n/* 1123 */ .getCitizenVillage() != null && caster.getCitizenVillage().isEnemy(aCreature)))\n/* */ {\n/* 1125 */ boolean ok = true;\n/* 1126 */ if (!caster.isOnPvPServer() || !aCreature.isOnPvPServer()) {\n/* */ \n/* 1128 */ Village v = aCreature.getCurrentVillage();\n/* 1129 */ if (v != null && !v.mayAttack(caster, aCreature))\n/* */ {\n/* 1131 */ ok = false;\n/* */ }\n/* */ } \n/* 1134 */ if (ok)\n/* */ {\n/* 1136 */ aCreature.addAttacker(caster);\n/* 1137 */ if (type == 36 || type == 53)\n/* */ {\n/* 1139 */ byte pos = aCreature.getBody().getRandomWoundPos();\n/* 1140 */ sendAttachCreatureEffect(aCreature, (byte)6, (byte)0, (byte)0, (byte)0, (byte)0);\n/* */ \n/* */ \n/* */ \n/* 1144 */ double damage = getAreaEffect().getPower() * 4.0D;\n/* 1145 */ damage += 150.0D;\n/* 1146 */ double resistance = SpellResist.getSpellResistance(aCreature, 414);\n/* 1147 */ damage *= resistance;\n/* */ \n/* 1149 */ SpellResist.addSpellResistance(aCreature, 414, damage);\n/* */ \n/* 1151 */ damage = Spell.modifyDamage(aCreature, damage);\n/* */ \n/* 1153 */ dead = CombatEngine.addWound(caster, aCreature, (byte)8, pos, damage, 1.0F, \"\", null, 0.0F, 0.0F, false, false, true, true);\n/* */ \n/* */ \n/* */ \n/* */ }\n/* 1158 */ else if (type == 35 || type == 51)\n/* */ {\n/* 1160 */ byte pos = aCreature.getBody().getRandomWoundPos();\n/* */ \n/* 1162 */ double damage = getAreaEffect().getPower() * 2.75D;\n/* 1163 */ damage += 300.0D;\n/* 1164 */ double resistance = SpellResist.getSpellResistance(aCreature, 420);\n/* 1165 */ damage *= resistance;\n/* */ \n/* 1167 */ SpellResist.addSpellResistance(aCreature, 420, damage);\n/* */ \n/* 1169 */ damage = Spell.modifyDamage(aCreature, damage);\n/* 1170 */ dead = CombatEngine.addWound(caster, aCreature, (byte)4, pos, damage, 1.0F, \"\", null, 0.0F, 0.0F, false, false, true, true);\n/* */ \n/* */ \n/* */ \n/* */ }\n/* 1175 */ else if (type == 34)\n/* */ {\n/* 1177 */ byte pos = aCreature.getBody().getRandomWoundPos();\n/* */ \n/* 1179 */ double damage = getAreaEffect().getPower() * 1.0D;\n/* 1180 */ damage += 400.0D;\n/* 1181 */ double resistance = SpellResist.getSpellResistance(aCreature, 418);\n/* 1182 */ damage *= resistance;\n/* */ \n/* 1184 */ SpellResist.addSpellResistance(aCreature, 418, damage);\n/* */ \n/* 1186 */ damage = Spell.modifyDamage(aCreature, damage);\n/* */ \n/* 1188 */ dead = CombatEngine.addWound(caster, aCreature, (byte)0, pos, damage, 1.0F, \"\", null, 1.0F, 0.0F, false, false, true, true);\n/* */ \n/* */ \n/* */ \n/* */ }\n/* 1193 */ else if (type == 37)\n/* */ {\n/* 1195 */ sendAttachCreatureEffect(aCreature, (byte)7, (byte)0, (byte)0, (byte)0, (byte)0);\n/* */ \n/* */ \n/* 1198 */ byte pos = aCreature.getBody().getRandomWoundPos();\n/* */ \n/* */ \n/* 1201 */ double damage = getAreaEffect().getPower() * 2.0D;\n/* 1202 */ damage += 350.0D;\n/* 1203 */ double resistance = SpellResist.getSpellResistance(aCreature, 433);\n/* 1204 */ damage *= resistance;\n/* */ \n/* 1206 */ SpellResist.addSpellResistance(aCreature, 433, damage);\n/* */ \n/* 1208 */ damage = Spell.modifyDamage(aCreature, damage);\n/* */ \n/* 1210 */ dead = CombatEngine.addWound(caster, aCreature, (byte)5, pos, damage, 1.0F, \"\", null, 0.0F, 3.0F, false, false, true, true);\n/* */ }\n/* */ \n/* */ }\n/* */ \n/* */ }\n/* */ \n/* 1217 */ } catch (Exception exe) {\n/* */ \n/* 1219 */ logger.log(Level.WARNING, exe.getMessage(), exe);\n/* */ } \n/* */ }\n/* */ } \n/* */ } \n/* 1224 */ return dead;\n/* */ }",
"private boolean hit(int accuracy)\n {\n Random random = new Random();\n int num = random.nextInt(100); //creates random number 0-100\n if(num < accuracy) //if number is lower than the accuracy then you can attack\n {\n return true;\n } else\n {\n return false;\n }\n }",
"public boolean attackAlly(Ally target) {\n\t\tLog.d(TAG, \"Attacking!\");\n\t\tif (target.takeDamage(damage)) {\n\t\t\treturn true;\n\t\t} else\n\t\t\treturn false;\n\t}",
"@Override\n public int doDamage() {\n if (difficulty <5)\n return damage;\n else \n return damage*2;\n }",
"@Override\n public void attack(Entity e) {\n e.hit(atk);\n }",
"@Override\n\tpublic boolean eat(Item item,GameMap map) {\n\t\ttry {\n\t\t\tif (hitPoints<maxHitPoints){\n\t\t\t\theal(item.effect());\n\t\t\t\tmap.locationOf(this).removeItem(item);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} catch (NullPointerException nullPointer) {\n\t\t\tnullPointer.printStackTrace();\n\t\t}\n\t\treturn false;\n\t}"
] | [
"0.74945277",
"0.70437485",
"0.687789",
"0.67123026",
"0.6521473",
"0.63444614",
"0.63444614",
"0.63444614",
"0.63444614",
"0.63444614",
"0.62976587",
"0.62660164",
"0.6234342",
"0.6199864",
"0.61125475",
"0.60712814",
"0.6032157",
"0.5999861",
"0.5973536",
"0.5967822",
"0.5942333",
"0.59400773",
"0.5938797",
"0.59306896",
"0.5923714",
"0.5914181",
"0.59065545",
"0.58927476",
"0.5864828",
"0.5859428",
"0.5822142",
"0.5820429",
"0.58151466",
"0.5805031",
"0.57701904",
"0.5751344",
"0.57492244",
"0.5747097",
"0.57425994",
"0.5741873",
"0.57389146",
"0.57377017",
"0.5732203",
"0.5718472",
"0.5708637",
"0.5706878",
"0.5706012",
"0.569943",
"0.56947786",
"0.56947595",
"0.56938875",
"0.5693805",
"0.5689861",
"0.5684507",
"0.5680663",
"0.56781596",
"0.5675646",
"0.5672388",
"0.56592315",
"0.56580627",
"0.5657771",
"0.5656063",
"0.5651238",
"0.5635505",
"0.56282765",
"0.56277806",
"0.56229484",
"0.56215775",
"0.5607482",
"0.56070054",
"0.5602353",
"0.56003034",
"0.5597189",
"0.55946046",
"0.5591234",
"0.55912",
"0.55871385",
"0.5582033",
"0.55813015",
"0.5578409",
"0.55711806",
"0.55702585",
"0.55702585",
"0.55669576",
"0.5559146",
"0.5557898",
"0.5557618",
"0.5556704",
"0.5554777",
"0.55473506",
"0.554463",
"0.5540555",
"0.5540151",
"0.55365145",
"0.5534694",
"0.5529573",
"0.5529522",
"0.5527818",
"0.5527702",
"0.55173653"
] | 0.79591376 | 0 |
aggroHitTimer How long this mob would stay angry at this attacker if aggroed via hit | int aggroHitTimer(IGeneticMob geneticMob, EntityLiving attacker); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"float shouldAggroOnHit(IGeneticMob geneticMob, EntityLiving attacker);",
"public interface IHitAggro {\n /**\n * shouldAggroOnHit\n * The chance (where 1.0F = 100%) that this mob would be aggroed if struck by this entity\n * Should NOT trigger the aggro itself! That should only occur when actually hit!\n * @param geneticMob the mob being checked\n * @param attacker the entity that could attack\n * @return the chance of aggro (1.0F = 100%, 0.0F = 0%)\n */\n float shouldAggroOnHit(IGeneticMob geneticMob, EntityLiving attacker);\n\n /**\n * aggroHitTimer\n * How long this mob would stay angry at this attacker if aggroed via hit\n * @param geneticMob the mob being checked\n * @param attacker the entity that could attack\n * @return the length, in ticks, of the timer\n */\n int aggroHitTimer(IGeneticMob geneticMob, EntityLiving attacker);\n }",
"protected void attack(){\n\t\tif(reloadTime-- <= 0){\n\t\t\treloadTime = 0;\n\t\t}\n\t\tif(!hostileInRange())\n\t\t\treturn;\n\t\tif(!rotate()){\n\t\t\tif(reloadTime <= 0){\n\t\t\t\tshotAt(this.target);\n\t\t\t}\n\t\t}\n\t}",
"public abstract int doDamage(int time, GenericMovableUnit unit, Unit target);",
"public void OnDamage(AI ai, int aTK, float f) {\n\tif(DamagedTimer < 0.8f)\n\t\treturn;\n\tvel.x = f;\n\tvel.y = 3;\n\tDamagedTimer = 0;\n\tgrounded = false;\n\taTK -= (getDEF()*0.8f);\n\tif(aTK <= 0)\n\t\taTK = 1;\n\tHP -= aTK;\n\tInventory.CurrentInventory.dmgTxts.add(new dmgText(pos.x, pos.y+1, aTK));\n\t\n\tSoundManager.PlaySound(\"playerHurt\",3);\n\t\n\t\n}",
"private int timeToNextAttack() {\n return ATTACK_SPEED - mAttacker.getSpeed();\n }",
"public void attack() {\n energy = 2;\n redBull = 0;\n gun = 0;\n target = 1;\n // if Player is in range take off a life.\n if (CharacterTask.ghostLocation == GameWindow.playerLocation) {\n playerLives = playerLives - 1;\n System.out.println(\"Player Lives: \" + playerLives);\n }\n }",
"public void Hit()\n {\n this.numLives--;\n //Oscillate visible and not if the number of lives is greater than zero\n if(this.numLives > 0)\n {\n this.damaged = true;\n this.Blink(1);\n\n }\n }",
"private void attackPlayer()\n\t{\n\t\tif(shootTimer.done())\n\t\t{\n\t\t\tProjectile spiderWeb = new SpiderWeb(x, y);\n\t\t\tGame.objectWaitingRoom.add(spiderWeb);\n\t\t\tspiderWeb.shoot();\n\t\t\tshootTimer.setTime(200);\n\t\t}\n\t}",
"public void attack(){\n activity = CreatureActivity.ATTACK;\n createWeapon();\n endAttack = new CountDown(20); //100\n endAnimationAttack = new CountDown(100);\n }",
"public void weaken(float hit) {\n if (!isInvincible()) {\n hp -= hit;\n invincible = true;\n if (hp < 0) {\n hp = 0;\n }\n\n if(isWeak()){ //Play the death animation\n currentAnimation = deathAnimation;\n }\n }\n }",
"public void hit() {\n if (explodeTime == 0) {\n if (isExplosive) {\n region = explodeAnimation.getKeyFrame(explodeTime, false);\n explodeTime += Gdx.graphics.getDeltaTime();\n width = region.getRegionWidth();\n height = region.getRegionHeight();\n position.sub(width / 2, height / 2);\n direction = new Vector2(1, 0);\n explosionSound.play();\n } else {\n impactSound.play();\n active = false;\n }\n }\n }",
"public static long getTotalHitTime() {\r\n return _time;\r\n }",
"public void addDamageHate(final L2Character attacker, final int damage, int aggro)\n\t{\n\t\tif (attacker == null /* || aggroList == null */)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Get the AggroInfo of the attacker L2Character from the aggroList of the L2Attackable\n\t\tAggroInfoHolder ai = getAggroListRP().get(attacker);\n\t\t\n\t\tif (ai == null)\n\t\t{\n\t\t\tai = new AggroInfoHolder(attacker);\n\t\t\tai.init();\n\t\t\tgetAggroListRP().put(attacker, ai);\n\t\t}\n\t\t\n\t\t// If aggro is negative, its comming from SEE_SPELL, buffs use constant 150\n\t\tif (aggro < 0)\n\t\t{\n\t\t\tai.decHate(aggro * 150 / (getLevel() + 7));\n\t\t\taggro = -aggro;\n\t\t}\n\t\t// if damage == 0 -> this is case of adding only to aggro list, dont apply formula on it\n\t\telse if (damage == 0)\n\t\t{\n\t\t\tai.incHate(aggro);\n\t\t\t// else its damage that must be added using constant 100\n\t\t}\n\t\telse\n\t\t{\n\t\t\tai.incHate(aggro * 100 / (getLevel() + 7));\n\t\t}\n\t\t\n\t\t// Add new damage and aggro (=damage) to the AggroInfo object\n\t\tai.incDmg(damage);\n\t\t\n\t\t// Set the intention to the L2Attackable to AI_INTENTION_ACTIVE\n\t\tif (getAI() != null && aggro > 0 && getAI().getIntention() == CtrlIntention.AI_INTENTION_IDLE)\n\t\t{\n\t\t\tgetAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);\n\t\t}\n\t\t\n\t\tai = null;\n\t\t// Notify the L2Attackable AI with EVT_ATTACKED\n\t\tif (damage > 0)\n\t\t{\n\t\t\tif (getAI() != null)\n\t\t\t{\n\t\t\t\tgetAI().notifyEvent(CtrlEvent.EVT_ATTACKED, attacker);\n\t\t\t}\n\t\t\t\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (attacker instanceof L2PcInstance || attacker instanceof L2Summon)\n\t\t\t\t{\n\t\t\t\t\tL2PcInstance player = attacker instanceof L2PcInstance ? (L2PcInstance) attacker : ((L2Summon) attacker).getOwner();\n\t\t\t\t\t\n\t\t\t\t\tfor (final Quest quest : getTemplate().getEventQuests(Quest.QuestEventType.ON_ATTACK))\n\t\t\t\t\t{\n\t\t\t\t\t\tquest.notifyAttack(this, player, damage, attacker instanceof L2Summon);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tplayer = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (final Exception e)\n\t\t\t{\n\t\t\t\tLOGGER.error(\"\", e);\n\t\t\t}\n\t\t}\n\t}",
"@Override\n public void hit(int atk) {\n hp = hp - atk;\n }",
"@Override\n\t\tpublic void hit(Npc attacker, Mob defender, Hit hit) {\n\t\t}",
"@Override\r\n\tpublic void recieveHit() {\n\t\tif(armour <= 0) {\r\n\t\t\tSystem.out.println(\"Enemy Destroyed\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdouble calculateHitDamage = shot * basicDamage;\r\n\t\t\tif(calculateHitDamage == armour) {\r\n\t\t\t\tarmour = armour - calculateHitDamage;\r\n\t\t\t\tSystem.out.println(\"Enemy Armour Destroyed!!!\");\r\n\t\t\t}\r\n\t\t\telse if(calculateHitDamage > armour) {\r\n\t\t\t\tarmour = armour - calculateHitDamage;\r\n\t\t\t\tSystem.out.println(\"Enemy is Dead!!\");\r\n\t\t\t}\r\n\t\t\telse if(calculateHitDamage < armour) {\r\n\t\t\t\tarmour = armour - calculateHitDamage;\r\n\t\t\t\tSystem.out.println(\"Enemy not detroyed!! \\n\");\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"Current Enemy life: \"+ armour);\r\n\t\t}\r\n\t}",
"@Override\n public void update() {\n if (!myNPC.isAlive()) {\n myNPC.setState(MovingState.DEATH);\n }\n\n if (isAttacking()) {\n if (attackCounter > 300) {\n myNPC.setState(MovingState.IDLE);\n attackCounter = 0;\n } else {\n attackCounter++;\n }\n return;\n }\n\n// randomMove();\n }",
"@Override\n\tpublic void reduceCurrentHp(final double damage, final L2Character attacker, final boolean awake)\n\t{\n\t\t/*\n\t\t * if ((this instanceof L2SiegeGuardInstance) && (attacker instanceof L2SiegeGuardInstance)) //if((this.getEffect(L2Effect.EffectType.CONFUSION)!=null) && (attacker.getEffect(L2Effect.EffectType.CONFUSION)!=null)) return; if ((this instanceof L2MonsterInstance)&&(attacker instanceof\n\t\t * L2MonsterInstance)) if((this.getEffect(L2Effect.EffectType.CONFUSION)!=null) && (attacker.getEffect(L2Effect.EffectType.CONFUSION)!=null)) return;\n\t\t */\n\t\t\n\t\tif (isRaid() && attacker != null && attacker.getParty() != null && attacker.getParty().isInCommandChannel() && attacker.getParty().getCommandChannel().meetRaidWarCondition(this))\n\t\t{\n\t\t\tif (firstCommandChannelAttacked == null) // looting right isn't set\n\t\t\t{\n\t\t\t\tsynchronized (this)\n\t\t\t\t{\n\t\t\t\t\tif (firstCommandChannelAttacked == null)\n\t\t\t\t\t{\n\t\t\t\t\t\tfirstCommandChannelAttacked = attacker.getParty().getCommandChannel();\n\t\t\t\t\t\tif (firstCommandChannelAttacked != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcommandChannelTimer = new CommandChannelTimer(this);\n\t\t\t\t\t\t\tcommandChannelLastAttack = System.currentTimeMillis();\n\t\t\t\t\t\t\tThreadPoolManager.getInstance().scheduleGeneral(commandChannelTimer, 10000); // check for last attack\n\t\t\t\t\t\t\tfirstCommandChannelAttacked.broadcastToChannelMembers(new CreatureSay(0, Say2.PARTYROOM_ALL, \"\", \"You have looting rights!\")); // TODO: retail msg\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\telse if (attacker.getParty().getCommandChannel().equals(firstCommandChannelAttacked)) // is in same channel\n\t\t\t{\n\t\t\t\tcommandChannelLastAttack = System.currentTimeMillis(); // update last attack time\n\t\t\t}\n\t\t}\n\t\t/*\n\t\t * // CommandChannel if(commandChannelTimer == null && isRaid() && attacker != null) { if(attacker.isInParty() && attacker.getParty().isInCommandChannel() && attacker.getParty().getCommandChannel().meetRaidWarCondition(this)) { firstCommandChannelAttacked = attacker.getParty().getCommandChannel();\n\t\t * commandChannelTimer = new CommandChannelTimer(this, attacker.getParty().getCommandChannel()); ThreadPoolManager.getInstance().scheduleGeneral(_commandChannelTimer, 300000); // 5 min firstCommandChannelAttacked.broadcastToChannelMembers(new CreatureSay(0, Say2.PARTYROOM_ALL, \"\",\n\t\t * \"You have looting rights!\")); } }\n\t\t */\n\t\tif (isEventMob)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Add damage and hate to the attacker AggroInfo of the L2Attackable aggroList\n\t\tif (attacker != null)\n\t\t{\n\t\t\taddDamage(attacker, (int) damage);\n\t\t}\n\t\t\n\t\t// If this L2Attackable is a L2MonsterInstance and it has spawned minions, call its minions to battle\n\t\tif (this instanceof L2MonsterInstance)\n\t\t{\n\t\t\tL2MonsterInstance master = (L2MonsterInstance) this;\n\t\t\t\n\t\t\tif (this instanceof L2MinionInstance)\n\t\t\t{\n\t\t\t\tmaster = ((L2MinionInstance) this).getLeader();\n\t\t\t\t\n\t\t\t\tif (!master.isInCombat() && !master.isDead())\n\t\t\t\t{\n\t\t\t\t\tmaster.addDamage(attacker, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (master.hasMinions())\n\t\t\t{\n\t\t\t\tmaster.callMinionsToAssist(attacker);\n\t\t\t}\n\t\t\t\n\t\t\tmaster = null;\n\t\t}\n\t\t\n\t\t// Reduce the current HP of the L2Attackable and launch the doDie Task if necessary\n\t\tsuper.reduceCurrentHp(damage, attacker, awake);\n\t}",
"@Override\n public void update() {\n if(alive==false){\n afterBeKilled();\n return;\n }\n animate();\n chooseState();\n checkBeKilled();\n if(attack){\n if(timeBetweenShot<0){\n chooseDirection();\n attack();\n timeBetweenShot=15;\n }\n else{\n timeBetweenShot--;\n }\n\n }\n else{\n calculateMove();\n setRectangle();\n }\n }",
"void playerHit() {\n if (lives == 0) {//if no lives left\n isDead = true;\n } else {//remove a life and reset positions\n lives -=1;\n immortalityTimer = 100;\n resetPositions();\n }\n }",
"@Override\r\n public int actionDelayTime(Entity attacker) {\n return 4000;\r\n }",
"public void act() \n {\n updateTimerDisplay();\n if(timeCounter < 3600){\n timeCounter++;\n \n }else{\n timeElapsed++;\n timeCounter = 0;\n }\n checkHighScore();\n checkRegScore();\n\n }",
"@Override\n\tpublic void onDamage(WorldObj obj, Items item) {\n\n\t\tif(is_stunned) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tint dmg = (int) item.type.ATK;\n\t\t\n\t\tOnScreenText.AddText(\"\"+dmg, bounds.x , bounds.y + 1.1f);\n\t\t\n\t\tvelX = obj.direction * 5;\n\t\tvelY = 5;\n\t\tgrounded = false;\n\t\t\n\t\tHP -= dmg;\n\t\t\n\n\t\tstun_counter = 0;\n\t\t\n\t\tif(HP <= 0 && !isDead) {\n\t\t\tonDeath();\n\t\t}\n\t\t\n\t}",
"@Override\n void planted() {\n super.planted();\n TimerTask Task = new TimerTask() {\n @Override\n public void run() {\n\n for (Drawable drawables : gameState.getDrawables()) {\n if (drawables instanceof Zombie) {\n int distance = (int) Math.sqrt(Math.pow((drawables.x - x), 2) + Math.pow((drawables.y - y), 2));\n if (distance <= explosionradious) {\n ((Zombie) drawables).hurt(Integer.MAX_VALUE);\n }\n }\n }\n\n life = 0;\n }\n\n };\n\n Timer timer = new Timer();\n timer.schedule(Task, 2000);\n }",
"public void takeDamage(int damage) {\n Random rand = new Random();\n int game = rand.nextInt(51) + 75;\n double game2 = (double) game;\n double percDamage = game2/100.0;\n double realSomething = (double) damage;\n double actualDamageNotReal = realSomething * percDamage;\n int actualDamage = (int) actualDamageNotReal;\n int actualDmg = actualDamage - this.armour;\n if (actualDmg <= 0){\n actualDmg = 0;\n }\n this.health -= actualDmg;\n slowDisplay(String.format(\"%s takes %s damage, now at %s\\n\",this.name,actualDmg,this.health));\n\n }",
"private void enemyAttack() {\n\t\t\n\t\tRandom rand = new Random();\t\n\t\t\n\t\tint roll = rand.nextInt(101);\n\t\t\n\t\tint sroll = rand.nextInt(101);\n\t\t\n\t\tevents.appendText(e.getName() + \" attacks!\\n\");\n\t\t\n\t\tif(roll <= p.getEV()) { // Player evades\n\t\t\t\n\t\t\tevents.appendText(\"You evaded \"+e.getName()+\"\\'s Attack!\\n\");\n\t\t\t\n\t\t}else if(roll > p.getEV()) { // Player is hit and dies if HP is 0 or less\n\t\t\t\n\t\t\tp.setHP(p.getHP() - e.getDMG());\n\t\t\t\n\t\t\tString newHp = p.getHP()+\"/\"+p.getMaxHP();\n\t\t\t\n\t\t\tString effect = e.getSpecial(); // Stats are afflicted\n\t\t\t\n\t\t\tif(sroll < 51){\n\t\t\t\t\n\t\t\tif(effect == \"Bleed\") { // Bleed Special\n\t\t\t\t\n\t\t\t\tp.setHP(p.getHP() - 100);\n\t\t\t\t\n\t\t\t\tevents.appendText(\"You bleed profusely. - 100 HP\\n\");\n\t\t\t\t\n\t\t\t\tnewHp = String.valueOf(p.getHP()+\"/\"+p.getMaxHP());\n\t\t\t}\n\t\t\tif(effect == \"Break\") { // Break Special \n\t\t\t\t\n\t\t\t\tif(p.getEV()-5>0)\n\t\t\t\t\tp.setEV(p.getEV() - 5);\n\t\t\t\telse\n\t\t\t\t\tp.setEV(0);\n\t\t\t\t\n\t\t\t\tevents.appendText(\"You feel a bone break restricting movement. - 5 EV\\n\");\n\t\t\t\t\n\t\t\t\tString newEV = String.valueOf(p.getEV());\n\t\t\t\t\n\t\t\t\tgev.setText(newEV);\n\t\t\t\t\n\t\t\t}\n\t\t\tif(effect == \"Fear\") { // Fear Special \n\t\t\t\t\n\t\t\t\tif(p.getDMG()-40>0)\n\t\t\t\t\tp.setDMG(p.getDMG() - 40);\n\t\t\t\telse\n\t\t\t\t\tp.setDMG(0);\n\t\t\t\t\n\t\t\t\tevents.appendText(\"A crippling fear rattles your resolve. - 40 DMG\\n\");\n\t\t\t\t\n\t\t\t\tString newDMG = String.valueOf(p.getDMG());\n\t\t\t\t\n\t\t\t\tgdmg.setText(newDMG);\n\t\t\t\t\n\t\t\t}\n\t\t\tif(effect == \"Rend\") { // Rend Special \n\t\t\t\t\n\t\t\t\tif(p.getDMG()-30>0)\n\t\t\t\t\tp.setDMG(p.getDMG() - 30);\n\t\t\t\telse\n\t\t\t\t\tp.setDMG(0);\n\t\t\t\t\n\t\t\t\tif(p.getEV()-5>0)\n\t\t\t\t\tp.setEV(p.getEV() - 5);\n\t\t\t\telse\n\t\t\t\t\tp.setEV(0);\n\t\t\t\t\n\t\t\t\tevents.appendText(\"Morthar unleashes a pillar of flame! - 30 DMG and - 5 EV\\n\");\n\t\t\t\t\n\t\t\t\tString newDMG = String.valueOf(p.getDMG());\n\t\t\t\t\n\t\t\t\tString newEV = String.valueOf(p.getEV());\n\t\t\t\t\n\t\t\t\tgdmg.setText(newDMG);\n\t\t\t\t\n\t\t\t\tgev.setText(newEV);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\t\n\t\t\tif(p.getHP() <= 0) {\n\t\t\t\t\n\t\t\t\tp.setDead(true);\n\t\t\t\t\n\t\t\t\tcurrentHp.setText(0+\"/\"+e.getMaxHP());\n\t\t\t\tplayerHPBar.setProgress((double)0);\n\t\t\t}else {\n\t\t\t\t\n\t\t\t\tcurrentHp.setText(newHp);\n\t\t\t\tplayerHPBar.setProgress((double)p.getHP()/p.getMaxHP());\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tif(p.isDead()) { // Game over if player dies\n\t\t\t\n\t\t\ttry {\n\t\t\t\tLoadGO();\n\t\t\t} catch (IOException e1) {\n\t\t\t\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\tcombat = false;\n\t\t}\n\t}",
"public void tick() {\n if (ShulkerEntity.this.world.getDifficulty() != Difficulty.PEACEFUL) {\n --this.attackTime;\n LivingEntity livingentity = ShulkerEntity.this.getAttackTarget();\n ShulkerEntity.this.getLookController().setLookPositionWithEntity(livingentity, 180.0F, 180.0F);\n double d0 = ShulkerEntity.this.getDistanceSq(livingentity);\n if (d0 < 400.0D) {\n if (this.attackTime <= 0) {\n this.attackTime = 20 + ShulkerEntity.this.rand.nextInt(10) * 20 / 2;\n ShulkerEntity.this.world.addEntity(new ShulkerBulletEntity(ShulkerEntity.this.world, ShulkerEntity.this, livingentity, ShulkerEntity.this.getAttachmentFacing().getAxis()));\n ShulkerEntity.this.playSound(SoundEvents.ENTITY_SHULKER_SHOOT, 2.0F, (ShulkerEntity.this.rand.nextFloat() - ShulkerEntity.this.rand.nextFloat()) * 0.2F + 1.0F);\n }\n } else {\n ShulkerEntity.this.setAttackTarget((LivingEntity)null);\n }\n\n super.tick();\n }\n }",
"double getHitRate();",
"double getHitRate();",
"public void hit(int melee_dmg,int range_dmg) {\n melee_dmg=this.current_atk-30;\n range_dmg=this.current_atk-60;\n }",
"public void takedmg(int dmg){\n curHp -= dmg;\n }",
"@Override\n\tpublic void takeHit(int attack) {\n\n\t}",
"private void enemyturn() {\n if (enemy.getHealth() == 0) { // check if the enemy is still alive\n enemy.setAlive(false);\n }\n\n if (enemy.getAlive()) { // if he is alive\n // time to fuck the players day up\n System.out.println(\"\");//formatting\n System.out.println(enemy.getName() + \" attacks you!\");\n\n // calculate the damage this enemy will do\n int differenceHit = enemy.getMaxHit() - enemy.getMinHit(); // difference will be 0-3. But plus 1 (as the result will ALWAYS be +1 in the randomizer so a \"0\" will not happen.\n int minimumDamage = randomize.getRandomDamage(differenceHit); // for example, will return 0-4 if the min and max hit was 4-7. Then do a -1. Making it a 0-3 chance.\n int damage = differenceHit + minimumDamage; // add the minimum damage, to random hit damage.\n\n // calculate the players armor\n damage = damage - player.getPlayerArmorRating();\n if (damage <= 0){\n System.out.println(\"... but you dont take any damage because of your armor!\");\n } else {\n\n System.out.println(\"You take \" + damage + \" damage!\");\n player.removeHealth(damage);\n }\n\n } else { // when ded\n System.out.println(\"The enemy has no chance to fight back. As your final blow killed the enemy.\");\n }\n }",
"void hp_counter()\n {\n T=new Timer();\n T.scheduleAtFixedRate(new TimerTask() {\n @Override\n public void run() {\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n //decrement the HP by delay of a second\n if(hp_value>0) {\n redball.setText(hp_value + \"\");\n hp_value--;\n }\n //you have lost and the game will reset\n else if(hp_value<=0)\n {\n //Here's a funny toast for all Sheldon's fans\n toast.setView(lost);\n toast.show();\n //\n resetValues();\n }\n }\n });\n }\n }, 1000, 1000);\n\n }",
"void evadeAttack(IUnit attacker, int incomingDamage);",
"public void update(float deltaTime) {\n if (creationPoint.y != (int)(GameView.instance.groundLevel - height*3/4) || creationPoint.x != x+width/2){\n creationPoint.x = x+width/2-width/4;\n creationPoint.y = (int)(GameView.instance.groundLevel - height/2)+height/8;\n }\n\n\n if(isStanding) {\n\n /*System.out.println(creationPoint.x);\n System.out.println(GameView.instance.player.position.x);\n System.out.println(GameView.instance.player.position.x-creationPoint.x);\n System.out.println(GameView.instance.cameraSize*attackRange);*/\n\n tax();\n\n\n //=======================================================================================//\n\n //Buildings\n\n //=======================================================================================//\n\n\n grow();\n\n\n // = ======== == ==\n // = = == == ==\n // ===== == ====\n // = = == == ===\n\n if (inRange() && !surrender) {\n countdown+=GameView.instance.fixedDeltaTime;\n //System.out.println(countdown);\n float shootSpeed=4-lv;\n if (countdown > 1000*shootSpeed) {\n\n if (countdown > 1200*shootSpeed && attack == 0) {\n Attack();\n\n attack += 1;\n }\n\n if (countdown > 1400*shootSpeed && attack == 1) {\n Attack();\n\n attack += 1;\n }\n\n if (countdown > 1600*shootSpeed && attack == 2) {\n Attack();\n\n attack += 1;\n }\n\n if (countdown >= 1800*shootSpeed) {\n countdown = 0;\n attack = 0;\n }\n }\n }\n if ((Scene.instance.timeOfDay) / (Scene.instance.dayLength) > 0.6) {\n spawnedNPC = false;\n }\n if(!spawnedNPC) {\n //spawning thief\n if ((townFear > 20 && lv != 0 && (currentGold < maxGold / 2)) || (goldRate < 200 && lv != 0) && Scene.instance.day > 2) {\n GameView.instance.npc_pool.spawnThiefs(x, (int) GameView.instance.groundLevel, 1, this);\n }\n if(!surrender) {\n //spawning dragonslayer\n if (townFear > 30 && lv != 0) {\n GameView.instance.npc_pool.spawnDragonLayers(x, (int) GameView.instance.groundLevel, this);\n }\n\n //spawning wizard\n if (townFear > 35 && lv == 2 && !summonedWizard) {\n GameView.instance.npc_pool.spawnFarmers(x, (int) GameView.instance.groundLevel, this);\n summonedWizard = true;\n }\n }\n spawnedNPC = true;\n }\n\n if(!surrender) {\n if (townFear > surrenderFear) {\n surrender = true;\n flag.setSurrender(surrender);\n SoundEffects.instance.play(SoundEffects.TRIBUTE);\n }\n }\n else {\n if(townFear < surrenderFear/2) {\n surrender = false;\n flag.setSurrender(surrender);\n\n }\n }\n\n\n\n Flagposition(deltaTime);\n }\n else {\n buildingImage = SpriteManager.instance.getBuildingSprite(\"FortressRuin\");\n\n if(beenEmptied == false){\n GoldPool.instance.spawnGold(collider.centerX(), collider.centerY(),Math.min(currentGold,100*(lv+1)) );\n beenEmptied = true;\n }\n townFear = 0;\n }\n\n //==== ===== ===== = == ==== ============================\n //= = == = = = = == = = ============================\n //==== == ===== ===== == ==== ============================\n //= == ===== = = = == = == ============================\n repair(deltaTime);\n\n for(int i = 0; i < currentBuildingsLeft.size(); i++){\n currentBuildingsLeft.get(i).update(deltaTime);\n }\n\n for(int i = 0; i < currentBuildingsRight.size(); i++){\n currentBuildingsRight.get(i).update(deltaTime);\n }\n super.update(deltaTime);\n\n }",
"@Override\r\n\tpublic int costOfShooting() {\r\n\t\treturn 50;\r\n\t}",
"@Override\r\n public void onHit(int damage){\n if(box2body != null){\r\n hp -= damage;\r\n screen.getGameManager().get(\"Sounds/orc-34-hit.wav\", Sound.class).play();\r\n if(this.hp <= 0) {\r\n screen.bodiesToDelete.add(box2body);\r\n deleteFlag = true;\r\n screen.spawnedCreatures.remove(this);\r\n screen.getGameManager().get(\"Sounds/orc-32-death.wav\", Sound.class).play();\r\n\r\n //Award Experience\r\n screen.getPlayer().awardExperience(this.experienceValue);\r\n screen.getPlayer().increaseKillCount();\r\n }\r\n }\r\n //Attack player when damaged\r\n //Prevents player from sniping monsters using Wander AI\r\n if(currentState != State.ATTACKING){\r\n Vector2 orcPosition = new Vector2(box2body.getPosition().x, box2body.getPosition().y);\r\n Vector2 playerPosition = new Vector2(screen.getPlayer().box2body.getPosition().x, screen.getPlayer().box2body.getPosition().y);\r\n\r\n currentState = State.HASBEENATTACKED;\r\n velocity = new Vector2(playerPosition.x - orcPosition.x, playerPosition.y - orcPosition.y);\r\n box2body.setLinearVelocity(velocity.scl(speed));\r\n }\r\n }",
"public void Attack(){\n float randomx = (float)(Math.random()-0.5)*attackRange*GameView.instance.cameraSize/10;\n float randomy = (float)(Math.random()-0.5)*attackRange*GameView.instance.cameraSize/5;\n Vector2 target = GameView.instance.player.aimFor();\n float dx = target.x-creationPoint.x;\n float dy =target.y-creationPoint.y;\n float l= (float)Math.sqrt(dx*dx+dy*dy);\n dx = dx/l-((float)Math.random()-0.5f)/2;\n dy = dy/l-(float)(Math.random())/10;\n ProjectilePool.instance.shootArrow(creationPoint.x, creationPoint.y, 1, dx, dy, 3);\n }",
"private void handleStandardGameplay(float deltaTime) {\n\t\t// Decrease time to next revived enemy\n\t\tmSpawnTime--;\n\n\t\t// Accumulate time elapsed while playing\n\t\tmRoundTimeElapsed += deltaTime;\n\n\t\t/**\n\t\t * Input Handling\n\t\t * When the screen is touched, kill touched attackers\n\t\t */\n\t\tif(Gdx.input.justTouched()) {\n\t\t\t// Grab the touch position, saved as a Vector3\n\t\t\tmLastTouch.set(Gdx.input.getX(), Gdx.input.getY(), 0);\n\t\t\tmCamera.unproject(mLastTouch); // Translates to game world coordinates\n\n\t\t\t// Find the first attacker located at the touch position, if any\n\t\t\tint indexOfAttacker = getFirstAttackerAt(mLastTouch.x, mLastTouch.y);\n\t\t\t// If the index is greater than negative one, kill the attacker and add points\n\t\t\tif(indexOfAttacker > -1){\n\t\t\t\tmAttackers[indexOfAttacker].kill();\n\t\t\t\tmLivingAttackerCount--;\n\t\t\t\tmMonsterHouseSpawn--;\n\t\t\t\tmRoundScore += 100f;\n\t\t\t\tif(indexOfAttacker > ATTACKER_HALF_SIZE - 1)\n\t\t\t\t\tmRoundScore += 150f; // 150 Bonus points for killing a knight\n\t\t\t}\n\t\t}\n\n\t\t// Spawns a new enemy once the respawn timer hits less than 0\n\t\tif(mSpawnTime <0) {\n\t\t\t// Revive an attacker\n\t\t\treviveAttacker();\n\n\t\t\t// Randomly select a new respawn timer within min and max bounds\n\t\t\tmSpawnTime = mRandom.nextInt(mSpawnTimeMax - mSpawnTimeMin + 1) + mSpawnTimeMin;\n\t\t}\n\n\t\t//spawns a row of enemy units if player is doing well\n\t\tif(mMonsterHouseSpawn <0) {\n\t\t\tint monsterHouseRush = 3;\n\t\t\twhile(monsterHouseRush > 0) {\n\t\t\t\tfor (float i = 0; i < 5f; i++) {\n\t\t\t\t\treviveAttacker();\n\t\t\t\t}\n\t\t\t\tmonsterHouseRush--;\n\t\t\t}\n\t\t\tmMonsterHouseSpawn = 10;\n\t\t}\n\n\t\t// Loop through the array of attackers and update each (dead attackers' update does nothing)\n\t\tfor (int i = 0; i < ATTACKER_ARRAY_SIZE; i++) {\n\t\t\tAttacker a = mAttackers[i];\n\t\t\ta.update(deltaTime);\n\n\t\t\tif(a.getX() > MIN_STOP_X) {\n\t\t\t\t// Play the attacker's \"attack\" animation\n\t\t\t\ta.play(\"attack\", true);\n\t\t\t\t// The attacker stops at the castle and the castle begins losing health\n\t\t\t\ta.setPosition(MIN_STOP_X, a.getY());\n\t\t\t\tmCastleHealth -= a.getHitDamage();\n\t\t\t\t// Only bother checking castle damage stage here - only when damage is being dealt\n\t\t\t\tfloat percentDamage = (mCastleMaxHealth - mCastleHealth) / mCastleMaxHealth;\n\t\t\t\tif(percentDamage < 0.5f) {\n\t\t\t\t\tmCastleDamageStage = 0;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tmCastleDamageStage = 1;\n\t\t\t\t}\n\t\t\t\tif(percentDamage > 0.15f) {\n\t\t\t\t\tmCastleDamageStage = 2;\n\t\t\t\t}\n\t\t\t\tif(percentDamage > 0.35f) {\n\t\t\t\t\tmCastleDamageStage = 3;\n\t\t\t\t}\n\t\t\t\tif(percentDamage > 0.65f) {\n\t\t\t\t\tmCastleDamageStage = 4;\n\t\t\t\t}\n\t\t\t\tif(percentDamage > 0.85f) {\n\t\t\t\t\tmCastleDamageStage = 5;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Check if the game is over, where mCastleHealth <= 0\n\t\tif(mCastleHealth <= 0) {\n\t\t\t// The castle has fallen to the attackers\n\t\t\t// Currently, the game will pause and add text that states the game is over\n\t\t\tmCastleHealth = 0f;\n\t\t\tmHealthText = \"Castle Strength: \" + mCastleHealth;\n\t\t\tmGameState = STATE_GAME_OVER;\n\t\t\thideAllButtons();\n\t\t}\n\n\t\t// If the round time is up, end the round and go to a new state\n\t\tif(mRoundTimeElapsed > mRoundMaxTime) {\n\t\t\tmGameState = STATE_ROUND_OVER;\n\t\t\tmTotalScore += mRoundScore;\n\t\t\tmRoundNumber++;\n\t\t\thideAllButtons();\n\t\t}\n\t}",
"void doGun() {\r\n\t\tlong time = getTime()\r\n\t\t\t\t+ (int) Math\r\n\t\t\t\t\t\t.round((getRange(getX(), getY(), target.x, target.y) / (20 - (3 * firePower))));\r\n\t\tPoint2D.Double p = target.guessPosition(time);\r\n\r\n\t\t// offsets the gun by the angle to the next shot based on linear\r\n\t\t// targeting provided by the enemy class\r\n\t\tdouble gunOffset = getGunHeadingRadians()\r\n\t\t\t\t- (Math.PI / 2 - Math.atan2(p.y - getY(), p.x - getX()));\r\n\t\tsetTurnGunLeftRadians(normaliseBearing(gunOffset));\r\n\t}",
"public void checkHits() {\n\t\t// your code here\n\t\tfor (int i = 0; i < enemyX.length; i++) {\n\t\t\tif (distance((int)xI, (int)yI, enemyX[i], enemyY[i]) <= DIAM_ENEMY/2 + DIAM_LAUNCHER/2) {\n\t\t\t}\n\t\t}\n\t}",
"public void playerAttack() {\n if (playerTurn==true) {\n myMonster.enemHealth=myMonster.enemHealth-battlePlayer.str;\n }\n playerTurn=false;\n enemyMove();\n }",
"public boolean attackEntityFrom(DamageSource damagesource, float i)\n {\n Entity entity = damagesource.getEntity();\n\n if (entity instanceof EntityPlayer)\n {\n \tsetRevengeTarget((EntityLivingBase) entity);\n becomeAngryAt(entity);\n }\n\n timetopee = rand.nextInt(900) + 500;\n bumrotation = 999F;\n super.attackEntityFrom(DamageSource.causeMobDamage(this), i);\n return true;\n }",
"public static void increaseDifficaulty() {\r\n\t\tif (Enemy._timerTicker > 5)\r\n\t\t\tEnemy._timerTicker -= 2;\r\n\t\tif (Player._timerTicker < 100)\r\n\t\t\tPlayer._timerTicker += 2;\r\n\t}",
"public void processEnemyHitsAndDeaths(AbstractEnemy enemy) {\n this.scoreCounter.changeScore(2000, '+'); // This was put here to see all objectives being met\n this.gameState.updateScoreGoals(this.scoreCounter);\n this.gameState.updateEnemyHitGoals(enemy.getEnemyType());\n this.killCount += 1; \n }",
"public static boolean calcHitMiss(L2Character attacker, L2Character target)\n\t{\n\t\tdouble chance = 800 + 20 * (attacker.getAccuracy() - target.getEvasionRate(attacker));\n\n\t\t//if (attacker instanceof L2PcInstance && target instanceof L2PcInstance)\n\t\t//\tLog.info(\"P: \" + attacker.getAccuracy() + \" \" + target.getEvasionRate(attacker) + \": \" + chance);\n\n\t\t// Get additional bonus from the conditions when you are attacking\n\t\tchance *= hitConditionBonus.getConditionBonus(attacker, target);\n\n\t\tchance = Math.max(chance, 200);\n\t\tchance = Math.min(chance, 980);\n\n\t\tif (attacker instanceof L2PcInstance)\n\t\t{\n\t\t\tfinal L2PcInstance player = (L2PcInstance) attacker;\n\t\t\tif (player.getExpertiseWeaponPenalty() != 0)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn chance < Rnd.get(1000);\n\t}",
"protected void attackEntity(Entity var1, float var2)\n {\n if (this.attackTime <= 0 && var2 < 2.0F && var1.boundingBox.maxY > this.boundingBox.minY && var1.boundingBox.minY < this.boundingBox.maxY)\n {\n this.attackTime = 20;\n this.attackEntityAsMob(var1);\n }\n }",
"public void takeDamage(int dmg){ \r\n\t\tif(hitPoints - dmg >= 0){\r\n\t\t\tSystem.out.print(this.getName() + \" took \" + dmg + \" damage! \\n\");\r\n\t\t\tSystem.out.print(this.name + \"'s Hit Points: \" + hitPoints + \" ---> \" + (hitPoints-dmg) + \"\\n\");\r\n\t\t\thitPoints -= dmg;\r\n\r\n\t\t}\r\n\t\telse{\r\n\t\t\tSystem.out.print(this.getName() + \" took \" + dmg + \" damage! \\n\");\r\n\t\t\tSystem.out.print(this.name + \"'s Hit Points: \" + hitPoints + \" ---> \" + 0 + \"\\n\");\r\n\t\t\thitPoints = 0;\r\n\t\t}\r\n\t\tif(hitPoints == 0){\r\n\t\t\tthis.isAlive = false;\r\n\t\t\tSystem.out.print(this.name + \" has been incapacitated.\\n\");\r\n\t\t}\r\n\r\n\t}",
"public void handle(long now) {\n if (attackCD > 0) {\n attackCD--;\n }\n if (input.contains(\"J\") && attackCD <= 0) {\n currSpeed = 0;\n attackCD = 50;\n int temp = attack();\n damageWindow = temp;\n moveCD = temp;\n } else if (input.size() > 1) {\n currSpeed = speed * speedWeaponModifier * speedBuffModifier / Math.sqrt(2);\n } else {\n currSpeed = speed * speedWeaponModifier * speedBuffModifier;\n }\n if (damageWindow > 0) {\n for (Monster monster : GameLoop.getMonsters()) {\n if (Controller.getPlayer().intersects(monster) && !(weapon instanceof Bow)) {\n System.out.println(\"Player damaged monster for \" + damage * damageWeaponModifier * damageBuffModifier);\n monster.takeDamage(damage * damageWeaponModifier * damageBuffModifier);\n damageWindow = 0;\n }\n }\n damageWindow--;\n }\n if (damageCooldown > 0 && damageCooldown % 15 == 0) { // got hit\n invisibilityCd = 5; // set invis frames\n }\n damageCooldown--; // so dmgcd triggers for first frame (60 % 15)\n\n if (moveCD > 0) {\n moveCD--;\n } else {\n if (input.contains(\"A\") && positionX > 10) {\n imageView.setScaleX(1);\n moveRelative(-currSpeed, 0);\n direction = 0;\n }\n if (input.contains(\"D\") && positionX + width < (scene.getWidth() - 25)) {\n imageView.setScaleX(-1);\n moveRelative(currSpeed, 0);\n direction = 1;\n }\n if (input.contains(\"W\") && positionY > 10) {\n moveRelative(0, -currSpeed);\n }\n if (input.contains(\"S\") && positionY + height < (scene.getHeight() - 55)) {\n moveRelative(0, currSpeed);\n }\n }\n\n if (invisibilityCd > 0) { // Overwrite setScale if invis frames\n imageView.setScaleX(0);\n } else if (imageView.getScaleX() == 0) { // If player didn't move\n if (direction == 0) { // same direction\n imageView.setScaleX(1);\n } else if (direction == 1) {\n imageView.setScaleX(-1);\n }\n }\n invisibilityCd--;\n\n\n //Keyboard transitions to screens\n if (input.contains(\"I\")) {\n containedI = true;\n }\n if (containedI && !input.contains(\"I\")) { //Go to inventory if I was released.\n Controller.goToInventory();\n input.remove(\"I\");\n containedI = false;\n }\n\n }",
"public boolean attackTimePassed(long nowTime) {\r\n\t\treturn (nowTime - this.getLastAttackTime() >= ATTACK_COOLDOWN);\r\n\t}",
"public void damageAnnouncementCountdown(int heroDamage, int antagonistDamage, FacePiece heroPiece, FacePiece antagonistPiece)\n {\n damageAnnouncementTimer = 290;\n announceDamage = true;\n this.heroDamage = heroDamage;\n this.antagonistDamage = antagonistDamage;\n damagedAntagonistPiece = null;\n damagedHeroPiece = null;\n\n if (antagonistDamage > 0)\n {\n damagedAntagonistPiece = antagonistPiece;\n flashDamagedPiecesCountdown();\n }\n\n if (heroDamage > 0)\n {\n damagedHeroPiece = heroPiece;\n flashDamagedPiecesCountdown();\n }\n }",
"void hit(GameObject o){\r\n\t\tif (!shield){ // if sheild is on all hits do nothing\r\n\t\t\tif (!(o instanceof UpPower)){ // if didnt hit a power up the ship loses a life\r\n\t\t\t\tif (lives > 1) {\r\n\t\t\t\t\tlives--;\r\n\t\t\t\t\treset();\r\n\t\t\t\t}\r\n\t\t\t\telse { // once there is no life left the ship dies\r\n\t\t\t\t\tdead = true;\r\n\t\t\t\t\tlives--;\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t}",
"public void attackSprite(StatSprite defendingSprite)\r\n\t{\n\t\ttry\r\n\t\t{\r\n\t\t\tThread.sleep(500);\r\n\t\t} catch (InterruptedException e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\tint randomHit = (int)Math.floor((int)hitCenter * .7) + rand.nextInt((int)Math.ceil(hitCenter * .6));\r\n\t\t\r\n\t\tSystem.out.println(getFightInfo(this,defendingSprite,randomHit));\r\n\t\t\r\n\t\tdefendingSprite.curHP -= randomHit;\r\n\t\tif(defendingSprite.curHP <= 0)\r\n\t\t{\r\n\t\t\tif(defendingSprite.myType != 2)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"\\nKilled \"+defendingSprite.getName()+\". \"+\r\n\t\t\t\t\tthis.updateXP(defendingSprite.myXPLevel + defendingSprite.myType));\r\n\t\t\t}\r\n\t\t\tif(defendingSprite.myType == 10)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"\\nCongratulations! You have slain the fire dragon!\");\r\n\t\t\t}\r\n\t\t\tdefendingSprite.alive = false;\r\n\t\t}\r\n\t}",
"public double getTotalTime()\n\t{\n\t\treturn this.timeBallHitsGround;\n\t}",
"public void shootGun() {\n\t\tammo--;\n\t}",
"@Override\r\n\tpublic int attack() {\r\n\t\treturn rnd.nextInt(MAX_MONSTER_ATTACK_DAMAGE);\r\n\t}",
"public void monsterAttacking(World world, int delta){\n\t\t\n\t\tthis.setAttackTimer(this.getAttackTimer() - delta );\n\t\tif (this.getAttackTimer() <= 0) {\n\t\t\tworld.getPlayer().getUnitStats().reduceHP(this.damageAmount());\n\t\t\tthis.setAttackTimer( this.getUnitStats().getCooldown() );\n\t\t}\n\t}",
"@Override\n public void action() throws Exception {\n if (!can_hit || count > 0)\n count++;\n if (count == 100) {\n can_hit = true;\n }\n else if (count == this.bombCountLimit) {\n bombPlaced--;\n count = 0;\n }\n\n if(Gdx.input.isKeyJustPressed(Input.Keys.SPACE)){\n go_ia=!go_ia;\n }\n if(go_ia){\n ia_count++;\n if(ia_count==11)\n ia_count=0;\n }\n if(go_ia&&ia_count==10) {\n\n int move = -1;\n int mode = 0;\n\n\n\n log.info(\"count bomb: \" + count);\n\n double enemyDist = sqrt(pow((playerX - enemyX), 2)+pow((playerY - enemyY), 2));\n if(powerUpFree) {\n currentGoalX = goalX;\n currentGoalY = goalY;\n if(deepSearch){\n currentGoalX = 1;\n currentGoalY = 1;\n }\n if(enemyDist < 7 && !enemyClean){\n if(enemyDist <= bombRange && sqrt(pow((playerX - goalX), 2)+pow((playerY - goalY), 2)) > 2)\n mode = 2;\n\n }\n }\n\n\n\n if (!can_hit) {\n mode = 1;\n log.info(\"can't hit\");\n }\n else if(doorLocked) {\n mode = 3;\n }\n /*if (count > 0 && count <= this.bombCountLimit && (playerX!=bombGoalX || playerY!=bombGoalY)){\n currentGoalX = bombGoalX;\n currentGoalY = bombGoalY;\n log.info(\"bomb goal\");\n }*/\n\n\n\n\n log.info(\"CURRENT goal x: \" + currentGoalX +\", CURRENT goal y: \" + currentGoalY);\n log.info(\"CURRENT bombgoal x: \" + bombGoalX +\", current bombgoal y: \" + bombGoalY);\n log.info(\"CURRENT player x: \" + playerX +\", current player y: \" + playerY);\n log.info(\"powerup free: \" + powerUpFree);\n log.info(\"CURRENT ENEMY: [\" + enemyX + \", \" + enemyY + \"] \");\n\n ArrayList<Action> actions = new ArrayList<>();\n ArrayList<Wall> walls = new ArrayList<>();\n ArrayList<EnemyPath> enemyPaths = new ArrayList<>();\n ArrayList<Around> around = new ArrayList<>();\n\n playerX = this.x/40;\n playerY = this.y/40;\n\n for( int i = 0; i < 4; i++ ){\n if (can_move[i]) {\n if (mode != 1 || checkSafe(i))\n actions.add(new Action(i));\n walls.add(new Wall(i, 0));\n }\n else if (can_destroy[i]){\n walls.add(new Wall(i, 1));\n if (mode != 1 || checkSafe(i))\n actions.add(new Action(i));\n }\n else\n walls.add(new Wall(i, 3));\n if(freeAround[i])\n around.add(new Around(i, 0));\n else\n around.add(new Around(i, 2));\n\n if ( !enemyFree[i] && enemyDist > bombRange)\n enemyPaths.add(new EnemyPath(i, 1));\n if( !enemyFree[i] && enemyDist <= bombRange || (bombRange == 1 && enemyDist <= 2))\n enemyPaths.add(new EnemyPath(i, 2));\n else if (enemyDist <= bombRange)\n enemyPaths.add(new EnemyPath(i, 1));\n else if(enemyFree[i])\n enemyPaths.add(new EnemyPath(i, 0));\n }\n if(sqrt(pow((playerX - bombGoalX), 2)+pow((playerY - bombGoalY), 2)) > bombRange ||\n mode != 1 || (playerX != bombGoalX && playerY != bombGoalY))\n actions.add(new Action(4));\n\n ai.load_fact( new Position(playerX, playerY),\n actions,\n makeDistances(buildDistances(currentGoalX, currentGoalY)),\n makeBombDistances(buildDistances(bombX, bombY)),\n makeEnemyDistances(buildDistances(enemyX, enemyY)),\n walls,\n around,\n enemyPaths,\n new Mode(mode)\n );\n\n AnswerSets answers = ai.getAnswerSets();\n while(answers.getAnswersets().get(0).getAnswerSet().isEmpty()){\n ai.load_fact( new Position(playerX, playerY),\n actions,\n makeDistances(buildDistances(currentGoalX, currentGoalY)),\n makeBombDistances(buildDistances(bombX, bombY)),\n makeEnemyDistances(buildDistances(enemyX, enemyY)),\n walls,\n around,\n enemyPaths,\n new Mode(mode)\n );\n answers = ai.getAnswerSets();\n }\n\n for (AnswerSet an : answers.getAnswersets()) {\n Pattern pattern = Pattern.compile(\"^choice\\\\((\\\\d+)\\\\)\");\n Matcher matcher;\n for (String atom : an.getAnswerSet()) {\n //System.out.println(atom);\n matcher = pattern.matcher(atom);\n\n if (matcher.find()) {\n log.info(\"DLV output: \" + matcher.group(1));\n move = Integer.parseInt(matcher.group(1));\n }\n }\n }\n if (move == 1) {\n set_allCan_move(0, true);\n this.x += 40;\n }\n else if (move == 2) {\n set_allCan_move(0, true);\n this.y += 40;\n }\n else if (move == 3) {\n set_allCan_move(0, true);\n this.y -= 40;\n }\n else if (move == 0) {\n set_allCan_move(0, true);\n this.x -= 40;\n }\n else if (move == 4 && can_hit && (playerX != goalX || playerY != goalY)) {\n ai_hit = true;\n can_hit = false;\n this.bombX=playerX;\n this.bombY=playerY;\n this.bombGoalX=playerX;\n this.bombGoalY=playerY;\n bombPlaced++;\n }\n moves.add(move);\n ai.clear();\n }\n else{\n playerX = this.x/40;\n playerY = this.y/40;\n }\n\n\n if (Gdx.input.isKeyPressed(Input.Keys.A)&&can_move[0]) {\n set_allCan_move(0, true);\n this.x -= 5;\n }\n if (Gdx.input.isKeyPressed(Input.Keys.D)&&can_move[1]) {\n set_allCan_move(0, true);\n this.x += 5;\n }\n if (Gdx.input.isKeyPressed((Input.Keys.W))&&can_move[2]) {\n this.y += 5;\n set_allCan_move(0, true);\n }\n if (Gdx.input.isKeyPressed((Input.Keys.S))&&can_move[3]){\n set_allCan_move(0, true);\n this.y -= 5;\n }\n if (Gdx.input.isKeyPressed((Input.Keys.Z)) && can_hit) {\n can_hit = false;\n this.bombX=playerX;\n this.bombY=playerY;\n this.bombGoalX=playerX;\n this.bombGoalY=playerY;\n bombPlaced++;\n }\n\n if (Gdx.input.isKeyPressed((Input.Keys.N)))\n log.info(\"CURRENT ENEMY: [\" + enemyX + \", \" + enemyY + \"] \");\n }",
"public void Attack(Character Opponent) {\n int damage = 0;\n\n System.out.print(\"\\n\\n\\t***************** Giant Attacks! *****************\\n\"\n + \"\\tBefore Attack: Giant Hit = \" + getHealth() + \" \"\n + Opponent.getName() + \" Hit = \" + Opponent.getHealth()\n + \"\\n\");\n\n Random rand = new Random();\n damage = (rand.nextInt(10) + 1) + getAttack();\n \n if (damage > Opponent.getDefense()) {\n damage -= Opponent.getDefense();\n } else {\n damage = 0;\n }\n if (Opponent.hasFullBodyArmor()) {\n if (damage > 4) {\n damage -= 4;\n }\n }\n if (Opponent.hasChainMail()) {\n if (damage > 2) {\n damage -= 2;\n }\n }\n\n Opponent.damage(damage);\n \n System.out.print(\"\\tAfter Attack: Giant Hit = \" + getHealth() + \" \"\n + Opponent.getName() + \" Hit = \" + Opponent.getHealth()\n + \"\\n\\n\");\n\n try { Thread.sleep(3000); } catch (Exception e) {}\n }",
"@Override\r\n\tpublic void onLivingUpdate() {\r\n\t\tsuper.onLivingUpdate();\r\n\t\tthis.field_70888_h = this.field_70886_e;\r\n\t\tthis.field_70884_g = this.destPos;\r\n\t\tthis.destPos = (float)((double)this.destPos + (double)(this.onGround ? -1 : 4) * 0.3D);\r\n\t\t\r\n\t\tif(this.destPos < 0.0F) {\r\n\t\t\tthis.destPos = 0.0F;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.destPos > 1.0F) {\r\n\t\t\tthis.destPos = 1.0F;\r\n\t\t}\r\n\t\t\r\n\t\tif(!this.onGround && this.field_70889_i < 1.0F) {\r\n\t\t\tthis.field_70889_i = 1.0F;\r\n\t\t}\r\n\t\t\r\n\t\tthis.field_70889_i = (float)((double)this.field_70889_i * 0.9D);\r\n\t\t\r\n\t\tif(!this.onGround && this.motionY < 0.0D) {\r\n\t\t\tthis.motionY *= 0.6D;\r\n\t\t}\r\n\t\t\r\n\t\tthis.field_70886_e += this.field_70889_i * 2.0F;\r\n\t\t\r\n\t\tif(!this.isChild() && !this.worldObj.isRemote && --this.timeUntilNextEgg <= 0) {\r\n\t\t\tthis.worldObj.playSoundAtEntity(this, \"mob.chickenplop\", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);\r\n\t\t\tthis.dropItem(SorceryItems.goldegg, 1);\r\n\t\t\tthis.timeUntilNextEgg = this.rand.nextInt(6000) + 6000;\r\n\t\t}\r\n\t}",
"@Override\n\tpublic void onHitted(EntityDamageByEntityEvent e, Player damager, Player victim) {\n\t\t\n\t}",
"@Override\n\tpublic void onDamageTaken(Entity attacker, Entity defender, int damage, int entityAttackType) {\n\t\tif (attacker.getType() == EntityType.PLAYER && defender.getType() == EntityType.NPC) {\n\t\t\tPlayer attackerAsPlayer = (Player) attacker;\n\n\t\t\tNpc defenderAsNpc = (Npc) defender;\n\n\t\t\tif (phase == AbyssalSirePhase.SLEEPING && phaseProgressionEvent == null) {\n\t\t\t\tphaseProgressionEvent = new AbyssalSirePhaseProgressionEvent();\n\n\t\t\t\tCycleEventContainer<Entity> container = getEventHandler().addEvent(this, phaseProgressionEvent, 6);\n\n\t\t\t\trequestAnimation(4528);\n\t\t\t\tcontainer.addStopListener(() -> {\n\t\t\t\t\tif (phase == AbyssalSirePhase.SLEEPING) {\n\t\t\t\t\t\ttarget = attackerAsPlayer;\n\t\t\t\t\t\tfirstWake();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else if (phase == AbyssalSirePhase.AWAKE) {\n\t\t\t\tif (attackerAsPlayer.getOldSpellId() > -1) {\n\t\t\t\t\tint spellDisorientation = DISORIENTING_SPELLS.getOrDefault(CombatConstants.MAGIC_SPELLS[attackerAsPlayer.getOldSpellId()][0], 0);\n\n\t\t\t\t\tif (spellDisorientation > 0) {\n\t\t\t\t\t\tdisorientation += spellDisorientation;\n\n\t\t\t\t\t\tif (disorientation >= 100) {\n\t\t\t\t\t\t\tdisorient();\n\t\t\t\t\t\t\tattackerAsPlayer.getPA().sendMessage(\"Your shadow spelled disoriented the Abyssal sire.\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (phase != AbyssalSirePhase.DISORIENTED) {\n\t\t\t\t\tdamageDisorientation += damage;\n\n\t\t\t\t\tif (damageDisorientation >= 75) {\n\t\t\t\t\t\tdisorient();\n\t\t\t\t\t\tattackerAsPlayer.getPA().sendMessage(\"Your damage slowly disoriented the Abyssal sire.\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\theal(ThreadLocalRandom.current().nextInt(1, Math.max(5, damage)));\n\t\t\t} else if (phase == AbyssalSirePhase.MELEE_COMBAT) {\n\t\t\t\tif ((defenderAsNpc.getCurrentHitPoints() <= 200)) {\n\t\t\t\t\twalkToCenter();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"private static void attack(RobotInfo target) throws GameActionException {\n if (SOLDIER_DEBUG) {\n System.out.println(\"attacking\");\n }\n BulletInfo[] bullets = rc.senseNearbyBullets(EvasiveSoldier.BULLET_DETECT_RADIUS);\n RobotInfo[] robots = rc.senseNearbyRobots(EvasiveSoldier.ENEMY_DETECT_RADIUS);\n MapLocation targetLocation = target.getLocation();\n move(bullets, robots, targetLocation);\n //RobotUtils.tryMoveDestination(targetLocation);\n if (TargetingUtils.clearShot(here, target) || (rc.getType() == RobotType.GARDENER && rc.getOpponentVictoryPoints() > 10)) {\n if (SOLDIER_DEBUG) {\n System.out.println(\"clearShot to target\");\n }\n Direction towardsEnemy = here.directionTo(targetLocation);\n float distanceEnemy = here.distanceTo(targetLocation);\n if (distanceEnemy <= 3.5 && rc.canFirePentadShot() && rc.getTeamBullets() > 200) {\n rc.firePentadShot(towardsEnemy);\n }\n else {\n if (rc.canFireTriadShot() && rc.getTeamBullets() > 50) {\n rc.fireTriadShot(towardsEnemy);\n }\n else if (rc.canFireSingleShot()) {\n rc.fireSingleShot(towardsEnemy);\n }\n }\n }\n }",
"public void startHealing()\n\t{\n\t\ttimerList.clear();\n\t\tinHospitalTimer = new PlayPauseTimer(10, new ActionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tworld.heal();\n\t\t\t\tx = random.nextInt(world.getSIMULATION_WIDTH() - individualSize);\n\t\t\t\ty = random.nextInt(world.getSIMULATION_HEIGHT() - individualSize); \n\t\t\t\tmoveInPopulation();\n\t\t\t\texitHospital();\n\t\t\t\thealthStatus = HealthStatus.HEALTHY;\n\t\t\t\ttimerList.remove(inHospitalTimer);\n\t\t\t}\n\t\t\t\n\t\t}, world.getRefreshTime());\n\t\ttimerList.add(inHospitalTimer);\n\t}",
"void shoot_ship_missiles(long now) {\n if (pressed_key_codes.contains(KeyCode.SPACE)) {\n // Rate of fire cannot exceed 2 missiles per second\n if (now - missile_timer > 500000000) {\n missile_audio.play();\n Missile missile = ship.shootMissile();\n ImageView ship_missile_image_view = new ImageView(ship_missile_image);\n ship_missile_image_view.setX(missile.x_position);\n ship_missile_image_view.setY(missile.y_position);\n ship_missile_image_view.setFitWidth(Dimensions.SHIP_MISSILE_WIDTH);\n ship_missile_image_view.setFitHeight(Dimensions.SHIP_MISSILE_HEIGHT);\n ship_missile_image_views.add(ship_missile_image_view);\n game_pane.getChildren().add(ship_missile_image_view);\n missile_timer = now;\n }\n }\n }",
"public int doDamage(Actor attacker, int damage){\n if( iframes==0 ){\n health -= damage;\n healthbar.setHealth(health);\n iframes = 20;\n MuteControl.playSound(attackSound);\n if (health>0) return damage;\n die();\n return damage;\n }else return 0;\n }",
"@Override\n\tpublic int attack( ){\n\t\treturn enemy.attack();\n\t}",
"public void attack(Entity entity, boolean aoe) {\n if(aoe) entity.damaged((int) (this.damage*0.6));\n else entity.damaged(this.damage);\n if(entity.isDead()){\n incExp(entity.getLevel()*9);\n if(entity instanceof Boss) {\n this.bossesDefeated++;\n }\n }\n }",
"public void tick(){\r\n scoreKeep++;\r\n if(scoreKeep >= 500){\r\n scoreKeep = 0;\r\n hud.setLevel(hud.getLevel()+1);\r\n // continuous addition of enemies at each new level\r\n if(game.diff == 0) {\r\n \tif((hud.getLevel() >= 2 && hud.getLevel() <= 3)||(hud.getLevel() >= 7 && hud.getLevel() <= 9))\r\n \thandler.addObject(new BasicEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.BasicEnemy, handler));\r\n if(hud.getLevel() == 4 || hud.getLevel() == 6)\r\n handler.addObject(new FastEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.FastEnemy, handler));\r\n if(hud.getLevel() == 5)\r\n \thandler.addObject(new SmartEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.SmartEnemy, handler));\r\n if(hud.getLevel() == 10){\r\n handler.clearEnemies();\r\n handler.addObject(new SmartEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.SmartEnemy, handler));\r\n handler.addObject(new BossEnemy((Game.width/2)-48, -100, ID.BossEnemy, handler));\r\n }\r\n }else if(game.diff == 1) {\r\n \tif((hud.getLevel() >= 2 && hud.getLevel() <= 3)||(hud.getLevel() >= 7 && hud.getLevel() <= 9))\r\n \thandler.addObject(new HardEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.BasicEnemy, handler));\r\n if(hud.getLevel() == 4 || hud.getLevel() == 6)\r\n handler.addObject(new FastEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.FastEnemy, handler));\r\n if(hud.getLevel() == 5)\r\n \thandler.addObject(new SmartEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.SmartEnemy, handler));\r\n if(hud.getLevel() == 10){\r\n handler.clearEnemies();\r\n handler.addObject(new SmartEnemy(r.nextInt(Game.width-50), r.nextInt(Game.height-50), ID.SmartEnemy, handler));\r\n handler.addObject(new BossEnemy((Game.width/2)-48, -100, ID.BossEnemy, handler));\r\n }\r\n }\r\n }\r\n }",
"public static void enemyWonInc(){\r\n\t\t_enemyWon++;\r\n\t}",
"public void gettingAttacked(HitByBulletEvent e) {\r\n\t\tif (gotTarget) {\r\n\t\t\tfor (int i = 0; i < enemyTracker.getEnemyList().size(); i++) {\r\n\t\t\t\tif (enemyTracker.getEnemyList().get(i).getName().equals(e.getName()) && (!e.getName().equals(radarTarget.getName()))) {\r\n\t\t\t\t\t\tmrRobot.sendMessage(5, \"2\");\r\n\t\t\t\t\t\tradarTarget = enemyTracker.getEnemyList().get(getIndexForEnemy(e.getName()));\r\n\t\t\t\t\t\ttargetTracking.get(getIndexForName(mrRobot.getName())).updateTarget(radarTarget);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void onMushroomTimerTick() {\r\n\t\tgame.tryToPlantMushroom();\r\n\t}",
"public void attack() {\n this.attacked = true;\n }",
"private void enemiesWillShoot(Graphics2D g2d, GameState state) {\n if (numOfRenderShoot == 75) {\n numOfRenderShoot = 0;\n for (int i = 0; i < state.getEnemyTanks().size(); i++) {\n if (state.getEnemyTanks().get(i).getLocY() < state.getTankLocY() + 500 && state.getEnemyTanks().get(i).getLocY() > state.getTankLocY() - 400 &&\n state.getEnemyTanks().get(i).getLocX() < state.getTankLocX() + 800 && state.getEnemyTanks().get(i).getLocX() > state.getTankLocX() - 500) {\n state.getEnemyMissiles().add(new EnemyMissile(this, state, 10\n , state.getEnemyTanks().get(i)));\n state.getEnemyMissiles().get(state.getEnemyMissiles().size() - 1).missileDirection(state);\n AudioPlayer enemyGunShotSFX = new AudioPlayer(\"sound effects/enemyshot.wav\", 0);\n }\n }\n for (int i = 0; i < state.getEnemyCars().size(); i++) {\n if (state.getEnemyCars().get(i).getLocY() < state.getTankLocY() + 500 && state.getEnemyCars().get(i).getLocY() > state.getTankLocY() - 400 &&\n state.getEnemyCars().get(i).getLocX() < state.getTankLocX() + 800 && state.getEnemyCars().get(i).getLocX() > state.getTankLocX() - 500) {\n state.getEnemyBullets().add(new EnemyBullet(this, state, 20\n , state.getEnemyCars().get(i)));\n state.getEnemyBullets().get(state.getEnemyBullets().size() - 1).bulletDirection(state);\n AudioPlayer enemyGunShotSFX = new AudioPlayer(\"sound effects/enemyshot.wav\", 0);\n }\n }\n for (int i = 0; i < state.getEnemyWallTurrets().size(); i++) {\n if (state.getEnemyWallTurrets().get(i).getLocY() < state.getTankLocY() + 500 && state.getEnemyWallTurrets().get(i).getLocY() > state.getTankLocY() - 400 &&\n state.getEnemyWallTurrets().get(i).getLocX() < state.getTankLocX() + 800 && state.getEnemyWallTurrets().get(i).getLocX() > state.getTankLocX() - 500) {\n state.getEnemyWallTurretMissiles().add(new EnemyWallTurretMissile(this, state, 15\n , state.getEnemyWallTurrets().get(i)));\n state.getEnemyWallTurretMissiles().get(state.getEnemyWallTurretMissiles().size() - 1).missileDirection(state);\n AudioPlayer enemyGunShotSFX = new AudioPlayer(\"sound effects/enemyshot.wav\", 0);\n }\n }\n\n for (int i = 0; i < state.getEnemyTurrets().size(); i++) {\n if (state.getEnemyTurrets().get(i).getLocY() < state.getTankLocY() + 500 && state.getEnemyTurrets().get(i).getLocY() > state.getTankLocY() - 400 &&\n state.getEnemyTurrets().get(i).getLocX() < state.getTankLocX() + 800 && state.getEnemyTurrets().get(i).getLocX() > state.getTankLocX() - 500) {\n state.getEnemyHomingMissiles().add(new EnemyHomingMissile(this, state, 15\n , state.getEnemyTurrets().get(i)));\n state.getEnemyHomingMissiles().get(state.getEnemyHomingMissiles().size() - 1).missileDirection(state);\n AudioPlayer enemyGunShotSFX = new AudioPlayer(\"sound effects/enemyshot.wav\", 0);\n }\n }\n }\n for (EnemyMissile enemyMissile : state.getEnemyMissiles()) {\n enemyMissile.paint(g2d, state);\n }\n for (EnemyBullet enemyBullet : state.getEnemyBullets()) {\n enemyBullet.paint(g2d, state);\n }\n for (EnemyWallTurretMissile enemyWallTurretMissile : state.getEnemyWallTurretMissiles()) {\n enemyWallTurretMissile.paint(g2d, state);\n }\n for (EnemyHomingMissile enemyHomingMissile : state.getEnemyHomingMissiles()) {\n enemyHomingMissile.paint(g2d, state);\n }\n }",
"@Override\n public void attackedByPaladin(double attack) {\n this.attack += (2 * attack) / 3;\n damageCounter = Math.max(damageCounter - (2 * attack) / 3, 0);\n }",
"public void Hitting(Monsters opponent) throws Exception {\n\t\tassert (this != opponent);\n\t\tRandom rand = new Random();\n\t\tint hit = rand.nextInt(30);\n\t\tif(hit >= this.getHitpoints()) \n\t\t\thit = this.getHitpoints();\n\t\tif (hit >= opponent.getProtection()) {\n\t\t\tint power;\n\t\t\tif (this.getAnchor(1) == null)\n\t\t\t\tpower = this.getDamage() + (this.getStrength() - 5) / 3;\n\t\t\telse\n\t\t\t\tpower = this.getDamage() + (this.getStrength() - 5) / 3 + ((Weapons)this.getAnchor(1)).getDamage();\n\t\t\topponent.setHitpoints(opponent.getHitpoints() - power);\n\t\t\tSystem.out.println(this.getName() + \" Deals \" + power + \" damage over \" + opponent.getName());\n\t\t}\n\t\telse\n\t\t\tSystem.out.println(this.getName() + \" attack failed!\");\n\t}",
"abstract public double timeUntilCollision(Ball ball);",
"public float hit(Projectile projectile) {\n float scoreReturned = 0;\n float velocity;\n int timesHit;\n\n if (projectile.getDestroys().contains(getType())) {\n velocity = projectile.getLinearVelocity().length();\n\n if (velocity >= 80) {\n timesHit = 3;\n } else if (velocity >= 60) {\n timesHit = 2;\n } else {\n timesHit = 1;\n }\n\n for (int i = 0; i < timesHit; i++) {\n if (!isDestroyed()) {\n hitCounter++;\n scoreReturned += getHitScore();\n }\n }\n\n playSound(hitCounter - 1, 1f);\n } else {\n if (!(getType() == TargetType.ENEMY)) {\n playSound(hitCounter, 0.5f);\n }\n }\n\n return scoreReturned;\n }",
"public abstract void attack(Vector2 spawnPos, Vector2 target);",
"public int CriticalHit(int start)\r\n {\r\n damage = ((int)(Math.random() * 100) % 50 + 80);\r\n int hp = start - damage;\r\n \r\n //modified to turn hp to 0 once it drops below or equals 0.\r\n if(hp <= 0)\r\n hp = 0;\r\n return hp;\r\n }",
"public void gotDamaged() {\n \tif(!dead) {\n\t\t\tdamaged = true;\n\t\t\tgettingHitParticleEffect.reset();\n\t\t\tcolorValue = 0;\n\t\t}\n\n }",
"@Override\n\t\tpublic final double time() throws Throwable {\n\t\t\tinit();\n\t\t\ttimer.lap();\n\t\t\ttimed();\n\t\t\tdouble time = timer.lap();\n\t\t\tcleanup();\n\t\t\treturn time;\n\t\t}",
"public void attemptAttack() {\r\n\t\tattackAttempts += 100;\r\n\t}",
"boolean shouldAutoAggro(IGeneticMob geneticMob, EntityLiving otherEntity);",
"private void damage(){\n\n LevelMap.getLevel().damage(dmg);\n //System.out.println(\"died\");\n setDie();\n }",
"public void shoot()\n {\n\n if(reload<=0)//if the tower has reloaded\n {\n int randomizer=Greenfoot.getRandomNumber(20)-10; \n MinigunBullet bullet = new MinigunBullet(this.getRotation()+randomizer, damage,this);\n getWorld().addObject(bullet, getX(), getY());\n bullet.move(30);\n reload=3;\n }\n else//reload\n {\n reload--;\n }\n\n }",
"public void timer() {\r\n date.setTime(System.currentTimeMillis());\r\n calendarG.setTime(date);\r\n hours = calendarG.get(Calendar.HOUR_OF_DAY);\r\n minutes = calendarG.get(Calendar.MINUTE);\r\n seconds = calendarG.get(Calendar.SECOND);\r\n //Gdx.app.debug(\"Clock\", hours + \":\" + minutes + \":\" + seconds);\r\n\r\n buffTimer();\r\n dayNightCycle(false);\r\n }",
"public void battleEnemyAttack() {\n if(battleEnemy != null){ // If all enemies have attacked, they cannot attack anymore for this round\n\n MovingEntity target = battleEnemy.getAttackPreference(targetAllies);\n if(target == null){\n target = targetAlly;\n }\n\n battleEnemy.attack(target, targetEnemies, targetAllies);\n //System.out.println(battleEnemy.getID() + \" is attacking \" + target.getID() + \" remaining hp: \" + target.getCurrHP());\n if (updateTarget(target) == false) {\n // if target still alive, check if its still friendly incase of zombify\n targetAlly = checkSideSwap(targetAlly, false, battleEnemies, targetEnemies, battleAllies, targetAllies);\n }\n\n battleEnemy = nextAttacker(battleEnemy, battleEnemies);\n\n }\n }",
"public void timer()\n {\n if(exists == true)\n { \n if(counter < 500) \n { \n counter++; \n } \n else \n { \n Greenfoot.setWorld(new Test()); \n exists = false; \n } \n } \n }",
"@Override\n\tpublic void onHitPlayer(EntityDamageByEntityEvent e, Player damager, Player victim) {\n\t\t\n\t}",
"@Override \n\tpublic ShotInfo process(double dtime, ShotInfo shotInfo) {\n\t\tVector2d currentPosition = shotInfo.getPosition2D();\n\t\tVector2d currentVelocity = shotInfo.getVelocity2D();\n\t\tboolean hitWater = false;\n\n\t\tfor (double timer = 0; timer < dtime; timer += step) {\n\t\t\tif (currentVelocity.length() == 0) {\n\t\t\t\tcurrentVelocity = currentVelocity.add(new Vector2d(1e-20,1e-20));\n\t\t\t}\n\t\t\tVector2d currentAcceleration = acceleration(currentPosition,currentVelocity);\n\n\t\t\t//Calculate next position and next velocity\n\t\t\tVector2d nextPosition = currentPosition.add(currentVelocity.multiply(step));\n\t\t\tVector2d nextVelocity = currentVelocity.add(currentAcceleration.multiply(step));\n\n\t\t\t//update position and velocity\n\t\t\tcurrentPosition = checkOutOfBounds(nextPosition);\n\t\t\tcurrentVelocity = limitVelocity(nextVelocity);\n\n\t\t\t//Check for collisions and react accordingly\n\t\t\tVector3f ballPosition = new Vector3f((float) currentPosition.x, (float) course.height.evaluate(currentPosition), (float) currentPosition.y);\n\n\t\t\t//Check for water 'collision'\n\t\t\tif (!botMod) {\n\t\t\t\tVector3d collisionNormal = CheckCollision.checkForCollision(game.getTrees().getTrees(), course.goal, course.ball, ballPosition);\n\t\t\t\tif(collisionNormal!=null){\n\t\t\t\t\tSystem.out.println(\"YEE\");\n\n\t\t\t\t\tdouble A = (currentVelocity.dotProduct(collisionNormal.getVector2D()))/(currentVelocity.length()*collisionNormal.getVector2D().length());\n\t\t\t\t\tdouble angle = Math.acos(A);\n\t\t\t\t\tcurrentVelocity = currentVelocity.rotate(angle);\n\t\t\t\t}\n\n\t\t\t\thitWater = WaterHit.hitWater(ballPosition);\n\t\t\t\tif(hitWater){\n\t\t\t\t\tWaterHit.showWaterHitUI(game, ballPosition);\n\t\t\t\t\tcourse.ball.setVelocity(new Vector3d(0, 0, 0));\n\t\t\t\t\tcurrentVelocity = new Vector2d(0, 0);\n\t\t\t\t\ttimer = dtime;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(!hitWater) {\n\t\t\tshotInfo.setPosition3D(new Vector3d(currentPosition.x, course.height.evaluate(currentPosition), currentPosition.y));\n\t\t\tshotInfo.setVelocity3D(new Vector3d(currentVelocity.x, 0, currentVelocity.y));\n\t\t}\n\n\t\treturn new ShotInfo(shotInfo);\n\t}",
"int getTimesCombatActionsCalled();",
"@Test\n\tpublic void TestCalculateDamage() \n\t{\n\t\tWeapon gun = new Gun();\n\t\t// 0<=distance between the range<=30\n\t\tgun.calculateDamage(10);\n\t\tassertEquals(15,gun.getDamage());\n\t\tassertEquals(3,((Gun) gun).gettRateofFire(),.1);\n\t\tassertEquals(39,((Gun) gun).getActualAmmo(),.1);\n\t\t//distance out of the range\n\t\tgun.calculateDamage(50);\n\t\tassertEquals(15,gun.getDamage());\n\t\tassertEquals(2,((Gun) gun).gettRateofFire(),.1);\n\t\tassertEquals(38,((Gun) gun).getActualAmmo(),.1);\n\t\t //reload when actual ammo is 0\n\t\t((Gun) gun).setActualAmmo(0);\n\t ((Gun) gun).reload();\n\t\tassertEquals(40,((Gun) gun).getActualAmmo(),.1);\n\t\t\n\t}",
"public void update(MazeEventEnemyWalkedKilled e) {\r\n }",
"int attack(Unit unit, Unit enemy);",
"public int lowHit(int start)\r\n {\r\n damage = ((int)(Math.random() * 100) % 20 + 35);\r\n int hp = start - damage; \r\n \r\n //modified to turn hp to 0 once it drops below or equals 0.\r\n if(hp <= 0)\r\n hp = 0;\r\n return hp;\r\n }",
"@Override\n\tpublic void onUpdate()\n\t{\n\t\tthis.lastTickPosX = this.posX;\n\t\tthis.lastTickPosY = this.posY;\n\t\tthis.lastTickPosZ = this.posZ;\n\t\tsuper.onUpdate();\n\n\t\tif (this.throwableShake > 0)\n\t\t{\n\t\t\t--this.throwableShake;\n\t\t}\n\n\t\tif (this.inGround)\n\t\t{\n\t\t\tif (this.worldObj.getBlockState(this.getPosition()).getBlock() == this.inTile)\n\t\t\t{\n\t\t\t\t++this.ticksInGround;\n\n\t\t\t\tif (this.ticksInGround == 1200)\n\t\t\t\t{\n\t\t\t\t\tthis.setDead();\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.inGround = false;\n\t\t\tthis.motionX *= this.rand.nextFloat() * 0.2F;\n\t\t\tthis.motionY *= this.rand.nextFloat() * 0.2F;\n\t\t\tthis.motionZ *= this.rand.nextFloat() * 0.2F;\n\t\t\tthis.ticksInGround = 0;\n\t\t\tthis.ticksInAir = 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t++this.ticksInAir;\n\t\t}\n\n\t\tVec3 vec3 = new Vec3(this.posX, this.posY, this.posZ);\n\t\tVec3 vec31 = new Vec3(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);\n\t\tMovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks(vec3, vec31);\n\t\tvec3 = new Vec3(this.posX, this.posY, this.posZ);\n\t\tvec31 = new Vec3(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);\n\n\t\tif (movingobjectposition != null)\n\t\t{\n\t\t\tvec31 = new Vec3(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);\n\t\t}\n\n\t\tif (!this.worldObj.isRemote)\n\t\t{\n\t\t\tEntity entity = null;\n\t\t\tList list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this,\n\t\t\t\t\tthis.getEntityBoundingBox().addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));\n\t\t\tdouble d0 = 0.0D;\n\t\t\tEntityLivingBase entitylivingbase = this.getThrower();\n\n\t\t\tfor (Object obj : list)\n\t\t\t{\n\t\t\t\tEntity entity1 = (Entity) obj;\n\n\t\t\t\tif (entity1.canBeCollidedWith() && ((entity1 != entitylivingbase) || (this.ticksInAir >= 5)))\n\t\t\t\t{\n\t\t\t\t\tfloat f = 0.3F;\n\t\t\t\t\tAxisAlignedBB axisalignedbb = entity1.getEntityBoundingBox().expand(f, f, f);\n\t\t\t\t\tMovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31);\n\n\t\t\t\t\tif (movingobjectposition1 != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tdouble d1 = vec3.distanceTo(movingobjectposition1.hitVec);\n\n\t\t\t\t\t\tif ((d1 < d0) || (d0 == 0.0D))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tentity = entity1;\n\t\t\t\t\t\t\td0 = d1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (entity != null)\n\t\t\t{\n\t\t\t\tmovingobjectposition = new MovingObjectPosition(entity);\n\t\t\t}\n\t\t}\n\n\t\tif (movingobjectposition != null)\n\t\t{\n\t\t\tif ((movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)\n\t\t\t\t\t&& (this.worldObj.getBlockState(movingobjectposition.getBlockPos()).getBlock() == Blocks.portal))\n\t\t\t{\n\t\t\t\tthis.inPortal = true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.onImpact(movingobjectposition);\n\t\t\t}\n\t\t}\n\n\t\tthis.posX += this.motionX;\n\t\tthis.posY += this.motionY;\n\t\tthis.posZ += this.motionZ;\n\t\tfloat f1 = MathHelper.sqrt_double((this.motionX * this.motionX) + (this.motionZ * this.motionZ));\n\t\tthis.rotationYaw = (float) ((Math.atan2(this.motionX, this.motionZ) * 180.0D) / Math.PI);\n\n\t\tfor (this.rotationPitch = (float) ((Math.atan2(this.motionY, f1) * 180.0D) / Math.PI); (this.rotationPitch\n\t\t\t\t- this.prevRotationPitch) < -180.0F; this.prevRotationPitch -= 360.0F)\n\t\t{\n\t\t}\n\n\t\twhile ((this.rotationPitch - this.prevRotationPitch) >= 180.0F)\n\t\t{\n\t\t\tthis.prevRotationPitch += 360.0F;\n\t\t}\n\n\t\twhile ((this.rotationYaw - this.prevRotationYaw) < -180.0F)\n\t\t{\n\t\t\tthis.prevRotationYaw -= 360.0F;\n\t\t}\n\n\t\twhile ((this.rotationYaw - this.prevRotationYaw) >= 180.0F)\n\t\t{\n\t\t\tthis.prevRotationYaw += 360.0F;\n\t\t}\n\n\t\tthis.rotationPitch = this.prevRotationPitch + ((this.rotationPitch - this.prevRotationPitch) * 0.2F);\n\t\tthis.rotationYaw = this.prevRotationYaw + ((this.rotationYaw - this.prevRotationYaw) * 0.2F);\n\t\tfloat f2 = 0.99F;\n\t\tfloat f3 = this.getGravityVelocity();\n\n\t\tif (this.isInWater())\n\t\t{\n\t\t\tfor (int i = 0; i < 4; ++i)\n\t\t\t{\n\t\t\t\tfloat f4 = 0.25F;\n\t\t\t\tthis.worldObj.spawnParticle(EnumParticleTypes.WATER_BUBBLE, this.posX - (this.motionX * f4), this.posY - (this.motionY * f4),\n\t\t\t\t\t\tthis.posZ - (this.motionZ * f4), this.motionX, this.motionY, this.motionZ);\n\t\t\t}\n\n\t\t\tf2 = 0.8F;\n\t\t}\n\n\t\tthis.motionX *= f2;\n\t\tthis.motionY *= f2;\n\t\tthis.motionZ *= f2;\n\t\tthis.motionY -= f3;\n\t\tthis.setPosition(this.posX, this.posY, this.posZ);\n\t}",
"public void idle(double deltaTime) {\n\n\n float distance = distanceCalc();\n if (distance < 10000) {\n homing();\n } else {\n idleMovement -= deltaTime;\n\n Random rand = new Random();\n int directionNum = rand.nextInt((4 - 1) + 1) + 1;\n\n if (directionNum == 1) {\n yPos -= speed * deltaTime;\n idleMovement = idleRate;\n }\n if (directionNum == 2) {\n yPos += speed * deltaTime;\n idleMovement = idleRate;\n }\n if (directionNum == 3) {\n xPos -= speed * deltaTime;\n idleMovement = idleRate;\n }\n if (directionNum == 4) {\n xPos += speed * deltaTime;\n idleMovement = idleRate;\n }\n }\n }"
] | [
"0.688876",
"0.6758555",
"0.6490412",
"0.64149743",
"0.63874286",
"0.63290006",
"0.6230141",
"0.6131724",
"0.6101909",
"0.6071835",
"0.6037663",
"0.6022642",
"0.6011783",
"0.6002283",
"0.59953773",
"0.59373164",
"0.5915731",
"0.58806574",
"0.5865827",
"0.5856175",
"0.58493847",
"0.583895",
"0.58244795",
"0.5806147",
"0.57912266",
"0.5789636",
"0.5770593",
"0.57642525",
"0.57211214",
"0.57211214",
"0.5720034",
"0.56579465",
"0.56231314",
"0.5622833",
"0.56150734",
"0.5614052",
"0.5601969",
"0.55598444",
"0.55542254",
"0.5546941",
"0.5535005",
"0.5529807",
"0.55272806",
"0.55199295",
"0.5516594",
"0.55112267",
"0.5509859",
"0.55071837",
"0.55034614",
"0.5494474",
"0.548685",
"0.54819053",
"0.54715836",
"0.54654896",
"0.5463518",
"0.5452971",
"0.5450886",
"0.5445845",
"0.54449326",
"0.54385996",
"0.54306275",
"0.54259807",
"0.5425316",
"0.5416885",
"0.5413369",
"0.54130083",
"0.54073393",
"0.5396933",
"0.5396692",
"0.5393838",
"0.5386078",
"0.5379242",
"0.5377863",
"0.5375585",
"0.5352856",
"0.53480613",
"0.53459096",
"0.53455865",
"0.5343587",
"0.5340142",
"0.5339234",
"0.53381276",
"0.5337997",
"0.53334415",
"0.5326609",
"0.5319684",
"0.53195465",
"0.5315468",
"0.53121567",
"0.53073084",
"0.53029746",
"0.5298024",
"0.52976155",
"0.5290483",
"0.5287319",
"0.5283407",
"0.5280854",
"0.52746266",
"0.52726865",
"0.527064"
] | 0.8607811 | 0 |
shouldAggroTowardsMob Whether this mob should go attack that mob by seeing it | boolean shouldAutoAggro(IGeneticMob geneticMob, EntityLiving otherEntity); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"float shouldAggroOnHit(IGeneticMob geneticMob, EntityLiving attacker);",
"@Override\r\n\tpublic boolean attackEntityAsMob(Entity target) {\r\n\t\t\r\n\t\tboolean flag = super.attackEntityAsMob(target);\r\n\t\tflag = target.attackEntityFrom(DamageSource.causeMobDamage(this), (float)((int)this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).getAttributeValue()));\r\n\r\n if (flag) {\r\n this.applyEnchantments(this, target);\r\n }\r\n\r\n return flag;\r\n }",
"@Override\n\tpublic boolean shouldExecute() {\n\t\tif (!theEntity.isTamed())\n\t\t\treturn false;\n\t\telse if (theEntity.isInWater())\n\t\t\treturn false;\n\t\telse if (!theEntity.onGround)\n\t\t\treturn false;\n\t\telse {\n\t\t\tfinal EntityLivingBase var1 = theEntity.getOwner();\n\t\t\treturn var1 == null ? true\n\t\t\t\t\t: theEntity.getDistanceSqToEntity(var1) < 144.0D\n\t\t\t\t\t\t\t&& var1.getAITarget() != null ? false : isSitting;\n\t\t}\n\t}",
"@Override\n\tpublic boolean attackEntityAsMob(Entity entity) {\n\t\treturn attack(entity);\n\t}",
"float shouldEatOffTheGround(IGeneticMob geneticMob, EntityItem itemEntity);",
"public boolean shouldExecute()\n {\n return !super.shouldExecute() ? false : (!this.theEntity.worldObj.getGameRules().getGameRuleBooleanValue(\"mobGriefing\") ? false : !this.field_151504_e.func_150015_f(this.theEntity.worldObj, this.entityPosX, this.entityPosY, this.entityPosZ));\n }",
"@Override\n\tpublic boolean shouldExecute() {\n\t\tif (!theEntityTameable.isTamed())\n\t\t\treturn false;\n\t\telse {\n\t\t\tfinal EntityLivingBase var1 = theEntityTameable.getOwner();\n\n\t\t\tif (var1 == null)\n\t\t\t\treturn false;\n\t\t\telse {\n\t\t\t\ttheTarget = var1.getLastAttacker();\n\t\t\t\tfinal int var2 = var1.getLastAttackerTime();\n\t\t\t\treturn var2 != field_142050_e\n\t\t\t\t\t\t&& isSuitableTarget(theTarget, false)\n\t\t\t\t\t\t&& theEntityTameable.func_142018_a(theTarget, var1);\n\t\t\t}\n\t\t}\n\t}",
"boolean willEggHatch(IGeneticMob geneticMob);",
"public boolean wantsToAttack() {\n boolean ret = false;\n \n potentialAttackers.clear(); //Previous potentials might no longer be adjacent to an enemy\n \n //Look at all my territories. If it has enough troops to smack someone, it does.\n for(Territory t : gameController.getBoard().getAgentsTerritories(this)){\n if(t.getNumTroops() > 1){\n \n //Check adjacent territories to see if we can do anything about it.\n List<Territory> adjs = gameController.getBoard().getAdjacentTerritories(t);\n for(Territory adj : adjs){\n //Record a boolean so we don't need to call it twice;\n boolean yes = !adj.getOwner().equals(this);\n \n //Check if we have an acceptable chance of success\n int tTroops = t.getNumTroops() - 1;\n int aTroops = adj.getNumTroops();\n double odds = MarkovLookupTable.getOddsOfSuccessfulAttack(tTroops, aTroops);\n yes &= Double.compare(odds, ACCEPTABLE_RISK) >= 0;\n \n //If we can attack with this territory, yes will be true, throw this Territory\n //in the list of potential attackers if it isn't already in there.\n if(yes){\n if(!potentialAttackers.contains(t)){\n potentialAttackers.add(t);\n }\n }\n ret |= yes; //Ret will be set to true and can't be unset if even 1 t can attack\n }\n }\n }\n \n return ret;\n }",
"public boolean shouldExecute() {\n return ShulkerEntity.this.getAttackTarget() == null && ShulkerEntity.this.rand.nextInt(40) == 0;\n }",
"boolean canLayEgg(IGeneticMob geneticMob);",
"public boolean attackAlly(Ally target) {\n\t\tLog.d(TAG, \"Attacking!\");\n\t\tif (target.takeDamage(damage)) {\n\t\t\treturn true;\n\t\t} else\n\t\t\treturn false;\n\t}",
"public boolean handleAttack(Action action) {\n ActorState a = action.getActor();\n if (a.getActor() == actor) {\n // Attacks on oneself always succeed, and we don't want to add ourselves as an enemy\n return true;\n }\n \n //maybeCounter(Augmentation.Type.ATTACK, a, combatants);\n enemies.add(a);\n \n double weaponAccuracy = 1.0; //source.getWeaponAccuracy(action);\n double chance = a.getAccuracy() * weaponAccuracy * (1.0 - getDefense());\n boolean success = Math.random() < chance;\n return success;\n }",
"private boolean canMageHarrasing(Creature m) {\n return (heroC.getX() - m.getX()) * (heroC.getX() - m.getX()) == (heroC.getY() - m.getY()) * (heroC.getY() - m.getY());\n }",
"public boolean attack(Combatant target) {\r\n for (int i = 0; i < numAttacks; i++) {\r\n int attackRoll = this.basicAttackToHit();\r\n\r\n if (attackRoll == (20 + toHit)) { //Critical case, double number of damage dice\r\n target.setCurrentHitPoints(target.getHitPoints() - (this.basicAttackDamage() + damageDice.roll()));\r\n } else if (attackRoll == 1 + toHit) { //Natural 1 case, auto miss\r\n continue;\r\n } else if (attackRoll > target.getAC()) { //Regular hit case\r\n target.setCurrentHitPoints(target.getHitPoints() - this.basicAttackDamage());\r\n } else { //Miss case\r\n continue;\r\n }\r\n\r\n if (target.getHitPoints() <= 0) {\r\n this.win();\r\n return true;\r\n }\r\n }\r\n return false;\r\n }",
"public boolean shouldExecute() {\n return this.entity.getAttackTarget() != null && this.isBowInMainhand();\n }",
"@Override\n\tpublic boolean performsAttackAnimation() {\n\t\tif (phase == AbyssalSirePhase.MAGIC_COMBAT && attack == AbyssalSireAttack.POISON) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"public interface IHitAggro {\n /**\n * shouldAggroOnHit\n * The chance (where 1.0F = 100%) that this mob would be aggroed if struck by this entity\n * Should NOT trigger the aggro itself! That should only occur when actually hit!\n * @param geneticMob the mob being checked\n * @param attacker the entity that could attack\n * @return the chance of aggro (1.0F = 100%, 0.0F = 0%)\n */\n float shouldAggroOnHit(IGeneticMob geneticMob, EntityLiving attacker);\n\n /**\n * aggroHitTimer\n * How long this mob would stay angry at this attacker if aggroed via hit\n * @param geneticMob the mob being checked\n * @param attacker the entity that could attack\n * @return the length, in ticks, of the timer\n */\n int aggroHitTimer(IGeneticMob geneticMob, EntityLiving attacker);\n }",
"public abstract boolean attack(Enemy w);",
"protected boolean isMovementNoisy() {\n/* 1861 */ return (!this.abilities.flying && (!this.onGround || !isDiscrete()));\n/* */ }",
"public boolean isTurnOngoing() {\n int numEntitiesWithActions = 0;\n for (Entity entity : entitiesInCombat) {\n if (entity.canAct()) {\n numEntitiesWithActions++;\n }\n }\n return numEntitiesWithActions > 0;\n }",
"public boolean shouldHit() {\r\n\t\tif(getHandVal() < 17) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false; \r\n\t}",
"public boolean shouldTrack( ScannedRobotEvent e )\r\n {\n return ( enemy.none() || e.getDistance() < enemy.getDistance() - 70\r\n || e.getName().equals( enemy.getName() ) );\r\n }",
"int aggroHitTimer(IGeneticMob geneticMob, EntityLiving attacker);",
"public boolean canAttackWithItem() {\n/* 215 */ return false;\n/* */ }",
"private static void decisionWhenAttacking() {\n\t\tif (isNewAttackState()) {\n\t\t\tchangeStateTo(STATE_ATTACK_PENDING);\n\n\t\t\t// We will try to define place for our army where to attack. It\n\t\t\t// probably will be center around a crucial building like Command\n\t\t\t// Center. But what we really need is the point where to go, not the\n\t\t\t// unit. As long as the point is defined we can attack the enemy.\n\n\t\t\t// If we don't have defined point where to attack it means we\n\t\t\t// haven't yet decided where to go. So it's the war's very start.\n\t\t\t// Define this assault point now. It would be reasonable to relate\n\t\t\t// it to a particular unit.\n\t\t\t// if (!isPointWhereToAttackDefined()) {\n\t\t\tStrategyManager.defineInitialAttackTarget();\n\t\t\t// }\n\t\t}\n\n\t\t// Attack is pending, it's quite \"regular\" situation.\n\t\tif (isGlobalAttackInProgress()) {\n\n\t\t\t// Now we surely have defined our point where to attack, but it can\n\t\t\t// be so, that the unit which was the target has been destroyed\n\t\t\t// (e.g. just a second ago), so we're standing in the middle of\n\t\t\t// wasteland.\n\t\t\t// In this case define next target.\n\t\t\t// if (!isSomethingToAttackDefined()) {\n\t\t\tdefineNextTarget();\n\t\t\t// }\n\n\t\t\t// Check again if continue attack or to retreat.\n\t\t\tboolean shouldAttack = decideIfWeAreReadyToAttack();\n\t\t\tif (!shouldAttack) {\n\t\t\t\tretreatsCounter++;\n\t\t\t\tchangeStateTo(STATE_RETREAT);\n\t\t\t}\n\t\t}\n\n\t\t// If we should retreat... fly you fools!\n\t\tif (isRetreatNecessary()) {\n\t\t\tretreat();\n\t\t}\n\t}",
"private boolean shouldApplyGFTGun(double aimedEnemyDistance, int enemiesCount) {\n double totalIncreasePercentageDistance = enemiesCount * PERCENTAGE_INCREASING_DISTANCE_FOR_EACH_ADDITIONAL_ENEMY;\n boolean result = aimedEnemyDistance <= FURTHEST_DISTANCE_TO_FIRE_ONE_ON_ONE * (1 + totalIncreasePercentageDistance);\n return result;\n }",
"public void battleEnemyAttack() {\n if(battleEnemy != null){ // If all enemies have attacked, they cannot attack anymore for this round\n\n MovingEntity target = battleEnemy.getAttackPreference(targetAllies);\n if(target == null){\n target = targetAlly;\n }\n\n battleEnemy.attack(target, targetEnemies, targetAllies);\n //System.out.println(battleEnemy.getID() + \" is attacking \" + target.getID() + \" remaining hp: \" + target.getCurrHP());\n if (updateTarget(target) == false) {\n // if target still alive, check if its still friendly incase of zombify\n targetAlly = checkSideSwap(targetAlly, false, battleEnemies, targetEnemies, battleAllies, targetAllies);\n }\n\n battleEnemy = nextAttacker(battleEnemy, battleEnemies);\n\n }\n }",
"public boolean shouldExecute() {\n if (this.runDelay <= 0) {\n if (!net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(bean.world, bean)) {\n return false;\n }\n\n this.currentTask = -1;\n if(plantAndCollect)\n this.hasFarmItem = ((EntityWorkBean)bean).isFarmItemInInventory();\n else this.hasFarmItem = false;\n this.wantsToReapStuff = true; //this.villager.wantsMoreFood();\n }\n\n return super.shouldExecute();\n }",
"@Override\n public boolean applyThis() {\n Unit source = (Unit) ref.getSourceObj();\n Ref REF = ref.getCopy();\n Condition conditions = new OrConditions(\n DC_ConditionMaster\n .getSelectiveTargetingTemplateConditions(SELECTIVE_TARGETING_TEMPLATES.MY_ITEM),\n DC_ConditionMaster\n .getSelectiveTargetingTemplateConditions(SELECTIVE_TARGETING_TEMPLATES.MY_WEAPON));\n if (!new SelectiveTargeting(conditions).select(REF)) {\n ref.getActive().setCancelled(true);\n return false;\n }\n HeroItem item = (HeroItem) REF.getTargetObj();\n conditions = new Conditions(\n // ++ Max distance?\n new DistanceCondition(ref.getActive().getIntParam(PARAMS.RANGE, false) + \"\"),\n // new NumericCondition(\"{match_c_n_of_actions}\", \"1\"),\n new CanActCondition(KEYS.MATCH),\n new NotCondition(ConditionMaster.getSelfFilterCondition()),\n DC_ConditionMaster\n .getSelectiveTargetingTemplateConditions(SELECTIVE_TARGETING_TEMPLATES.ANY_ALLY));\n // non-immobile, ++facing?\n if (!new SelectiveTargeting(conditions).select(REF)) {\n ref.getActive().setCancelled(true);\n return false;\n }\n\n Unit unit = (Unit) REF.getTargetObj();\n\n boolean result = roll(source, unit, item);\n if (item instanceof QuickItem) {\n QuickItem quickItem = (QuickItem) item;\n source.removeQuickItem(quickItem);\n if (result) {\n unit.addQuickItem(quickItem);\n } else {\n dropped(item, unit);\n }\n\n } else {\n source.unequip(item, null);\n if (result) {\n unit.addItemToInventory(item); // TODO equip in hand if\n }\n// possible? spend AP?\n else {\n dropped(item, unit);\n }\n\n }\n // ref.getObj(KEYS.ITEM);\n return true;\n }",
"public boolean shouldExecute() {\n LivingEntity livingentity = ShulkerEntity.this.getAttackTarget();\n if (livingentity != null && livingentity.isAlive()) {\n return ShulkerEntity.this.world.getDifficulty() != Difficulty.PEACEFUL;\n } else {\n return false;\n }\n }",
"@Override\r\n\tpublic boolean canAttackEntity(Entity entity) {\n\t\treturn false;\r\n\t}",
"@Override\r\n\tpublic boolean canAttackEntity(Entity entity) {\n\t\treturn false;\r\n\t}",
"abstract public boolean performNextAttack();",
"public boolean canAttackWithItem() {\n/* 253 */ return false;\n/* */ }",
"@Override\n public boolean act() {\n float variation = (random.nextFloat() / 2f) - 1;\n\n // Reconfigure the time to wait before spawning another enemy.\n this.deltaLimit = Math.max(100, INITIAL_SPAWN_TIME + variation - (100 * round));\n\n spawnEnemy();\n return false;\n }",
"public Boolean makeAttackAction(UnitActor target) {\n if (this.isInRange(target)) {\n PlayBoardActor current = lazyPlayboardActor.get();\n long pvStart = target.getPv();\n current.getPlayBoard().applyAttack(this.point, target.getPoint());\n this.addAction(Actions.sequence(getActionAttack(target), target.getAfterAttack(pvStart - target.getPv())));\n this.disable(true);\n this.setIdle();\n return true;\n } else {\n return false;\n }\n }",
"public boolean checkOpportunityAttacks(Creature creature) {\n/* 2073 */ Creature[] lTempCreatures = getCreatures();\n/* 2074 */ for (int x = 0; x < lTempCreatures.length; x++) {\n/* */ \n/* 2076 */ if (lTempCreatures[x] != creature && !lTempCreatures[x].isMoving())\n/* */ {\n/* 2078 */ if (lTempCreatures[x].getAttitude(creature) == 2)\n/* */ {\n/* */ \n/* 2081 */ if (VirtualZone.isCreatureTurnedTowardsTarget(creature, lTempCreatures[x]))\n/* 2082 */ return lTempCreatures[x].opportunityAttack(creature); \n/* */ }\n/* */ }\n/* */ } \n/* 2086 */ return false;\n/* */ }",
"public boolean shouldTrack( ScannedRobotEvent e )\n {\n // track if we have no enemy, the one we found is significantly\n // closer, or we scanned the one we've been tracking.\n return ( enemy.none() || e.getDistance() < enemy.getDistance() - 70\n || e.getName().equals( enemy.getName() ) );\n }",
"public boolean canAttack(Figure target) {\n return true;\n }",
"@Override\n public boolean shouldExecute()\n {\n if (theEntity.getAITarget() == null && theEntity.isBurning())\n {\n return false;\n }\n else\n {\n if (theEntity.isRearingFirstTick()) // only set the first tick that is rearing\n {\n return true; \n }\n else\n {\n return false;\n }\n } \n }",
"public boolean shouldExecute()\n {\n if (this.runDelay <= 0)\n {\n if (!this.theRaider.world.getGameRules().getBoolean(\"mobGriefing\"))\n {\n return false;\n }\n\n this.currentTask = -1;\n this.wantsToReapStuff = true;\n }\n\n return super.shouldExecute();\n }",
"public boolean canAttack(Combatant aCombatant)\n\t{\n\t\treturn false;\n\t}",
"private static boolean runAway(Critter foo){\n\t\tif(foo.moved) {\n\t\t\tfoo.energy = foo.getEnergy() - Params.walk_energy_cost;\n\t\t\tif (foo.getEnergy() <= 0) {\n\t\t\t\tfoo.isAlive=false;\n\t\t\t}\n\t\t\treturn false;\n\t\t} else {\n\t\t\tint dir = getRandomInt(8);\n\t\t\tif(canMove(foo, dir)) {\n\t\t\t\tfoo.walk(dir);\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\tfoo.energy = foo.getEnergy() - Params.walk_energy_cost;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}",
"private boolean shootAt(Enemy enemy) {\n if (nextAttack == 0) {\n enemy.setHealth(enemy.getHealth() - tower.getDamage());\n shotEnemy = enemy;\n return true;\n }\n return false;\n }",
"public boolean canMove ()\n {\n return ((ActiveAdvancer)_advancer).canMove();\n }",
"public abstract boolean attack(TemporaryCharm i);",
"public abstract String forceAttack(Humanoid enemy);",
"private boolean shouldBecomeCombatEngineer() {\r\n\t\tdouble machineUnitsCount = this.getNumberOfMachineUnits();\r\n\t\tdouble combatEngineers = this.informationStorage.getWorkerConfig().getTotalCombatEngineerCount();\r\n\r\n\t\treturn combatEngineers / machineUnitsCount <= this.combatEngineerTriggerPercentageEnroll;\r\n\t}",
"public void attack(Entity entity, boolean aoe) {\n if(aoe) entity.damaged((int) (this.damage*0.6));\n else entity.damaged(this.damage);\n if(entity.isDead()){\n incExp(entity.getLevel()*9);\n if(entity instanceof Boss) {\n this.bossesDefeated++;\n }\n }\n }",
"public static boolean isSomethingToAttackDefined() {\n\t\treturn _attackTargetUnit != null && !_attackTargetUnit.getType().isOnGeyser();\n\t}",
"boolean hasDamage();",
"boolean hasDamage();",
"boolean hasDamage();",
"boolean hasDamage();",
"boolean hasDamage();",
"private boolean shouldAttackPlayer(EntityPlayer player) {\n ItemStack itemStack = player.inventory.armorInventory[3];\n if (itemStack != null && itemStack.getItem() == Item.getItemFromBlock(Blocks.pumpkin))\n return false;\n Vec3 lookVec = player.getLook(1.0F).normalize();\n Vec3 posVec = Vec3.createVectorHelper(this.posX - player.posX, this.boundingBox.minY + this.height / 2.0 - player.posY - player.getEyeHeight(), this.posZ - player.posZ);\n double distance = posVec.lengthVector();\n posVec = posVec.normalize();\n double dotProduct = lookVec.dotProduct(posVec);\n return dotProduct > 1.0 - 0.025 / distance ? player.canEntityBeSeen(this) : false;\n }",
"private static void attack(RobotInfo target) throws GameActionException {\n if (SOLDIER_DEBUG) {\n System.out.println(\"attacking\");\n }\n BulletInfo[] bullets = rc.senseNearbyBullets(EvasiveSoldier.BULLET_DETECT_RADIUS);\n RobotInfo[] robots = rc.senseNearbyRobots(EvasiveSoldier.ENEMY_DETECT_RADIUS);\n MapLocation targetLocation = target.getLocation();\n move(bullets, robots, targetLocation);\n //RobotUtils.tryMoveDestination(targetLocation);\n if (TargetingUtils.clearShot(here, target) || (rc.getType() == RobotType.GARDENER && rc.getOpponentVictoryPoints() > 10)) {\n if (SOLDIER_DEBUG) {\n System.out.println(\"clearShot to target\");\n }\n Direction towardsEnemy = here.directionTo(targetLocation);\n float distanceEnemy = here.distanceTo(targetLocation);\n if (distanceEnemy <= 3.5 && rc.canFirePentadShot() && rc.getTeamBullets() > 200) {\n rc.firePentadShot(towardsEnemy);\n }\n else {\n if (rc.canFireTriadShot() && rc.getTeamBullets() > 50) {\n rc.fireTriadShot(towardsEnemy);\n }\n else if (rc.canFireSingleShot()) {\n rc.fireSingleShot(towardsEnemy);\n }\n }\n }\n }",
"public void attackMonster(World world){\n\t\tif ((UnitManager.unitNearPlayer(world.getPlayer(),this,PLAYER_RANGE) == true \n\t\t\t\t\t&& RPG.isAttacking()) && world.getPlayer().isAttack()) {\n\t\t\tthis.getUnitStats().reduceHP(world.getPlayer().damageAmount());\n\t\t\t\n\t\t}else{\n\t\t\t\n\t\t}\n\t}",
"public void doAi(){\n\t\t\tif(MathHelper.getRandom(0, Game.FRAMERATE * 5) == 5){\n\t\t\t\tsetScared(true);\n\t\t\t}\n\t\t\n\t\t//Update rectangle\n\t\tsetRectangle(getX(), getY(), getTexture().getWidth(), getTexture().getHeight());\n\t\t\n\t\trect = new Rectangle(getDestinationX(), getDestinationY(), 10, 10);\n\t\t\n\t\tif(rect.intersects(getRectangle())){\n\t\t\t\n\t\t\tif(StateManager.getState() == StateManager.STATE_BOSSTWO){\n\t\t\t\t\n\t\t\t\t\tsetDestinationX(StateGame.player.getX());\n\t\t\t\t\t\n\t\t\t\t\tsetDestinationY(StateGame.player.getY());\n\t\t\t\t\t\n\t\t\t\t\trect = new Rectangle(getDestinationX(), getDestinationY(), 10, 10);\n\t\t\t\t\treachedDestination = (true);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Check for collision with jelly\n\t\tint checkedJelly = (0);\n\t\twhile(checkedJelly < EntityJelly.JELLY.size() && EntityJelly.JELLY.get(checkedJelly) != null){\n\t\t\tif(EntityJelly.JELLY.get(checkedJelly).getDead() == false){\n\t\t\t\tif(getRectangle().intersects(EntityJelly.JELLY.get(checkedJelly).getRectangle())){\n\t\t\t\t\tsetHealth(getHealth() - 2);\n\t\t\t\t\tif(MathHelper.getRandom(1, 10) == 10){\n\t\t\t\t\tAnnouncer.addAnnouncement(\"-2\", 60, EntityJelly.JELLY.get(checkedJelly).getX(), EntityJelly.JELLY.get(checkedJelly).getY());\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t\tcheckedJelly++;\n\t\t}\n\t\t\n\t\t//If we're out of health, kill the entity\n\t\tif(getHealth() < 0){\n\t\t\tsetDead(true);\n\t\t}\n\t\t\n\t\tif(StateManager.getState() == StateManager.STATE_BOSSTWO){\n\t\t\tif(reachedDestination == true){\n\t\t\t\tif(getScared() == false){\n\t\t\t\tsetY(getY() + getSpeed());\n\t\t\t\t}else{\n\t\t\t\t\tsetY(getY() - getSpeed() * 3);\n\t\t\t\t\tsetX(getX() - getSpeed() * 3);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tif(getScared() == false){\n\t\t\t\tif(getX() < getDestinationX())\n\t\t\t\t\tsetX(getX() + getSpeed());\n\t\t\t\tif(getX() > getDestinationX())\n\t\t\t\t\tsetX(getX() - getSpeed());\n\t\t\t\tif(getY() < getDestinationY())\n\t\t\t\t\tsetY(getY() + getSpeed());\n\t\t\t\tif(getY() > getDestinationY())\n\t\t\t\t\tsetY(getY() - getSpeed());\n\t\t\t\t}else{\n\t\t\t\t\t\tsetY(getY() - getSpeed() * 3);\n\t\t\t\t\t\tsetX(getX() - getSpeed() * 3);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public abstract boolean attack(Warrior w);",
"public void onAgress(IPokemob mob, EntityLivingBase target)\r\n {\r\n }",
"public void attack() {\n this.attacked = true;\n }",
"public boolean goalAchieve(LoopManiaWorld world) {\n return world.getDoggieKilledValue() >= this.doggie;\n }",
"@Override\r\n\tpublic boolean condition(WorldManager worldManager, WorldObjectManager gameObjectManager, BombManager bombManager,\r\n\t\t\tPlantManager plantManager, Player player) {\n\t\treturn bombManager.canPlace(player.transform);\r\n\t}",
"public void move(Mob mob) {\n double x = mob.getxPos() - xPos;\n double y = mob.getyPos() - yPos;\n if (x < 18 && x > -18 && y < 18 && y > -18) {\n mob.reduceHealth(damage);\n hasHit = true;\n } else {\n double distancesq = x * x + y * y;\n double distance = Math.sqrt(distancesq);\n xPos += speed * x / distance;\n yPos += speed * y / distance;\n }\n }",
"@Override\n public void attack(Entity e) {\n e.hit(atk);\n }",
"@Override\n protected boolean preUseCheck(Event event, ItemStack item) {\n return event instanceof EntityShootBowEvent && new Random().nextDouble()<level/20 && ((EntityShootBowEvent)event).getEntity().hasPermission(\"rayken.unsafe\");\n }",
"@Override\n\t\tpublic void hit(Npc attacker, Mob defender, Hit hit) {\n\t\t}",
"@Override\r\n\tpublic boolean isAggressive() {\n\t\treturn true;\r\n\t}",
"@EventHandler\n\tpublic void attackMobs(EntityDamageByEntityEvent e) {\n\t\tMessages messagesConfig = plugin.getMsgs();\n\n\t\tif (e.getCause().equals(EntityDamageEvent.DamageCause.PROJECTILE)) { //Just my magic code w(o.o)w\n\t\t\treturn;\n\t\t}else if (e.getDamager() instanceof Player) {\n\t\t\tPlayer p = (Player) e.getDamager();\n\t\t\tItemStack pInv = p.getInventory().getItemInMainHand();\n\n\t\t\tif (!pInv.getType().name().contains(\"SWORD\") && !pInv.getType().name().contains(\"AXE\")) {\n\t\t\t\tif (!(e.getEntity() instanceof Chicken)) {\n\t\t\t\t\te.setCancelled(true);\n\n\t\t\t\t\tif (canSendMessage(p.getUniqueId()))\n\t\t\t\t\t\tp.sendMessage(StringUtil.inColor(messagesConfig.getCantHitWithoutSword()));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"@Override\n public void takeTurn(CombatCharacter agent) {\n this.agent=agent;\n while(agent.attributes.getAP()>0){\n StrategySkill s =getBestMove();\n if(s!=null) s.useSkill();\n else return;\n }\n }",
"@Override\n\tpublic void onSpawn()\n\t{\n\t\tsetIsNoRndWalk(true);\n\t\tsuper.onSpawn();\n\n\t\t// check the region where this mob is, do not activate the AI if region is inactive.\n\t\tL2WorldRegion region = WorldManager.getInstance().getRegion(getX(), getY());\n\t\tif(region != null && !region.isActive())\n\t\t{\n\t\t\tgetAI().stopAITask();\n\t\t}\n\t}",
"private boolean shouldRush(GameInfo intel) {\n if (intel.getNumPlayers() > 2) {\n return false;\n }\n\n final GameMap gameMap = intel.getGamemap();\n final Map<Integer, Ship> myShips = gameMap.getMyPlayer().getShips();\n\n // get enemy player ships\n for (Player player : gameMap.getAllPlayers()) {\n if (player.getId() != gameMap.getMyPlayerId()) {\n for (Ship ship : player.getShips().values()) {\n for (Ship myShip : myShips.values()) {\n if (myShip.getDistanceTo(ship) < RUSH_MAX_DISTANCE) {\n return true;\n }\n }\n }\n }\n }\n\n return false;\n }",
"public boolean shootoutEntity(Entity ent, boolean simulate);",
"@Override\n public void doAction() {\n String move = agent.getBestMove(currentPosition);\n execute(move);\n\n //Location of the player\n int cX = w.getPlayerX();\n int cY = w.getPlayerY();\n\n if (w.hasWumpus(cX, cY)) {\n System.out.println(\"Wampus is here\");\n w.doAction(World.A_SHOOT);\n } else if (w.hasGlitter(cX, cY)) {\n System.out.println(\"Agent won\");\n w.doAction(World.A_GRAB);\n } else if (w.hasPit(cX, cY)) {\n System.out.println(\"Fell in the pit\");\n }\n\n// //Basic action:\n// //Grab Gold if we can.\n// if (w.hasGlitter(cX, cY)) {\n// w.doAction(World.A_GRAB);\n// return;\n// }\n//\n// //Basic action:\n// //We are in a pit. Climb up.\n// if (w.isInPit()) {\n// w.doAction(World.A_CLIMB);\n// return;\n// }\n//\n// //Test the environment\n// if (w.hasBreeze(cX, cY)) {\n// System.out.println(\"I am in a Breeze\");\n// }\n// if (w.hasStench(cX, cY)) {\n// System.out.println(\"I am in a Stench\");\n// }\n// if (w.hasPit(cX, cY)) {\n// System.out.println(\"I am in a Pit\");\n// }\n// if (w.getDirection() == World.DIR_RIGHT) {\n// System.out.println(\"I am facing Right\");\n// }\n// if (w.getDirection() == World.DIR_LEFT) {\n// System.out.println(\"I am facing Left\");\n// }\n// if (w.getDirection() == World.DIR_UP) {\n// System.out.println(\"I am facing Up\");\n// }\n// if (w.getDirection() == World.DIR_DOWN) {\n// System.out.println(\"I am facing Down\");\n// }\n//\n// //decide next move\n// rnd = decideRandomMove();\n// if (rnd == 0) {\n// w.doAction(World.A_TURN_LEFT);\n// w.doAction(World.A_MOVE);\n// }\n//\n// if (rnd == 1) {\n// w.doAction(World.A_MOVE);\n// }\n//\n// if (rnd == 2) {\n// w.doAction(World.A_TURN_LEFT);\n// w.doAction(World.A_TURN_LEFT);\n// w.doAction(World.A_MOVE);\n// }\n//\n// if (rnd == 3) {\n// w.doAction(World.A_TURN_RIGHT);\n// w.doAction(World.A_MOVE);\n// }\n }",
"@Override\n public boolean continueExecuting()\n {\n theEntity.decrementRearingCounter();;\n Boolean continueExecuting = theEntity.getRearingCounter()>0; \n if (!continueExecuting)\n {\n theEntity.setRearing(false);\n theEntity.setAttackTarget(theEntity.getLastAttacker()); // now attack back\n }\n // DEBUG\n if (theEntity.getAITarget() != null)\n {\n System.out.println(\"AIPanic continueExecuting = \"+continueExecuting+\", rearingCounter = \"+theEntity.getRearingCounter()+\", isRearing = \"\n +theEntity.isRearing()+\", Attack Target = \"+theEntity.getAITarget().getClass().getSimpleName()+\", client side = \"+theEntity.worldObj.isRemote);\n }\n else\n {\n System.out.println(\"AIPanic continueExecuting = \"+continueExecuting+\", rearingCounter = \"+theEntity.getRearingCounter()+\", isRearing = \"\n +theEntity.isRearing()+\", Attack Target = null\"+\", client side = \"+theEntity.worldObj.isRemote);\n }\n return (continueExecuting);\n }",
"@Override\n public String specialMove(Entity target)\n {\n if(Math.random() <= this.accuracy-0.1)\n {\n Random rand = new Random();\n Attack atk = new Attack();\n atk.addDamage(new Damage(rand.nextInt(10), true, \"slash\"));\n CorrosiveAcid acidEffect = new CorrosiveAcid();\n atk.addStatus(acidEffect);\n atk.applyPower(this.power);\n\n return target.takeDamage(atk);\n }\n else\n {\n \t return (\"The attack failed!\");\n\n }\n }",
"@Override\n public void interact(Object obj) {\n // TODO: Cave Code - Add additional Agility to the player while on this Tile\n }",
"public void act()\n {\n \n //move();\n //if(canSee(Worm.class))\n //{\n // eat(Worm.class);\n //}\n //else if( atWorldEdge() )\n //{\n // turn(15);\n //}\n\n }",
"public boolean wantToFight(int[] enemyAbilities) {\n boolean fight = boldness < 50;//After 50 fights, believes self unstoppable \n int huntable = 0;\n for(int ability : enemyAbilities){\n if(ability == 1)\n huntable++;\n }\n if(huntable >= 3){\n fight = true;\n }//if at least 3 of the visible stats are 1 then consider this prey and attack\n else if((float)enemyAbilities[1] / (float)getDefenseLvl() <= (float)getStrengthLvl() + (float)(getClevernessLvl() % 10) / (float)enemyAbilities[2] && enemyAbilities[0] / 5 < getLifeLvl() / 5)\n fight = true;//If I fancy my odds of coming out on top, float division for chance\n if(fight){//Count every scar\n boldness++;//get more bold with every battle\n life += enemyAbilities[0] / 5;\n str += enemyAbilities[1] / 5;\n def += enemyAbilities[2] / 5;\n clever += (10 - (enemyAbilities[0] + enemyAbilities[1] + enemyAbilities[2] + enemyAbilities[3] - 4)) / 5;//count the human cleverness attained or the enemies who buffed clever early\n }\n return fight;\n }",
"public boolean shouldExecute()\n\t{\n\t\tif (this.entity.getAge() >= 100)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse if (this.entity.getRNG().nextInt(120) != 0)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tVec3d Vec3d = RandomPositionGenerator.findRandomTarget(this.entity, 10, 7);\n\n\t\t\tif (Vec3d == null)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.xPosition = Vec3d.xCoord;\n\t\t\t\tthis.yPosition = Vec3d.yCoord;\n\t\t\t\tthis.zPosition = Vec3d.zCoord;\n\t\t\t\tthis.leapTarget = Vec3d;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}",
"public boolean shouldContinueExecuting() {\n return ShulkerEntity.this.getAttackTarget() == null && this.peekTime > 0;\n }",
"private boolean isMovementCausedByEntityBump(Player p) {\n double requiredDistance = 0.5;\n\n //If both bump and hurt by mob protections are disabled then we can just ignore this\n if (!(plugin.getConfig().getBoolean(\"Protections.Bump\") || plugin.getConfig().getBoolean(\"Protections.HurtByMob\")))\n return false;\n\n //Check if the player has been attacked by a mob in bump range\n boolean playerAttacked = false;\n EntityDamageEvent event = p.getLastDamageCause();\n Entity damager = null;\n if (event instanceof EntityDamageByEntityEvent) {\n damager = ((EntityDamageByEntityEvent) event).getDamager();\n }\n\n boolean isEntityClose = false;\n //Find all entities within the required range\n for (Entity e : p.getNearbyEntities(requiredDistance, requiredDistance, requiredDistance)) {\n if (e instanceof Monster || e instanceof Player) {\n if (e.equals(damager)) {\n playerAttacked = true;\n }\n isEntityClose = true;\n break;\n }\n }\n //If bump is enabled and the player was bumped by an entity then we report as a bump\n if (plugin.getConfig().getBoolean(\"Protections.Bump\") && isEntityClose)\n return true;\n //Report as bump is mob protection is on and they were attacked or a mob is close\n return plugin.getConfig().getBoolean(\"Protections.HurtByMob\") && (playerAttacked || isEntityClose);\n }",
"public void goAdventuring() {\n\n game.createRandomMonster(4);\n if(RandomClass.getRandomTenPercent() == 5) {\n System.out.println(\"Your are walking down the road... Everything looks peaceful and calm.. Hit enter to continue!\");\n sc.nextLine();\n\n } else {\n game.battle();\n p.checkXp();\n }\n }",
"private void enemyturn() {\n if (enemy.getHealth() == 0) { // check if the enemy is still alive\n enemy.setAlive(false);\n }\n\n if (enemy.getAlive()) { // if he is alive\n // time to fuck the players day up\n System.out.println(\"\");//formatting\n System.out.println(enemy.getName() + \" attacks you!\");\n\n // calculate the damage this enemy will do\n int differenceHit = enemy.getMaxHit() - enemy.getMinHit(); // difference will be 0-3. But plus 1 (as the result will ALWAYS be +1 in the randomizer so a \"0\" will not happen.\n int minimumDamage = randomize.getRandomDamage(differenceHit); // for example, will return 0-4 if the min and max hit was 4-7. Then do a -1. Making it a 0-3 chance.\n int damage = differenceHit + minimumDamage; // add the minimum damage, to random hit damage.\n\n // calculate the players armor\n damage = damage - player.getPlayerArmorRating();\n if (damage <= 0){\n System.out.println(\"... but you dont take any damage because of your armor!\");\n } else {\n\n System.out.println(\"You take \" + damage + \" damage!\");\n player.removeHealth(damage);\n }\n\n } else { // when ded\n System.out.println(\"The enemy has no chance to fight back. As your final blow killed the enemy.\");\n }\n }",
"@Override\n\tpublic boolean fight(String opponent) {\n\t\tif (getEnergy() > (Params.start_energy/2) && (!opponent.equals(\"Critter3\"))) {\n\t\t\treturn true;\n\t\t}\n\t\tint check = this.getX() + 1 ;\n\t\tif(check > (Params.world_width-1)) {\n\t\t\tcheck = 0;\n\t\t}\n\t\tif((this.moveFlag == false) && (myWorld.world[this.getY()][check].isEmpty())){\n\t\t\twalk(0);\n\t\t\tthis.moveFlag = true;\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\tthis.setEnergy(this.getEnergy() - Params.walk_energy_cost);\n\t\t\treturn false;\n\t\t}\n\t}",
"@Test\n public void isActionLegal()\n {\n // Setup.\n final CheckersGameInjector injector = new CheckersGameInjector();\n final List<Agent> agents = createAgents(injector);\n final Agent agentWhite = agents.get(1);\n final CheckersEnvironment environment = createEnvironment(injector, agents);\n final Adjudicator adjudicator = injector.injectAdjudicator();\n\n // Agent white can move his token to an adjacent empty space.\n {\n final CheckersMoveAction action = new CheckersMoveAction(environment, agentWhite, CheckersPosition.P09,\n CheckersPosition.P13);\n assertTrue(adjudicator.isActionLegal(action));\n }\n\n // Agent white cannot move backwards.\n assertFalse(adjudicator.isActionLegal(new CheckersMoveAction(environment, agentWhite, CheckersPosition.P09,\n CheckersPosition.P05)));\n\n // Agent white cannot move to an occupied space.\n assertFalse(adjudicator.isActionLegal(new CheckersMoveAction(environment, agentWhite, CheckersPosition.P04,\n CheckersPosition.P08)));\n\n // Agent white cannot move a red token.\n assertFalse(adjudicator.isActionLegal(new CheckersMoveAction(environment, agentWhite, CheckersPosition.P21,\n CheckersPosition.P17)));\n\n // Agent white cannot move too far.\n assertFalse(adjudicator.isActionLegal(new CheckersMoveAction(environment, agentWhite, CheckersPosition.P09,\n CheckersPosition.P18)));\n }",
"@Override\n public boolean cast(Player player, Enemy target) {\n int damage;\n\n if (checkMana(player, this.MANA_COST)) {\n damage = calculateDamage();\n target.setHp(target.getHp() - damage);\n depleteMana(player, this.MANA_COST);\n System.out.println(\"You whistle for your dog Frostbite to come to your assistance.\");\n System.out.println(\"Frostbite bites \" + target.getName() + \" for \" + damage + \" damage.\");\n return true;\n }\n else {\n System.out.println(\"You tried casting \" + this.getSpellName() + \" but didn't have enough mana!\");\n return false;\n }\n }",
"public void basicEnemyAI(){\n if(enemyMana == enemyManaMax){\n applyCard(enemyPlayCard(), \"enemy\");\n }\n }",
"public void move1(Pokemon enemy){\n int randCrit = (int)(22 * Math.random()+1);\n boolean crit = false;\n boolean superEffective = false;\n boolean reduced = false;\n boolean moveHit = true;\n\n //CHANGE ATTACK TO FALSE IF MOVE DOES NO DAMAGE<<<<<<<<<<<<<\n boolean attack = true;\n //CHANGE TYPE TO TYPE OF MOVE POWER AND ACCURACY<<<<<<<<<<<<<\n String type = \"Dark\";\n int power = 70;\n int accuracy = 100;\n\n //DO NOT CHANGE BELOW THIS\n int damage = ((CONSTANT * power * ( getAtt() / enemy.getDef() )) /50);\n if(randCrit == CONSTANT){\n damage = damage * 2;\n crit = true;\n }\n if(checkSE(type,enemy.getType())){\n damage = damage * 2;\n superEffective = true;\n }\n if(checkNVE(type, enemy.getType())){\n damage = damage / 2;\n reduced = true;\n }\n if(attack && hit(accuracy)){\n enemy.lowerHp(damage);\n }\n else{\n if(hit(accuracy)){\n //DO STATUS EFFECT STUFF HERE (ill figure out later)\n }\n\n }\n lowerM1PP();\n }",
"@Override\n\tpublic void act() {\n\n\t\t//Location symbol of a Droid (Stack Overflow 2010)\n\t\tchar locationSymbol = this.world.getEntityManager().whereIs(this).getSymbol();\n\t\t\n\t\t//Begin act\n\t\tsay(describeLocation());\t\t\n\t\t\n\t\t//Check for the lose condition that R2 is disassembled\n\t\t//If R2's HP is <=0\n\t\tif (this.isDead())\n\t\t{\n\t\t\t//If R2 is disassembled\n\t\t\tif(this.getIsDisassembled())\n\t\t\t{\n\t\t\t\t//Is the symbol of the disassembled Droid is R2's\n\t\t\t\tif(this.getSymbol().contains(\"{R2}\"))\n\t\t\t\t{\n\t\t\t\t\t//Message stating R2 was disassembled\n\t\t\t\t\tthis.messageRenderer.render(\"\\n\\nR2-D2 has been disassembled!\");\n\t\t\t\t\t\n\t\t\t\t\t//Scheduler schedules the loss\n\t\t\t\t\tscheduler.lossSchedule(this.messageRenderer);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t//If a Droid is immobile (Dead)\n\t\tif (this.getIsImmobile() == true) {\n\t\t\tsay(this.getShortDescription() + \" is immobile. \");\n\t\t\t\t\t\t\n\t\t\tif(this.getOwner() != null)\n\t\t\t{\n\t\t\t\tsay(\"Owned. checking in owners follow list\");\n\t\t\t\t\n\t\t\t\tString thisDroidNoBraces = this.getSymbol().substring(1, this.getSymbol().length()-1);\n\n\t\t\t\tint indexofDroid = this.getOwner().getFollowerList().indexOf(thisDroidNoBraces);\n\t\t\t\t\n\t\t\t\tif (this.getOwner().getFollowerList().get(indexofDroid).equals(thisDroidNoBraces))\n\t\t\t\t{\n\t\t\t\t\tsay(\"Removing\");\n\t\t\t\t\tthis.getOwner().getFollowerList().remove(thisDroidNoBraces);\n\t\t\t\t\tthis.getOwner().getFollowerListSWActors().remove(this);\n\t\t\t\t\tthis.setOwner(null);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t//If a Droid is mobile and human controlled\n\t\telse if (this.humanControlled == true) {\n\t\t\t\n\t\t\t//Following Owner - since humancontrolled.\n\t\t\t\n\t\t\t\n\t\t\tif (isDead()) \n\t\t\t{\n\t\t\t\tthis.setIsImmobile(true);\n\t\t\t\treturn;\n\t\t\t} \n\t\t\t\n\t\t\telse\n\t\t\t{\n\t\t\t\t//Get owners' location\n\t\t\t\tSWLocation ownerloc = this.world.getEntityManager().whereIs(this.getOwner());\n\t\t\t\t\n\t\t\t\t//Set Droids' position to owners' location (follow)\n\t\t\t\tthis.world.getEntityManager().setLocation(this, ownerloc);\n\t\t\t\t\n\t\t\t\t//Take damage if moving to the Badlands\n\t\t\t\tif (locationSymbol == 'b') { //IF the Droid is at the Badlands\n\t\t\t\t\tint NewHP = this.getHitpoints() - 2;\t//Take 2 from the Droids' health\n\t\t\t\t\tthis.setHitpoints(NewHP);\n\t\t\t\t\n\t\t\t\t\tsay(this.getShortDescription() + \" has lost health by moving into the Badlands!\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tselfHeal();\n\t\t\t}\t\n\t\t} \n\t\t\n\t\t//C-3PO Droid specific act ()code\n\t\telse if (this.getSymbol() == \"C3\") {\n\t\t\t\n\t\t\t//Double precision number to represenet C-3PO's chance of speaking\n\t\t\tdouble c3Speak = Math.random();\n\t\t\t\n\t\t\t//10% chance of occuring a 0.9 or above\n\t\t\tif (c3Speak >= 0.9) {\n\t\t\t\t//Call C-3PO speak method (he talks!)\n\t\t\t\tc3POSpeaks();\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//R2-D2 Repair droid specific act() code\n\t\telse if (this.getSymbol() == \"R2\") {\n\t\t\t\n\t\t\tthis.messageRenderer.render(\"R2 DISS: \" + this.isDisassembled);\n\t\t\t\n\t\t\t//Describe who R2 can see\n\t\t\t//get the contents of the location\n\t\t\tList<SWEntityInterface> r2contents = this.world.getEntityManager().contents(this.world.getEntityManager().whereIs(this));\n\t\t\t\n\t\t\t//and describe the contents\n\t\t\tif (r2contents.size() > 1) { // if it is equal to one, the only thing here is R2, so there is nothing to report\n\t\t\t\tfor (SWEntityInterface r2entity : r2contents) {\n\t\t\t\t\tif (r2entity.getSymbol().contains(\"D\")) { // If R2 comes across a Droid (Stack Overflow 2010)\n\t\t\t\t\t\tsay(this.getShortDescription() + \" has come accross a Droid!\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Cast target entity as a Droid for checking what it needs from R2\n\t\t\t\t\t\tDroid targetr2 = (Droid) r2entity;\n\t\t\t\t\t\t\n\t\t\t\t\t\t//R2 attempts to disassemble the Droid if its immobile\n\t\t\t\t\t\tif (targetr2.isImmobile && targetr2.isDisassembled == false) {\n\t\t\t\t\t\t\tDisassemble r2diss = new Disassemble(r2entity, messageRenderer);\n\t\t\t\t\t\t\tscheduler.schedule(r2diss, this, 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//R2 tries to repair a droid who is immobile and disassembled\n\t\t\t\t\t\telse if (targetr2.isImmobile && targetr2.isDisassembled) {\n\t\t\t\t\t\t\tif (this.getItemCarried() != null) {\n\t\t\t\t\t\t\t\tRepair r2rep = new Repair(r2entity, messageRenderer);\n\t\t\t\t\t\t\t\tscheduler.schedule(r2rep, this, 1);\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//R2 attempts to Heal a Droid if active and not disassembled\n\t\t\t\t\t\telse if (targetr2.isDisassembled == false && targetr2.isImmobile == false)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tHealDroid r2heal = new HealDroid(r2entity, messageRenderer);\n\t\t\t\t\t\t\tscheduler.schedule(r2heal, this, 1);\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\t\t\n\t\t\t//Heals himself if he can\n\t\t\t\n\t\t\tHealDroid droidHealR2 = new HealDroid(this, messageRenderer);\n\t\t\tscheduler.schedule(droidHealR2, this, 1);\n\t\t\t\n\t\t\t//R2 moves\n\t\t\tDirection R2Direction = this.getDroidPatrol().getNext();\n\t\t\tsay(getShortDescription() + \" moves \" + R2Direction);\n\t\t\tMove myMove = new Move(R2Direction, messageRenderer, world);\n\n\t\t\tscheduler.schedule(myMove, this, 1);\n\t\n\t\t}\n\t\t\n\t\t//If a Droid is not immobile, and not human controlled (roaming)\n\t\telse {\t\n\t\t\t\n\t\t\t//Picking up an oil can\n\t\t\t//Get contents of the current location\n\t\t\tList<SWEntityInterface> contents = this.world.getEntityManager().contents(this.world.getEntityManager().whereIs(this));\n\t\t\t\n\t\t\t//and describe the contents\n\t\t\tif (contents.size() > 1) { // if it is equal to one, the only thing here is this Player, so there is nothing to report\n\t\t\t\tfor (SWEntityInterface entity : contents) {\n\t\t\t\t\tif (entity != this) { // don't include self in scene description\n\t\t\t\t\t\tif (entity.getSymbol() == \"x\") {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//The Droid is standing over a oil can. Does it pick it up?\n\t\t\t\t\t\t\tif (Math.random() > 0.5){ //Half a chance...\n\t\t\t\t\t\t\t\tsay(this.getShortDescription() + \" decided to pick up \" + entity.getShortDescription());\n\t\n\t\t\t\t\t\t\t\t//Droid takes the oil can. Scheduler implements the Take.\n\t\t\t\t\t\t\t\tTake droidTakes = new Take(entity, messageRenderer);\n\t\t\t\t\t\t\t\tscheduler.schedule(droidTakes, this, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse { //The Droid passes over the oil can.\n\t\t\t\t\t\t\t\tsay(this.getShortDescription() + \" decided not to pick up\" + entity.getShortDescription());\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif (Math.random() > 0.8){\n\t\t\t\trandomMovement();\n\t\t\t}\n\t\t\t\n\t\t\t//If a Roaming Droid is at the Badlands, they lose health\n\t\t\t\n\t\t\tif (locationSymbol == 'b') { //IF the Droid is at the Badlands\n\t\t\t\tint NewHP = this.getHitpoints() - 2;\t//Take 2 from the Droids' health\n\t\t\t\tthis.setHitpoints(NewHP);\n\t\t\t\n\t\t\t\tsay(this.getShortDescription() + \" has lost health by moving into the Badlands!\");\n\t\t\t}\n\t\t\t\n\t\t\t/*Self healing\n\t\t\tImplementation that if a Droids' health gets below half, they will attempt to heal themselves IF they \n\t\t\tare carrying an oil can\n\t\t\t*/\n\t\t\tselfHeal();\n\t\t\t\n\t\t\t\n\t\t}\t\n\t}",
"@Override\r\n\tpublic void doAction(MedcivGame game) {\n\t\ttry {\r\n\t\t\t((Livestock)game.matchingVillager(ownerId).getItemById(targetId)).setTendedToThisTurn(true);\r\n\t\t}catch(NullPointerException e) {\r\n\t\t\t//do nothing; the cow is dead, or you are\r\n\t\t}\r\n\t}",
"@Test\n public void isMoveActionLegalFor()\n {\n // Setup.\n final CheckersGameInjector injector = new CheckersGameInjector();\n final List<Agent> agents = createAgents(injector);\n final CheckersEnvironment environment = createEnvironment(injector, agents);\n final CheckersAdjudicator adjudicator = injector.injectAdjudicator();\n\n // Agent white can move his token to an adjacent empty space.\n assertTrue(adjudicator.isMoveActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P09,\n CheckersPosition.P13));\n\n // Agent white cannot move backwards.\n assertFalse(adjudicator.isMoveActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P09,\n CheckersPosition.P05));\n\n // Agent white cannot move to an occupied space.\n assertFalse(adjudicator.isMoveActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P04,\n CheckersPosition.P08));\n\n // Agent white cannot move a red token.\n assertFalse(adjudicator.isMoveActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P21,\n CheckersPosition.P17));\n\n // Agent white cannot move too far.\n assertFalse(adjudicator.isMoveActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P09,\n CheckersPosition.P18));\n }",
"public boolean takeGoldReward(){\n if(!isGameOver() || character.getHp() <= 0 )return false;\n if( goldRewardGiven )return false;\n int gold = character.getGold();\n character.setGold( gold + reward.getGold() );\n goldRewardGiven=true;\n return true;\n }",
"public boolean whatNow (String action, player friday, player you){ // Method which will allow the ia to choose his action\n\t\tString testAction = \"Tank\"; // Create a String we will use a lot to test other string\n\t\tint actionIa; // If the ia is a Tank, forbid him to use his special attack. The purpose is to prevent him from useless turns\n\t\tif (friday.getName().equals(testAction)){ // If the name of the ia's class is Tank\n\t\t\t actionIa = (int)(Math.random() * 2); // His random will be between 0 or 1\n\t\t}\n\t\t\n\t\telse {\n\t\t\t actionIa = (int)(Math.random() * 3); // Else, his random will be between 0, 1 and 2\n\t\t}\n\t\t\n\t\ttestAction = \"attack\"; // Will be use to test if you attacked\n\t\t\n\t\t\n\t\tswitch (actionIa){ // Test ia's action\n\t\t\tcase 0: // 0, the enemy attack\n\t\t\t\tfriday.setSprite(\"attack\");\n\t\t\t\tSystem.out.println(\"The enemy attack\\n\"); // Warns the user\n\t\t\t\ttestAction = \"block\"; // Will be use to test if you block\n\t\t\t\tif (action.equals(testAction)){ // If you block\n\t\t\t\t\tSystem.out.println(\"You blocked the enemy's attack.\"); // Warns the user\n\t\t\t\t\tyou.setHp(you.getHp() - you.getDp()); // You loose as much hp as your dp\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse{\n\t\t\t\t\tyou.setHp(you.getHp() - friday.getAp()); // Else, you loose as much hp as your enemy's ap\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 1: // 1, the enemy block\n\t\t\t\tfriday.setSprite(\"block\");\n\t\t\t\tif (action.equals(testAction)){ // If you attacked\n\t\t\t\t\tfriday.setHp(friday.getHp() - friday.getDp()); // The enemy loose as much hp as his dp\n\t\t\t\t\taction = \"\"; // Prevent you from attack a second time\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"The enemy blocked your attack\\n\"); // Warns the user\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 2: // 2, the enemy use his special power if he isn't a tank\n\t\t\t\tfriday.setSprite(\"special\");\n\t\t\t\tSystem.out.println(\"The enemy uses his special power.\"); // Warns the user\n\t\t\t\tfriday.special(); // Execute ia's special attack\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t}\n\t\t\n\t\ttestAction = \"attack\"; // Reset testAction\n\t\t\n\t\tif (action.equals(testAction)){ // If you attacked\n\t\t\tfriday.setHp(friday.getHp() - you.getAp()); // The enemy loose as much hp as your ap\n\t\t} // Nota Bene : if the enemy blocked your attack, this won't be executed because 'action = \"\";'\n\t\t\n\t\tSystem.out.println(\"You have \" + you.getHp() + \" HP left.\"); // Warns the user\n\t\tSystem.out.println(\"The ennemy have \" + friday.getHp() + \" HP left.\\n\"); // Warns the user\n\t\t\n\t\tif(you.getHp() <= 0){ // If you or the ia has no hp left, warn the system that the fight is over by setting 'end' on true and tell who died\n\t\t\tend = true;\n\t\t\tSystem.out.println(\"You died!\");\n\t\t\tyou.setSprite(\"dead\");\n\t\t}\n\t\t\n\t\telse if(friday.getHp() <= 0){\n\t\t\tend = true;\n\t\t\tSystem.out.println(\"You killed the ennemy!\");\n\t\t\tfriday.setSprite(\"dead\");\n\t\t}\n\t\t\n\t\telse { // Else, it just asks you what you want to do\n\t\t\tSystem.out.println(\"What do you want to do, attack, block or use your special power ?\"); // Asks what you want to do\n\t\t}\n\t\treturn end;\n\t}",
"@Override\n\tpublic int attack( ){\n\t\treturn enemy.attack();\n\t}",
"public abstract boolean attack(KillableItem i);",
"public boolean canHit() {\n\t\treturn this.hand.countValue().first() < 17;\n\t}",
"public boolean isAttack() {\n\t\treturn attack;\n\t}"
] | [
"0.742728",
"0.6908835",
"0.68257934",
"0.6736443",
"0.66751146",
"0.65000975",
"0.6439552",
"0.6405393",
"0.63933146",
"0.63779145",
"0.63771766",
"0.63237077",
"0.6305707",
"0.62485677",
"0.6140846",
"0.61147404",
"0.6091959",
"0.60728",
"0.6066074",
"0.6050489",
"0.60323447",
"0.60226953",
"0.5959341",
"0.59519863",
"0.5940142",
"0.5934083",
"0.5932667",
"0.59288627",
"0.59177357",
"0.5916313",
"0.59043694",
"0.59036946",
"0.59036946",
"0.589611",
"0.5863433",
"0.58610964",
"0.58506083",
"0.5839679",
"0.58199424",
"0.58180726",
"0.5803604",
"0.5798357",
"0.578689",
"0.57817537",
"0.5735191",
"0.5732191",
"0.57240826",
"0.570255",
"0.5700868",
"0.5693048",
"0.568724",
"0.56794345",
"0.56794345",
"0.56794345",
"0.56794345",
"0.56794345",
"0.56690025",
"0.564358",
"0.56434935",
"0.56406194",
"0.561614",
"0.561512",
"0.5613363",
"0.56028384",
"0.5596889",
"0.5582616",
"0.55821973",
"0.5579623",
"0.55739766",
"0.55581397",
"0.5552804",
"0.5547917",
"0.5546483",
"0.5546476",
"0.55434597",
"0.55410403",
"0.5538203",
"0.55366075",
"0.55331296",
"0.5531871",
"0.55311656",
"0.55295825",
"0.5528382",
"0.5528102",
"0.55275863",
"0.55257094",
"0.5520643",
"0.55166906",
"0.55146486",
"0.55129063",
"0.5509889",
"0.5505061",
"0.5499001",
"0.5496389",
"0.54927737",
"0.5491336",
"0.5491029",
"0.5488943",
"0.548699",
"0.5483689"
] | 0.7504001 | 0 |
shouldEatOffTheGround The desirability of this item to this mob | float shouldEatOffTheGround(IGeneticMob geneticMob, EntityItem itemEntity); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected boolean isMovementNoisy() {\n/* 1861 */ return (!this.abilities.flying && (!this.onGround || !isDiscrete()));\n/* */ }",
"public boolean canAttackWithItem() {\n/* 215 */ return false;\n/* */ }",
"public boolean damagable() {\n return !this.state.equals(\"knockedBack\")\n && !this.state.equals(\"dodge\");\n }",
"public boolean canAttackWithItem() {\n/* 253 */ return false;\n/* */ }",
"@Override\n\tpublic boolean shouldExecute() {\n\t\tif (!theEntity.isTamed())\n\t\t\treturn false;\n\t\telse if (theEntity.isInWater())\n\t\t\treturn false;\n\t\telse if (!theEntity.onGround)\n\t\t\treturn false;\n\t\telse {\n\t\t\tfinal EntityLivingBase var1 = theEntity.getOwner();\n\t\t\treturn var1 == null ? true\n\t\t\t\t\t: theEntity.getDistanceSqToEntity(var1) < 144.0D\n\t\t\t\t\t\t\t&& var1.getAITarget() != null ? false : isSitting;\n\t\t}\n\t}",
"@Override\n\tpublic void canTakeOff() {\n\t\tSystem.out.println(\"I CANNOT TAKE OFF UNLESS YA JUMP ME OVER SOMMAT\");\n\t}",
"public boolean shouldExecute() {\n if (this.runDelay <= 0) {\n if (!net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(bean.world, bean)) {\n return false;\n }\n\n this.currentTask = -1;\n if(plantAndCollect)\n this.hasFarmItem = ((EntityWorkBean)bean).isFarmItemInInventory();\n else this.hasFarmItem = false;\n this.wantsToReapStuff = true; //this.villager.wantsMoreFood();\n }\n\n return super.shouldExecute();\n }",
"boolean hasBonusItemDrop();",
"public boolean canFly() {\n\t\treturn !isEgg() && !isHatchling();\n\t}",
"public boolean shouldExecute()\n {\n return !super.shouldExecute() ? false : (!this.theEntity.worldObj.getGameRules().getGameRuleBooleanValue(\"mobGriefing\") ? false : !this.field_151504_e.func_150015_f(this.theEntity.worldObj, this.entityPosX, this.entityPosY, this.entityPosZ));\n }",
"@Override\r\n\tprotected boolean canDropLoot() {\r\n\t\treturn false;\r\n\t}",
"public boolean shouldDieAtEndOfTurnBecauseOfWater() {\n return shouldDieAtEndOfTurnBecauseOfWater;\n }",
"public boolean shouldExecute() {\n return ShulkerEntity.this.getAttackTarget() == null && ShulkerEntity.this.rand.nextInt(40) == 0;\n }",
"boolean isDrooping();",
"public void getAttackedByDarknessMagicBook(IEquipableItem item){item.strongAttackTo(this.getOwner());}",
"public boolean shouldHit() {\r\n\t\tif(getHandVal() < 17) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false; \r\n\t}",
"public boolean isSwimming() {\n/* 1967 */ return (!this.abilities.flying && !isSpectator() && super.isSwimming());\n/* */ }",
"public void buyFarm(){\n bought = !bought;\n }",
"public boolean isShotDown(){\n return this.shotDown;\n }",
"public boolean bust() {\n if (dealerHand.isBust()) {\n dealerHand = new Deck();\n return true;\n } else {\n return false;\n }\n }",
"@Override\n public boolean applyThis() {\n Unit source = (Unit) ref.getSourceObj();\n Ref REF = ref.getCopy();\n Condition conditions = new OrConditions(\n DC_ConditionMaster\n .getSelectiveTargetingTemplateConditions(SELECTIVE_TARGETING_TEMPLATES.MY_ITEM),\n DC_ConditionMaster\n .getSelectiveTargetingTemplateConditions(SELECTIVE_TARGETING_TEMPLATES.MY_WEAPON));\n if (!new SelectiveTargeting(conditions).select(REF)) {\n ref.getActive().setCancelled(true);\n return false;\n }\n HeroItem item = (HeroItem) REF.getTargetObj();\n conditions = new Conditions(\n // ++ Max distance?\n new DistanceCondition(ref.getActive().getIntParam(PARAMS.RANGE, false) + \"\"),\n // new NumericCondition(\"{match_c_n_of_actions}\", \"1\"),\n new CanActCondition(KEYS.MATCH),\n new NotCondition(ConditionMaster.getSelfFilterCondition()),\n DC_ConditionMaster\n .getSelectiveTargetingTemplateConditions(SELECTIVE_TARGETING_TEMPLATES.ANY_ALLY));\n // non-immobile, ++facing?\n if (!new SelectiveTargeting(conditions).select(REF)) {\n ref.getActive().setCancelled(true);\n return false;\n }\n\n Unit unit = (Unit) REF.getTargetObj();\n\n boolean result = roll(source, unit, item);\n if (item instanceof QuickItem) {\n QuickItem quickItem = (QuickItem) item;\n source.removeQuickItem(quickItem);\n if (result) {\n unit.addQuickItem(quickItem);\n } else {\n dropped(item, unit);\n }\n\n } else {\n source.unequip(item, null);\n if (result) {\n unit.addItemToInventory(item); // TODO equip in hand if\n }\n// possible? spend AP?\n else {\n dropped(item, unit);\n }\n\n }\n // ref.getObj(KEYS.ITEM);\n return true;\n }",
"@Override\n public boolean shouldHeal(ActivePokemon p) {\n return p.hasStatus();\n }",
"@Override\n public boolean shouldHeal(ActivePokemon p) {\n return p.hasStatus();\n }",
"private void notdrawy()\n\t{\n\t\t// check if a flag for a item has been set to see if the item has died and remove it from the arraylist\n\t\tfor (int i =0; i < drawableItems.size();i++)\n\t\t\tif (drawableItems.get(i).isDead())\n\t\t\t{\n\t\t\t\t//remove the corps\n\t\t\t\tdrawableItems.remove(i);\n\t\t\t\t//add to score\n\t\t\t\tscore += +100;\n\t\t\t}\n\t\t\n\t\t//check if any enterties enter each others bounds and if so means they have collided and will trigger the collision on the entitie\n\t\tfor (int i = 0; i < drawableItems.size();i++)\n\t\t\tfor (int j = 0; j < drawableItems.size();j++)\n\t\t\t\tif (j != i)\n\t\t\t\t\tif (drawableItems.get(j).getBounds().intersect(drawableItems.get(i).getBounds()))\n\t\t\t\t\t\tif (drawableItems.get(i).equals(player))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdrawableItems.get(j).collision();\n\t\t\t\t\t\t\tdrawableItems.get(i).collision();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdrawableItems.get(j).collision();\n\t\t\n\t\t//sets have bullets\n\t\tfor (int i = 0; i < player.getGun().getBullets().size();i++)\n\t\t\tfor (int j = 0; j<drawableItems.size();j++)\n\t\t\t\tif (!drawableItems.get(j).equals(player))\n\t\t\t\t\tif (drawableItems.get(j).getBounds().intersect(player.getGun().getBullets().get(i).getBounds()))\n\t\t\t\t\t{\n\t\t\t\t\t\tdrawableItems.get(j).hit(player.getGun().getBullets().get(i).getDamage());\n\t\t\t\t\t\t//tell the bullet it has collided\n\t\t\t\t\t\tplayer.getGun().getBullets().get(i).collision();\n\t\t\t\t\t\t// we want to add to score\n\t\t\t\t\t\tscore++;\n\t\t\t\t\t}\n\t\t\n\t\t// {debug} add new zombies to fight\n\t\tif (drawableItems.size() < 20)\n\t\t\tdrawableItems.add(new ObjectItem(Statics.getScreenWidth() - 100,Statics.getScreenHeight() - 300));\n\t\t\n\t\t//update player p\n\t\tsettarget(player.getPosX(),player.getPosY());\n\t}",
"public boolean isBurning()\n {\n return this.fuel > 0 && this.canSmelt();\n }",
"boolean hasDamage();",
"boolean hasDamage();",
"boolean hasDamage();",
"boolean hasDamage();",
"boolean hasDamage();",
"private boolean blowBlockUp(final Location at, String eventTypeRep) {\n if (at == null) {\n return false;\n }\n Block block = at.getBlock();\n if (block == null) {\n return false;\n }\n if (block.getType() == Material.AIR) {\n return false;\n }\n\n if (!MaterialManager.getInstance().contains(block.getType().name())) {\n return false;\n }\n\n if (eventTypeRep.equals(\"CraftTNTPrimed\") && !MaterialManager.getInstance().getTntEnabled(block.getType().name())) {\n return false;\n }\n if (eventTypeRep.equals(\"CraftSnowball\") && !MaterialManager.getInstance().getCannonsEnabled(block.getType().name())) {\n return false;\n }\n if (eventTypeRep.equals(\"CraftCreeper\") && !MaterialManager.getInstance().getCreepersEnabled(block.getType().name())) {\n return false;\n }\n if (eventTypeRep.equals(\"CraftWither\") && !MaterialManager.getInstance().getWithersEnabled(block.getType().name())) {\n return false;\n }\n if (eventTypeRep.equals(\"CraftMinecartTNT\") && !MaterialManager.getInstance().getTntMinecartsEnabled(block.getType().name())) {\n return false;\n }\n if ((eventTypeRep.equals(\"CraftFireball\") || eventTypeRep.equals(\"CraftGhast\")) && !MaterialManager.getInstance().getGhastsEnabled(block.getType().name())) {\n return false;\n }\n\n if (MaterialManager.getInstance().getDurabilityEnabled(block.getType().name()) && MaterialManager.getInstance().getDurability(block.getType().name()) > 1) {\n TimerState state = checkDurabilityActive(block.getLocation());\n if (ConfigManager.getInstance().getEffectsEnabled()) {\n final double random = Math.random();\n if (random <= ConfigManager.getInstance().getEffectsChance()) {\n block.getWorld().playEffect(at, Effect.MOBSPAWNER_FLAMES, 0);\n }\n }\n if (state == TimerState.RUN || state == TimerState.INACTIVE) {\n int currentDurability = getMaterialDurability(block);\n currentDurability++;\n if (checkIfMax(currentDurability, block.getType().name())) {\n // counter has reached max durability, remove and drop an item\n dropBlockAndResetTime(at);\n } else {\n // counter has not reached max durability damage yet\n if (!MaterialManager.getInstance().getDurabilityResetTimerEnabled(block.getType().name())) {\n addBlock(block, currentDurability);\n } else {\n startNewTimer(block, currentDurability, state);\n }\n }\n } else {\n if (!MaterialManager.getInstance().getDurabilityResetTimerEnabled(block.getType().name())) {\n addBlock(block, 1);\n } else {\n startNewTimer(block, 1, state);\n }\n if (checkIfMax(1, block.getType().name())) {\n dropBlockAndResetTime(at);\n }\n }\n } else {\n destroyBlockAndDropItem(at);\n }\n return true;\n }",
"public boolean isDropped(){\r\n\t\treturn getDirectHolder() == World.world;\r\n\t}",
"static boolean getMauled(){\n\t\t\tif (Person.player.inventory.contains(Item.repellent)) //if you have the goose repellent...\n\t\t\t\treturn (MainFile.getRandomNumber(240) == 12); //drastically lowers your chance of being mauled.\n\t\t\treturn (MainFile.getRandomNumber(20) == 12);//generates a random number for if you don't have it, and if it's 12 you get mauled\n\t\t}",
"public boolean shouldExecute() {\n return this.entity.getAttackTarget() != null && this.isBowInMainhand();\n }",
"public boolean canHit() {\n\t\treturn this.hand.countValue().first() < 17;\n\t}",
"static boolean settleDown() throws GameActionException {\n\t\treturn !rc.isCircleOccupiedExceptByThisRobot(rc.getLocation(), SETTLERADIUS);\n\t}",
"public boolean isDrooping() {\n return false;\n }",
"public boolean unSetDangerous() {\r\n\t\tif(isDangerous && isCovered) {\r\n\t\t\tisDangerous=false;\r\n\t\t\t\r\n\t\t\tthis.setChanged();\r\n\t\t\tthis.notifyObservers();\r\n\t\t\tthis.clearChanged();\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public boolean is_shot(){\n \treturn this.shot;\n }",
"protected boolean isCanCheckDurability(Action action, Material heldItemType) {\n boolean canRun = false;\n if ((heldItemType.toString().contains(\"_HOE\")\n || heldItemType.toString().contains(\"_SPADE\"))\n && action == Action.RIGHT_CLICK_BLOCK) {\n canRun = true;\n } else if ((heldItemType.toString().contains(\"_AXE\")\n //Pickaxe\n || heldItemType.toString().contains(\"_PICKAXE\")\n\n //Hoe\n || heldItemType.toString().contains(\"_HOE\")\n\n //Spade\n || heldItemType.toString().contains(\"_SPADE\")\n\n //Sword\n || heldItemType.toString().contains(\"_SWORD\")) && (action == Action.LEFT_CLICK_BLOCK)) {\n canRun = true;\n }\n return canRun;\n }",
"public boolean canBike() {\r\n\t\tif (location == Location.SAFARI || location == Location.TOWN || location == Location.CAVE) {\r\n\t\t\treturn items.containsKey(Bicycle.getBicycleInstance());\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"@NonNull boolean canBreakWithHand();",
"boolean hasDefense();",
"boolean hasDefense();",
"boolean hasDefense();",
"boolean hasDefense();",
"boolean hasDefense();",
"boolean hasDefense();",
"public boolean isGround() {\n\t return this != WALL && this != BOUNDS;\n\t}",
"public boolean isAllBurntUp() {\n return (flammableItemCount == itemsOnFire);\n }",
"public boolean shouldExecute()\n {\n if (this.runDelay <= 0)\n {\n if (!this.theRaider.world.getGameRules().getBoolean(\"mobGriefing\"))\n {\n return false;\n }\n\n this.currentTask = -1;\n this.wantsToReapStuff = true;\n }\n\n return super.shouldExecute();\n }",
"public boolean isBusted() {\n\t\tif (hand.checkHandValue() > 21) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public boolean hasBust() {\n\t\treturn this.hand.countValue().first() > 21;\n\t}",
"public boolean isGoal() {\n return humming() = 0;\n }",
"boolean canReceiveManaFromItem(ItemStack otherStack);",
"public boolean isPushedByFluid() {\n/* 1974 */ return !this.abilities.flying;\n/* */ }",
"boolean canFall();",
"public boolean shouldExecute() {\n LivingEntity livingentity = ShulkerEntity.this.getAttackTarget();\n if (livingentity != null && livingentity.isAlive()) {\n return ShulkerEntity.this.world.getDifficulty() != Difficulty.PEACEFUL;\n } else {\n return false;\n }\n }",
"public void isShot() {\r\n\t\tlives -=1;\r\n\t\tif(isDead())\r\n\t\t{\r\n\t\t\tthis.erase();\r\n\t\t}\r\n\t}",
"public boolean isGameWon(){\r\n for(Card c: this.cards){\r\n if (c.getFace() == false){\r\n return false;\r\n }\r\n }\r\n return true;\r\n }",
"public boolean isShootDown() {\n return shootDown;\n }",
"@Override\n protected boolean preUseCheck(Event event, ItemStack item) {\n return event instanceof EntityShootBowEvent && new Random().nextDouble()<level/20 && ((EntityShootBowEvent)event).getEntity().hasPermission(\"rayken.unsafe\");\n }",
"private boolean canDamoneBlackSaveItselfRightBehind(Damone damone) {\n return canBlackSaveItselfRightBehind(damone);\n }",
"public boolean isFireDamage();",
"public boolean isAllowed(Player owner, Item item) {\r\n if (item.getValue() > 50000) {\r\n owner.getActionSender().sendMessage(\"This item is too valuable to trust to this familiar.\");\r\n return false;\r\n }\r\n if (!item.getDefinition().isTradeable()) {\r\n owner.getActionSender().sendMessage(\"You can't trade this item, not even to your familiar.\");\r\n return false;\r\n }\r\n if (!owner.getFamiliarManager().getFamiliar().getDefinition().getName().toLowerCase().contains(\"abyssal\")) {\r\n if (item.getId() == 1436 || item.getId() == 7936 || !item.getDefinition().getConfiguration(ItemConfiguration.BANKABLE, true)) {\r\n owner.getActionSender().sendMessage(\"You can't store \" + item.getName().toLowerCase() + \" in this familiar.\");\r\n return false;\r\n }\r\n }\r\n return true;\r\n }",
"boolean isAllowFriendlyFire();",
"private boolean hasEatenApple() {\r\n return snake.getHead().equals(apple);\r\n }",
"public boolean getDamage(){\n\t\tdie();\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean isGameTied() {\t\n\t\treturn false;\n\t}",
"public void playerHasSword() {\n\t\tthis.state = canBeKilled;\n\t}",
"public boolean setDangerous() {\r\n\t\tif(!isDangerous && isCovered) {\r\n\t\t\tisDangerous=true;\r\n\t\t\t\r\n\t\t\tthis.setChanged();\r\n\t\t\tthis.notifyObservers();\r\n\t\t\tthis.clearChanged();\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public boolean isBust() {\n\t\tif(handValue() > 21) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public boolean isBear() {\n return false;\n }",
"public boolean isDropped();",
"@Override\r\n\tpublic boolean isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int side) {\r\n\t\tint meta = world.getBlockMetadata(x, y, z);\r\n\t\treturn getStateFromMeta(meta) == 0 ? false : side == 1;\r\n\t}",
"private static boolean runAway(Critter foo){\n\t\tif(foo.moved) {\n\t\t\tfoo.energy = foo.getEnergy() - Params.walk_energy_cost;\n\t\t\tif (foo.getEnergy() <= 0) {\n\t\t\t\tfoo.isAlive=false;\n\t\t\t}\n\t\t\treturn false;\n\t\t} else {\n\t\t\tint dir = getRandomInt(8);\n\t\t\tif(canMove(foo, dir)) {\n\t\t\t\tfoo.walk(dir);\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\tfoo.energy = foo.getEnergy() - Params.walk_energy_cost;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}",
"public boolean isOnFight();",
"@Override\n public boolean shouldExecute()\n {\n if (theEntity.getAITarget() == null && theEntity.isBurning())\n {\n return false;\n }\n else\n {\n if (theEntity.isRearingFirstTick()) // only set the first tick that is rearing\n {\n return true; \n }\n else\n {\n return false;\n }\n } \n }",
"boolean canLayEgg(IGeneticMob geneticMob);",
"public boolean isShivering();",
"@Override\r\n\tpublic void onSpellHit(Spell spell) {\n\t\tif (spell.getName().contains(\"Antlitz der Göttin\")){\r\n\t\t\tcaster.setFlying(false);\r\n\t\t\tcaster.setAllowFlight(false);\r\n\t\t}\r\n\t}",
"public boolean isBonusShotAllowed() {\n\t\treturn isLastFrame() && (isStrike() || isSpare());\n\t}",
"public static boolean isSomethingToAttackDefined() {\n\t\treturn _attackTargetUnit != null && !_attackTargetUnit.getType().isOnGeyser();\n\t}",
"public boolean isShootUp() {\n return shootUp;\n }",
"public boolean canBurnStun();",
"public boolean isHolding();",
"public boolean hasFainted() {\n return hp <= 0;\n }",
"public boolean isWaterAnimal() {\n return false;\n }",
"boolean precondition(Skill castSkill, Creature performer, Item target) {\n/* 53 */ if (!target.isMailBox() && !target.isSpringFilled() && !target.isUnenchantedTurret() && \n/* 54 */ !target.isPuppet() && !target.isEnchantedTurret()) {\n/* */ \n/* 56 */ performer.getCommunicator().sendNormalServerMessage(\"The spell will not work on that.\", (byte)3);\n/* 57 */ return false;\n/* */ } \n/* */ \n/* */ \n/* 61 */ SpellEffect negatingEffect = EnchantUtil.hasNegatingEffect(target, getEnchantment());\n/* 62 */ if (negatingEffect != null) {\n/* 63 */ EnchantUtil.sendNegatingEffectMessage(getName(), performer, target, negatingEffect);\n/* 64 */ return false;\n/* */ } \n/* 66 */ return true;\n/* */ }",
"public boolean handleDeceive(Action action) {\n ActorState a = action.getActor();\n // TODO we need to test this against the deception of all actors and add\n // handler logic if the target is oneself\n \n //maybeCounter(Augmentation.Type.DECEIVE, a, combatants);\n double chance = a.getDeception() * (1.0 - getPerception());\n boolean success = Math.random() < chance;\n return success;\n }",
"public boolean uncover() {\r\n\t\tif(isCovered && !isDangerous) {\r\n\t\t\tisCovered=false;\r\n\t\t\t\r\n\t\t\tthis.setChanged();\r\n\t\t\tthis.notifyObservers();\r\n\t\t\tthis.clearChanged();\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public boolean isBypassable() {\n return mIsBypassable;\n }",
"public boolean unpoison() {\r\n\t\tstrength = STRENGTH;\r\n\t\treturn true;\r\n\t}",
"public boolean isArmed() { return other.isArmed(); }",
"private boolean canDamoneBlackSaveItselfLeftBehind(Damone damone) {\n return canBlackSaveItselfLeftBehind(damone);\n }",
"boolean canBuy( final Item item )\n {\n return !ship.contains( item ) && item.getPrice() <= credits;\n }",
"boolean canCharge(ItemStack me);",
"@Override\n\tpublic boolean shouldExecute() {\n\t\tif (!theEntityTameable.isTamed())\n\t\t\treturn false;\n\t\telse {\n\t\t\tfinal EntityLivingBase var1 = theEntityTameable.getOwner();\n\n\t\t\tif (var1 == null)\n\t\t\t\treturn false;\n\t\t\telse {\n\t\t\t\ttheTarget = var1.getLastAttacker();\n\t\t\t\tfinal int var2 = var1.getLastAttackerTime();\n\t\t\t\treturn var2 != field_142050_e\n\t\t\t\t\t\t&& isSuitableTarget(theTarget, false)\n\t\t\t\t\t\t&& theEntityTameable.func_142018_a(theTarget, var1);\n\t\t\t}\n\t\t}\n\t}",
"@Override\n\tpublic ArrayList<Unit> useSkill() {\n\t\tArrayList<Unit> canExit = new ArrayList<Unit>();\n\t\tGameBoard gameBoard = GameController.gameBoard;\n\t\tfor (int i = 0; i < gameBoard.getWidth(); i++) {\n\t\t\tfor (int j = 0; j < gameBoard.getHeight(); j++) {\n\t\t\t\tif (gameBoard.getUnit(i, j) instanceof Defender) {\n\t\t\t\t\tdef = (Defender) gameBoard.getUnit(i, j);\n\t\t\t\t\tif (def.getCaptureUnit() == null) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (def.getCaptureUnit() instanceof Silva) {\n\t\t\t\t\t\tfor (Unit u: gameBoard.getAdjacentUnit(i, j)) {\n\t\t\t\t\t\t\tif (u instanceof Empty) {\n\t\t\t\t\t\t\t\tcanExit.add(u);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn canExit;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn canExit;\n\t}",
"boolean isGameSpedUp();"
] | [
"0.68794197",
"0.6655902",
"0.6641247",
"0.6575853",
"0.65440196",
"0.64550143",
"0.6298038",
"0.6269937",
"0.6267241",
"0.62417036",
"0.6131832",
"0.61259353",
"0.6121531",
"0.60843086",
"0.60811144",
"0.6055492",
"0.6049359",
"0.6035561",
"0.60307896",
"0.6018652",
"0.60144264",
"0.5995091",
"0.5995091",
"0.59850127",
"0.59702116",
"0.5947854",
"0.5947854",
"0.5947854",
"0.5947854",
"0.5947854",
"0.5937259",
"0.5921334",
"0.5912609",
"0.5904846",
"0.58844405",
"0.5881072",
"0.5803768",
"0.579909",
"0.5798537",
"0.5797252",
"0.57897955",
"0.5766353",
"0.57567364",
"0.57567364",
"0.57567364",
"0.57567364",
"0.57567364",
"0.57567364",
"0.5749346",
"0.57487404",
"0.57460105",
"0.57452995",
"0.5732239",
"0.5728166",
"0.5716918",
"0.5714989",
"0.57058364",
"0.5701754",
"0.5700032",
"0.56967914",
"0.5692415",
"0.5691996",
"0.5690272",
"0.5688277",
"0.56805664",
"0.5676831",
"0.5676015",
"0.5671009",
"0.565914",
"0.5648421",
"0.5647419",
"0.5643938",
"0.5636571",
"0.5631016",
"0.56303424",
"0.56245214",
"0.56232953",
"0.5622175",
"0.5619954",
"0.561711",
"0.5612054",
"0.5603065",
"0.5596849",
"0.55935746",
"0.5593096",
"0.55907965",
"0.55861",
"0.55787873",
"0.5578285",
"0.5573198",
"0.5569531",
"0.55634606",
"0.55613244",
"0.55613",
"0.5559983",
"0.5559534",
"0.5559313",
"0.5549661",
"0.5545246",
"0.55246526"
] | 0.7033267 | 0 |
getHomeCoords Returns the current coordinates of this mob's home, if they exist | Vec3 getHomeCoords(IGeneticMob geneticMob); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public double[] getHomePosition()\r\n\t{\r\n\t\treturn dataStorage.getHomePosition();\r\n\t}",
"public Location getHome() {\n return home;\n }",
"private int[] findHome() {\n int[] loc = new int[2];\n switch (playerNum) {\n case 0: //player RED's home\n loc[0] = 0;\n loc[1] = 0;\n break;\n case 1: //player YELLOW's home\n loc[0] = 6;\n loc[1] = 0;\n break;\n case 2: //player GREEN's home\n loc[0] = 6;\n loc[1] = 6;\n break;\n case 3: //player BLUE's home\n loc[0] = 0;\n loc[1] = 6;\n break;\n default:\n loc[0] = -1;\n loc[1] = -1;\n break;\n }\n return loc;\n }",
"public String getHomeAddress() {\n return homeAddress;\n }",
"private MatrixHome getMatrixHome() {\n\t\treturn mMatrixHome;\n\t}",
"public int getHome() {\n return m_home;\n }",
"public Object[] getHomeList(){\r\n\t\t//Map laden\r\n\t\tloadMap();\r\n\t\treturn map.keySet().toArray();\r\n\t}",
"public int home () {\n Location center = new Location(myCenterXValue, myCenterYValue);\n int distance = (int) Vector.distanceBetween(getLocation(), center);\n setLocation(center);\n resetHeading();\n return distance;\n }",
"public URI getHome() {\n return this.homeSpace;\n }",
"@Override\n public int[] getGoalPosition() {\n\n if(maze != null){\n int[] position = new int[2];\n position[0] = maze.getGoalPosition().getRowIndex();\n position[1] = maze.getGoalPosition().getColumnIndex();\n return position;\n }\n return null;\n }",
"public Location getHome(UUID uuid, String name){\r\n\t\t//Load Map (Update)\r\n\t\tloadMap();\r\n\t\t//Combovar of Homename & UUID of Player\r\n\t\tString uniqhome = uuid.toString() + name;\r\n\r\n\t\t//Reads the HomePoint and returns its Location\r\n\t\ttry{\r\n\t\t\tStringTokenizer toker = new StringTokenizer(map.get(uniqhome), \";\");\r\n\t\t\tLocation loc = new Location(Bukkit.getWorld(toker.nextToken()),\r\n\t\t\t\t\t\t\t\t\t\tDouble.valueOf(toker.nextToken()), Double.valueOf(toker.nextToken()), Double.valueOf(toker.nextToken()),\r\n\t\t\t\t\t\t\t\t\t\tFloat.valueOf(toker.nextToken()), Float.valueOf(toker.nextToken()));\r\n\r\n\t\t\treturn loc;\r\n\r\n\t\t} catch(NullPointerException e){\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}",
"public static int getHomeCellIndex()\n {\n switch (TurnController.getPlayerTurn())\n {\n case BLUE:\n return 48;\n case RED:\n return 55;\n case GREEN:\n return 62;\n case YELLOW:\n return 69;\n }\n return -1;\n }",
"boolean setHome(IGeneticMob geneticMob, Vec3 coords);",
"public boolean getIsHome() {\n return isHome;\n }",
"public Element createHomePositionElement (Document serviceDoc)\r\n\t{\r\n\t\tElement homePositionElement = serviceDoc.createElement(\"HomePosition\");\r\n\t\tdouble[] pos = getHomePosition();\r\n\t\tif (pos == null)\r\n\t\t\treturn null;\r\n\t\thomePositionElement.setAttribute(\"latitude\", new Double(pos[0]).toString());\r\n\t\thomePositionElement.setAttribute(\"longitude\", new Double(pos[1]).toString());\r\n\t\treturn homePositionElement;\r\n\t}",
"public String getHome(){\n return homeTown;\n\t}",
"@Override\n\tpublic void returnHome()\n\t{\n\t\tif (!isInsideRadius(getSpawn(), 200, false, false))\n\t\t{\n\t\t\tif (Config.DEBUG)\n\t\t\t{\n\t\t\t\tLOG.debug(\"{} moving home\", getObjectId());\n\t\t\t}\n\t\t\tsetisReturningToSpawnPoint(true);\n\t\t\tclearAggroList();\n\t\t\t\n\t\t\tif (hasAI())\n\t\t\t{\n\t\t\t\tgetAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, getSpawn().getLocation());\n\t\t\t}\n\t\t}\n\t}",
"boolean isValidHome(IGeneticMob geneticMob, Vec3 coords);",
"protected Object getHome()\r\n/* 75: */ throws NamingException\r\n/* 76: */ {\r\n/* 77:159 */ if ((!this.cacheHome) || ((this.lookupHomeOnStartup) && (!isHomeRefreshable()))) {\r\n/* 78:160 */ return this.cachedHome != null ? this.cachedHome : lookup();\r\n/* 79: */ }\r\n/* 80:163 */ synchronized (this.homeMonitor)\r\n/* 81: */ {\r\n/* 82:164 */ if (this.cachedHome == null)\r\n/* 83: */ {\r\n/* 84:165 */ this.cachedHome = lookup();\r\n/* 85:166 */ this.createMethod = getCreateMethod(this.cachedHome);\r\n/* 86: */ }\r\n/* 87:168 */ return this.cachedHome;\r\n/* 88: */ }\r\n/* 89: */ }",
"public boolean isHome() {\n return getHomePackageNames().contains(\n mActivityManager.getRunningTasks(1).get(0).topActivity.getPackageName());\n }",
"private Home getHome(final Context ctx)\r\n {\r\n return (Home) ctx.get(this.homeKey_);\r\n }",
"public static String getHome() {\n return home;\n }",
"public AddressForm getHomeAddress() {\n\t\t homeAddress.setAddressType(\"H\");\n\t\treturn homeAddress;\n\t}",
"public File getHome() {\r\n\t\treturn homeDir;\r\n\t}",
"private Element createHomeAreaElement(Document serviceDoc) {\r\n\t\tElement homeAreaElement = serviceDoc.createElement(\"HomeArea\");\r\n\t\t// Get the safe Area from the Profiling and add it to the XML\r\n\t\tVector homeArea = dataStorage.getArea(\"homeArea\");\r\n\t\tif (homeArea == null)\r\n\t\t\treturn null;\r\n\t\t// Iterate over the safe area polygon\r\n\r\n\t\tfor (Iterator i = homeArea.iterator(); i.hasNext();) {\r\n\t\t\tPoint p = (Point) i.next();\r\n\t\t\tdouble lat = p.get2DCoordinates()[0];\r\n\t\t\tdouble lng = p.get2DCoordinates()[1];\r\n\t\t\tElement pointElement = serviceDoc.createElement(\"HomeAreaPoint\");\r\n\t\t\tpointElement.setAttribute(\"latitude\", new Double(lat).toString());\r\n\t\t\tpointElement.setAttribute(\"longitude\", new Double(lng).toString());\r\n\t\t\thomeAreaElement.appendChild(pointElement);\r\n\t\t\tSystem.err.println(\"home are point \" + pointElement.getNodeName() + \" \" + pointElement.getNodeValue());\r\n\t\t}\r\n\r\n\t\treturn homeAreaElement;\r\n\r\n\t}",
"public HomeGroup getHomeGroup() {\n\t\treturn homeGroup;\n\t}",
"public static final String getHome() { return home; }",
"public String getHomeNumber() {\r\n return homeNumber;\r\n }",
"public Location getLobbyLocation() {\n return gameLocations.get(GameLocation.LOBBY);\n }",
"public Boolean isInCurrentHome() throws CallError, InterruptedException {\n return (Boolean)service.call(\"isInCurrentHome\").get();\n }",
"public String getHomeNum() {\n return homeNum;\n }",
"private com.hps.july.trailcom.beans.OpticalHopHome ejbHome() throws java.rmi.RemoteException, javax.naming.NamingException {\n return (com.hps.july.trailcom.beans.OpticalHopHome) PortableRemoteObject.narrow(getHome(), com.hps.july.trailcom.beans.OpticalHopHome.class);\n }",
"private NodeRef getompanyHomeFolder(){\n LOG.debug(\"### Executing \"+ Thread.currentThread().getStackTrace()[1].getMethodName() +\" ####\");\n return nodeLocatorService.getNode(\"companyhome\", null, null);\n }",
"public static int getCoords()\n\t{\n\t\treturn moveCoords;\n\t}",
"MazePoint getActivePlayerCoordinates();",
"@GetMapping(\"ElementWebService/getAllCoords\")\n\tpublic String getAllHQCoords() {\n\t\tList<Element> elementList = elementService.getAll();\n\t\tList<Coord> coordList = new ArrayList<Coord>();\n\t\tfor(Element element: elementList) {\n\t\t\tcoordList.add(element.getLocation());\n\t\t}\n\t\treturn Tools.toJsonString(coordList);\n\t}",
"public void setHomePosition(String latlng) {\r\n\t\t\r\n\t\tdataStorage.setHomePosition(latlng);\r\n\t\t\r\n\t}",
"public void setHome(Location home) {\n this.home = home;\n }",
"public TaskStack getHomeStack() {\n if (this.mHomeStack == null && DisplayContent.this.mDisplayId == 0) {\n Slog.e(DisplayContent.TAG, \"getHomeStack: Returning null from this=\" + this);\n }\n return this.mHomeStack;\n }",
"public Vector2F getScreenLocation() {\n\t\treturn new Vector2F(xPos, yPos);\n\t}",
"public File getHomeDir() {\n return physicalHomeDir;\n }",
"@Override\n public int[] getStartPosition() {\n if(maze != null){\n int[] position = new int[2];\n position[0] = maze.getStartPosition().getRowIndex();\n position[1] = maze.getStartPosition().getColumnIndex();\n return position;\n }\n return null;\n }",
"public List<LatLng> getCoordinates() {\n return mCoordinates;\n }",
"public ReturnHome() {\n addSequential(new SetShooterPos(Constants.shooterHome));\n addParallel(new HoldIntakePosition(Constants.intakeArmHome));\n addSequential(new WaitCommand(1.5));\n addSequential(new StopChassisIntake());\n }",
"private com.hps.july.persistence.SuperRegionAccHome ejbHome() throws java.rmi.RemoteException, javax.naming.NamingException {\n return (com.hps.july.persistence.SuperRegionAccHome) PortableRemoteObject.narrow(getHome(), com.hps.july.persistence.SuperRegionAccHome.class);\n }",
"@Override\n\tpublic void returnHome()\n\t{\n\t\tif(_returnHome && !isInsideRadius(getSpawn().getLocx(), getSpawn().getLocy(), 150, false))\n\t\t{\n\t\t\tclearAggroList();\n\t\t\tgetAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, getSpawn().getLoc());\n\t\t}\n\t}",
"public Point[] getLocation()\n {\n return shipLocation.clone();\n }",
"public CopyOnWriteArrayList<Point> \tgetOccupiedPositions() \t\t\t \t\t\t{ return this.occupiedPositions; }",
"public List<LatLng> getCoordinates() {\n return getGeometryObject();\n }",
"public double[] getHitGeoCoord();",
"public double[] getCoordinates() {\n \tdouble []coords = this.position.getCoordinates();\n \tthis.currentX = coords[0];\n \tthis.currentY = coords[1];\n \treturn coords;\n }",
"public String getHomeTeam(){\n\t\treturn _homeTeam.getTeamName();\n\t}",
"public LatLng getCentrePos() {\n double lat = 0;\n double lon = 0;\n for (int i=0; i<newHazards.size(); i++) {\n lat += frags.get(i).getHazard().getLatitude();\n lon += frags.get(i).getHazard().getLongitude();\n }\n return new LatLng(lat / newHazards.size(), lon / newHazards.size());\n }",
"private List<LatLng> getCoordinates() {\n\n List<LatLng> list = new ArrayList<>();\n SharedPreferences.Editor editor = walkingSharedPreferences.edit();\n int size = walkingSharedPreferences.getInt(user.getUsername(), 0);\n for(int actual = 0; actual < size; actual++) {\n String pos = walkingSharedPreferences.getString(user.getUsername() + \"_\" + actual, \"\");\n editor.remove(user.getUsername() + \"_\" + actual);\n String[] splitPos = pos.split(\" \");\n LatLng latLng = new LatLng(Double.parseDouble(splitPos[LAT]), Double.parseDouble(splitPos[LNG]));\n list.add(latLng);\n }\n editor.remove(user.getUsername());\n editor.apply();\n return list;\n\n }",
"public int getHomeId() {\n return controller.getHomeId();\n }",
"boolean wouldBeValidHome(IGeneticMob geneticMob, Vec3 coords, Block block, int metadata, TileEntity te);",
"public void go_to_home_position() {\n stop_hold_arm();\n Pneumatics.get_instance().set_solenoids(false);\n Dispatcher.get_instance().add_job(new JMoveArm(RobotMap.Arm.pot_value_home, 0.9, 0.7, 0.7, 0.2, 0.8, false, false));\n hold_arm();\n }",
"public Matrix_4_HSH getRelativeCoordinates(AddressIF currentNode,Collection<AddressIF > allNodes,\n\t\t\tCollection<AddressIF > landmarks, double[] lat) {\n\t\treturn null;\n\t}",
"private com.hps.july.persistence.SuperRegionHome ejbHome() throws java.rmi.RemoteException, javax.naming.NamingException {\n return (com.hps.july.persistence.SuperRegionHome) PortableRemoteObject.narrow(getHome(), com.hps.july.persistence.SuperRegionHome.class);\n }",
"private com.hps.july.persistence.CarHome ejbHome() throws java.rmi.RemoteException, javax.naming.NamingException {\n return (com.hps.july.persistence.CarHome) PortableRemoteObject.narrow(getHome(), com.hps.july.persistence.CarHome.class);\n }",
"public double[] getCoordinates() {\n\t\treturn coordinateTools.localToCoordinates(this);\n\t}",
"public Coordinates getCoordinates() {\n if (this.coordinates == null)\n return new Coordinates(-1, -1);\n return this.coordinates;\n }",
"private com.hps.july.persistence.EquipmentSetHome ejbHome() throws java.rmi.RemoteException, javax.naming.NamingException {\n return (com.hps.july.persistence.EquipmentSetHome) PortableRemoteObject.narrow(getHome(), com.hps.july.persistence.EquipmentSetHome.class);\n }",
"public String getHomeWin(String team) {\n\n return getGameInfo(team, \"home_win\");\n }",
"public TaskStack getHomeStack() {\n return this.mTaskStackContainers.getHomeStack();\n }",
"public void getCoordinates(){\n\t\t\n\t\t // check if GPS enabled\n GPSTracker gpsTracker = new GPSTracker(this);\n \n if (gpsTracker.canGetLocation())\n {\n latitude = gpsTracker.latitude;\n\n longitude = gpsTracker.longitude;\n }\n else\n {\n // can't get location\n // GPS or Network is not enabled\n // Ask user to enable GPS/network in settings\n gpsTracker.showSettingsAlert();\n }\n\t}",
"public Point getTopLeft() {\n return location.topLeft();\n }",
"public ArrayList<HexagonPos> getHexagons() {\n\t\treturn hexagonsPos;\n\t}",
"public Point getAbsPosition() {\n return Game.getMap().TFMapCoordinateToMapCenter(position);\n }",
"public ArrayList<Coordinates> getHeroesPositions (){\n\t\tArrayList<Coordinates> path = new ArrayList<>();\n\t\tArrayList<Coordinates> coordinatePieces = chessboard.getTurnPieces();\n\t\tArrayList<Coordinates> threats = getThreats();\n\n\t\tfor ( Coordinates c : threats ){\n\t\t\tpath.add(c); //aggiungo la posizione dell'avversario\n\t\t\tif ( !(chessboard.at(c) instanceof Knight) )\n\t\t\t\tpath.addAll(chessboard.at(c).getPath(c, chessboard.getTurnKing())); //tutte le posizione in cui può andare\n\t\t}\n\t\t\n\t\tArrayList<Coordinates> result = new ArrayList<>();\n\t\t\tfor ( Coordinates c : coordinatePieces )\n\t\t\t\tfor ( Coordinates to : path)\n\t\t\t\t\tif ( !(chessboard.at(c) instanceof King) && checkMove(c, to) )\n\t\t\t\t\t\tresult.add(to);\n\t\treturn result;\n\t}",
"public long[] getWorldCoordinate(int screenX, int screenY);",
"public File getHome() {\n return home;\n }",
"public Point getHeadLocation ()\r\n {\r\n if (headLocation == null) {\r\n computeLocations();\r\n }\r\n\r\n return headLocation;\r\n }",
"public static String getHomeDirectory() {\n\t\treturn System.getProperty(\"user.home\");\n\t}",
"private EntryStorageHome home()\r\n {\r\n if( home == null )\r\n {\r\n\t\ttry\r\n\t\t{\r\n home = (EntryStorageHome) \r\n get_storage_home().get_catalog().find_storage_home( PSS_HOME );\r\n\t\t}\r\n\t\tcatch( Throwable e )\r\n\t\t{\r\n\t\t String error = \"Could not resolve the EntryStorageHome\";\r\n\t\t throw new RuntimeException( error, e );\r\n\t\t}\r\n }\r\n return home;\r\n }",
"public ArrayList<Integer[]> getMineLocations()\n {\n return mineLocations;\n }",
"public Coords getUpperLeft()\r\n {\r\n return new Coords(x, y);\r\n }",
"public java.lang.String getSenderHomePhone() {\r\n return senderHomePhone;\r\n }",
"long getCoordinates();",
"long getCoordinates();",
"private double[] getPositionOfSpaceObject(CTS_SpaceObject obj) {\n\t\tif (obj == null) {\n\t\t\t//System.out.println(\"null obj passed to getPositionOfSpaceObject!\");\n\t\t\treturn null;\n\t\t}\n\t\tdouble azimuth = obj.getAzimuth();\n\t\tdouble altitude = obj.getAltitude();\n\t\tif (altitude < 0 || altitude > 90) {\n\t\t\treturn null;\n\t\t}\n\t\tdouble radAlt = toRadians(altitude);\n\t\tdouble r = VIEWING_AREA_WIDTH / 2;\n\t\tdouble x_val, y_val, distanceFromCenter;\n\t\tdistanceFromCenter = abs(r*cos(radAlt));\n\t\t// x_val, y_val are coords relative to the center of the viewing area\n\t\t// being considered 0,0 on the Cartesian plane\n\t\tx_val = distanceFromCenter*(sin(toRadians(azimuth)));\n\t\ty_val = distanceFromCenter*(cos(toRadians(azimuth)));\n\t\t// view_x, view_y are the actual JavaFX coordinates to draw at\n\t\tdouble view_x = 0, view_y = 0;\n\t\tif (azimuth < 90) {\n\t\t\tview_x = x_val + 299;\n\t\t\tview_y = max(0,(299-y_val));\n\t\t} else if (azimuth < 180) {\n\t\t\tview_x = x_val + 299;\n\t\t\tview_y = min(599,(299-y_val));\n\t\t} else if (azimuth < 270) {\n\t\t\tview_x = max(0,(299+x_val));\n\t\t\tview_y = min(599,(299-y_val));\n\t\t} else {\n\t\t\tview_x = max(0,(299+x_val));\n\t\t\tview_y = max(0,(299-y_val));\n\t\t}\n\t\tdouble[] retval = { view_x, view_y};\n\t\treturn retval;\n\t}",
"public GridLocation getLocation();",
"public String getHomeTeam() {\n return homeTeam;\n }",
"public static String home() {\n\n String treefsHome = stringValue(\"treefs.home\");\n if(isNullOrEmpty(treefsHome)) {\n // default home location\n treefsHome = System.getProperty(\"user.dir\");\n }\n\n return treefsHome;\n }",
"private String getHome()\n {\n return this.bufferHome.getAbsolutePath() + \"/\";\n }",
"public Location getEyeLocation ( ) {\n\t\treturn extract ( handle -> handle.getEyeLocation ( ) );\n\t}",
"public Point getGridCoordinates(){\n try {\n return (new Point(x / MapManager.getMapTileWidth(), y / MapManager.getMapTileHeight()));\n } catch (Exception e){\n System.out.print(\"Error while getting grid coordinates.\");\n throw e;\n }\n }",
"public ArrayList<Location> getLocations()\n {\n ArrayList<Location> locs = new ArrayList<>();\n for (int row = 0; row < squares.length; row++)\n {\n for (int col = 0; col < squares[0].length; col++)\n {\n locs.add(new Location(row,col));\n }\n }\n return locs;\n }",
"public Point getRobotLocation();",
"private List<BaseLocation> getExpectedBaseLocations() {\r\n final List<BaseLocation> baseLocations = new ArrayList<>();\r\n\r\n final Position position1 = new Position(3104, 3856, PIXEL);\r\n final Position center1 = new Position(3040, 3808, PIXEL);\r\n baseLocations.add(new BaseLocation(position1, center1, 13500, 5000, true, false, true));\r\n\r\n final Position position2 = new Position(2208, 3632, PIXEL);\r\n final Position center2 = new Position(2144, 3584, PIXEL);\r\n baseLocations.add(new BaseLocation(position2, center2, 9000, 5000, true, false, false));\r\n\r\n final Position position3 = new Position(640, 3280, PIXEL);\r\n final Position center3 = new Position(576, 3232, PIXEL);\r\n baseLocations.add(new BaseLocation(position3, center3, 13500, 5000, true, false, true));\r\n\r\n final Position position4 = new Position(2688, 2992, PIXEL);\r\n final Position center4 = new Position(2624, 2944, PIXEL);\r\n baseLocations.add(new BaseLocation(position4, center4, 9000, 5000, true, false, false));\r\n\r\n final Position position5 = new Position(1792, 2480, PIXEL);\r\n final Position center5 = new Position(1728, 2432, PIXEL);\r\n baseLocations.add(new BaseLocation(position5, center5, 12000, 0, true, true, false));\r\n\r\n final Position position6 = new Position(3200, 1776, PIXEL);\r\n final Position center6 = new Position(3136, 1728, PIXEL);\r\n baseLocations.add(new BaseLocation(position6, center6, 13500, 5000, true, false, true));\r\n\r\n final Position position7 = new Position(640, 1968, PIXEL);\r\n final Position center7 = new Position(576, 1920, PIXEL);\r\n baseLocations.add(new BaseLocation(position7, center7, 9000, 5000, true, false, false));\r\n\r\n final Position position8 = new Position(1792, 1808, PIXEL);\r\n final Position center8 = new Position(1728, 1760, PIXEL);\r\n baseLocations.add(new BaseLocation(position8, center8, 12000, 0, true, true, false));\r\n\r\n final Position position9 = new Position(2336, 560, PIXEL);\r\n final Position center9 = new Position(2272, 512, PIXEL);\r\n baseLocations.add(new BaseLocation(position9, center9, 13500, 5000, true, false, true));\r\n\r\n final Position position10 = new Position(3584, 720, PIXEL);\r\n final Position center10 = new Position(3520, 672, PIXEL);\r\n baseLocations.add(new BaseLocation(position10, center10, 9000, 5000, true, false, false));\r\n\r\n final Position position11 = new Position(544, 432, PIXEL);\r\n final Position center11 = new Position(480, 384, PIXEL);\r\n baseLocations.add(new BaseLocation(position11, center11, 13500, 5000, true, false, true));\r\n\r\n return baseLocations;\r\n }",
"@Override\n\tpublic ArrayList<BoardLocation> findLocation() {\n\t\treturn null;\n\t}",
"public List<Integer> ghostLocation(int Ghostx, int Ghosty){\n\n ghostLocay.add(Ghostx);\n ghostLocay.add(Ghosty);\n\n return ghostLocay;\n }",
"public int[] getScreenCoordinate(long worldLat, long worldLon);",
"public Coords getFinalCoords() {\n if (getLastStep() != null) {\n return getLastStep().getPosition();\n }\n return getEntity().getPosition();\n }",
"public Location getCurrentLocation();",
"public float[] getLocation() {\n return llpoints;\n }",
"public Location getEnterLocation() {\r\n return location;\r\n }",
"public geo_location getLocation() {\n return _pos;\n }",
"public ArrayList<Location> getMoveLocations()\n {\n ArrayList<Location> locs = new ArrayList<Location>();\n ArrayList<Location> validLocations = getGrid().getValidAdjacentLocations(getLocation());\n for (Location neighborLoc : validLocations)\n {\n if (getGrid().get(neighborLoc) == null || getGrid().get(neighborLoc) instanceof AbstractPokemon || getGrid().get(neighborLoc) instanceof PokemonTrainer)\n locs.add(neighborLoc);\n }\n return locs;\n }",
"public static String getUserHome() {\n return System.getProperty(\"user.home\");\n }"
] | [
"0.7364839",
"0.64021313",
"0.6168838",
"0.5885873",
"0.5843075",
"0.5825167",
"0.5769801",
"0.5596718",
"0.55674416",
"0.5497497",
"0.5474314",
"0.5464747",
"0.5461798",
"0.5459704",
"0.543538",
"0.54248106",
"0.54110634",
"0.53977203",
"0.53614193",
"0.53476524",
"0.52522725",
"0.51855123",
"0.5174682",
"0.5138325",
"0.5131492",
"0.51231194",
"0.5120988",
"0.5115724",
"0.50992066",
"0.5097512",
"0.50818586",
"0.5075864",
"0.50732416",
"0.5062393",
"0.5055941",
"0.5036809",
"0.5029657",
"0.5025312",
"0.5018554",
"0.5006523",
"0.49972424",
"0.4995795",
"0.49942854",
"0.49814114",
"0.49770334",
"0.49685073",
"0.49665058",
"0.4965989",
"0.49639004",
"0.49583203",
"0.49551347",
"0.4954836",
"0.49296933",
"0.49254346",
"0.4919809",
"0.49009338",
"0.4897943",
"0.48870474",
"0.48725042",
"0.4867842",
"0.48571035",
"0.48563507",
"0.485087",
"0.48505583",
"0.48497838",
"0.4845703",
"0.48414856",
"0.4829701",
"0.4822546",
"0.48195758",
"0.48114416",
"0.4782438",
"0.47776052",
"0.47657326",
"0.47643018",
"0.4760032",
"0.47559047",
"0.4740513",
"0.47354454",
"0.47354454",
"0.47315842",
"0.47290364",
"0.47152114",
"0.4711361",
"0.47108445",
"0.47046494",
"0.47037125",
"0.47032744",
"0.46939537",
"0.46917218",
"0.4691309",
"0.4691255",
"0.46905512",
"0.46891713",
"0.4687106",
"0.46840233",
"0.4673353",
"0.4669493",
"0.46475697",
"0.464024"
] | 0.6783583 | 1 |
isValidHome whether the block at the given coords is a valid home for this mob | boolean isValidHome(IGeneticMob geneticMob, Vec3 coords); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean wouldBeValidHome(IGeneticMob geneticMob, Vec3 coords, Block block, int metadata, TileEntity te);",
"boolean setHome(IGeneticMob geneticMob, Vec3 coords);",
"@Override\n public boolean isLocationValid(XYCoord coords)\n {\n return master.isLocationValid(coords);\n }",
"private boolean checkM(){\n if(currentLocation.x == previousLocation.x && currentLocation.y == previousLocation.y) {\n return false;\n }\n // Is outside the border\n if(currentLocation.x < size || currentLocation.y < size || currentLocation.x > map.numRows - size || currentLocation.y > map.numCols - size) {\n return false;\n }\n // Is on the land\n double angle2 = 0;\n while (angle2 < 6.3) {\n if (map.getTerrainGrid()[currentLocation.x + (int) (size/2 * cos(angle2))][currentLocation.y + (int) (size/2 * sin(angle2))] == Colors.OCEAN) {\n return false;\n }\n angle2 += 0.3;\n }\n return true;\n }",
"@Override\n public boolean isLocationValid(int x, int y)\n {\n return master.isLocationValid(x, y);\n }",
"private boolean quickVerify(Location loc)\n {\n //quickly check if 2 blocks above this is clear\n Block oneAbove = loc.getBlock();\n Block twoAbove = oneAbove.getRelative(BlockFace.UP, 1);\n return oneAbove.getType().equals(Material.AIR) && twoAbove.getType().equals(Material.AIR);\n }",
"boolean isGoodLocation(World world, int x, int y, int z);",
"private boolean isValid() throws InvalidStateException{\n if (this.homeTeam == null || this.visitingTeam == null){\n return false;\n }else{\n return true;\n }\n }",
"boolean isHome(IGeneticMob geneticMob);",
"private boolean isLegalPositon(Position checkPosition){\n if (checkPosition.equalPosition(start)||checkPosition.equalPosition(end))\n return true;\n if(checkPosition.getRow()<0 || checkPosition.getCol()<0 || checkPosition.getRow()>=this.rows || checkPosition.getCol() >= this.cols){\n return false;\n }\n\n if(maze[checkPosition.getRow()][checkPosition.getCol()]== WallType.wall){\n return false;\n }\n return true;\n }",
"public boolean isPositionValid(){\n\t\t//check overlapping with walls\n\t\tfor(Wall wall : Game.gameField.getWalls()){\n\t\t\tif(wall.overlaps(center))\n\t\t\t\treturn false;\n\t\t}\n\t\t//check overlapping with other balls\n\t\tfor(Ball ball : Game.gameField.getBalls()){\n\t\t\tif(ball == this)\n\t\t\t\tcontinue;\n\t\t\tif(ball.getCenterPoint().distance(center) < RADIUS * 2)\n\t\t\t\treturn false;\n\t\t}\n\t\treturn GameField.FIELD.contains(center);\n\t}",
"public static boolean isValidMove(Robot robot) {\r\n\t\t\r\n\t\tint x = robot.getX();\r\n\t\tint y = robot.getY();\r\n\t\t\r\n\t\t//Make sure the next move won't out\r\n\t\t//of bound to the east\r\n\t\tif(robot.facingEast()) {\r\n\t\t\tif(x + 1 < 10) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Make sure the next move won't hit\r\n\t\t//the wall to the west\r\n\t\tif(robot.facingWest()) {\r\n\t\t\tif(x - 1 > 0) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\t\r\n\t\t//Make sure the next move won't hit\r\n\t\t//the wall to the south\r\n\t\tif(robot.facingSouth()) {\r\n\t\t\tif(y - 1 > 0) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\t\r\n\t\t//Make sure the next move won't out\r\n\t\t//of the bound to the north\r\n\t\tif(robot.facingNorth()) {\r\n\t\t\tif(y + 1 < 10) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\t\t\t\r\n\t\treturn false;\r\n\t}",
"boolean canPlaceRobber(HexLocation hexLoc);",
"public static boolean validLocation(AbstractCard c) {\n return AbstractDungeon.player.hand.contains(c) ||\n AbstractDungeon.player.drawPile.contains(c) ||\n AbstractDungeon.player.discardPile.contains(c) ||\n AbstractDungeon.player.exhaustPile.contains(c);\n }",
"private boolean checkCrash (Location next)\n {\n if (next == null) {\n return true;\n }\n\n Location last = playerLocations.get(playerLocations.size()-1);\n\n LocationType type = next.getType();\n //println(getLocation(next).getType()+\" : \"+next);\n if (type == LocationType.POWERUP) {\n PowerUp p = getPowerUp(next);\n\n if (p != null) { // Basically a workaround for the NPE\n // if (ENABLE_SOUND) {\n // sfx.gainedPowerUp();\n // }\n addSpeed(1);\n speedTimer += (int) frameRate * 2;\n removePowerUp(p);\n }\n\n return false;\n }\n\n if ((type == LocationType.PLAYER || type == LocationType.WALL) ||\n (next.getY() != last.getY() && (direction == LEFTKEY || direction == RIGHTKEY)) ||\n (next.getX() != last.getX() && (direction == UPKEY || direction == DOWNKEY))) { // This is to prevent bike from wrapping around edge of grid, because grid is a 1d array\n //sfx.lostALife(); //Commented out because you hear a shrill sound at the end for some reason\n return true;\n }\n\n return false;\n }",
"public boolean isValid(Board board) {\n if (!from.isValid(board.size) || !to.isValid(board.size)) {\r\n return false;\r\n }\r\n\r\n // Confirm the 'from' space is occupied\r\n if (!board.b[from.row][from.column]) {\r\n return false;\r\n }\r\n\r\n // Confirm the 'to' space is empty\r\n if (board.b[to.row][to.column]) {\r\n return false;\r\n }\r\n\r\n int rowJump = Math.abs(from.row - to.row);\r\n int colJump = Math.abs(from.column - to.column);\r\n\r\n if (rowJump == 0) {\r\n if (colJump != 2) {\r\n return false;\r\n }\r\n }\r\n else if (rowJump == 2) {\r\n if (colJump != 0 && colJump != 2) {\r\n return false;\r\n }\r\n }\r\n else {\r\n return false;\r\n }\r\n\r\n // Confirm the 'step' space is occupied\r\n return board.b[(from.row + to.row) / 2][(from.column + to.column) / 2];\r\n }",
"private boolean legalMove() {\n\n\t\t// empty landing spot\n\t\tif (tilePath.size() == 0) {\n\t\t\tdebug(\"illegal, empty landing spot\");\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!mBoard.tileIsEmpty(tilePath.get(tilePath.size() - 1))) {\n\t\t\tdebug(\"illegal, tile not empty\");\n\t\t\treturn false;\n\t\t}\n\n\t\t// start doesn't equal end\n\t\tif (tilePath.get(0).equals(tilePath.get(tilePath.size() - 1))) {\n\t\t\tdebug(\"illegal, start doesn't equal end\");\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"public static boolean isValid(Location l)\n\t{\n\t\treturn l != null || Maze.isInBounds(l);\n\t}",
"public static boolean hasEmptyFaces(Location loc) {\n\t\tWorld world = loc.getWorld();\n\t\tif (world.getBlockAt((int) loc.getX() + 1, (int) loc.getY(), (int) loc.getZ()).getType() == Material.AIR) {\n\t\t\tif (world.getBlockAt((int) loc.getX() - 1, (int) loc.getY(), (int) loc.getZ()).getType() == Material.AIR) {\n\t\t\t\tif (world.getBlockAt((int) loc.getX(), (int) loc.getY(), (int) loc.getZ() + 1)\n\t\t\t\t\t\t.getType() == Material.AIR) {\n\t\t\t\t\tif (world.getBlockAt((int) loc.getX() + 1, (int) loc.getY(), (int) loc.getZ() - 1)\n\t\t\t\t\t\t\t.getType() == Material.AIR) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"private static boolean isValidStartingLocation(Location startLocation,\n\t\t\tPlayerColor color) {\n\t\tfinal int xCoord = startLocation.getCoordinate(Coordinate.X_COORDINATE);\n\t\tfinal int yCoord = startLocation.getCoordinate(Coordinate.Y_COORDINATE);\n\t\tswitch (color) {\n\t\tcase RED:\n\t\t\treturn (xCoord >= 0 && xCoord <= 5 && yCoord >= 0 && yCoord <= 1);\n\t\tcase BLUE:\n\t\t\treturn (xCoord >= 0 && xCoord <= 5 && yCoord >= 4 && yCoord <= 5);\n\t\tdefault:\n\t\t\treturn false;\n\t\t}\n\n\t}",
"public boolean inRegion(Location loc)\n {\n if (!loc.getWorld().getName().equals(world.getName()) || !setup)\n return false;\n \n int x = loc.getBlockX();\n int y = loc.getBlockY();\n int z = loc.getBlockZ();\n \n // Check the lobby first.\n if (lobbySetup)\n {\n if ((x >= l1.getBlockX() && x <= l2.getBlockX()) && \n (z >= l1.getBlockZ() && z <= l2.getBlockZ()) && \n (y >= l1.getBlockY() && y <= l2.getBlockY()))\n return true;\n }\n \n // Returns false if the location is outside of the region.\n return ((x >= p1.getBlockX() && x <= p2.getBlockX()) && \n (z >= p1.getBlockZ() && z <= p2.getBlockZ()) && \n (y >= p1.getBlockY() && y <= p2.getBlockY()));\n }",
"private boolean isAllAreaAchievable() throws ReachabilityException {\n\t\t\n\t\t// mark all points that the player should reach as 1, else as 0\n\t\tint[][] tempMap = new int[height][width];\n\t\tfor (int i = 0; i < height; i++) {\n\t\t\tfor (int j = 0; j < width; j++) {\n\t\t\t\tif (mapElementArray[i][j] instanceof Item\n\t\t\t\t\t\t|| mapElementArray[i][j] instanceof Teleporter\n\t\t\t\t\t\t|| mapElementArray[i][j] instanceof PlayerSpawnPoint)\n\t\t\t\t\ttempMap[i][j] = 1;\n\t\t\t\telse\n\t\t\t\t\ttempMap[i][j] = 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//try to reach all area\n\t\treachAllValidPoint(tempMap, aPlayerSpawnPointRow, aPlayerSpawnPointCol);\n\t\t\n\t\t//check if all area have been reached\n\t\tint unreachablePoint = 0;\n\t\tfor (int i = 0; i < height; i++) {\n\t\t\tfor (int j = 0; j < width; j++) {\n\t\t\t\tif (tempMap[i][j] == 1) {\n\t\t\t\t\tunreachablePoint++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n//\t\ttry {\n\t\t\tif (unreachablePoint > 0) {\n\t\t\t\tSystem.out.println(unreachablePoint + \" points are unreachable\");\n\t\t\t\tthrow new ReachabilityException();\n\t\t\t}else {\n\t\t\t\treturn true;\n\t\t\t}\n\t/*\t} catch (ReachabilityException e) {\n\t\t\tSystem.out.println(e);\n\t\t\t//print out map with invalid area\n\t\t\tfor (int i = 0; i < height; i++) {\n\t\t\t\tfor (int j = 0; j <width; j++) {\n\t\t\t\t\tSystem.out.print(tempMap[i][j]);\n\t\t\t\t}\n\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t}\n\t\t\treturn false;\n\t\t}*/\n\n\t}",
"@Override\n protected boolean doTask()\n {\n if (!this.homePos.isEmpty()) return true;\n final Brain<?> brain = this.entity.getBrain();\n if (brain.hasMemoryValue(MemoryModules.GOING_HOME.get())) return true;\n if (BurrowTasks.shouldBeInside(this.world, this.burrow))\n {\n brain.setMemory(MemoryModules.GOING_HOME.get(), true);\n return true;\n }\n return false;\n }",
"private Location verifyLocation(Location location)\n {\n Block playerBlock = location.getBlock();\n World world = location.getWorld();\n\n if (rootC.getStringList(RootNode.WORLDS).contains(world.getName()))\n {\n // Only spawn monsters in normal world. End is crowded with endermen\n // and nether is too extreme anyway, add config later\n int lightLvl = location.getBlock().getLightFromSky();\n if (world.getEnvironment() == Environment.NORMAL\n && (location.getY() < rootC.getInt(RootNode.MORE_MONSTERS_MAX_Y) && lightLvl < 3))\n {\n // the playerBlock should always be air, but if the player stands\n // on a slab he actually is in the slab, checking a few blocks under because player could have jumped etc..\n if (playerBlock.getType().equals(Material.AIR))\n {\n for (int i = 0; i <= 3; i++)\n {\n playerBlock = location.getBlock().getRelative(BlockFace.DOWN, 1);\n\n if (playerBlock.getType().equals(Material.AIR))\n {\n location.subtract(0, 1, 0);\n playerBlock = location.getBlock();\n // the playerBlock is now the block where the monster\n // should spawn on, next up: verify block\n }\n else\n {\n break;\n }\n }\n }\n // no spawning on steps, stairs and transparent blocks\n if (playerBlock.getType().name().endsWith(\"STEP\") || playerBlock.getType().name().endsWith(\"STAIRS\")\n || playerBlock.getType().isTransparent() || !playerBlock.getType().isOccluding() || playerBlock.getType().equals(Material.AIR))\n {\n // don't spawn here\n return null;\n }\n\n if (quickVerify(location))\n return location;\n }\n\n }\n return null;\n }",
"@Override\n\tpublic boolean canCoordinateBeSpawn(int par1, int par2) {\n\t\tint i = worldObj.getFirstUncoveredBlock(par1, par2);\n\t\tif (i == 0) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn Block.blocksList[i].blockMaterial.blocksMovement();\n\t\t}\n\t}",
"public boolean isValid(World world, BlockPos pos, IBlockState state) {\n return true;\n }",
"public boolean canMove(Location loc){\n if(loc.getX() >= theWorld.getX() || loc.getX() < 0){\n System.out.println(\"cant move1\");\n return false;\n }else if(loc.getY() >= theWorld.getY() || loc.getY() < 0){\n System.out.println(\"cant move2\");\n return false;\n }else{\n System.out.println(\"can move\");\n return true;\n }\n }",
"public boolean isSpawnable(Location loc) {\n Block block = loc.getBlock();\n Block under = loc.getBlock().getRelative(BlockFace.DOWN);\n Block above = loc.getBlock().getRelative(BlockFace.UP);\n if (block.getType().equals(Material.AIR) && !under.getType().equals(Material.AIR) && above.getType().equals(Material.AIR)) {\n if (block.getLightLevel() <= plugin.CONFIG.SPAWNING_LIGHT) {\n return true;\n }\n }\n return false;\n }",
"public ArrayList<Location> getValid(Location loc) {\n\n\tGrid<Actor> grid = getGrid();\n\tif (grid == null)\n\t return null;\n\n\tArrayList<Location> valid = new ArrayList<Location>();\n\tArrayList<Location> lastNode = crossLocation.peek();\n\tint[] dirs =\n { Location.SOUTH, Location.NORTH, Location.EAST, Location.WEST };\n\n\t// get the empty and valid location in the desire directions\n for (int d : dirs) {\n\n\t Location neighborLoc = loc.getAdjacentLocation(getDirection() + d);\n\t\t if (!lastNode.contains(neighborLoc) && grid.isValid(neighborLoc)) {\n\t\t\t\n\t\t\tActor actor = (Actor) grid.get(neighborLoc);\n\t\t\tif (grid.get(neighborLoc) == null || actor instanceof Flower) {\n\t\t\t \n\t\t\t valid.add(neighborLoc);\n\t\t\t} \n\t\t\n\t\t\tif (actor instanceof Rock && actor.getColor() == Color.RED) {\n\t\t\t\n\t\t\t isEnd = true;\n\t\t\t}\n\t\t }\n\t }\n\t \n\t\treturn valid;\n }",
"@Override\n\tpublic void returnHome()\n\t{\n\t\tif (!isInsideRadius(getSpawn(), 200, false, false))\n\t\t{\n\t\t\tif (Config.DEBUG)\n\t\t\t{\n\t\t\t\tLOG.debug(\"{} moving home\", getObjectId());\n\t\t\t}\n\t\t\tsetisReturningToSpawnPoint(true);\n\t\t\tclearAggroList();\n\t\t\t\n\t\t\tif (hasAI())\n\t\t\t{\n\t\t\t\tgetAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, getSpawn().getLocation());\n\t\t\t}\n\t\t}\n\t}",
"@Test\n public void test1LandOn()throws Exception{\n Position pos = new Position(0,0);\n generateLevel.landOn(pos,BlockType.PATH.toString());\n assertFalse(generateLevel.getBlocks().isEmpty());\n }",
"private boolean atLeastOneNonWallLocation() {\n\t\tfor (int x = 0; x < this.map.getMapWidth(); x++) {\n\t\t\tfor (int y = 0; y < this.map.getMapHeight(); y++) {\n\n\t\t\t\tif (this.map.getMapCell(new Location(x, y)).isWalkable()) {\n\t\t\t\t\t// If it's not a wall then we can put them there\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"private boolean isValid(AStarNode start, AStarNode end) {\n boolean check = true;\n for (Obstacle obs : getObstacles()) {\n if (isOnTheWay(start, end, obs))\n check = false;\n }\n return check;\n }",
"public boolean isValidBoard() {\n\t\t\n\t\tif(mainSlots.size() != NUM_MAIN_SLOTS) {\n\t\t\treturn false;\n\t\t} else if ((redHomeZone != null && redHomeZone.size() != NUM_HOME_SLOTS) ||\n\t\t\t\t(greenHomeZone != null && greenHomeZone.size() != NUM_HOME_SLOTS) ||\n\t\t\t\t(yellowHomeZone != null && yellowHomeZone.size() != NUM_HOME_SLOTS) || \n\t\t\t\t(blueHomeZone != null && blueHomeZone.size() != NUM_HOME_SLOTS)) {\n\t\t\treturn false;\n\t\t} else if ((redEndZone != null && redEndZone.size() != NUM_END_SLOTS) ||\n\t\t\t\t(greenEndZone != null && greenEndZone.size() != NUM_END_SLOTS) || \n\t\t\t\t(yellowEndZone != null && yellowEndZone.size() != NUM_END_SLOTS) || \n\t\t\t\t(blueEndZone != null && blueEndZone.size() != NUM_END_SLOTS)) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t}",
"private boolean checkSpaceAvailability(Point targetLocation, ICityFragment element) {\r\n //basic constraint:no other things here\r\n\r\n if (city.isAnythingHere(targetLocation, element.getBoundary().width, element.getBoundary().height, element)) {\r\n return false;\r\n }\r\n\r\n //crossroads:at least one road can connected\r\n if (element instanceof Crossroads) {\r\n var crossroad = (Crossroads) element;\r\n\r\n var accessibleRoad = findAccessibleRoads(crossroad, targetLocation);\r\n\r\n if (accessibleRoad == null || accessibleRoad.size() <= 1) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }",
"public boolean inValidSpot(Path p1){\n\t\t// Checks to see it the path piece placed expects an entrance or exit piece out of bounds\n\t\t\n\t\tint largestRow = (height*width-1)/width;\n\t\t\n\t\t// if entrance or exit pos expected is negative, know it is expecting a path outside the top bound\n\t\tif(p1.getEntry()<0 || p1.getExit()<0){\n\t\t\treturn false;\n\t\t}\n\t\t// if entrance or exit's row greater than the maximum row, know it is expecting a path outside bottom bound\n\t\tif(p1.getEntryRow()>largestRow || p1.getExitRow()>largestRow){\n\t\t\treturn false;\n\t\t}\n\t\tint currentRow = p1.getRow();\n\t\tint nextRow=0;\n\t\tif(Math.abs(p1.getPos()-p1.getEntry())==1){\n\t\t\t// If the absolute value of the difference between the current position and its entrance is 1 ...\n\t\t\t// Checking to see if the entrance is expected to be outside of the left or right edges of Map\n\t\t\tnextRow = p1.getEntryRow();\n\t\t\tif(currentRow!=nextRow){\n\t\t\t\t// This means that the entrance expected is not to the left or to the right\n\t\t\t\t// In other words, the entrance is expected in another row\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tif(Math.abs(p1.getPos()-p1.getExit())==1){\n\t\t\t// If the absolute value of the difference between the current position and its exit is 1 ...\n\t\t\t// Checking to see if the exit is expected to be outside of the left or right edges of Map\n\t\t\tnextRow = p1.getExitRow();\n\t\t\tif(currentRow!=nextRow){\n\t\t\t\t// This means that the exit expected is not to the left or to the right\n\t\t\t\t// In other words, the exit is expected in another row\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t/*\n\t\tif(Math.abs(p1.getPos()-p1.getEntry())==width){\n\t\t\tnextRow = p1.getEntryRow();\n\t\t\tif(p1.getEntry()<0 || nextRow>(height-1/width)){//it used to be calculaterow(height*width-1\n\t\t\t\t//Less than zero would make it on top of the top edge\n\t\t\t\t//First term calculated in this manner because any negative entrance between -1 and \n\t\t\t\t// -width+1 will have an integer rounded to zero. The double casting will give an \n\t\t\t\t// accurate number without losing the sign\n\t\t\t\t\n\t\t\t\t//Greater than height*width-1 would make in lower than the bottom edge\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tif(Math.abs(p1.getPos()-p1.getExit())==width){\n\t\t\tnextRow = p1.getExitRow();\n\t\t\tif(p1.getEntry()<0 || nextRow>(height-1/width)){//it used to be calculaterow(height*width-1\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t*/\n\t\treturn true;\n\t\t\n\t}",
"public boolean isValid(CoreProtectAPI.ParseResult ore) {\n if (worldName != null && worldName.equalsIgnoreCase(ore.worldName())) {\n Location loc = new Location(Bukkit.getWorld(ore.worldName()), ore.getX(), ore.getY(), ore.getZ());\n if (loc.distance(getLocation()) <= MAX_DISTANCE) {\n if (ore.getType() == type) {\n return true;\n }\n }\n }\n return false;\n }",
"public boolean canMove (Location loc) {\n Grid<Actor> gr = getGrid();\n if (gr == null)\n return false;\n if (!gr.isValid(loc))\n return false;\n Actor neighbor = gr.get(loc);\n return !(neighbor instanceof Wall);\n }",
"public boolean canMove() {\n\n\tArrayList<Location> moveLocs = getValid(getLocation());\n\n\tif (isEnd == true) {\n\t return false;\n\t} \n\tif (!moveLocs.isEmpty()) {\n\t \n\t randomSelect(moveLocs);\n\t // selectMoveLocation(moveLocs);\n\t return true;\n\n\t} else {\n\t return false;\n\t}\n }",
"public boolean canWalk() {\n\t\treturn rangeBottomLeft != null && !rangeBottomLeft.equals(location)\n\t\t\t\t&& rangeTopRight != null && !rangeTopRight.equals(location);\n\t}",
"public abstract boolean canMoveTo(Case Location);",
"public boolean validPosition(Player p, double x, double y) {\n\n\t\tTile tile = getTile(p, x + p.BOUNDING_BOX_X, y);\n\t\tif (tile == null || !tile.canEnter(p)) {\n\t\t\treturn false;\n\t\t}\n\n\t\ttile = getTile(p, x, y + p.BOUNDING_BOX_Y);\n\t\tif (tile == null || !tile.canEnter(p)) {\n\t\t\treturn false;\n\t\t}\n\n\t\ttile = getTile(p, x - p.BOUNDING_BOX_X, y);\n\t\tif (tile == null || !tile.canEnter(p)) {\n\t\t\treturn false;\n\t\t}\n\n\t\ttile = getTile(p, x, y - p.BOUNDING_BOX_Y);\n\t\tif (tile == null || !tile.canEnter(p)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"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}",
"public boolean checkCollisions(Tuple camera) {\n\n\t\t// already exploded\n\t\tif(disabled > 0) {\n\t\t\treturn false;\n\t\t} // if\n\t\t\n\t\t// collision detected\n\t\tif(location.distance(camera) - size < SHIP_SIZE) {\n\t\t\tdisabled = 1;\n\t\t\treturn true;\n\t\t} // if\n\t\treturn false;\n\t}",
"public boolean canCoordinateBeSpawn(int par1, int par2) {\n\t\tint var3 = this.worldObj.getFirstUncoveredBlock(par1, par2);\n\t\treturn var3 == 0 ? false : Block.blocksList[var3].blockMaterial.blocksMovement();\n\t}",
"boolean hasLocation();",
"boolean hasLocation();",
"@Override\n public boolean shouldExecute()\n {\n if (!this.mustUpdate)\n {\n if (this.entity.getRNG().nextInt(this.executionChance) != 0)\n {\n return false;\n }\n }\n\n Vec3d vec3d = RandomPositionGenerator.findRandomTarget(this.entity, 10, 7);\n int attempts = 0;\n while (attempts < 10 && entity.getHomePosition().getDistance(vec3d != null ? (int)vec3d.xCoord : (int)entity.posX, vec3d != null ? (int)vec3d.yCoord : (int)entity.posY, vec3d != null ? (int)vec3d.zCoord : (int)entity.posZ) > entity.getMaximumHomeDistance()) {\n vec3d = RandomPositionGenerator.findRandomTarget(this.entity, 12, 8);\n attempts++;\n }\n\n if (vec3d == null || attempts >= 10)\n {\n return false;\n }\n else\n {\n this.xPosition = vec3d.xCoord;\n this.yPosition = vec3d.yCoord;\n this.zPosition = vec3d.zCoord;\n this.mustUpdate = false;\n return true;\n }\n }",
"public boolean isValid() {\n return latitudeSouth != INVALID_LAT_LON;\n }",
"boolean testCoords(Tester t) {\n return t.checkExpect(this.p3.xCoord(), 50) && t.checkExpect(this.p4.yCoord(), 600);\n }",
"public boolean isLegalStep(MoveDirection dir){\r\n GamePosition curPos = currentGame.getCurrentPosition();\n\t\tPlayer white = currentGame.getWhitePlayer();\n\t\tint[] toCheckPos = new int[2];\n\t\tint[] existingPos = new int[2];\n\t\tif(curPos.getPlayerToMove().equals(white)) {\n\t\t\ttoCheckPos[0] = curPos.getWhitePosition().getTile().getColumn();\n\t\t\ttoCheckPos[1] = curPos.getWhitePosition().getTile().getRow();\n\t\t\t\n\t\t\texistingPos[0] = curPos.getBlackPosition().getTile().getColumn();\n\t\t\texistingPos[1] = curPos.getBlackPosition().getTile().getRow();\n\t\t\t\n\t\t} else {\n\t\t\ttoCheckPos[0] = curPos.getBlackPosition().getTile().getColumn();\n\t\t\ttoCheckPos[1] = curPos.getBlackPosition().getTile().getRow();\n\t\t\t\n\t\t\texistingPos[0] = curPos.getWhitePosition().getTile().getColumn();\n\t\t\texistingPos[1] = curPos.getWhitePosition().getTile().getRow();\n\t\t}\n\t\t//0 = column, 1 = row\n\t\tif(dir == MoveDirection.North) {\n\t\t\tif(toCheckPos[1] == 1) return false;\n\t\t\tif(toCheckPos[1] - 1 == existingPos[1] && toCheckPos[0] == existingPos[0]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), -1, 0);\n\t\t} else if(dir == MoveDirection.South) {\n\t\t\tif(toCheckPos[1] == 9) return false;\n\t\t\tif(toCheckPos[1] + 1 == existingPos[1] && toCheckPos[0] == existingPos[0]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), 1, 0);\n\t\t} else if(dir == MoveDirection.East) {\n\t\t\tif(toCheckPos[0] == 9) return false;\n\t\t\tif(toCheckPos[0] + 1 == existingPos[0] && toCheckPos[1] == existingPos[1]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), 0, 1);\n\t\t} else if(dir == MoveDirection.West) {\n\t\t\tif(toCheckPos[0] == 1) return false;\n\t\t\tif(toCheckPos[0] - 1 == existingPos[0] && toCheckPos[1] == existingPos[1]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), 0, -1);\n\t\t}\n\t\t\n\t\treturn false;\r\n }",
"public static boolean inRange(double lon, double lat) {\n // Coordinates of office and current location in radians\n double lon1 = Math.toRadians(lon);\n double lat1 = Math.toRadians(lat);\n double lon2 = Constants.OFFICE_LONG;\n double lat2 = Constants.OFFICE_LAT;\n\n // Uses the haversine formula to calculate distance\n double deltaLon = Math.abs(lon1 - lon2);\n double deltaLat = Math.abs(lat1 - lat2);\n double num1 = Math.sin(deltaLat/Constants.SQUARE);\n num1 = Math.pow(num1, Constants.SQUARE);\n double num2 = Math.sin(deltaLon/Constants.SQUARE);\n num2 = Math.pow(num2, Constants.SQUARE);\n num2 = num2 * Math.cos(lat1) * Math.cos(lat2);\n double num = num1 + num2;\n num = Math.sqrt(num);\n num = Math.asin(num);\n num *= Constants.SQUARE;\n double dist = num * Constants.RADIUS; \n return (dist <= Constants.MAX); // Compares it to max distance\n }",
"boolean land();",
"@Override\n public boolean isLocationEmpty(Unit unit, XYCoord coords)\n {\n return isLocationEmpty(unit, coords.xCoord, coords.yCoord);\n }",
"protected boolean validCoord(int row, int col) {\n\t\treturn (row >= 0 && row < b.size() && col >= 0 && col < b.size());\n\t}",
"public boolean verifyHomePageDisplayed(){\r\n\t\tWebDriver driver = SeleniumDriver.getInstance().getWebDriver();\r\n\t\tWebElement body;\r\n\t\ttry{\r\n\t\t\tbody = driver.findElement(By.tagName(\"body\"));\r\n\t\t\tif(body.getAttribute(\"class\").contains(\"home page\")){\r\n\t\t\t\tmyAssert.setGblPassFailMessage(\"pass\", \"UpTake home page is displayed\");\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tmyAssert.setGblPassFailMessage(\"fail\", \"UpTake home page is not displayed\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t return true;\r\n\t}",
"@Override\r\n\tpublic boolean isNodeValid() {\n\t\treturn (SKILLS.HITPOINTS.getActualLevel() >= 25\r\n\t\t\t\t&& SKILLS.THIEVING.getActualLevel() >= 28\r\n\t\t\t\t&& Inventory.getCount(\"Coins\") >= 30 && (Location.karamjaFirstStepCheck.atLocation(Player.getPosition()) ||Location.karamjaBoatLandTile.equals(Player.getPosition()) ));\r\n\t}",
"public boolean land() {\n\t\treturn (Math.random() > this.crashProb);\r\n\t}",
"public Location inRange()\n\t{\n\t\tboolean equals = false;\n\t\tif(getGrid() == null)\n\t\t\treturn null;\n\t\tfor(int i = -5; i < 6; i++)\n\t\t{\n\t\t\tfor(int j = -5; j < 6; j++)\n\t\t\t{\t\t\t\t\n\t\t\t\tif(getGrid().isValid(new Location(getLocation().getRow() + i, getLocation().getCol() + j)))\n\t\t\t\t{\n\t\t\t\t\tif(getGrid().get(new Location(getLocation().getRow() + i, getLocation().getCol() + j)) instanceof User)\n\t\t\t\t\t{\n\t\t\t\t\t\tequals = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tif(!equals)\n\t\t{\n\t\t\tArrayList<Location> locs = getGrid().getEmptyAdjacentLocations(getLocation());\n\t\t\tif(locs.size() != 0)\n\t\t\t\t return locs.get( (int) (Math.random() * locs.size()));\n\t\t\telse\n\t\t\t\treturn getLocation();\n\t\t}\n\t\t\t\n\t\tLocation moveLocation;\n\t\t\n\t\t\n\t\tif(getGrid().getNeighbors(getLocation()).contains(getGrid().getUser()))\n\t\t{\n\t\t\tmoveLocation = getGrid().getUser().getLocation();\n\t\t}\n\t\telse\n {\n PathFinder a = new PathFinder(getGrid(),20);\n Path path = a.findPath(this, this.getGrid().getUser().getLocation().getRow(), this.getGrid().getUser().getLocation().getCol(),true);\n if(path.getLength() != 0)\n moveLocation = a.findPath(this, this.getGrid().getUser().getLocation().getRow(), this.getGrid().getUser().getLocation().getCol(),true).getStep(0);\n else\n moveLocation = null;\n\n }\n\n\t\tif(moveLocation == null)\n\t\t{\n\t\t\tArrayList<Location> locs = getGrid().getEmptyAdjacentLocations(getLocation());\n\t\t\tif(locs.size() != 0)\n\t\t\t\tmoveLocation = locs.get( (int) (Math.random() * locs.size()));\n\t\t\telse\n\t\t\t\tmoveLocation = getLocation();\n\t\t}\n\t\t\n\t\treturn moveLocation;\n\t}",
"public boolean check_func(int [] land, int x, int y)\n\t{\n\t\tif ((land[0] < x && land[2] > x\n\t\t\t& (land[1] < y && land[3] > y)))\n\t\t\t\treturn true;\n\t\treturn false;\n\t}",
"public boolean land() {\n\t\treturn ( Math.random() > this.crashProb);\r\n\t}",
"private boolean checkIfGoodSquare(MapLocation location) {\n return (location.x % 2 == location.y % 2) && !location.isAdjacentTo(Cache.myECLocation);\n }",
"public boolean canReach(BE be, Vec3 pos) {\n\t\tAABB testRange = new AABB(be.getBlockPos()).inflate(this.range.apply(be));\n\n\t\treturn testRange.minX <= pos.x && testRange.minY <= pos.y && testRange.minZ <= pos.z && testRange.maxX >= pos.x && testRange.maxY >= pos.y && testRange.maxZ >= pos.z;\n\t}",
"private boolean isValidPosition(Point pos){\r\n return (0 <= pos.getFirst() && pos.getFirst() < 8 && \r\n 0 <= pos.getSecond() && pos.getSecond() < 8);\r\n }",
"private static boolean checkSpace(Unit unit, GameMap myMap, SearchNode currentNode, XYCoord coord, boolean ignoreUnits)\n {\n // if we're past the edges of the map\n if( !myMap.isLocationValid(coord) )\n {\n return false;\n }\n // if there is a unit in that space\n if( !ignoreUnits && (myMap.getLocation(coord).getResident() != null) )\n { // if that unit is an enemy\n if( unit.CO.isEnemy(myMap.getLocation(coord).getResident().CO) )\n {\n return false;\n }\n }\n // if this unit can't traverse that terrain.\n if( findMoveCost(unit, coord.xCoord, coord.yCoord, myMap) == 99 )\n {\n return false;\n }\n return true;\n }",
"public boolean outOfBounds()\n {\n if((lastpowerUp.equals(\"BLUE\") || lastpowerUp.equals(\"RAINBOW\")) && powerupTimer > 0)\n {\n return false;\n }\n \n if(head.getA() < 150 || head.getA() >= 1260)\n return true;\n else if(head.getB() <150 || head.getB() >=630)\n return true;\n else \n return false;\n \n \n }",
"@Override\n\tpublic void returnHome()\n\t{\n\t\tif(_returnHome && !isInsideRadius(getSpawn().getLocx(), getSpawn().getLocy(), 150, false))\n\t\t{\n\t\t\tclearAggroList();\n\t\t\tgetAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, getSpawn().getLoc());\n\t\t}\n\t}",
"public static boolean checkHit(int row, int col, BattleshipModel currentModel){\n boolean hit = false;\n\n //check if it is a hit on the computer's aircraft carrier\n if ((currentModel.computerAircraftCarrier.start.Across <= col) && (col <= currentModel.computerAircraftCarrier.end.Across)){\n if ((currentModel.computerAircraftCarrier.start.Down <= row) && (row <= currentModel.computerAircraftCarrier.end.Down))\n {\n //it's a hit on the aircraft carrier\n hit = true;\n }\n }\n\n //check if it's a hit on the battleship\n if ((currentModel.computerBattleship.start.Across <= col) && (col <= currentModel.computerBattleship.end.Across)){\n if ((currentModel.computerBattleship.start.Down <= row) && (row <= currentModel.computerBattleship.end.Down))\n {\n //it's a hit on the battleship\n hit = true;\n }\n }\n\n //check if it's a hit on the cruiser\n if ((currentModel.computerCruiser.start.Across <= col) && (col <= currentModel.computerCruiser.end.Across)){\n if ((currentModel.computerCruiser.start.Down <= row) && (row <= currentModel.computerCruiser.end.Down))\n {\n //it's a hit on the cruiser\n hit = true;\n }\n }\n\n //check if it's a hit on the destroyer;\n if ((currentModel.computerDestroyer.start.Across <= col) && (col <= currentModel.computerDestroyer.end.Across)){\n if ((currentModel.computerDestroyer.start.Down <= row) && (row <= currentModel.computerDestroyer.end.Down))\n {\n //it's a hit on the destroyer\n hit = true;\n }\n }\n\n //check if it's a hit on th submarine\n if ((currentModel.computerSubmarine.start.Across <= col) && (col <= currentModel.computerSubmarine.end.Across)){\n if ((currentModel.computerSubmarine.start.Down <= row) && (row <= currentModel.computerSubmarine.end.Down))\n {\n //it's a hit on the submarine\n hit = true;\n }\n }\n\n\n if (!hit){\n //record as a miss\n Misses miss = new Misses(row, col);\n currentModel.computerMisses.add(miss);\n System.out.println(\"You missed!\");\n } else if (hit) {\n Hits hit1 = new Hits(row, col);\n currentModel.computerHits.add(hit1);\n System.out.println(\"That was a hit\");\n }\n\n //Hit for AI to user\n int airow, aicol;\n boolean aihit = false;\n\n airow = rn.nextInt(10) + 1;\n aicol = rn.nextInt(10) + 1;\n\n //check if it is a hit on the computer's aircraft carrier\n if ((currentModel.AircraftCarrier.start.Across <= aicol) && (aicol <= currentModel.AircraftCarrier.end.Across)){\n if ((currentModel.AircraftCarrier.start.Down <= airow) && (airow <= currentModel.AircraftCarrier.end.Down))\n {\n //it's a hit on the aircraft carrier\n aihit = true;\n }\n }\n\n //check if it's a hit on the battleship\n if ((currentModel.Battleship.start.Across <= aicol) && (aicol <= currentModel.Battleship.end.Across)){\n if ((currentModel.Battleship.start.Down <= airow) && (airow <= currentModel.Battleship.end.Down))\n {\n //it's a hit on the battleship\n aihit = true;\n }\n }\n\n //check if it's a hit on the cruiser\n if ((currentModel.Cruiser.start.Across <= aicol) && (aicol <= currentModel.Cruiser.end.Across)){\n if ((currentModel.Cruiser.start.Down <= airow) && (airow <= currentModel.Cruiser.end.Down))\n {\n //it's a hit on the cruiser\n aihit = true;\n }\n }\n\n //check if it's a hit on the destroyer;\n if ((currentModel.Destroyer.start.Across <= aicol) && (aicol <= currentModel.Destroyer.end.Across)){\n if ((currentModel.Destroyer.start.Down <= airow) && (airow <= currentModel.Destroyer.end.Down))\n {\n //it's a hit on the destroyer\n aihit = true;\n }\n }\n\n //check if it's a hit on th submarine\n if ((currentModel.Submarine.start.Across <= aicol) && (aicol <= currentModel.Submarine.end.Across)){\n if ((currentModel.Submarine.start.Down <= airow) && (airow <= currentModel.Submarine.end.Down))\n {\n //it's a hit on the submarine\n aihit = true;\n }\n }\n\n if (!aihit){\n //record as a miss\n Misses aimiss = new Misses(airow, aicol);\n currentModel.Misses.add(aimiss);\n System.out.println(\"The computer missed!\");\n } else if (aihit) {\n Hits aihit1 = new Hits(airow, aicol);\n currentModel.Hits.add(aihit1);\n System.out.println(\"The computer hit\");\n }\n\n //return the updated battleship model as a string (json)\n Gson gson = new Gson();\n String CurrentStateJson = gson.toJson(currentModel);\n\n // return CurrentStateJson;\n return hit;\n\n }",
"@Test\n\t\tpublic void canGiveMinotaurLocation() {\n\t\t\tPoint whereMinotaur = new Pointer(1,3);\n\t\t\tgameLoader.addMinotaur(whereMinotaur);\n\t\t\tPoint expected = whereMinotaur;\n\t\t\tPoint actual = gameSaver.wheresMinotaur();\n\t\t\t\n\t\t\tassertEquals(expected.across(), actual.across());\n\t\t\tassertEquals(expected.down(), actual.down());\n\t\t}",
"final protected boolean isValid() {\n boolean valid = true;\n for (Hex h : hexagons)\n for (Vertex v : h.vertices)\n if (isAdjacent(v) && v.getBuilding() == null)\n valid = false;\n return valid;\n }",
"public boolean canCoordinateBeSpawn(int par1, int par2)\n {\n return false;\n }",
"@Override\n\tpublic boolean validMove(int xEnd, int yEnd, board b){\n\t\t//try to land one same color piece\n\t\tif(b.occupied(xEnd, yEnd)&&b.getPiece(xEnd, yEnd).getColor()==color){\n\t\t\treturn false;\n\t\t}\n\t\tif(v==0){\n\t\t\tif(!this.guard(xEnd, yEnd, b)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t//normal move\n\t\tif((xEnd==x-1&&yEnd==y-1)||(xEnd==x-1&&yEnd==y)||(xEnd==x-1&&yEnd==y+1)||(xEnd==x&&yEnd==y-1)||(xEnd==x&&yEnd==y+1)||(xEnd==x+1&&yEnd==y-1)||(xEnd==x+1&&yEnd==y)||(xEnd==x+1&&yEnd==y+1)){\n\t\t\tif(b.occupied(xEnd, yEnd)){\n\t\t\t\t//set the enpass flage back\n\t\t\t\tb.setFlag(color, 100, 100);\n\t\t\t\tb.recycle(xEnd, yEnd);\n\t\t\t\tthis.setPosition(xEnd, yEnd);\n\t\t\t\tb.update();\n\t\t\t\tc=0;\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\t//set the enpass flage back\n\t\t\t\tb.setFlag(color, 100, 100);\n\t\t\t\tthis.setPosition(xEnd, yEnd);\n\t\t\t\tb.update();\n\t\t\t\tc=0;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}else if((xEnd==x-2&&yEnd==y)){ //castling\n\t\t\tpiece r = b.getPiece(0, y);\n\t\t\tif(r==null){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(r.getC()==0||r.getColor()!=color||r.getType()!= type.ROOK||c==0){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tfor(int i=3;i>0;i--){\n\t\t\t\tif(b.occupied(i, y)){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.setPosition(xEnd, yEnd);\n\t\t\tr.setPosition(3,y);\n\t\t\tc=0;\n\t\t\tr.setC(0);\n\t\t\tb.setFlag(color, 100, 100);\n\t\t\tb.update();\n\t\t\treturn true;\n\t\t}else if((xEnd==x+2&&yEnd==y)){\n\t\t\tpiece r = b.getPiece(7, y);\n\t\t\tif(r==null){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(r.getC()==0||r.getColor()!=color||r.getType()!= type.ROOK||c==0){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tfor(int i=5;i<=6;i++){\n\t\t\t\tif(b.occupied(i, y)){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.setPosition(xEnd, yEnd);\n\t\t\tr.setPosition(5,y);\n\t\t\tc=0;\n\t\t\tr.setC(0);\n\t\t\tb.setFlag(color, 100, 100);\n\t\t\tb.update();\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"private ArrayList<Location> canMoveInit() {\n if (last == null) {\n ArrayList<Location> firstList = new ArrayList<>();\n firstList.add(getLocation());\n firstList.add(null);\n crossLocation.push(firstList);\n }\n if (crossLocation.empty() || isEnd) {\n return null;\n }\n Grid gr = getGrid();\n if (gr == null) {\n return null;\n }\n last = getLocation();\n return getValid(getLocation());\n }",
"public boolean isValid() {\n\t\treturn (x >= 0 && x < Board.SIZE && y >= 0 && y < Board.SIZE);\n\t}",
"private static boolean isInBounds(Location location, Vector3i min, Vector3i max) {\n return location.getX() >= min.x && location.getX() < max.x && location.getY() >= min.y\n && location.getY() < max.y && location.getZ() >= min.z && location.getZ() < max.z;\n }",
"public static boolean isInColosseum(Location loc) {\n\t\tif (!(loc.getWorld() == Bukkit.getWorld(\"redacted2\"))) return false;\n\t\t// bad hotfix\n\t\tif (loc.clone().add(0, -1, 0).getBlock().getType() == Material.GRASS) return false;\n\t\tint locX = loc.getBlockX();\n\t\tint locY = loc.getBlockY();\n\t\tint locZ = loc.getBlockZ();\n\t\t//Test if player is in main launcher ignore box\n\t\t// -4 98 10 to -23 30 23 - ignore zone for main launcher\n\t\tif (-23 <= locX && locX <= -4 && 30 <= locY && locY <= 98 && 10 <= locZ && locZ <= 23) return false;\n\t\t//Test if player is in side launcher ignore box\n\t\t//-4 98 98 to -25 30 75 - ignore zone for side launcher\n\t\tif (-25 <= locX && locX <= -4 && 30 <= locY && locY <= 98 && 75 <= locZ && locZ <= 98) return false;\n\t\t//If the player is not in either of the ignore boxes, check if they are in the colosseum boundaries\n\t\t//-4 98 10 to -100 30 98 - Colosseum boundaries\n\t\tif (-100 <= locX && locX <= -4 && 30 <= locY && locY <= 98 && 10 <= locZ && locZ <= 98) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public abstract boolean isTerrainAccessiable(final Cell cell);",
"@Override\r\n public boolean canMove() {\r\n Grid<Actor> gr = getGrid();\r\n int dirs[] = {\r\n Location.AHEAD, Location.HALF_CIRCLE, Location.LEFT,\r\n Location.RIGHT };\r\n // 当终点在周围时,不能移动且isEnd应当为true\r\n for (int i = 0; i < dirs.length; i++) {\r\n Location tarLoc = getLocation().getAdjacentLocation(dirs[i]);\r\n if (gr.isValid(tarLoc) && gr.get(tarLoc) != null) {\r\n // Color直接用==计算竟然不可行(真是哔了dog...\r\n if (gr.get(tarLoc) instanceof Rock\r\n && gr.get(tarLoc).getColor().equals(Color.RED)) {\r\n isEnd = true;\r\n return false;\r\n }\r\n }\r\n }\r\n ArrayList<Location> nextLocs = getValid(getLocation());\r\n // 当附近没有可以移动的位置时,不能移动\r\n if (nextLocs.size() == 0) {\r\n return false;\r\n }\r\n // 当可以移动的位置>1时,说明存在一个节点,这个节点应当被新建一个arraylist入栈\r\n if (nextLocs.size() > 1) {\r\n ArrayList<Location> newStackElem = new ArrayList<Location>();\r\n newStackElem.add(getLocation());\r\n crossLocation.push(newStackElem);\r\n }\r\n // 有可以移动的位置时,向概率最高的方向移动\r\n int maxProbLoc = 0;\r\n // 由于nextLocs不一定有4个location,所以只好循环判断取最大值\r\n for (int i = 0; i < nextLocs.size(); i++) {\r\n Location loc = nextLocs.get(i);\r\n int dirNum = getLocation().getDirectionToward(loc) / 90;\r\n if (probablyDir[dirNum] > probablyDir[maxProbLoc]) {\r\n maxProbLoc = i;\r\n }\r\n }\r\n next = nextLocs.get(maxProbLoc);\r\n return true;\r\n }",
"@Override\r\n\tpublic boolean isMoveValid(Game g, Location from, Location to){\n\t\tColor toColor = g.getColor(to);\r\n\t\tColor fromColor = g.getColor(from);\r\n\t\tswitch(toColor){\r\n\t\tcase RED:\r\n\t\t\tif (fromColor == Color.BLACK){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase BLACK:\r\n\t\t\tif (fromColor == Color.RED){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\t//cannot make a movement if the from location is empty\r\n\t\t//cannot move if the piece belongs to the opponent\r\n\t\tswitch(g.getPlayerInTurn()){\r\n\t\tcase RED:\r\n\t\t\tif(fromColor != Color.RED){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase BLACK:\r\n\t\t\tif(fromColor != Color.BLACK){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t//just return something is wrong anyways...\r\n\t\tdefault:\r\n\t\t\treturn false;\t\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}",
"Vec3 getHomeCoords(IGeneticMob geneticMob);",
"public boolean isValid() {\n return coordinates != null && coordinates.size() == 2\n && coordinates.get(0) >= -180.0 && coordinates.get(0) <= 180.0\n && coordinates.get(1) >= -90.0 && coordinates.get(1) <= 90.0\n && (coordinateSystem == null || coordinateSystem.isValid());\n }",
"private boolean isValidLocationFound() {\n return latitudeValue != null && longitudeValue != null;\n }",
"boolean testPlaceAllShipsAcc(Tester t) {\n return t.checkExpect(this.los3.placeAllAcc(this.em),\n em.placeImageXY(ship1.draw(), 0, 150).placeImageXY(ship2.draw(), 50, 50)\n .placeImageXY(ship3.draw(), 50, 50))\n && t.checkExpect(\n this.los1.placeAllAcc(\n this.em.placeImageXY(ship2.draw(), 50, 50).placeImageXY(ship3.draw(), 50, 50)),\n em.placeImageXY(ship1.draw(), 0, 150).placeImageXY(ship2.draw(), 50, 50)\n .placeImageXY(ship3.draw(), 50, 50))\n && t.checkExpect(this.mt.placeAllAcc(new WorldScene(300, 700)), new WorldScene(300, 700));\n }",
"private boolean checkCollisions(int keycode) {\n \t\t\n \t\tint sX = super.getX()/Main.gridSize;\n \t\tint sY = super.getY()/Main.gridSize;\n \t\t\n \t\tif (World.currentMap().solidAtPoint(sX-1, sY) && keycode == Keyboard.KEY_A) {\n \t\t\treturn false;\n \t\t} else if (World.currentMap().solidAtPoint(sX+1, sY) && keycode == Keyboard.KEY_D) {\n \t\t\treturn false;\n \t\t} else if (World.currentMap().solidAtPoint(sX, sY-1) && keycode == Keyboard.KEY_W) {\n \t\t\treturn false;\n \t\t} else if (World.currentMap().solidAtPoint(sX, sY+1) && keycode == Keyboard.KEY_S) {\n \t\t\treturn false;\n \t\t}\n \t\treturn true;\n \t}",
"private boolean locateSafety(String[] coord) {\n\n int[] indices = getIndexFromCoord(coord);\n int x0 = indices[0];\n int y0 = indices[1];\n int x1 = indices[2];\n int y1 = indices[3];\n\n\n if (x0 == x1) {\n // horizontal\n int northIndex = x0 > 0 ? x0 - 1 : -1;\n int southIndex = x0 < Row.values().length - 1 ? x0 + 1 : -1;\n int leftIndex = y0 > 0 ? y0 - 1 : -1;\n int rightIndex = y1 < fields.length - 1 ? y1 + 1 : -1;\n // check north area\n if (northIndex != -1) {\n for (int i = y0; i <= y1; i++) {\n if (fields[northIndex][i].isShip()) {\n System.out.println(\"Error! You placed it too close to another one. Try again:\");\n return false;\n }\n }\n }\n // check south area\n if (southIndex != -1) {\n for (int i = y0; i <= y1; i++) {\n if (fields[southIndex][i].isShip()) {\n System.out.println(\"Error! You placed it too close to another one. Try again:\");\n return false;\n }\n }\n }\n // check left\n if (leftIndex != -1 && fields[x0][leftIndex].isShip()) {\n System.out.println(\"Error! You placed it too close to another one. Try again:\");\n return false;\n }\n // check right\n if (rightIndex != -1 && fields[x0][rightIndex].isShip()) {\n System.out.println(\"Error! You placed it too close to another one. Try again:\");\n return false;\n }\n\n } else {\n // vertical\n int leftCol = y0 > 0 ? y0 - 1 : -1;\n int rightCol = y0 < fields.length - 1 ? y0 + 1 : -1;\n int northIndex = x0 > 0 ? x0 - 1 : -1;\n int southIndex = x1 < Row.values().length -1 ? x1 + 1 : -1;\n\n // check north\n if (northIndex != -1 && fields[northIndex][y0].isShip()) {\n System.out.println(\"Error! You placed it too close to another one. Try again:\");\n return false;\n }\n // check south\n if (southIndex != -1 && fields[southIndex][y0].isShip()) {\n System.out.println(\"Error! You placed it too close to another one. Try again:\");\n return false;\n }\n // check left\n if (leftCol != -1) {\n for (int i = x0; i <= x1; i++) {\n if (fields[i][leftCol].isShip()) {\n System.out.println(\"Error! You placed it too close to another one. Try again:\");\n return false;\n }\n }\n }\n // check right\n if (rightCol != -1) {\n for (int i = x0; i <= x1; i++) {\n if (fields[i][rightCol].isShip()) {\n System.out.println(\"Error! You placed it too close to another one. Try again:\");\n return false;\n }\n }\n }\n }\n return true;\n }",
"protected boolean validateLocation (BodyObject source, Location loc)\n {\n return true;\n }",
"@Test\n\tpublic void invalidEnterShip_1(){\n\t\tShip ship = new Ship(new ShipPart(0,0),new ShipPart(1,1),new ShipPart(2,2));\n\t\tassertFalse(ship.canEnter(null, Direction.EAST));\n\t}",
"@Override\n public boolean isLocationEmpty(XYCoord coords)\n {\n return isLocationEmpty(null, coords.xCoord, coords.yCoord);\n }",
"boolean checkLineOfSight(Entity a, Entity b, ServerGameModel model) {\n // Get x and y coordinate of both entities.\n double ax = a.getX();\n double ay = a.getY();\n double bx = b.getX();\n double by = b.getY();\n\n // Find how far in each component the two entities are.\n double dy = Math.abs(by - ay);\n double dx = Math.abs(bx - ax);\n\n int x = (int) Math.floor(a.getX());\n int y = (int) Math.floor(a.getY());\n\n // Number of grid cells to check.\n int n = 0;\n\n // How much to increment x, y after each grid cell check. Should be -1, 0, or 1.\n int xinc, yinc;\n double error;\n\n if (dx == 0) {\n xinc = 0;\n error = Double.POSITIVE_INFINITY;\n } else if (bx > ax) {\n xinc = 1;\n n += (int) Math.floor(bx) - x;\n error = (Math.floor(ax) + 1 - ax) * dy;\n } else {\n xinc = -1;\n n += x - (int) Math.floor(bx);\n error = (ax - Math.floor(ax)) * dy;\n }\n\n if (dy == 0) {\n yinc = 0;\n error -= Double.POSITIVE_INFINITY;\n } else if (by > ay) {\n yinc = 1;\n n += (int) Math.floor(by) - y;\n error -= (Math.floor(ay) + 1 - ay) * dx;\n } else {\n yinc = -1;\n n += y - (int) Math.floor(by);\n error -= (ay - Math.floor(ay)) * dx;\n }\n\n while (true) {\n\n // Check if cell x, y has a wall.\n if (!a.containedIn.contains(model.getCell(x, y)) && !model.getCell(x, y).isSeeThrough())\n return false;\n\n if (--n == 0)\n break;\n\n if (error > 0) {\n y += yinc;\n error -= dx;\n } else if (error < 0) {\n x += xinc;\n error += dy;\n } else {\n // Error = 0 case. Intersects the corner of a grid cell. Need to check\n // all of the 3 other corners.\n // May need to check this case.\n if (!model.getCell(x - 1, y - 1).isPassable() || !model.getCell(x - 1, y).isPassable() ||\n !model.getCell(x, y - 1).isPassable())\n return false;\n x += xinc;\n y += yinc;\n error += (dy - dx);\n n--;\n }\n\n }\n return true;\n }",
"private boolean checkInsideZone() {\n for (Zone z : shiftZones) {\n if (PolyUtil.containsLocation(userLocation, Arrays.asList(z.getCoords()), true)) {\n return true;\n }\n }\n return false;\n }",
"public void checkBoundaries(Player pl) {\n\t\tPoint loc = gameMap.toGridLocation(pl.getLocation());\n\t\tint locationX = loc.x;\n\t\tint locationY = loc.y;\n\t\t\n\t\tif(gameMap.getType(loc.x, loc.y) == GameMap.WALL)\n\t\t{\n\t\t\tif(loc.x > 0)\n\t\t\t\tpl.getLocation().x -= 1f;\n\t\t\telse\n\t\t\t\tpl.getLocation().x += 1f;\n\t\t}\n\t\t\n\t\tPoint[] surrounding = gameMap.getSurrounding((int) locationX, (int) locationY);\n\t\t\n\t\tRectangle2D.Float player = pl.getLocationAsRect();\n\t\tfor(Point p : surrounding)\n\t\t{\n\t\t\tRectangle2D.Float rect = new Rectangle2D.Float(p.x * 16 + 112, p.y * 16 + 32, 16, 16);\n\t\t\tif(rect.intersects(player))\n\t\t\t{\n\t\t\t\tbyte type = gameMap.getType(p.x, p.y);\n\t\t\t\tif(isSpecial(pl, type))\n\t\t\t\t{\n\t\t\t\t\tspecialMovement(pl, type);\n//\t\t\t\t\tSystem.out.println(pl.getClass().getSimpleName() + \" hit a boundary\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(type == GameMap.ORB)\n\t\t\t\t{\n\t\t\t\t\tgameMap.setType(p.x, p.y, GameMap.EATEN_ORB);\n\t\t\t\t\t\n\t\t\t\t\tonOrbCollect(pl);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"boolean isAllOnDestination(){\n\n if(player.getCurrentX()-player.getDestinationX()!=0 || player.getCurrentY()-player.getDestinationY()!=0)\n return false;\n\n for(int i = 0; i < boxes.size(); i++){\n Box item = boxes.get(i);\n if(item.getCurrentX()-item.getDestinationX()!=0 || item.getCurrentY()-item.getDestinationY()!=0)\n return false;\n }\n return true;\n }",
"public boolean inGoalRegion() {\n return position >= GOAL_POSITION;\n }",
"@Override\n\t\t\t\tpublic boolean validEntity(Entity me, Entity other) {\n\t\t\t\t\tif(Mappers.status.get(me).same(Mappers.status.get(other))) return false;\n\t\t\t\t\t\n\t\t\t\t\tFacingComponent facingComp = Mappers.facing.get(me);\n\t\t\t\t\tBody myBody = Mappers.body.get(me).body;\n\t\t\t\t\tBody otherBody = Mappers.body.get(other).body;\n\t\t\t\t\t\n\t\t\t\t\tfloat xOff = facingComp.facingRight ? 0.5f : -0.5f;\n\t\t\t\t\t\n\t\t\t\t\tfloat myX = myBody.getPosition().x + xOff;\n\t\t\t\t\tfloat myY = myBody.getPosition().y;\n\t\t\t\t\tfloat otherX = otherBody.getPosition().x;\n\t\t\t\t\tfloat otherY = otherBody.getPosition().y;\n\t\t\t\t\t\n\t\t\t\t\tfloat minX = 0.0f;\n\t\t\t\t\tfloat maxX = minX + range;\n\t\t\t\t\tfloat yRange = 0.9f;\n\t\t\t\t\t\n\t\t\t\t\t// Construct box in front of you\n\t\t\t\t\tfloat closeX = facingComp.facingRight ? myX + minX : myX - minX;\n\t\t\t\t\tfloat farX = facingComp.facingRight ? myX + maxX : myX - maxX;\n\t\t\t\t\tfloat top = myY + yRange;\n\t\t\t\t\tfloat bottom = myY - yRange;\n\t\t\t\t\t\n\t\t\t\t\tDebugRender.setType(ShapeType.Line);\n\t\t\t\t\tDebugRender.setColor(Color.CYAN);\n\t\t\t\t\tDebugRender.rect(facingComp.facingRight ? closeX : farX, bottom, Math.abs(farX - closeX), top - bottom, 1.0f);\n\t\t\t\t\t\n\t\t\t\t\tRectangle kick = new Rectangle(Math.min(closeX, farX), bottom, Math.abs(closeX - farX), top - bottom);\n\t\t\t\t\tRectangle enemy = new Rectangle(Mappers.body.get(other).getAABB());\n\t\t\t\t\tenemy.x = otherX - enemy.width * 0.5f;\n\t\t\t\t\tenemy.y = otherY - enemy.height * 0.5f;\n\t\t\t\t\t\n\t\t\t\t\treturn kick.overlaps(enemy);\n//\t\t\t\t\treturn (((facingComp.facingRight && otherX >= closeX && otherX <= farX) || (!facingComp.facingRight && otherX >= farX && otherX <= closeX)) && otherY <= top && otherY >= bottom);\n\t\t\t\t}",
"boolean isLegal(Move move) {\n int count = pieceCountAlong(move);\n int c0 = move.getCol0();\n int r0 = move.getRow0();\n int c1 = move.getCol1();\n int r1 = move.getRow1();\n int count2 = Math.max(Math.abs(c1 - c0), Math.abs(r1 - r0));\n return ((count == count2) && !blocked(move));\n }",
"private static boolean isObstacleBetweenSteps(Point3DReadOnly pawPosition, Point3DReadOnly previousPawPosition, List<PlanarRegion> planarRegions,\n double groundClearance)\n {\n if (pawPosition.distance(previousPawPosition) < PawNode.gridSizeXY)\n return false;\n\n PlanarRegion bodyPath = createBodyCollisionRegionFromTwoFeet(pawPosition, previousPawPosition, groundClearance, 2.0);\n\n for (PlanarRegion region : planarRegions)\n {\n if (!region.intersect(bodyPath).isEmpty())\n return true;\n }\n\n return false;\n }",
"private static boolean goalFunction(Maze m, int x, int y)\n\t{\n\t\tfor (int i = 0; i < x; i++)\n\t\t{\n\t\t\tfor (int j = 0; j < y; j++)\n\t\t\t{\n\t\t\t\tif(m.getRoom(i,j).getNumConnectedRooms() == 0)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(m.getEnd().getNumConnectedRooms() > 1)\n\t\t\treturn false;\n\t\t\n\t\treturn true;\n\t}",
"boolean canPlaceCity(VertexLocation vertLoc);",
"@Test\n\tpublic void validSpawn() {\n\t\tGameState gameState = new GameState(1, \"assets/maps/map.json\");\n\t\tassertTrue(\"Should be able to be set to 0,0\", gameState.addSpawn(new Location(0, 0)));\n\t}",
"private boolean canEntityBuild(User user, Location location) {\n Collection<TownBlock> blocks = TownyUniverse.getInstance().getDataSource().getAllTownBlocks();\n\n int x = (int)Math.floor(location.getX() / 16.0);\n int z = (int)Math.floor(location.getZ() / 16.0);\n\n TownyWorld world;\n try {\n world = TownyUniverse.getInstance().getDataSource().getWorld(location.getWorld().getName());\n } catch (Exception e) {\n return true;\n }\n\n TownBlock block = new TownBlock(x, z, world);\n\n return !blocks.contains(block);\n }"
] | [
"0.7989653",
"0.62144995",
"0.59624064",
"0.5941752",
"0.5725879",
"0.5682741",
"0.56035316",
"0.5571968",
"0.55376375",
"0.55292743",
"0.5527048",
"0.5523266",
"0.5520648",
"0.5514577",
"0.55023277",
"0.54946434",
"0.5470993",
"0.5447642",
"0.5440407",
"0.53769505",
"0.5373099",
"0.5349455",
"0.5325531",
"0.5305063",
"0.529071",
"0.5269598",
"0.5260436",
"0.52520484",
"0.5238998",
"0.5230943",
"0.52300286",
"0.52224994",
"0.52155614",
"0.5210078",
"0.51937157",
"0.5186022",
"0.5180128",
"0.517727",
"0.51709414",
"0.5163663",
"0.51389486",
"0.512295",
"0.51136315",
"0.5109466",
"0.510697",
"0.5106536",
"0.5106536",
"0.5105671",
"0.51038146",
"0.5088294",
"0.5082386",
"0.5081365",
"0.5080044",
"0.5069961",
"0.5059987",
"0.50596374",
"0.50457907",
"0.5030595",
"0.50287807",
"0.5025654",
"0.5019692",
"0.5019653",
"0.50159067",
"0.5013077",
"0.5009064",
"0.500678",
"0.5004994",
"0.50022876",
"0.49989778",
"0.4984192",
"0.49703416",
"0.49696976",
"0.49638626",
"0.49608377",
"0.49469095",
"0.49465954",
"0.49463865",
"0.49402538",
"0.49370205",
"0.49368316",
"0.49296945",
"0.49233142",
"0.49205744",
"0.4919543",
"0.4919349",
"0.49145225",
"0.49092257",
"0.49074882",
"0.489069",
"0.4886115",
"0.4875888",
"0.4869448",
"0.48677537",
"0.48677248",
"0.4855324",
"0.48549393",
"0.48538393",
"0.48528814",
"0.4849395",
"0.4849303"
] | 0.7845156 | 1 |
wouldBeValidHome whether the block at the given coords would be a valid home for this mob if the given block was placed there | boolean wouldBeValidHome(IGeneticMob geneticMob, Vec3 coords, Block block, int metadata, TileEntity te); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean isValidHome(IGeneticMob geneticMob, Vec3 coords);",
"private boolean quickVerify(Location loc)\n {\n //quickly check if 2 blocks above this is clear\n Block oneAbove = loc.getBlock();\n Block twoAbove = oneAbove.getRelative(BlockFace.UP, 1);\n return oneAbove.getType().equals(Material.AIR) && twoAbove.getType().equals(Material.AIR);\n }",
"@Override\n\tpublic boolean canCoordinateBeSpawn(int par1, int par2) {\n\t\tint i = worldObj.getFirstUncoveredBlock(par1, par2);\n\t\tif (i == 0) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn Block.blocksList[i].blockMaterial.blocksMovement();\n\t\t}\n\t}",
"private Location verifyLocation(Location location)\n {\n Block playerBlock = location.getBlock();\n World world = location.getWorld();\n\n if (rootC.getStringList(RootNode.WORLDS).contains(world.getName()))\n {\n // Only spawn monsters in normal world. End is crowded with endermen\n // and nether is too extreme anyway, add config later\n int lightLvl = location.getBlock().getLightFromSky();\n if (world.getEnvironment() == Environment.NORMAL\n && (location.getY() < rootC.getInt(RootNode.MORE_MONSTERS_MAX_Y) && lightLvl < 3))\n {\n // the playerBlock should always be air, but if the player stands\n // on a slab he actually is in the slab, checking a few blocks under because player could have jumped etc..\n if (playerBlock.getType().equals(Material.AIR))\n {\n for (int i = 0; i <= 3; i++)\n {\n playerBlock = location.getBlock().getRelative(BlockFace.DOWN, 1);\n\n if (playerBlock.getType().equals(Material.AIR))\n {\n location.subtract(0, 1, 0);\n playerBlock = location.getBlock();\n // the playerBlock is now the block where the monster\n // should spawn on, next up: verify block\n }\n else\n {\n break;\n }\n }\n }\n // no spawning on steps, stairs and transparent blocks\n if (playerBlock.getType().name().endsWith(\"STEP\") || playerBlock.getType().name().endsWith(\"STAIRS\")\n || playerBlock.getType().isTransparent() || !playerBlock.getType().isOccluding() || playerBlock.getType().equals(Material.AIR))\n {\n // don't spawn here\n return null;\n }\n\n if (quickVerify(location))\n return location;\n }\n\n }\n return null;\n }",
"boolean isGoodLocation(World world, int x, int y, int z);",
"private boolean checkM(){\n if(currentLocation.x == previousLocation.x && currentLocation.y == previousLocation.y) {\n return false;\n }\n // Is outside the border\n if(currentLocation.x < size || currentLocation.y < size || currentLocation.x > map.numRows - size || currentLocation.y > map.numCols - size) {\n return false;\n }\n // Is on the land\n double angle2 = 0;\n while (angle2 < 6.3) {\n if (map.getTerrainGrid()[currentLocation.x + (int) (size/2 * cos(angle2))][currentLocation.y + (int) (size/2 * sin(angle2))] == Colors.OCEAN) {\n return false;\n }\n angle2 += 0.3;\n }\n return true;\n }",
"@Test\n public void test1LandOn()throws Exception{\n Position pos = new Position(0,0);\n generateLevel.landOn(pos,BlockType.PATH.toString());\n assertFalse(generateLevel.getBlocks().isEmpty());\n }",
"public boolean canCoordinateBeSpawn(int par1, int par2) {\n\t\tint var3 = this.worldObj.getFirstUncoveredBlock(par1, par2);\n\t\treturn var3 == 0 ? false : Block.blocksList[var3].blockMaterial.blocksMovement();\n\t}",
"public boolean isSpawnable(Location loc) {\n Block block = loc.getBlock();\n Block under = loc.getBlock().getRelative(BlockFace.DOWN);\n Block above = loc.getBlock().getRelative(BlockFace.UP);\n if (block.getType().equals(Material.AIR) && !under.getType().equals(Material.AIR) && above.getType().equals(Material.AIR)) {\n if (block.getLightLevel() <= plugin.CONFIG.SPAWNING_LIGHT) {\n return true;\n }\n }\n return false;\n }",
"@Override\n public boolean isLocationValid(XYCoord coords)\n {\n return master.isLocationValid(coords);\n }",
"public boolean inRegion(Location loc)\n {\n if (!loc.getWorld().getName().equals(world.getName()) || !setup)\n return false;\n \n int x = loc.getBlockX();\n int y = loc.getBlockY();\n int z = loc.getBlockZ();\n \n // Check the lobby first.\n if (lobbySetup)\n {\n if ((x >= l1.getBlockX() && x <= l2.getBlockX()) && \n (z >= l1.getBlockZ() && z <= l2.getBlockZ()) && \n (y >= l1.getBlockY() && y <= l2.getBlockY()))\n return true;\n }\n \n // Returns false if the location is outside of the region.\n return ((x >= p1.getBlockX() && x <= p2.getBlockX()) && \n (z >= p1.getBlockZ() && z <= p2.getBlockZ()) && \n (y >= p1.getBlockY() && y <= p2.getBlockY()));\n }",
"boolean canPlaceRobber(HexLocation hexLoc);",
"boolean setHome(IGeneticMob geneticMob, Vec3 coords);",
"private boolean canEntityBuild(User user, Location location) {\n Collection<TownBlock> blocks = TownyUniverse.getInstance().getDataSource().getAllTownBlocks();\n\n int x = (int)Math.floor(location.getX() / 16.0);\n int z = (int)Math.floor(location.getZ() / 16.0);\n\n TownyWorld world;\n try {\n world = TownyUniverse.getInstance().getDataSource().getWorld(location.getWorld().getName());\n } catch (Exception e) {\n return true;\n }\n\n TownBlock block = new TownBlock(x, z, world);\n\n return !blocks.contains(block);\n }",
"@Override\n\tpublic boolean canPlaceBlockAt(World world, int x, int y, int z) {\n\t\t//int currentID = world.getBlockId(x, y, z);\n\t\treturn (world.isAirBlock(x, y, z));\n\t}",
"@Override\n public boolean isLocationValid(int x, int y)\n {\n return master.isLocationValid(x, y);\n }",
"private boolean isLegalPositon(Position checkPosition){\n if (checkPosition.equalPosition(start)||checkPosition.equalPosition(end))\n return true;\n if(checkPosition.getRow()<0 || checkPosition.getCol()<0 || checkPosition.getRow()>=this.rows || checkPosition.getCol() >= this.cols){\n return false;\n }\n\n if(maze[checkPosition.getRow()][checkPosition.getCol()]== WallType.wall){\n return false;\n }\n return true;\n }",
"public boolean isValid(World world, BlockPos pos, IBlockState state) {\n return true;\n }",
"public boolean isPositionValid(){\n\t\t//check overlapping with walls\n\t\tfor(Wall wall : Game.gameField.getWalls()){\n\t\t\tif(wall.overlaps(center))\n\t\t\t\treturn false;\n\t\t}\n\t\t//check overlapping with other balls\n\t\tfor(Ball ball : Game.gameField.getBalls()){\n\t\t\tif(ball == this)\n\t\t\t\tcontinue;\n\t\t\tif(ball.getCenterPoint().distance(center) < RADIUS * 2)\n\t\t\t\treturn false;\n\t\t}\n\t\treturn GameField.FIELD.contains(center);\n\t}",
"public boolean canReach(BE be, Vec3 pos) {\n\t\tAABB testRange = new AABB(be.getBlockPos()).inflate(this.range.apply(be));\n\n\t\treturn testRange.minX <= pos.x && testRange.minY <= pos.y && testRange.minZ <= pos.z && testRange.maxX >= pos.x && testRange.maxY >= pos.y && testRange.maxZ >= pos.z;\n\t}",
"@Override\n public boolean shouldExecute()\n {\n if (!this.mustUpdate)\n {\n if (this.entity.getRNG().nextInt(this.executionChance) != 0)\n {\n return false;\n }\n }\n\n Vec3d vec3d = RandomPositionGenerator.findRandomTarget(this.entity, 10, 7);\n int attempts = 0;\n while (attempts < 10 && entity.getHomePosition().getDistance(vec3d != null ? (int)vec3d.xCoord : (int)entity.posX, vec3d != null ? (int)vec3d.yCoord : (int)entity.posY, vec3d != null ? (int)vec3d.zCoord : (int)entity.posZ) > entity.getMaximumHomeDistance()) {\n vec3d = RandomPositionGenerator.findRandomTarget(this.entity, 12, 8);\n attempts++;\n }\n\n if (vec3d == null || attempts >= 10)\n {\n return false;\n }\n else\n {\n this.xPosition = vec3d.xCoord;\n this.yPosition = vec3d.yCoord;\n this.zPosition = vec3d.zCoord;\n this.mustUpdate = false;\n return true;\n }\n }",
"public boolean areBlocksValid() {\n\t\tif (!isValidMaterial(this.mainblock))\n\t\t\tthis.player.sendMessage(ChatColor.RED + \"Please stand on a valid block for this type of ship\");\n\t\telse {\n\t\t\tif (this.blocks.length > this.properties.MAX_BLOCKS)\n\t\t\t\tthis.player.sendMessage(ChatColor.RED + \"Your ship has \" + ChatColor.YELLOW + this.blocks.length + ChatColor.RED + \"/\" + ChatColor.YELLOW + this.properties.MAX_BLOCKS + ChatColor.RED + \" blocks. Please delete some.\");\n\t\t\telse if (this.numMainBlocks < this.properties.MIN_BLOCKS)\n\t\t\t\tthis.player.sendMessage(ChatColor.RED + \"Your ship has \" + ChatColor.YELLOW + this.numMainBlocks + ChatColor.RED + \"/\" + ChatColor.YELLOW + this.properties.MIN_BLOCKS + ChatColor.AQUA + \" \" + getMainType() + ChatColor.RED + \" blocks. Please add more.\");\n\t\t\telse\n\t\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"boolean canBuildBlock(Tile t);",
"public boolean canMove(Location loc){\n if(loc.getX() >= theWorld.getX() || loc.getX() < 0){\n System.out.println(\"cant move1\");\n return false;\n }else if(loc.getY() >= theWorld.getY() || loc.getY() < 0){\n System.out.println(\"cant move2\");\n return false;\n }else{\n System.out.println(\"can move\");\n return true;\n }\n }",
"@Test\n\t\tpublic void canGiveMinotaurLocation() {\n\t\t\tPoint whereMinotaur = new Pointer(1,3);\n\t\t\tgameLoader.addMinotaur(whereMinotaur);\n\t\t\tPoint expected = whereMinotaur;\n\t\t\tPoint actual = gameSaver.wheresMinotaur();\n\t\t\t\n\t\t\tassertEquals(expected.across(), actual.across());\n\t\t\tassertEquals(expected.down(), actual.down());\n\t\t}",
"private boolean compareLocation(Location location){\n return location.getBlockX()==this.location.getBlockX() && location.getBlockY()==this.location.getBlockY() && location.getBlockZ() == this.location.getBlockZ();\n }",
"public static boolean validLocation(AbstractCard c) {\n return AbstractDungeon.player.hand.contains(c) ||\n AbstractDungeon.player.drawPile.contains(c) ||\n AbstractDungeon.player.discardPile.contains(c) ||\n AbstractDungeon.player.exhaustPile.contains(c);\n }",
"private static boolean isValidStartingLocation(Location startLocation,\n\t\t\tPlayerColor color) {\n\t\tfinal int xCoord = startLocation.getCoordinate(Coordinate.X_COORDINATE);\n\t\tfinal int yCoord = startLocation.getCoordinate(Coordinate.Y_COORDINATE);\n\t\tswitch (color) {\n\t\tcase RED:\n\t\t\treturn (xCoord >= 0 && xCoord <= 5 && yCoord >= 0 && yCoord <= 1);\n\t\tcase BLUE:\n\t\t\treturn (xCoord >= 0 && xCoord <= 5 && yCoord >= 4 && yCoord <= 5);\n\t\tdefault:\n\t\t\treturn false;\n\t\t}\n\n\t}",
"public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)\n {\n return par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true) ? true : (par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true) ? true : (par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true) ? true : (par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true) ? true : this.canPlaceTorchOn(par1World, par2, par3 - 1, par4))));\n }",
"public boolean canCoordinateBeSpawn(int par1, int par2)\n {\n return false;\n }",
"public static boolean isValid(Location l)\n\t{\n\t\treturn l != null || Maze.isInBounds(l);\n\t}",
"public ArrayList<Location> getValid(Location loc) {\n\n\tGrid<Actor> grid = getGrid();\n\tif (grid == null)\n\t return null;\n\n\tArrayList<Location> valid = new ArrayList<Location>();\n\tArrayList<Location> lastNode = crossLocation.peek();\n\tint[] dirs =\n { Location.SOUTH, Location.NORTH, Location.EAST, Location.WEST };\n\n\t// get the empty and valid location in the desire directions\n for (int d : dirs) {\n\n\t Location neighborLoc = loc.getAdjacentLocation(getDirection() + d);\n\t\t if (!lastNode.contains(neighborLoc) && grid.isValid(neighborLoc)) {\n\t\t\t\n\t\t\tActor actor = (Actor) grid.get(neighborLoc);\n\t\t\tif (grid.get(neighborLoc) == null || actor instanceof Flower) {\n\t\t\t \n\t\t\t valid.add(neighborLoc);\n\t\t\t} \n\t\t\n\t\t\tif (actor instanceof Rock && actor.getColor() == Color.RED) {\n\t\t\t\n\t\t\t isEnd = true;\n\t\t\t}\n\t\t }\n\t }\n\t \n\t\treturn valid;\n }",
"public boolean shouldExecute() {\n/* 25 */ if (!this.field_190859_a.getLeashed() && !this.field_190859_a.func_190718_dR()) {\n/* */ \n/* 27 */ List<EntityLlama> list = this.field_190859_a.world.getEntitiesWithinAABB(this.field_190859_a.getClass(), this.field_190859_a.getEntityBoundingBox().expand(9.0D, 4.0D, 9.0D));\n/* 28 */ EntityLlama entityllama = null;\n/* 29 */ double d0 = Double.MAX_VALUE;\n/* */ \n/* 31 */ for (EntityLlama entityllama1 : list) {\n/* */ \n/* 33 */ if (entityllama1.func_190718_dR() && !entityllama1.func_190712_dQ()) {\n/* */ \n/* 35 */ double d1 = this.field_190859_a.getDistanceSqToEntity((Entity)entityllama1);\n/* */ \n/* 37 */ if (d1 <= d0) {\n/* */ \n/* 39 */ d0 = d1;\n/* 40 */ entityllama = entityllama1;\n/* */ } \n/* */ } \n/* */ } \n/* */ \n/* 45 */ if (entityllama == null)\n/* */ {\n/* 47 */ for (EntityLlama entityllama2 : list) {\n/* */ \n/* 49 */ if (entityllama2.getLeashed() && !entityllama2.func_190712_dQ()) {\n/* */ \n/* 51 */ double d2 = this.field_190859_a.getDistanceSqToEntity((Entity)entityllama2);\n/* */ \n/* 53 */ if (d2 <= d0) {\n/* */ \n/* 55 */ d0 = d2;\n/* 56 */ entityllama = entityllama2;\n/* */ } \n/* */ } \n/* */ } \n/* */ }\n/* */ \n/* 62 */ if (entityllama == null)\n/* */ {\n/* 64 */ return false;\n/* */ }\n/* 66 */ if (d0 < 4.0D)\n/* */ {\n/* 68 */ return false;\n/* */ }\n/* 70 */ if (!entityllama.getLeashed() && !func_190858_a(entityllama, 1))\n/* */ {\n/* 72 */ return false;\n/* */ }\n/* */ \n/* */ \n/* 76 */ this.field_190859_a.func_190715_a(entityllama);\n/* 77 */ return true;\n/* */ } \n/* */ \n/* */ \n/* */ \n/* 82 */ return false;\n/* */ }",
"public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) {\n\t\tint var5 = par1World.getBlockId(par2, par3 - 1, par4);\n\t\t\n\t\tif (var5 == 0) {\n\t\t\treturn false;\n\t\t}\n\t\tBlock block = Block.blocksList[var5];\n\t\treturn Block.sand.blockID == var5 || block.isOpaqueCube() == true;\n\t}",
"protected boolean setBlockIfValid(World world, BlockPos pos, IBlockState state) {\n\t\tif(world.getBlockState(pos).getBlockHardness(world, pos) >= 0) {\n\t\t\tthis.setBlockAndNotifyAdequately(world, pos, state);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public Location getSafePoint(Location location, boolean allowWater, int eyeHeight) {\r\n\t\tChunk chunk = location.getChunk();\r\n\t\tChunkSnapshot chunkShot = chunk.getChunkSnapshot();\r\n\t\t//int x = Math.abs(location.getBlockX() % 16);\r\n\t\tint x = Math.abs(location.getBlockX() - (location.getBlockX() >> 4) * 16);\r\n\t\tint y = Math.min(Math.max(location.getBlockY() + 1, location.getWorld().getMinHeight()), location.getWorld().getMaxHeight() + 1); // by default check block at feet\r\n\t\tint z = Math.abs(location.getBlockZ() - (location.getBlockZ() >> 4) * 16); \r\n\t\t// location is level with block borders, get the block below player\r\n\t\tif(Math.abs(location.getY() - (int)location.getY()) < 0.01) --y;\r\n\t\t\r\n\t\t// If in air, scan below until ground\r\n\t\tfor(int tempY = y; tempY > location.getWorld().getMinHeight(); --tempY) {\r\n\t\t\tif(chunkShot.getBlockType(x, tempY - 1, z).isSolid()) {\r\n\t\t\t\ty = tempY;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// check if the location in the chunk is safe\r\n\t\tSAFENESS safeness = null;\r\n\t\t\r\n\t\tif(y+eyeHeight <= location.getWorld().getMaxHeight())\r\n\t\t\tsafeness = isSafe(allowWater, chunkShot.getBlockType(x, y-1, z), \r\n\t\t\t\t\tchunkShot.getBlockType(x, y, z), \r\n\t\t\t\t\tchunkShot.getBlockType(x, (y+eyeHeight), z));\r\n\t\telse if(y+eyeHeight > location.getWorld().getMaxHeight() && y <= location.getWorld().getMaxHeight())\r\n\t\t\tsafeness = isSafe(allowWater, chunkShot.getBlockType(x, y-1, z), \r\n\t\t\t\t\tchunkShot.getBlockType(x, y, z));\r\n\t\telse\r\n\t\t\tsafeness = isSafe(allowWater, chunkShot.getBlockType(x, y-1, z));\r\n\t\t\r\n\t\t// TODO CHECK IF MAX HEIGHT IS 255 \r\n\t\t// 256 is maxheight + 1\r\n\t\t\r\n\t\t// if safe, return the given location\r\n\t\tif(safeness == SAFENESS.SAFE)\r\n\t\t\treturn location;\r\n\t\t\r\n\t\t// get the highest location to return if previous was unsafe\r\n\t\tint highestY = chunkShot.getHighestBlockYAt(x, z)+1;\r\n\t\t// no blocks at the axis\r\n\t\tif(highestY < 1) {\r\n\t\t\treturn null;\r\n\t\t} else if(highestY + eyeHeight < location.getWorld().getMaxHeight() + 1) {\r\n\t\t\t// normal location in world\r\n\t\t\tsafeness = isSafe(allowWater, chunkShot.getBlockType(x, highestY-1, z), \r\n\t\t\t\t\tchunkShot.getBlockType(x, highestY, z), \r\n\t\t\t\t\tchunkShot.getBlockType(x, (highestY+eyeHeight), z));\r\n\t\t} else if(highestY+eyeHeight > location.getWorld().getMaxHeight() && highestY <= location.getWorld().getMaxHeight()){\r\n\t\t\t// eye height above build limit, don't check eyeheight\r\n\t\t\tsafeness = isSafe(allowWater, chunkShot.getBlockType(x, highestY-1, z), \r\n\t\t\t\t\tchunkShot.getBlockType(x, highestY, z));\r\n\t\t} else {\r\n\t\t\t// highest block at build limit\r\n\t\t\tsafeness = isSafe(allowWater, chunkShot.getBlockType(x, highestY-1, z));\r\n\t\t}\r\n\t\t\r\n\t\t// a safe location found, return it\r\n\t\tif(safeness == SAFENESS.SAFE)\r\n\t\t\treturn new Location(location.getWorld(), location.getBlockX()+0.5, highestY, location.getBlockZ()+0.5, \r\n\t\t\t\t\tlocation.getYaw(), location.getPitch());\r\n\t\t\r\n\t\t// scan all the blocks below until a safe location is found\r\n\t\twhile(highestY > 1) {\r\n\t\t\t--highestY;\r\n\t\t\t\r\n\t\t\tMaterial blockBelowFeet = chunkShot.getBlockType(x, highestY-1, z);\r\n\t\t\tMaterial blockAtFeet = chunkShot.getBlockType(x, highestY, z);\r\n\t\t\t\r\n\t\t\tif((highestY + eyeHeight) <= location.getWorld().getMaxHeight()) {\r\n\t\t\t\tMaterial blockAtHead = chunkShot.getBlockType(x, (highestY+eyeHeight), z);\r\n\t\t\t\tif(SAFENESS.SAFE == isSafe(allowWater, blockBelowFeet, blockAtFeet, blockAtHead))\r\n\t\t\t\t\treturn new Location(location.getWorld(), location.getBlockX()+0.5, highestY, location.getBlockZ()+0.5, location.getYaw(), location.getPitch());\r\n\t\t\t} else {\r\n\t\t\t\tif(SAFENESS.SAFE == isSafe(allowWater, blockBelowFeet, blockAtFeet))\r\n\t\t\t\t\treturn new Location(location.getWorld(), location.getBlockX()+0.5, highestY, location.getBlockZ()+0.5, location.getYaw(), location.getPitch());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// no safe location found\r\n\t\treturn null;\r\n\t}",
"@Override\n\tpublic boolean onValidSurface()\n\t{\n\t\tif (!this.worldObj.getCollidingBoundingBoxes(this, this.getEntityBoundingBox()).isEmpty())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tint i = Math.max(1, this.blocksToTakeUp());\n\t\t\tint j = Math.max(1, this.blocksToTakeUp());\n\t\t\tBlockPos blockpos = this.hangingPosition.offset(this.facingDirection.getOpposite());\n\t\t\tEnumFacing enumfacing = this.facingDirection.rotateYCCW();\n\n\t\t\tfor (int k = -i / 2 + 1; k < i / 2 + 1; ++k)\n\t\t\t{\n\t\t\t\tfor (int l = -j / 2 + 1; l < j / 2 + 1; ++l)\n\t\t\t\t{\n\t\t\t\t\tBlockPos blockpos1 = blockpos.offset(enumfacing, k).up(l);\n\t\t\t\t\tBlock block = this.worldObj.getBlockState(blockpos1).getBlock();\n\n\t\t\t\t\tif (block.isSideSolid(this.worldObj, blockpos1, this.facingDirection))\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (!block.getMaterial().isSolid() && !BlockRedstoneDiode.isRedstoneRepeaterBlockID(block))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (Entity entity : this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox()))\n\t\t\t{\n\t\t\t\tif (entity instanceof EntityHanging)\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\t}",
"public boolean isValid(CoreProtectAPI.ParseResult ore) {\n if (worldName != null && worldName.equalsIgnoreCase(ore.worldName())) {\n Location loc = new Location(Bukkit.getWorld(ore.worldName()), ore.getX(), ore.getY(), ore.getZ());\n if (loc.distance(getLocation()) <= MAX_DISTANCE) {\n if (ore.getType() == type) {\n return true;\n }\n }\n }\n return false;\n }",
"public boolean canPlaceBlockAt(World world, int x, int y, int z)\n\t {\n\t boolean b = y >= world.getHeight() - 1;\n\t \n\t\t\tboolean solidBottom = doesBlockHaveSolidBottomSurface(world, x, y, z);\n\t\t\tboolean placeable = super.canPlaceBlockAt(world, x, y-1, z) && super.canPlaceBlockAt(world, x, y-2, z);\n\t\t\treturn b ? false : solidBottom && placeable;\n\t }",
"public static boolean hasEmptyFaces(Location loc) {\n\t\tWorld world = loc.getWorld();\n\t\tif (world.getBlockAt((int) loc.getX() + 1, (int) loc.getY(), (int) loc.getZ()).getType() == Material.AIR) {\n\t\t\tif (world.getBlockAt((int) loc.getX() - 1, (int) loc.getY(), (int) loc.getZ()).getType() == Material.AIR) {\n\t\t\t\tif (world.getBlockAt((int) loc.getX(), (int) loc.getY(), (int) loc.getZ() + 1)\n\t\t\t\t\t\t.getType() == Material.AIR) {\n\t\t\t\t\tif (world.getBlockAt((int) loc.getX() + 1, (int) loc.getY(), (int) loc.getZ() - 1)\n\t\t\t\t\t\t\t.getType() == Material.AIR) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public boolean canMove (Location loc) {\n Grid<Actor> gr = getGrid();\n if (gr == null)\n return false;\n if (!gr.isValid(loc))\n return false;\n Actor neighbor = gr.get(loc);\n return !(neighbor instanceof Wall);\n }",
"@Override\n\t\t\t\tpublic boolean validEntity(Entity me, Entity other) {\n\t\t\t\t\tif(Mappers.status.get(me).same(Mappers.status.get(other))) return false;\n\t\t\t\t\t\n\t\t\t\t\tFacingComponent facingComp = Mappers.facing.get(me);\n\t\t\t\t\tBody myBody = Mappers.body.get(me).body;\n\t\t\t\t\tBody otherBody = Mappers.body.get(other).body;\n\t\t\t\t\t\n\t\t\t\t\tfloat xOff = facingComp.facingRight ? 0.5f : -0.5f;\n\t\t\t\t\t\n\t\t\t\t\tfloat myX = myBody.getPosition().x + xOff;\n\t\t\t\t\tfloat myY = myBody.getPosition().y;\n\t\t\t\t\tfloat otherX = otherBody.getPosition().x;\n\t\t\t\t\tfloat otherY = otherBody.getPosition().y;\n\t\t\t\t\t\n\t\t\t\t\tfloat minX = 0.0f;\n\t\t\t\t\tfloat maxX = minX + range;\n\t\t\t\t\tfloat yRange = 0.9f;\n\t\t\t\t\t\n\t\t\t\t\t// Construct box in front of you\n\t\t\t\t\tfloat closeX = facingComp.facingRight ? myX + minX : myX - minX;\n\t\t\t\t\tfloat farX = facingComp.facingRight ? myX + maxX : myX - maxX;\n\t\t\t\t\tfloat top = myY + yRange;\n\t\t\t\t\tfloat bottom = myY - yRange;\n\t\t\t\t\t\n\t\t\t\t\tDebugRender.setType(ShapeType.Line);\n\t\t\t\t\tDebugRender.setColor(Color.CYAN);\n\t\t\t\t\tDebugRender.rect(facingComp.facingRight ? closeX : farX, bottom, Math.abs(farX - closeX), top - bottom, 1.0f);\n\t\t\t\t\t\n\t\t\t\t\tRectangle kick = new Rectangle(Math.min(closeX, farX), bottom, Math.abs(closeX - farX), top - bottom);\n\t\t\t\t\tRectangle enemy = new Rectangle(Mappers.body.get(other).getAABB());\n\t\t\t\t\tenemy.x = otherX - enemy.width * 0.5f;\n\t\t\t\t\tenemy.y = otherY - enemy.height * 0.5f;\n\t\t\t\t\t\n\t\t\t\t\treturn kick.overlaps(enemy);\n//\t\t\t\t\treturn (((facingComp.facingRight && otherX >= closeX && otherX <= farX) || (!facingComp.facingRight && otherX >= farX && otherX <= closeX)) && otherY <= top && otherY >= bottom);\n\t\t\t\t}",
"public void checkBlock(BlockPos debug1) {\n/* 29 */ if (this.blockEngine != null) {\n/* 30 */ this.blockEngine.checkBlock(debug1);\n/* */ }\n/* 32 */ if (this.skyEngine != null) {\n/* 33 */ this.skyEngine.checkBlock(debug1);\n/* */ }\n/* */ }",
"public boolean work() {\n // get the next block so the cart knows where to mine\n Vec3 next = getNextblock();\n // save thee coordinates for easy access\n int x = (int) next.xCoord;\n int y = (int) next.yCoord;\n int z = (int) next.zCoord;\n\n // loop through the blocks in the \"hole\" in front of the cart\n\n for (int i = -getRange(); i <= getRange(); i++) {\n for (int j = -getRange(); j <= getRange(); j++) {\n // calculate the coordinates of this \"hole\"\n int coordX = x + i;\n int coordY = y - 1;\n int coordZ = z + j;\n\n if (farm(coordX, coordY, coordZ)) {\n return true;\n } else if (till(coordX, coordY, coordZ)) {\n return true;\n } else if (plant(coordX, coordY, coordZ)) {\n return true;\n }\n }\n }\n\n return false;\n }",
"private boolean atLeastOneNonWallLocation() {\n\t\tfor (int x = 0; x < this.map.getMapWidth(); x++) {\n\t\t\tfor (int y = 0; y < this.map.getMapHeight(); y++) {\n\n\t\t\t\tif (this.map.getMapCell(new Location(x, y)).isWalkable()) {\n\t\t\t\t\t// If it's not a wall then we can put them there\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"protected boolean validCoord(int row, int col) {\n\t\treturn (row >= 0 && row < b.size() && col >= 0 && col < b.size());\n\t}",
"private boolean isValid() throws InvalidStateException{\n if (this.homeTeam == null || this.visitingTeam == null){\n return false;\n }else{\n return true;\n }\n }",
"private static boolean isInBounds(Location location, Vector3i min, Vector3i max) {\n return location.getX() >= min.x && location.getX() < max.x && location.getY() >= min.y\n && location.getY() < max.y && location.getZ() >= min.z && location.getZ() < max.z;\n }",
"public static boolean isInColosseum(Location loc) {\n\t\tif (!(loc.getWorld() == Bukkit.getWorld(\"redacted2\"))) return false;\n\t\t// bad hotfix\n\t\tif (loc.clone().add(0, -1, 0).getBlock().getType() == Material.GRASS) return false;\n\t\tint locX = loc.getBlockX();\n\t\tint locY = loc.getBlockY();\n\t\tint locZ = loc.getBlockZ();\n\t\t//Test if player is in main launcher ignore box\n\t\t// -4 98 10 to -23 30 23 - ignore zone for main launcher\n\t\tif (-23 <= locX && locX <= -4 && 30 <= locY && locY <= 98 && 10 <= locZ && locZ <= 23) return false;\n\t\t//Test if player is in side launcher ignore box\n\t\t//-4 98 98 to -25 30 75 - ignore zone for side launcher\n\t\tif (-25 <= locX && locX <= -4 && 30 <= locY && locY <= 98 && 75 <= locZ && locZ <= 98) return false;\n\t\t//If the player is not in either of the ignore boxes, check if they are in the colosseum boundaries\n\t\t//-4 98 10 to -100 30 98 - Colosseum boundaries\n\t\tif (-100 <= locX && locX <= -4 && 30 <= locY && locY <= 98 && 10 <= locZ && locZ <= 98) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"private boolean legalMove() {\n\n\t\t// empty landing spot\n\t\tif (tilePath.size() == 0) {\n\t\t\tdebug(\"illegal, empty landing spot\");\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!mBoard.tileIsEmpty(tilePath.get(tilePath.size() - 1))) {\n\t\t\tdebug(\"illegal, tile not empty\");\n\t\t\treturn false;\n\t\t}\n\n\t\t// start doesn't equal end\n\t\tif (tilePath.get(0).equals(tilePath.get(tilePath.size() - 1))) {\n\t\t\tdebug(\"illegal, start doesn't equal end\");\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"public boolean blockIsNotSafe(World world, double x, double y, double z) {\r\n if (world.getBlockAt((int) Math.floor(x), (int) Math.floor(y),(int) Math.floor(z)).getType() != Material.AIR \r\n || world.getBlockAt((int) Math.floor(x),(int) Math.floor(y + 1), (int) Math.floor(z)).getType() != Material.AIR)\r\n return true;\r\n \r\n if ((world.getBlockAt((int) Math.floor(x), (int) Math.floor(y - 1),(int) Math.floor(z)).getType() == Material.LAVA))\r\n return true;\r\n \r\n if ((world.getBlockAt((int) Math.floor(x), (int) Math.floor(y - 1),(int) Math.floor(z)).getType() == Material.STATIONARY_LAVA))\r\n return true;\r\n \r\n if ((world.getBlockAt((int) Math.floor(x), (int) Math.floor(y - 1),(int) Math.floor(z)).getType() == Material.FIRE))\r\n return true;\r\n \r\n if ((world.getBlockAt((int) Math.floor(x), (int) Math.floor(y),(int) Math.floor(z)).getType() == Material.FIRE))\r\n return true;\r\n \r\n if (blockIsAboveAir(world, x, y, z))\r\n return true;\r\n\r\n return false;\r\n }",
"protected boolean validateLocation (BodyObject source, Location loc)\n {\n return true;\n }",
"@Test\n\tpublic void validSpawn() {\n\t\tGameState gameState = new GameState(1, \"assets/maps/map.json\");\n\t\tassertTrue(\"Should be able to be set to 0,0\", gameState.addSpawn(new Location(0, 0)));\n\t}",
"boolean canPlaceCity(VertexLocation vertLoc);",
"public boolean containsLoc(final Location3D loc) {\n\t\tif (loc == null || !loc.getWorld().equals(highPoint.getWorld())) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn lowPoint.getBlockX() <= loc.getBlockX()\n\t\t\t\t&& highPoint.getBlockX() >= loc.getBlockX()\n\t\t\t\t&& lowPoint.getBlockZ() <= loc.getBlockZ()\n\t\t\t\t&& highPoint.getBlockZ() >= loc.getBlockZ()\n\t\t\t\t&& lowPoint.getBlockY() <= loc.getBlockY()\n\t\t\t\t&& highPoint.getBlockY() >= loc.getBlockY();\n\t}",
"private boolean checkSpaceAvailability(Point targetLocation, ICityFragment element) {\r\n //basic constraint:no other things here\r\n\r\n if (city.isAnythingHere(targetLocation, element.getBoundary().width, element.getBoundary().height, element)) {\r\n return false;\r\n }\r\n\r\n //crossroads:at least one road can connected\r\n if (element instanceof Crossroads) {\r\n var crossroad = (Crossroads) element;\r\n\r\n var accessibleRoad = findAccessibleRoads(crossroad, targetLocation);\r\n\r\n if (accessibleRoad == null || accessibleRoad.size() <= 1) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }",
"public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) {\n\t\tint l = 0;\n\n\t\tif (par1World.getBlock(par2 - 1, par3, par4) == this) {\n\t\t\t++l;\n\t\t}\n\n\t\tif (par1World.getBlock(par2 + 1, par3, par4) == this) {\n\t\t\t++l;\n\t\t}\n\n\t\tif (par1World.getBlock(par2, par3, par4 - 1) == this) {\n\t\t\t++l;\n\t\t}\n\n\t\tif (par1World.getBlock(par2, par3, par4 + 1) == this) {\n\t\t\t++l;\n\t\t}\n\n\t\treturn l > 1 ? false : (this.isThereANeighborChest(par1World, par2 - 1, par3, par4) ? false : (this.isThereANeighborChest(par1World, par2 + 1, par3,\n\t\t\t\tpar4) ? false : (this.isThereANeighborChest(par1World, par2, par3, par4 - 1) ? false : !this.isThereANeighborChest(par1World, par2, par3,\n\t\t\t\tpar4 + 1))));\n\t}",
"@Override\r\n\tpublic boolean isNodeValid() {\n\t\treturn (SKILLS.HITPOINTS.getActualLevel() >= 25\r\n\t\t\t\t&& SKILLS.THIEVING.getActualLevel() >= 28\r\n\t\t\t\t&& Inventory.getCount(\"Coins\") >= 30 && (Location.karamjaFirstStepCheck.atLocation(Player.getPosition()) ||Location.karamjaBoatLandTile.equals(Player.getPosition()) ));\r\n\t}",
"public boolean checkCollisions(Tuple camera) {\n\n\t\t// already exploded\n\t\tif(disabled > 0) {\n\t\t\treturn false;\n\t\t} // if\n\t\t\n\t\t// collision detected\n\t\tif(location.distance(camera) - size < SHIP_SIZE) {\n\t\t\tdisabled = 1;\n\t\t\treturn true;\n\t\t} // if\n\t\treturn false;\n\t}",
"@Override\n protected boolean doTask()\n {\n if (!this.homePos.isEmpty()) return true;\n final Brain<?> brain = this.entity.getBrain();\n if (brain.hasMemoryValue(MemoryModules.GOING_HOME.get())) return true;\n if (BurrowTasks.shouldBeInside(this.world, this.burrow))\n {\n brain.setMemory(MemoryModules.GOING_HOME.get(), true);\n return true;\n }\n return false;\n }",
"private boolean isAllAreaAchievable() throws ReachabilityException {\n\t\t\n\t\t// mark all points that the player should reach as 1, else as 0\n\t\tint[][] tempMap = new int[height][width];\n\t\tfor (int i = 0; i < height; i++) {\n\t\t\tfor (int j = 0; j < width; j++) {\n\t\t\t\tif (mapElementArray[i][j] instanceof Item\n\t\t\t\t\t\t|| mapElementArray[i][j] instanceof Teleporter\n\t\t\t\t\t\t|| mapElementArray[i][j] instanceof PlayerSpawnPoint)\n\t\t\t\t\ttempMap[i][j] = 1;\n\t\t\t\telse\n\t\t\t\t\ttempMap[i][j] = 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//try to reach all area\n\t\treachAllValidPoint(tempMap, aPlayerSpawnPointRow, aPlayerSpawnPointCol);\n\t\t\n\t\t//check if all area have been reached\n\t\tint unreachablePoint = 0;\n\t\tfor (int i = 0; i < height; i++) {\n\t\t\tfor (int j = 0; j < width; j++) {\n\t\t\t\tif (tempMap[i][j] == 1) {\n\t\t\t\t\tunreachablePoint++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n//\t\ttry {\n\t\t\tif (unreachablePoint > 0) {\n\t\t\t\tSystem.out.println(unreachablePoint + \" points are unreachable\");\n\t\t\t\tthrow new ReachabilityException();\n\t\t\t}else {\n\t\t\t\treturn true;\n\t\t\t}\n\t/*\t} catch (ReachabilityException e) {\n\t\t\tSystem.out.println(e);\n\t\t\t//print out map with invalid area\n\t\t\tfor (int i = 0; i < height; i++) {\n\t\t\t\tfor (int j = 0; j <width; j++) {\n\t\t\t\t\tSystem.out.print(tempMap[i][j]);\n\t\t\t\t}\n\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t}\n\t\t\treturn false;\n\t\t}*/\n\n\t}",
"public boolean canInteractWithBlock(Player player, Location location) {\n\t\tif (mayor.equals(player.getUniqueId()) || councils.containsKey(player.getUniqueId())) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tPlot plot = getPlotHere(location);\n\t\t\treturn (inhabitants.contains(player.getUniqueId()) && plot == null) || (plot != null && plot.canBuild(player, location));\n\t\t}\n\t}",
"public static boolean inArea(Location targetLoc, Location area1, Location area2) {\n if ((area1.getWorld() == area2.getWorld()) && (targetLoc.getWorld() == area1.getWorld())) {\n if ((targetLoc.getX() >= area1.getX() && targetLoc.getX() <= area2.getX())\n || (targetLoc.getX() <= area1.getX() && targetLoc.getX() >= area2.getX())) {\n if ((targetLoc.getY() >= area1.getY() && targetLoc.getY() <= area2.getY())\n || (targetLoc.getY() <= area1.getY() && targetLoc.getY() >= area2.getY())) {\n return (targetLoc.getZ() >= area1.getZ() && targetLoc.getZ() <= area2.getZ())\n || (targetLoc.getZ() <= area1.getZ() && targetLoc.getZ() >= area2.getZ());\n }\n }\n }\n return false;\n }",
"private boolean checkCrash (Location next)\n {\n if (next == null) {\n return true;\n }\n\n Location last = playerLocations.get(playerLocations.size()-1);\n\n LocationType type = next.getType();\n //println(getLocation(next).getType()+\" : \"+next);\n if (type == LocationType.POWERUP) {\n PowerUp p = getPowerUp(next);\n\n if (p != null) { // Basically a workaround for the NPE\n // if (ENABLE_SOUND) {\n // sfx.gainedPowerUp();\n // }\n addSpeed(1);\n speedTimer += (int) frameRate * 2;\n removePowerUp(p);\n }\n\n return false;\n }\n\n if ((type == LocationType.PLAYER || type == LocationType.WALL) ||\n (next.getY() != last.getY() && (direction == LEFTKEY || direction == RIGHTKEY)) ||\n (next.getX() != last.getX() && (direction == UPKEY || direction == DOWNKEY))) { // This is to prevent bike from wrapping around edge of grid, because grid is a 1d array\n //sfx.lostALife(); //Commented out because you hear a shrill sound at the end for some reason\n return true;\n }\n\n return false;\n }",
"private void scanForBlockFarAway() {\r\n\t\tList<MapLocation> locations = gameMap.senseNearbyBlocks();\r\n\t\tlocations.removeAll(stairs);\r\n\t\tif (locations.size() == 0) {\r\n\t\t\tblockLoc = null;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t/* remove blocks that can be sensed */\r\n\t\tIterator<MapLocation> iter = locations.iterator();\r\n\t\twhile(iter.hasNext()) {\r\n\t\t\tMapLocation loc = iter.next();\r\n\t\t\tif (myRC.canSenseSquare(loc))\r\n\t\t\t\titer.remove();\r\n\t\t} \r\n\t\t\r\n\t\tlocations = navigation.sortLocationsByDistance(locations);\r\n\t\t//Collections.reverse(locations);\r\n\t\tfor (MapLocation block : locations) {\r\n\t\t\tif (gameMap.get(block).robotAtLocation == null){\r\n\t\t\t\t/* this location is unoccupied */\r\n\t\t\t\tblockLoc = block;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tblockLoc = null;\r\n\t}",
"private void checkBlockAt(int x, int y, int z, World world,\n\t\t\tEntityPlayer entityplayer) {\n\t\tif (world.getBlock(x, y, z) == Blocks.air) {\n\t\t\tworld.playSoundEffect(x + 5.0D, y + 5.0D, z + 5.0D,\n\t\t\t\t\t\"mob.endermen.portal\", 2.0F,\n\t\t\t\t\tworld.rand.nextFloat() * 0.1F + 0.9F);\n\t\t\tentityplayer.setPosition(x, y, z);\n\t\t\tfor (int t = 1; t < 10; t++) {\n\t\t\t\tworld.spawnParticle(\"portal\", x, y, z, 0D + t, 0D + t, 0D + t);\n\t\t\t}\n\t\t} else {\n\t\t\tcheckBlockAt(x, y + 2, z, world, entityplayer);\n\t\t}\n\t}",
"public abstract boolean canMoveTo(Case Location);",
"@Override\n\tpublic void isGoodForInterior() throws MultiblockValidationException {\n\t\tTileEntity entityAbove = this.worldObj.getBlockTileEntity(xCoord, yCoord+1, zCoord);\n\t\tif(!(entityAbove instanceof TileEntityFuelRod || entityAbove instanceof TileEntityReactorControlRod)) {\n\t\t\tthrow new MultiblockValidationException(String.format(\"Fuel rod at %d, %d, %d must be part of a vertical column that reaches the entire height of the reactor, with a control rod on top.\", xCoord, yCoord, zCoord));\n\t\t}\n\n\t\t// Below must be fuel rod or the base of the reactor.\n\t\tTileEntity entityBelow = this.worldObj.getBlockTileEntity(xCoord, yCoord-1, zCoord);\n\t\tif(entityBelow instanceof TileEntityFuelRod) {\n\t\t\treturn;\n\t\t}\n\t\telse if(entityBelow instanceof IMultiblockPart) {\n\t\t\t((IMultiblockPart)entityBelow).isGoodForBottom();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tthrow new MultiblockValidationException(String.format(\"Fuel rod at %d, %d, %d must be part of a vertical column that reaches the entire height of the reactor, with a control rod on top.\", xCoord, yCoord, zCoord));\n\t}",
"@Override\n\tpublic boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) {\n\t\tif (player.getHeldItem() != null) {\n\t\t\tif (player.getHeldItem().getItem() == Items.iron_pickaxe) {\n\t\t\t\tplayer.getHeldItem().damageItem(100, player);\n\t\t\t\tfor (int i = -10; i < 10; i++) {// xval\n\t\t\t\t\tfor (int j = 0; j < 2; j++)\n\t\t\t\t\t\t// yval\n\t\t\t\t\t\tworld.setBlockToAir(x + i, y + j, z);\n\t\t\t\t}\n\n\t\t\t\tfor (int i = -10; i < 10; i++) {\n\t\t\t\t\tfor (int j = 0; j < 2; j++)\n\t\t\t\t\t\t// yval\n\t\t\t\t\t\tworld.setBlockToAir(x, y + j, z + i);\n\t\t\t\t}\n\t\t\t\t// player.getHeldItem().damageItem(100, player);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else {//if hand empty\n\t\t\tplayer.addChatMessage(new ChatComponentText(\"[NausicaaMod]This block digs 10x2x1 mineshafts in all 4 directions\"));\n\t\t\tplayer.addChatMessage(new ChatComponentText(\"**DISTROYS BLOCK WITH NO DROPS**\"));\n\n\t\t}\n\t\treturn false;\n\t}",
"boolean testCoords(Tester t) {\n return t.checkExpect(this.p3.xCoord(), 50) && t.checkExpect(this.p4.yCoord(), 600);\n }",
"public static boolean isValidMove(Robot robot) {\r\n\t\t\r\n\t\tint x = robot.getX();\r\n\t\tint y = robot.getY();\r\n\t\t\r\n\t\t//Make sure the next move won't out\r\n\t\t//of bound to the east\r\n\t\tif(robot.facingEast()) {\r\n\t\t\tif(x + 1 < 10) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Make sure the next move won't hit\r\n\t\t//the wall to the west\r\n\t\tif(robot.facingWest()) {\r\n\t\t\tif(x - 1 > 0) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\t\r\n\t\t//Make sure the next move won't hit\r\n\t\t//the wall to the south\r\n\t\tif(robot.facingSouth()) {\r\n\t\t\tif(y - 1 > 0) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\t\r\n\t\t//Make sure the next move won't out\r\n\t\t//of the bound to the north\r\n\t\tif(robot.facingNorth()) {\r\n\t\t\tif(y + 1 < 10) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\t\t\t\r\n\t\treturn false;\r\n\t}",
"private boolean locateSafety(String[] coord) {\n\n int[] indices = getIndexFromCoord(coord);\n int x0 = indices[0];\n int y0 = indices[1];\n int x1 = indices[2];\n int y1 = indices[3];\n\n\n if (x0 == x1) {\n // horizontal\n int northIndex = x0 > 0 ? x0 - 1 : -1;\n int southIndex = x0 < Row.values().length - 1 ? x0 + 1 : -1;\n int leftIndex = y0 > 0 ? y0 - 1 : -1;\n int rightIndex = y1 < fields.length - 1 ? y1 + 1 : -1;\n // check north area\n if (northIndex != -1) {\n for (int i = y0; i <= y1; i++) {\n if (fields[northIndex][i].isShip()) {\n System.out.println(\"Error! You placed it too close to another one. Try again:\");\n return false;\n }\n }\n }\n // check south area\n if (southIndex != -1) {\n for (int i = y0; i <= y1; i++) {\n if (fields[southIndex][i].isShip()) {\n System.out.println(\"Error! You placed it too close to another one. Try again:\");\n return false;\n }\n }\n }\n // check left\n if (leftIndex != -1 && fields[x0][leftIndex].isShip()) {\n System.out.println(\"Error! You placed it too close to another one. Try again:\");\n return false;\n }\n // check right\n if (rightIndex != -1 && fields[x0][rightIndex].isShip()) {\n System.out.println(\"Error! You placed it too close to another one. Try again:\");\n return false;\n }\n\n } else {\n // vertical\n int leftCol = y0 > 0 ? y0 - 1 : -1;\n int rightCol = y0 < fields.length - 1 ? y0 + 1 : -1;\n int northIndex = x0 > 0 ? x0 - 1 : -1;\n int southIndex = x1 < Row.values().length -1 ? x1 + 1 : -1;\n\n // check north\n if (northIndex != -1 && fields[northIndex][y0].isShip()) {\n System.out.println(\"Error! You placed it too close to another one. Try again:\");\n return false;\n }\n // check south\n if (southIndex != -1 && fields[southIndex][y0].isShip()) {\n System.out.println(\"Error! You placed it too close to another one. Try again:\");\n return false;\n }\n // check left\n if (leftCol != -1) {\n for (int i = x0; i <= x1; i++) {\n if (fields[i][leftCol].isShip()) {\n System.out.println(\"Error! You placed it too close to another one. Try again:\");\n return false;\n }\n }\n }\n // check right\n if (rightCol != -1) {\n for (int i = x0; i <= x1; i++) {\n if (fields[i][rightCol].isShip()) {\n System.out.println(\"Error! You placed it too close to another one. Try again:\");\n return false;\n }\n }\n }\n }\n return true;\n }",
"public boolean canPlaceEntity() {\n boolean blocked = this.mapCoordinatesForEntityToPlace.stream().anyMatch(c -> c.placeableState == PlaceableState.BLOCKED);\n if (blocked) return false;\n\n return this.mapCoordinatesForEntityToPlace.stream().anyMatch(c -> c.placeableState == PlaceableState.PLACEABLE);\n }",
"private ArrayList<Location> canMoveInit() {\n if (last == null) {\n ArrayList<Location> firstList = new ArrayList<>();\n firstList.add(getLocation());\n firstList.add(null);\n crossLocation.push(firstList);\n }\n if (crossLocation.empty() || isEnd) {\n return null;\n }\n Grid gr = getGrid();\n if (gr == null) {\n return null;\n }\n last = getLocation();\n return getValid(getLocation());\n }",
"public boolean validPosition(Player p, double x, double y) {\n\n\t\tTile tile = getTile(p, x + p.BOUNDING_BOX_X, y);\n\t\tif (tile == null || !tile.canEnter(p)) {\n\t\t\treturn false;\n\t\t}\n\n\t\ttile = getTile(p, x, y + p.BOUNDING_BOX_Y);\n\t\tif (tile == null || !tile.canEnter(p)) {\n\t\t\treturn false;\n\t\t}\n\n\t\ttile = getTile(p, x - p.BOUNDING_BOX_X, y);\n\t\tif (tile == null || !tile.canEnter(p)) {\n\t\t\treturn false;\n\t\t}\n\n\t\ttile = getTile(p, x, y - p.BOUNDING_BOX_Y);\n\t\tif (tile == null || !tile.canEnter(p)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"public boolean check() {\n return StuffUtils.equal(structure, SpigotUtils.structBetweenTwoLocations(pos1, pos2, material));\n }",
"public Location inRange()\n\t{\n\t\tboolean equals = false;\n\t\tif(getGrid() == null)\n\t\t\treturn null;\n\t\tfor(int i = -5; i < 6; i++)\n\t\t{\n\t\t\tfor(int j = -5; j < 6; j++)\n\t\t\t{\t\t\t\t\n\t\t\t\tif(getGrid().isValid(new Location(getLocation().getRow() + i, getLocation().getCol() + j)))\n\t\t\t\t{\n\t\t\t\t\tif(getGrid().get(new Location(getLocation().getRow() + i, getLocation().getCol() + j)) instanceof User)\n\t\t\t\t\t{\n\t\t\t\t\t\tequals = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tif(!equals)\n\t\t{\n\t\t\tArrayList<Location> locs = getGrid().getEmptyAdjacentLocations(getLocation());\n\t\t\tif(locs.size() != 0)\n\t\t\t\t return locs.get( (int) (Math.random() * locs.size()));\n\t\t\telse\n\t\t\t\treturn getLocation();\n\t\t}\n\t\t\t\n\t\tLocation moveLocation;\n\t\t\n\t\t\n\t\tif(getGrid().getNeighbors(getLocation()).contains(getGrid().getUser()))\n\t\t{\n\t\t\tmoveLocation = getGrid().getUser().getLocation();\n\t\t}\n\t\telse\n {\n PathFinder a = new PathFinder(getGrid(),20);\n Path path = a.findPath(this, this.getGrid().getUser().getLocation().getRow(), this.getGrid().getUser().getLocation().getCol(),true);\n if(path.getLength() != 0)\n moveLocation = a.findPath(this, this.getGrid().getUser().getLocation().getRow(), this.getGrid().getUser().getLocation().getCol(),true).getStep(0);\n else\n moveLocation = null;\n\n }\n\n\t\tif(moveLocation == null)\n\t\t{\n\t\t\tArrayList<Location> locs = getGrid().getEmptyAdjacentLocations(getLocation());\n\t\t\tif(locs.size() != 0)\n\t\t\t\tmoveLocation = locs.get( (int) (Math.random() * locs.size()));\n\t\t\telse\n\t\t\t\tmoveLocation = getLocation();\n\t\t}\n\t\t\n\t\treturn moveLocation;\n\t}",
"public boolean blockIsAboveAir(World world, double x, double y, double z) {\r\n return (world.getBlockAt((int) Math.floor(x), (int) Math.floor(y - 1),\r\n (int) Math.floor(z)).getType() == Material.AIR);\r\n }",
"public boolean isValid(Board board) {\n if (!from.isValid(board.size) || !to.isValid(board.size)) {\r\n return false;\r\n }\r\n\r\n // Confirm the 'from' space is occupied\r\n if (!board.b[from.row][from.column]) {\r\n return false;\r\n }\r\n\r\n // Confirm the 'to' space is empty\r\n if (board.b[to.row][to.column]) {\r\n return false;\r\n }\r\n\r\n int rowJump = Math.abs(from.row - to.row);\r\n int colJump = Math.abs(from.column - to.column);\r\n\r\n if (rowJump == 0) {\r\n if (colJump != 2) {\r\n return false;\r\n }\r\n }\r\n else if (rowJump == 2) {\r\n if (colJump != 0 && colJump != 2) {\r\n return false;\r\n }\r\n }\r\n else {\r\n return false;\r\n }\r\n\r\n // Confirm the 'step' space is occupied\r\n return board.b[(from.row + to.row) / 2][(from.column + to.column) / 2];\r\n }",
"public boolean structureWillSpawn(int xRegion, int zRegion, int xRandom, int zRandom, BiomeGenerator generator){\n if(\t\tgenerator.getBiomeAt(xRegion * 512 + xRandom * 16 + 8, zRegion * 512 +zRandom * 16 + 8) == 24 &&\n isValidBiome(xRegion * 512 + xRandom * 16 + 8, zRegion * 512 +zRandom * 16 + 8, 29, validSurroundingBiomes, generator))\n return true;\n return false;\n }",
"private boolean isValid(AStarNode start, AStarNode end) {\n boolean check = true;\n for (Obstacle obs : getObstacles()) {\n if (isOnTheWay(start, end, obs))\n check = false;\n }\n return check;\n }",
"protected boolean shouldMoveTo(World worldIn, BlockPos pos)\n {\n Block block = worldIn.getBlockState(pos).getBlock();\n\n if (block == Blocks.FARMLAND)\n {\n pos = pos.up();\n IBlockState iblockstate = worldIn.getBlockState(pos);\n block = iblockstate.getBlock();\n\n if (block instanceof BlockCrops && this.wantsToReapStuff && (this.currentTask == 0 || this.currentTask < 0))\n {\n this.currentTask = 0;\n return true;\n }\n\n }\n\n return false;\n }",
"private static boolean isObstacleBetweenSteps(Point3DReadOnly pawPosition, Point3DReadOnly previousPawPosition, List<PlanarRegion> planarRegions,\n double groundClearance)\n {\n if (pawPosition.distance(previousPawPosition) < PawNode.gridSizeXY)\n return false;\n\n PlanarRegion bodyPath = createBodyCollisionRegionFromTwoFeet(pawPosition, previousPawPosition, groundClearance, 2.0);\n\n for (PlanarRegion region : planarRegions)\n {\n if (!region.intersect(bodyPath).isEmpty())\n return true;\n }\n\n return false;\n }",
"public boolean inValidSpot(Path p1){\n\t\t// Checks to see it the path piece placed expects an entrance or exit piece out of bounds\n\t\t\n\t\tint largestRow = (height*width-1)/width;\n\t\t\n\t\t// if entrance or exit pos expected is negative, know it is expecting a path outside the top bound\n\t\tif(p1.getEntry()<0 || p1.getExit()<0){\n\t\t\treturn false;\n\t\t}\n\t\t// if entrance or exit's row greater than the maximum row, know it is expecting a path outside bottom bound\n\t\tif(p1.getEntryRow()>largestRow || p1.getExitRow()>largestRow){\n\t\t\treturn false;\n\t\t}\n\t\tint currentRow = p1.getRow();\n\t\tint nextRow=0;\n\t\tif(Math.abs(p1.getPos()-p1.getEntry())==1){\n\t\t\t// If the absolute value of the difference between the current position and its entrance is 1 ...\n\t\t\t// Checking to see if the entrance is expected to be outside of the left or right edges of Map\n\t\t\tnextRow = p1.getEntryRow();\n\t\t\tif(currentRow!=nextRow){\n\t\t\t\t// This means that the entrance expected is not to the left or to the right\n\t\t\t\t// In other words, the entrance is expected in another row\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tif(Math.abs(p1.getPos()-p1.getExit())==1){\n\t\t\t// If the absolute value of the difference between the current position and its exit is 1 ...\n\t\t\t// Checking to see if the exit is expected to be outside of the left or right edges of Map\n\t\t\tnextRow = p1.getExitRow();\n\t\t\tif(currentRow!=nextRow){\n\t\t\t\t// This means that the exit expected is not to the left or to the right\n\t\t\t\t// In other words, the exit is expected in another row\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t/*\n\t\tif(Math.abs(p1.getPos()-p1.getEntry())==width){\n\t\t\tnextRow = p1.getEntryRow();\n\t\t\tif(p1.getEntry()<0 || nextRow>(height-1/width)){//it used to be calculaterow(height*width-1\n\t\t\t\t//Less than zero would make it on top of the top edge\n\t\t\t\t//First term calculated in this manner because any negative entrance between -1 and \n\t\t\t\t// -width+1 will have an integer rounded to zero. The double casting will give an \n\t\t\t\t// accurate number without losing the sign\n\t\t\t\t\n\t\t\t\t//Greater than height*width-1 would make in lower than the bottom edge\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tif(Math.abs(p1.getPos()-p1.getExit())==width){\n\t\t\tnextRow = p1.getExitRow();\n\t\t\tif(p1.getEntry()<0 || nextRow>(height-1/width)){//it used to be calculaterow(height*width-1\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t*/\n\t\treturn true;\n\t\t\n\t}",
"boolean testPlaceAllShipsAcc(Tester t) {\n return t.checkExpect(this.los3.placeAllAcc(this.em),\n em.placeImageXY(ship1.draw(), 0, 150).placeImageXY(ship2.draw(), 50, 50)\n .placeImageXY(ship3.draw(), 50, 50))\n && t.checkExpect(\n this.los1.placeAllAcc(\n this.em.placeImageXY(ship2.draw(), 50, 50).placeImageXY(ship3.draw(), 50, 50)),\n em.placeImageXY(ship1.draw(), 0, 150).placeImageXY(ship2.draw(), 50, 50)\n .placeImageXY(ship3.draw(), 50, 50))\n && t.checkExpect(this.mt.placeAllAcc(new WorldScene(300, 700)), new WorldScene(300, 700));\n }",
"boolean checkIfValidToCreate(int start, int end) {\n return myMarkerTree.processOverlappingWith(start, end, region->{\n int rStart = region.getStartOffset();\n int rEnd = region.getEndOffset();\n if (rStart < start) {\n if (region.isValid() && start < rEnd && rEnd < end) {\n return false;\n }\n }\n else if (rStart == start) {\n if (rEnd == end) {\n return false;\n }\n }\n else {\n if (rStart > end) {\n return true;\n }\n if (region.isValid() && rStart < end && end < rEnd) {\n return false;\n }\n }\n return true;\n });\n }",
"public static Boolean isChest(Location loc){\n\t\tif(loc.getBlock() != null){\n\t\t\tif(loc.getBlock().getType() == Material.CHEST){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public void spawnInLattice() throws GameActionException {\n boolean isMyCurrentSquareGood = checkIfGoodSquare(Cache.CURRENT_LOCATION);\n\n // if in danger from muckraker, get out\n if (runFromMuckrakerMove() != 0) {\n return;\n }\n\n if (isMyCurrentSquareGood) {\n currentSquareIsGoodExecute();\n } else {\n currentSquareIsBadExecute();\n }\n\n }",
"public boolean isValidBoard() {\n\t\t\n\t\tif(mainSlots.size() != NUM_MAIN_SLOTS) {\n\t\t\treturn false;\n\t\t} else if ((redHomeZone != null && redHomeZone.size() != NUM_HOME_SLOTS) ||\n\t\t\t\t(greenHomeZone != null && greenHomeZone.size() != NUM_HOME_SLOTS) ||\n\t\t\t\t(yellowHomeZone != null && yellowHomeZone.size() != NUM_HOME_SLOTS) || \n\t\t\t\t(blueHomeZone != null && blueHomeZone.size() != NUM_HOME_SLOTS)) {\n\t\t\treturn false;\n\t\t} else if ((redEndZone != null && redEndZone.size() != NUM_END_SLOTS) ||\n\t\t\t\t(greenEndZone != null && greenEndZone.size() != NUM_END_SLOTS) || \n\t\t\t\t(yellowEndZone != null && yellowEndZone.size() != NUM_END_SLOTS) || \n\t\t\t\t(blueEndZone != null && blueEndZone.size() != NUM_END_SLOTS)) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t}",
"public boolean land() {\n\t\treturn (Math.random() > this.crashProb);\r\n\t}",
"@Test\n\tpublic void invalidSpawn_2() {\n\t\tGameState gameState = new GameState(1, \"assets/maps/map.json\");\n\t\tSquare[][] board = gameState.getBoard();\n\t\tassertFalse(\"Should not be able to add off the board\", gameState.addSpawn(new Location(board[0].length, 0)));\n\t}",
"private boolean checkIfGoodSquare(MapLocation location) {\n return (location.x % 2 == location.y % 2) && !location.isAdjacentTo(Cache.myECLocation);\n }",
"protected boolean shouldMoveTo(World worldIn, BlockPos pos) {\n Block block = worldIn.getBlockState(pos).getBlock();\n\n if (block == Blocks.FARMLAND) {\n pos = pos.up();\n IBlockState iblockstate = worldIn.getBlockState(pos);\n block = iblockstate.getBlock();\n\n if (block instanceof BlockCropPinto && ((BlockCropPinto) block).isMaxAge(iblockstate) && this.wantsToReapStuff && (this.currentTask == 0 || this.currentTask < 0)) {\n this.currentTask = 0;\n return true;\n }\n\n if (iblockstate.getMaterial() == Material.AIR && this.hasFarmItem && (this.currentTask == 1 || this.currentTask < 0)) {\n this.currentTask = 1;\n return true;\n }\n }\n return false;\n }",
"public boolean land() {\n\t\treturn ( Math.random() > this.crashProb);\r\n\t}",
"boolean canPlaceSettlement(VertexLocation vertLoc, boolean free);",
"private static boolean checkSpace(Unit unit, GameMap myMap, SearchNode currentNode, XYCoord coord, boolean ignoreUnits)\n {\n // if we're past the edges of the map\n if( !myMap.isLocationValid(coord) )\n {\n return false;\n }\n // if there is a unit in that space\n if( !ignoreUnits && (myMap.getLocation(coord).getResident() != null) )\n { // if that unit is an enemy\n if( unit.CO.isEnemy(myMap.getLocation(coord).getResident().CO) )\n {\n return false;\n }\n }\n // if this unit can't traverse that terrain.\n if( findMoveCost(unit, coord.xCoord, coord.yCoord, myMap) == 99 )\n {\n return false;\n }\n return true;\n }",
"public boolean checkIfBlocked(){\n\t\tsetNextXY();\n\t\t/*if(Physics.hitWall(this, game.wi)){\n\t\t\tblocked=true;\n\t\t}\n\t\telse{\n\t\t\tblocked=false;\n\t\t}\n\t\t*/\n\t\t\n\t\ttry{\n\t\t\tif(game.getController().wallArray[lastX][lastY]||game.getController().wallArray[nextX][nextY]){\n\t\t\t\treturn true;\n\t\t\t}\t\n\t\t}catch(IndexOutOfBoundsException x){\n\t\t\t\n\t\t\n\t\t}\n\t\treturn false;\n\t\t\n\t}",
"@SuppressWarnings(\"ConstantConditions\")\n private boolean isStuck(Position pos, Position posNow) {\n if (pos.isSimilar(posNow)) {\n return true;\n }\n\n Instance instance = getInstance();\n Chunk chunk = null;\n Collection<Entity> entities = null;\n\n /*\n What we're about to do is to discretely jump from the previous position to the new one.\n For each point we will be checking blocks and entities we're in.\n */\n double part = .25D; // half of the bounding box\n Vector dir = posNow.toVector().subtract(pos.toVector());\n int parts = (int) Math.ceil(dir.length() / part);\n Position direction = dir.normalize().multiply(part).toPosition();\n for (int i = 0; i < parts; ++i) {\n // If we're at last part, we can't just add another direction-vector, because we can exceed end point.\n if (i == parts - 1) {\n pos.setX(posNow.getX());\n pos.setY(posNow.getY());\n pos.setZ(posNow.getZ());\n } else {\n pos.add(direction);\n }\n BlockPosition bpos = pos.toBlockPosition();\n Block block = instance.getBlock(bpos.getX(), bpos.getY() - 1, bpos.getZ());\n if (!block.isAir() && !block.isLiquid()) {\n teleport(pos);\n return true;\n }\n\n Chunk currentChunk = instance.getChunkAt(pos);\n if (currentChunk != chunk) {\n chunk = currentChunk;\n entities = instance.getChunkEntities(chunk)\n .stream()\n .filter(entity -> entity instanceof LivingEntity)\n .collect(Collectors.toSet());\n }\n /*\n We won't check collisions with entities for first ticks of arrow's life, because it spawns in the\n shooter and will immediately damage him.\n */\n if (getAliveTicks() < 3) {\n continue;\n }\n Optional<Entity> victimOptional = entities.stream()\n .filter(entity -> entity.getBoundingBox().intersect(pos.getX(), pos.getY(), pos.getZ()))\n .findAny();\n if (victimOptional.isPresent()) {\n LivingEntity victim = (LivingEntity) victimOptional.get();\n victim.setArrowCount(victim.getArrowCount() + 1);\n callEvent(EntityAttackEvent.class, new EntityAttackEvent(this, victim));\n remove();\n return super.onGround;\n }\n }\n return false;\n }",
"private static boolean isMaterialInBlackList(final Location location){\n final List<Material> blackList = new ArrayList<>(Arrays.asList(\n Material.LONG_GRASS, Material.STATIONARY_WATER, Material.WATER,\n Material.WATER_LILY, Material.LAVA, Material.STATIONARY_LAVA,\n Material.STONE\n ));\n\n final Location upY = new Location(location.getWorld(), location.getX(), location.getY() + 1, location.getZ(), location.getYaw(), location.getPitch());\n\n return blackList.contains(location.getBlock().getType()) && upY.getBlock().getType() != Material.AIR;\n }",
"public boolean canMove() {\n\n\tArrayList<Location> moveLocs = getValid(getLocation());\n\n\tif (isEnd == true) {\n\t return false;\n\t} \n\tif (!moveLocs.isEmpty()) {\n\t \n\t randomSelect(moveLocs);\n\t // selectMoveLocation(moveLocs);\n\t return true;\n\n\t} else {\n\t return false;\n\t}\n }"
] | [
"0.7205015",
"0.6145603",
"0.6105076",
"0.6025025",
"0.59262276",
"0.58691007",
"0.5837147",
"0.58280915",
"0.5798142",
"0.5776919",
"0.57474846",
"0.571689",
"0.5683978",
"0.5681744",
"0.56401634",
"0.56299436",
"0.55582213",
"0.55089045",
"0.54875064",
"0.54754335",
"0.5474208",
"0.54697144",
"0.54280525",
"0.540868",
"0.5362147",
"0.53542954",
"0.5339801",
"0.532064",
"0.5320174",
"0.5317714",
"0.5304994",
"0.5294582",
"0.52844524",
"0.528375",
"0.5267987",
"0.52674",
"0.52671254",
"0.52554494",
"0.5254799",
"0.52488273",
"0.5248689",
"0.5243052",
"0.5240678",
"0.52332944",
"0.52308047",
"0.5227631",
"0.5223343",
"0.52204686",
"0.52179563",
"0.521233",
"0.520832",
"0.5206866",
"0.5200437",
"0.51943606",
"0.5193723",
"0.51901996",
"0.518718",
"0.51853955",
"0.5180999",
"0.5179169",
"0.5178227",
"0.5157831",
"0.5154283",
"0.51525587",
"0.5148563",
"0.51432025",
"0.5141803",
"0.51390845",
"0.51348037",
"0.5133863",
"0.51262194",
"0.51198006",
"0.5101255",
"0.5095952",
"0.5095595",
"0.508996",
"0.5089608",
"0.5088804",
"0.50880736",
"0.50878394",
"0.50866294",
"0.5076968",
"0.50743115",
"0.50647587",
"0.5054874",
"0.50494105",
"0.50467116",
"0.503832",
"0.50378823",
"0.5035186",
"0.5033358",
"0.5030019",
"0.5021598",
"0.50214356",
"0.5016037",
"0.5015266",
"0.5014688",
"0.50078124",
"0.49964085",
"0.4995466"
] | 0.803842 | 0 |
setHome Try to set the home of this mob to the specified coords | boolean setHome(IGeneticMob geneticMob, Vec3 coords); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setHome(Location home) {\n this.home = home;\n }",
"public void setHome(int home) {\n m_home = home;\n }",
"public void setHomePosition(String latlng) {\r\n\t\t\r\n\t\tdataStorage.setHomePosition(latlng);\r\n\t\t\r\n\t}",
"public void setIsHome(boolean isHome) {\n this.isHome = isHome;\n }",
"public void go_to_home_position() {\n stop_hold_arm();\n Pneumatics.get_instance().set_solenoids(false);\n Dispatcher.get_instance().add_job(new JMoveArm(RobotMap.Arm.pot_value_home, 0.9, 0.7, 0.7, 0.2, 0.8, false, false));\n hold_arm();\n }",
"@Override\n\tpublic void returnHome()\n\t{\n\t\tif (!isInsideRadius(getSpawn(), 200, false, false))\n\t\t{\n\t\t\tif (Config.DEBUG)\n\t\t\t{\n\t\t\t\tLOG.debug(\"{} moving home\", getObjectId());\n\t\t\t}\n\t\t\tsetisReturningToSpawnPoint(true);\n\t\t\tclearAggroList();\n\t\t\t\n\t\t\tif (hasAI())\n\t\t\t{\n\t\t\t\tgetAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, getSpawn().getLocation());\n\t\t\t}\n\t\t}\n\t}",
"public ReturnHome() {\n addSequential(new SetShooterPos(Constants.shooterHome));\n addParallel(new HoldIntakePosition(Constants.intakeArmHome));\n addSequential(new WaitCommand(1.5));\n addSequential(new StopChassisIntake());\n }",
"@Override\n\tpublic void setHouseGui(HouseGUI homegui) {\n\t\thousegui = homegui;\n\t\t\n\t}",
"public static void home(String homeName, Player player) {\n UUID Id = player.getUniqueId();\n World w = Bukkit.getServer().getWorld(FileManager.getHomeYml().getString(\"HOMES.\" + Id + \".\" + homeName + \".world\"));\n double x = FileManager.getHomeYml().getDouble(\"HOMES.\" + Id + \".\" + homeName + \".x\");\n double y = FileManager.getHomeYml().getDouble(\"HOMES.\" + Id + \".\" + homeName + \".y\");\n double z = FileManager.getHomeYml().getDouble(\"HOMES.\" + Id + \".\" + homeName + \".z\");\n int ya = FileManager.getHomeYml().getInt(\"HOMES.\" + Id + \".\" + homeName + \".yaw\");\n int pi = FileManager.getHomeYml().getInt(\"HOMES.\" + Id + \".\" + homeName + \".pitch\");\n player.teleport(new Location(w, x, y, z, ya, pi));\n if (Main.plugin.getConfig().getString(\"NOTIFICATIONS.Home\").equalsIgnoreCase(\"True\")) {\n String original = MessageManager.getMessageYml().getString(\"Home.Home\");\n String replaced = original.replaceAll(\"%home%\", homeName);\n player.sendMessage(MessageManager.getPrefix() + ChatColor.translateAlternateColorCodes('&', replaced));\n }\n }",
"public static void setHome(String home) {\n FindBugs.home = home;\n }",
"@Override\n\tpublic void returnHome()\n\t{\n\t\tif(_returnHome && !isInsideRadius(getSpawn().getLocx(), getSpawn().getLocy(), 150, false))\n\t\t{\n\t\t\tclearAggroList();\n\t\t\tgetAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, getSpawn().getLoc());\n\t\t}\n\t}",
"public void setMatrixHome(MatrixHome pNewMatrixHome) {\n\t\tmMatrixHome = pNewMatrixHome;\n\t}",
"@Override\n\tpublic void setHomeTeam() {\n\t\t\n\t}",
"public void home ()\r\n\t{\r\n\t\tthis.sector = this.head = this.cylinder = 0;\r\n\t}",
"public void switchToHomeScreen() {\n Intent startMain = new Intent(Intent.ACTION_MAIN);\n startMain.addCategory(Intent.CATEGORY_HOME);\n startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(startMain);\n }",
"public void setHomeScene(Scene scene) {\r\n scene1 = scene;\r\n }",
"public Location getHome() {\n return home;\n }",
"public void setHomeAddress(String homeAddress) {\n this.homeAddress = homeAddress == null ? null : homeAddress.trim();\n }",
"public void setHomeGroup(HomeGroup group) {\n\t\tthis.homeGroup = group;\n\t}",
"void home() {\n\t\tx = y = 10;\n\t\twin.repaint();\n\t}",
"public void gotoHome(){ application.gotoHome(); }",
"public void msgAtHome() {\n\t\tatHome.release();\n\t\tstateChanged();\n\t}",
"public void setHomeNumber(String homeNumber) {\r\n this.homeNumber = homeNumber;\r\n }",
"public void setHomeScore(int homeScore) {\n this.homeScore = homeScore;\n }",
"public void setHomePage(String homePage) {\r\n this.homePage = homePage.trim();\r\n }",
"public void setHomeProperty(String propertyName,\n String propertyValue) {\n this.home.setProperty(propertyName, propertyValue);\n }",
"public void goHome() {\n shouldWork = false;\n }",
"public void setPersonHome(PersonHome pNewPersonHome) {\r\n\t\tmPersonHome = pNewPersonHome;\r\n\t}",
"private void prepareAndShowHomeScreen() {\n\t\tFraHeader header = FraHeader.newInstance(true);\n\t\theader.showBackButton(false);\n\t\tFraHomeContent homeContent = FraHomeContent.newInstance();\n\t\tFraFooter footer = FraFooter.newInstance(FooterIcons.TOP10);\n\t\tFraSearch search = FraSearch.newInstance();\n\t\tFraFont font = FraFont.newInstance();\n\t\tFraShare share = FraShare.newInstance();\n\n\t\treplaceScreenWithNavBarContentAndMenu(header, FraHeader.TAG,\n\t\t\t\thomeContent, FraHomeContent.TAG, footer, FraFooter.TAG,\n\t\t\t\tFraMenu.newInstance(), FraMenu.TAG, search, FraSearch.TAG,\n\t\t\t\tfont, FraFont.TAG, share, FraShare.TAG, false);\n\t\tprepareAndShowHomeScreen(false);\n\t\t/*\n\t\t * replaceScreenWithNavBarContentAndFooter(homeContent,\n\t\t * FraHomeContent.TAG, footer, FraFooter.TAG, false);\n\t\t */\n\t}",
"public void setCacheHome(boolean cacheHome)\r\n/* 29: */ {\r\n/* 30: 83 */ this.cacheHome = cacheHome;\r\n/* 31: */ }",
"@Override\n public void pressHomeButton() {\n System.out.println(\"TV is already on the home screen\\n\");\n tv.setState(tv.getHomeState());\n }",
"private void launchHomeScreen(){\n\n prefManager.setFirstTimeLaunch(false);\n Intent i = new Intent(SplashActivity.this, MainActivity.class);\n startActivity(i);\n }",
"public void home() {\n\t\tUserUI ui = new UserUI();\n\t\tui.start();\n\t}",
"public void goHome() {\r\n\t\tif (mActivity instanceof DashboardActivity) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tfinal Intent intent = new Intent(mActivity, DashboardActivity.class);\r\n\t\tintent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\r\n\t\tmActivity.startActivity(intent);\r\n\r\n\t}",
"public void addHome( Class<?> homeClass, Home<?> home )\n {\n homes.put( homeClass, home );\n }",
"@Override\n\tpublic void setDisplayShowHomeEnabled(boolean showHome) {\n\t\t\n\t}",
"public void setPlatformHome(final File platformHome)\n {\n this.platformHome = platformHome;\n }",
"@Override\n\tpublic void backToHomePosition() {\n\t\t\n\t}",
"public void goHome();",
"boolean isValidHome(IGeneticMob geneticMob, Vec3 coords);",
"public void homeClicked() {\r\n Pane newRoot = loadFxmlFile(Home.getHomePage());\r\n Home.getScene().setRoot(newRoot);\r\n }",
"private void setHomeNum(String homeNum) {\n this.homeNum = StringExtension.nullFilter(homeNum);\n }",
"private void returnPlayerHome(Player player_to_be_eaten)\n {\n player_to_be_eaten.setX_cordinate(player_to_be_eaten.getInitial_x());\n player_to_be_eaten.setY_cordinate(player_to_be_eaten.getInitial_y());\n player_to_be_eaten.setSteps_moved(0);\n }",
"protected void callHome() {\n\t\tIntent intent = new Intent(this, AdminHome.class);\r\n\t\tstartActivity(intent);\r\n\t}",
"public void goHomeScreen(View view)\n {\n\n Intent homeScreen;\n\n homeScreen = new Intent(this, homeScreen.class);\n\n startActivity(homeScreen);\n\n }",
"public void displayHome() {\n\t\tclearBackStack();\n\t\tselectItemById(KestrelWeatherDrawerFactory.MAP_OVERVIEW, getLeftDrawerList());\n\t}",
"public void goHome() throws ManipulatorException;",
"public void testSetGoalLocation() {\n test = new Location(9, 9);\n assertEquals(test, maze1.getGoalLocation());\n \n test = new Location(1, 1);\n maze1.setGoalLocation(test);\n assertEquals(test, maze1.getGoalLocation());\n \n test = new Location(2, 2);\n maze1.setCell(test, MazeCell.WALL);\n maze1.setGoalLocation(test);\n assertEquals(test, maze1.getGoalLocation());\n \n \n }",
"public void goToHome() {\n navController.navigate(R.id.nav_home);\n }",
"public Home clickonHome()\n\t{\n\t\tdriver.findElement(By.xpath(home_xpath)).click();\n\t\treturn new Home(driver);\n\t}",
"boolean wouldBeValidHome(IGeneticMob geneticMob, Vec3 coords, Block block, int metadata, TileEntity te);",
"void doHome()\n\t{\n\t\ttry\n\t\t{\n\t\t\tLocation l = getCurrentLocation();\n\t\t\tSourceFile file = l.getFile();\n\t\t\tint module = file.getId();\n\t\t\tint line = l.getLine();\n\n\t\t\t// now set it\n setListingPosition(module, line);\n\t\t}\n\t\tcatch(NullPointerException npe)\n\t\t{\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"currentLocationUnknown\")); //$NON-NLS-1$\n\t\t}\n\t}",
"private void StartHomeActivity() {\n Intent intent = new Intent(this, PrivateGlobalActivity.class);\n intent.putExtra(ApiKeys.MANAGE_DEVICE_SSID, breathiWifiSSID);\n intent.putExtra(ApiKeys.MANAGE_DEVICE_PASSWORD, airOwlWifiPass);\n intent.putExtra(ApiKeys.MANAGE_DEVICE_ID, deviceId);\n intent.putExtra(ApiKeys.MANAGE_DEVICE_TYPE, type);\n intent.putExtra(ApiKeys.MANAGE_DEVICE_NAME, deviceName);\n startActivity(intent);\n }",
"public void setHomeName(String homeName) {\n this.homeName.setText(homeName);\n }",
"public void setSenderHomePhone(java.lang.String senderHomePhone) {\r\n this.senderHomePhone = senderHomePhone;\r\n }",
"public void toHomescreen () {\n Intent intent = new Intent(this, MainActivity.class);\n startActivity(intent);\n overridePendingTransition(R.anim.slide_in_left, R.anim.slide_out_right); //animation for transitioning back to the homescreen\n }",
"public void set(LoginGUI loginGUI, AccountCreationMenu accountCreationMenu, HomeMenuGUI homeMenuGUI){\n this.homeMenuGUI = homeMenuGUI;\n this.loginGUI = loginGUI;\n this.accountCreationMenu = accountCreationMenu;\n }",
"public void showHomeScreen() {\n try {\n FXMLLoader loader1 = new FXMLLoader();\n loader1.setLocation(MainApplication.class.getResource(\"view/HomeScreen.fxml\"));\n AnchorPane anchorPane = (AnchorPane) loader1.load();\n rootLayout.setCenter(anchorPane);\n HomeScreenController controller = loader1.getController();\n controller.setMainApp(this);\n } catch (IOException e) {\n \t\te.printStackTrace();\n \t }\n }",
"public Home() {\n initComponents();\n // setSize(700,400);\n //setLocation(200,60);\n// setResizable(false);\n// setBounds(200,80,700,400);\n \n \n }",
"public void pressHomeButton() {\n System.out.println(\"TV is already on the home screen\\n\");\n }",
"public void toHomeScreen(View view) {\n Intent intent = new Intent(SportHome.this, HomeScreen.class);\n startActivity(intent);\n\n }",
"public void setHomeClass(Class homeAPI)\n {\n _homeClass = homeAPI;\n }",
"@Override\n\tpublic void goHome() {\n\t\tSystem.out.println(\"回窝了!!!!\");\n\t}",
"public void homeScreen(Graphics art)\n\t{\n\t\t\n\t\tart.setColor(Color.pink);\n\t\tart.setFont(newFont);\n\t\tart.drawString(\"Balloon Pop\", 200, 200);\n\t\tart.setFont(newFont2);\n\t\tart.drawString(\"Press Z for instructions\", 100, 325);\n\t\tart.drawString(\"Hit the spacebar to start\", 100, 450);\n\t\t\n\t}",
"void setOssHomepage(String ossHomepage);",
"public URI getHome() {\n return this.homeSpace;\n }",
"public boolean getIsHome() {\n return isHome;\n }",
"private void openHome() {\n Intent intent = new Intent(this, WelcomeActivity.class);\n startActivity(intent);\n\n finish();\n }",
"@Override\n\tpublic void setDisplayHomeAsUpEnabled(boolean showHomeAsUp) {\n\t\t\n\t}",
"private void prepareAndShowHomeScreen(boolean addToBackstack) {\n\t\tFraHeader header = FraHeader.newInstance(true);\n\t\theader.showBackButton(false);\n\t\tFraHomeContent homeContent = FraHomeContent.newInstance();\n\t\tFraFooter footer = FraFooter.newInstance(FooterIcons.TOP10);\n\t\tFraSearch search = FraSearch.newInstance();\n\t\tFraFont font = FraFont.newInstance();\n\t\tFraShare share = FraShare.newInstance();\n\n\t\treplaceScreenWithNavBarContentAndMenu(header, FraHeader.TAG,\n\t\t\t\thomeContent, FraHomeContent.TAG, footer, FraFooter.TAG,\n\t\t\t\tFraMenu.newInstance(), FraMenu.TAG, search, FraSearch.TAG,\n\t\t\t\tfont, FraFont.TAG, share, FraShare.TAG, addToBackstack);\n\n\t\t/*\n\t\t * replaceScreenWithNavBarContentAndFooter(homeContent,\n\t\t * FraHomeContent.TAG, footer, FraFooter.TAG, false);\n\t\t */\n\t}",
"private void goToHome() {\n finish();\n Intent onPropertyView = new Intent(ChatMessage.this, MainActivity.class);\n startActivity(onPropertyView);\n }",
"public void onePointHome(View view) {\r\n homeScore += 1;\r\n displayHomeScore(homeScore);\r\n }",
"public int addHome(UUID uuid, String name, Location loc){\r\n\t\t//Load Map (Update)\r\n\t\tloadMap();\r\n\r\n\t\t//Combovar of Homename & UUID of Player\r\n\t\tString uniqhome = uuid.toString() + name;\r\n\r\n\t\t//Create new HomePoint and write it to Map\r\n\t\tif(!map.containsKey(uniqhome)){\r\n\t\t\tmap.put(uniqhome, loc.getWorld().getName() + \";\" + loc.getX() + \";\" + loc.getY() + \";\" + loc.getZ() + \";\" + loc.getYaw() + \";\" + loc.getPitch());\r\n\t\t} else {\r\n\t\t\treturn 1;\r\n\t\t}\r\n\r\n\t\t//Save Map\r\n\t\ttry {\r\n\t\t\tObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(homeFileLocation));\r\n\t\t\toos.writeObject(map);\r\n\t\t\toos.flush();\r\n\t\t\toos.close();\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn 2;\r\n\t\t}\r\n\r\n\t\treturn 0;\r\n\t}",
"public void setHomeScore(int h);",
"@Override\n\tpublic void msgAtHomePos() {\n\t\t\n\t}",
"default public void clickHome() {\n\t\tremoteControlAction(RemoteControlKeyword.HOME);\n\t}",
"public void transitionToHome() throws RemoteException{\n removeAll();\n mainPanel = new MainPanel(contr);\n add(mainPanel, \"span 1\");\n }",
"private void stateReturnToHomeBase() {\n\t\tif (isCloserToBall()) {\n\t\t\tstate = State.ATTACKING;\n\t\t\treturn;\n\t\t}\n\n\t\tif (!isCloseTo(playerDeafaultPosition)) {\n\t\t\tif (isAlignedTo(playerDeafaultPosition)) {\n\t\t\t\tcommander.doDashBlocking(50.0d);\n\t\t\t} else {\n\t\t\t\tturnTo(playerDeafaultPosition);\n\t\t\t}\n\t\t}\n\t}",
"public AppendNumberMgmtHistoryHome(final Context ctx, final Home delegate, final Object homeKey)\r\n {\r\n super(ctx, delegate);\r\n this.homeKey_ = homeKey;\r\n }",
"public int home () {\n Location center = new Location(myCenterXValue, myCenterYValue);\n int distance = (int) Vector.distanceBetween(getLocation(), center);\n setLocation(center);\n resetHeading();\n return distance;\n }",
"public void setLookupHomeOnStartup(boolean lookupHomeOnStartup)\r\n/* 24: */ {\r\n/* 25: 72 */ this.lookupHomeOnStartup = lookupHomeOnStartup;\r\n/* 26: */ }",
"public AppendNumberMgmtHistoryHome(final Home delegate, final Object homeKey)\r\n {\r\n this(null, delegate, homeKey);\r\n }",
"public static void goHome(Activity a) {\n\t\t\n\t\tIntent intent = new Intent(a, UserHome.class);\n\t\ta.startActivity(intent);\n\t}",
"public Builder homeEmail(String homeEmail) {\n this.homeEmail = homeEmail;\n return this;\n }",
"private void startHomeActivity() {\n startActivity(new Intent(SettingsActivity.this, HomeActivity.class));\n finish();\n }",
"void keyHome();",
"public void goHome(View view) {\n String toastString = \"go home...\";\n Toast.makeText(FriendsList.this,toastString, Toast.LENGTH_SHORT).show();\n\n //TODO\n // go to list screen....\n Intent goToNextScreen = new Intent (this, AccountAccess.class);\n final int result = 1;\n startActivity(goToNextScreen);\n }",
"public Home() {\n initComponents();\n ShowLauncher();\n }",
"public home() {\n initComponents();\n int xx;\n int xy;\n }",
"public int getHome() {\n return m_home;\n }",
"public void navigateToHome() {\n Intent intent = new Intent(this, MainMenu.class);\n startActivity(intent);\n finish();\n }",
"public void openHome() {\n connectionProgressDialog.dismiss();\n Intent i = new Intent(this, ZulipActivity.class);\n startActivity(i);\n finish();\n }",
"private com.hps.july.persistence.EquipmentSetHome ejbHome() throws java.rmi.RemoteException, javax.naming.NamingException {\n return (com.hps.july.persistence.EquipmentSetHome) PortableRemoteObject.narrow(getHome(), com.hps.july.persistence.EquipmentSetHome.class);\n }",
"public void clickOnHome() {\n\t\twait.waitForStableDom(250);\n\t\tisElementDisplayed(\"link_home\");\n\t\twait.waitForElementToBeClickable(element(\"link_home\"));\n\t\texecuteJavascript(\"document.getElementById('doctor-home').getElementsByTagName('i')[0].click();\");\n//\t\t element(\"link_home\").click();\n\t\tlogMessage(\"user clicks on Home\");\n\t}",
"boolean goHome(IGeneticMob geneticMob);",
"public void openHomePage() {\n\t\tlogger.info(\"Opening Home Page\");\n\t\tdriver.get(ReadPropertyFile.getConfigPropertyVal(\"homePageURL\"));\n\t\t\n\t}",
"public void setAPIManagerIsHome(boolean apiManagerIsHome)\n {\n this.apiManagerIsHome = apiManagerIsHome;\n }",
"@Override\n public void home() {\n System.out.println(\"They live underground.\");\n }",
"private void returnHome(){\n if (Boolean.toString(UpdatedHomePage.updatedHomeStarted).equals(\"false\")) {\n startActivity(new Intent(FinalPlan.this, Home.class));\n } else {\n Intent intent = new Intent(this, UpdatedHomePage.class);\n Bundle extras = new Bundle();\n extras.putBoolean(\"filtered\", true);\n intent.putExtras(extras);\n startActivity(intent);\n }\n }",
"protected Object getHome()\r\n/* 75: */ throws NamingException\r\n/* 76: */ {\r\n/* 77:159 */ if ((!this.cacheHome) || ((this.lookupHomeOnStartup) && (!isHomeRefreshable()))) {\r\n/* 78:160 */ return this.cachedHome != null ? this.cachedHome : lookup();\r\n/* 79: */ }\r\n/* 80:163 */ synchronized (this.homeMonitor)\r\n/* 81: */ {\r\n/* 82:164 */ if (this.cachedHome == null)\r\n/* 83: */ {\r\n/* 84:165 */ this.cachedHome = lookup();\r\n/* 85:166 */ this.createMethod = getCreateMethod(this.cachedHome);\r\n/* 86: */ }\r\n/* 87:168 */ return this.cachedHome;\r\n/* 88: */ }\r\n/* 89: */ }"
] | [
"0.76402044",
"0.72265",
"0.68831867",
"0.65164",
"0.6482401",
"0.6410484",
"0.6387669",
"0.6291238",
"0.6177199",
"0.61439574",
"0.6067667",
"0.5970028",
"0.5900061",
"0.5891986",
"0.58805376",
"0.5833806",
"0.5830301",
"0.5820017",
"0.58107066",
"0.58057207",
"0.5799349",
"0.57973224",
"0.5765831",
"0.57507557",
"0.57142",
"0.5706722",
"0.57048684",
"0.56989527",
"0.5615766",
"0.56119764",
"0.5581027",
"0.55655336",
"0.5555063",
"0.55344796",
"0.5522399",
"0.5516915",
"0.55155563",
"0.5511927",
"0.5499713",
"0.54832804",
"0.54826194",
"0.54781115",
"0.5464485",
"0.5446714",
"0.5424718",
"0.5400806",
"0.54005575",
"0.53979445",
"0.5386343",
"0.53449",
"0.5324547",
"0.5324267",
"0.5319341",
"0.52952296",
"0.5295137",
"0.52768767",
"0.5274642",
"0.5272244",
"0.52693814",
"0.5267095",
"0.52492815",
"0.52490246",
"0.52132064",
"0.5211349",
"0.52002627",
"0.5198284",
"0.5186821",
"0.5184294",
"0.5169187",
"0.514839",
"0.51398474",
"0.5130123",
"0.5115606",
"0.5115571",
"0.51013833",
"0.5100037",
"0.509726",
"0.5095316",
"0.5085224",
"0.5083883",
"0.50780934",
"0.5077585",
"0.50770324",
"0.50749546",
"0.5067435",
"0.50475156",
"0.5039191",
"0.5036574",
"0.5023307",
"0.50172544",
"0.50136024",
"0.4998268",
"0.49869788",
"0.49862793",
"0.49752003",
"0.49706763",
"0.49703497",
"0.49694932",
"0.49673775",
"0.4966527"
] | 0.7278473 | 1 |
removeHome Attempt to remove the current home coordinates of this mob without setting a new home | boolean removeHome(IGeneticMob geneticMob); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void removeHome(UUID uuid, String name){\r\n\t\t//Load Map (Update)\r\n\t\tloadMap();\r\n\r\n\t\t//Combovar of Homename & UUID of Player\r\n\t\tString uniqhome = uuid.toString() + name;\r\n\r\n\t\t//Remove HomePoint from Map\r\n\t\tmap.remove(uniqhome);\r\n\r\n\t\t//Save Map\r\n\t\ttry {\r\n\t\t\tObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(homeFileLocation));\r\n\t\t\toos.writeObject(map);\r\n\t\t\toos.flush();\r\n\t\t\toos.close();\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"@Override\n\tpublic void returnHome()\n\t{\n\t\tif(_returnHome && !isInsideRadius(getSpawn().getLocx(), getSpawn().getLocy(), 150, false))\n\t\t{\n\t\t\tclearAggroList();\n\t\t\tgetAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, getSpawn().getLoc());\n\t\t}\n\t}",
"public static void removeByU_H(long userId, boolean homeFlag) {\n\t\tgetPersistence().removeByU_H(userId, homeFlag);\n\t}",
"@Override\n\tpublic void returnHome()\n\t{\n\t\tif (!isInsideRadius(getSpawn(), 200, false, false))\n\t\t{\n\t\t\tif (Config.DEBUG)\n\t\t\t{\n\t\t\t\tLOG.debug(\"{} moving home\", getObjectId());\n\t\t\t}\n\t\t\tsetisReturningToSpawnPoint(true);\n\t\t\tclearAggroList();\n\t\t\t\n\t\t\tif (hasAI())\n\t\t\t{\n\t\t\t\tgetAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, getSpawn().getLocation());\n\t\t\t}\n\t\t}\n\t}",
"public void msgAtHome() {\n\t\tatHome.release();\n\t\tstateChanged();\n\t}",
"public static void removeByU_H_P(long userId, boolean homeFlag,\n\t\tboolean profileFlag) {\n\t\tgetPersistence().removeByU_H_P(userId, homeFlag, profileFlag);\n\t}",
"@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\t//mTracker.set(Fields.SCREEN_NAME, \"Home Screen\");\n\t\tmTracker.send(MapBuilder.createAppView().build());\n\t\t//mTracker.send(null);\n\t}",
"@Override\n\tpublic void backToHomePosition() {\n\t\t\n\t}",
"public void setHome(Location home) {\n this.home = home;\n }",
"public void removeTile(){\n\t\toccupied = false;\n\t\tcurrentTile = null;\n\t}",
"public void go_to_home_position() {\n stop_hold_arm();\n Pneumatics.get_instance().set_solenoids(false);\n Dispatcher.get_instance().add_job(new JMoveArm(RobotMap.Arm.pot_value_home, 0.9, 0.7, 0.7, 0.2, 0.8, false, false));\n hold_arm();\n }",
"public abstract void removeProximityActiveListener(@NonNull ProximityActiveListener listener);",
"public void removeOfficialInternetRadioStationHomepage( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.remove(this.model, this.getResource(), OFFICIALINTERNETRADIOSTATIONHOMEPAGE, value);\r\n\t}",
"public void setHome(int home) {\n m_home = home;\n }",
"public void goHome() {\r\n\t\tif (mActivity instanceof DashboardActivity) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tfinal Intent intent = new Intent(mActivity, DashboardActivity.class);\r\n\t\tintent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\r\n\t\tmActivity.startActivity(intent);\r\n\r\n\t}",
"public static void deleteHomework(Homework h) {\n int subject_index = h.getSubjectindex();\n int homework_index = h.getIndex();\n homework.get(subject_index).remove(homework_index);\n for(int i = homework_index; i < Storage.homework.get(subject_index).size(); i++) {\n FileSaver.renameHomeworkFolder(Storage.homework.get(subject_index).get(i), FileSaver.HOMEWORK_MINUS_HOMEWORK_INDEX);\n Storage.homework.get(subject_index).get(i).setIndex(i);\n }\n }",
"void removeHasInstitutionHomePage(Object oldHasInstitutionHomePage);",
"private void removeLocation() {\n try {\n this.location_view.setVisibility(View.GONE);\n this.current_location.setVisibility(View.GONE);\n this.drop_location.setVisibility(View.GONE);\n this.mPostModel.setLocationPost(\"\");\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }",
"public void removeOfficialInternetRadioStationHomepage(org.ontoware.rdfreactor.schema.rdfs.Resource value) {\r\n\t\tBase.remove(this.model, this.getResource(), OFFICIALINTERNETRADIOSTATIONHOMEPAGE, value);\r\n\t}",
"public void removePowerUp(PowerUp p) {\n for (Location loc : p.getLocations()) {\n Location replacement = new Location(loc.getX(), loc.getY());\n gridCache.add(replacement);\n }\n\n powerUps.remove(p);\n render();\n}",
"void unsetRoadTerrain();",
"public void setIsHome(boolean isHome) {\n this.isHome = isHome;\n }",
"public void onHomeBackClickedListener(View view) {\n mAboutScreen.setVisibility(View.GONE);\n }",
"public abstract void removeLocation(Location location);",
"@Override\r\n\tprotected void onDestroy()\r\n\t{\n\t\tGPSLocation.removeLocation();\r\n\t\tsuper.onDestroy();\r\n\t}",
"public void clearUpLanes () {\r\n\t\tupLanes = null;\r\n\t}",
"public int clearScreen () {\n int distance = home();\n myLine.clear();\n return distance;\n }",
"public void removeFromGame(){\n this.isInGame = false;\n }",
"void removeFromGame() {\n\t\t// remove from game\n\t\t//only for multi-player\n\t}",
"void removeRobot(Position pos);",
"public static void removeOfficialInternetRadioStationHomepage( Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.remove(model, instanceResource, OFFICIALINTERNETRADIOSTATIONHOMEPAGE, value);\r\n\t}",
"public ReturnHome() {\n addSequential(new SetShooterPos(Constants.shooterHome));\n addParallel(new HoldIntakePosition(Constants.intakeArmHome));\n addSequential(new WaitCommand(1.5));\n addSequential(new StopChassisIntake());\n }",
"public void goHome(Context context) \n{\n final Intent intent = new Intent(context, HomeActivity.class);\n intent.setFlags (Intent.FLAG_ACTIVITY_CLEAR_TOP);\n context.startActivity (intent);\n}",
"public void remove(){\n Api.worldRemover(getWorld().getWorldFolder());\n }",
"public static void removeOfficialInternetRadioStationHomepage(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, org.ontoware.rdfreactor.schema.rdfs.Resource value) {\r\n\t\tBase.remove(model, instanceResource, OFFICIALINTERNETRADIOSTATIONHOMEPAGE, value);\r\n\t}",
"public void setHomeAddress(String homeAddress) {\n this.homeAddress = homeAddress == null ? null : homeAddress.trim();\n }",
"@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t\tmovingArea = null;\r\n\t}",
"boolean setHome(IGeneticMob geneticMob, Vec3 coords);",
"public void removeAllOfficialInternetRadioStationHomepage() {\r\n\t\tBase.removeAll(this.model, this.getResource(), OFFICIALINTERNETRADIOSTATIONHOMEPAGE);\r\n\t}",
"@Override\n\n public void onDestroy() {\n\n mLocationManager.removeUpdates(this);\n\n mLocationManager.removeGpsStatusListener(this);\n\n stopForeground(true);\n\n }",
"public void setHomeGroup(HomeGroup group) {\n\t\tthis.homeGroup = group;\n\t}",
"public void home ()\r\n\t{\r\n\t\tthis.sector = this.head = this.cylinder = 0;\r\n\t}",
"public void stopMoving()\n {\n mouthPosition = 0;\n }",
"void removeRoute(McastRoute route);",
"private void removeGuess() {\n\t\tguessList[this.getLastPlayIndex()] = null;\n\t\tif (this.getLastPlayIndex() > 0)\n\t\t\tlastMoveID--;\n\t}",
"void unsetBranchOfficeList();",
"public static void deactivateGps() {\n try {\n if (mLocationListener != null) {\n mLocationManager.removeUpdates(mLocationListener);\n mLocationListener = null;\n }\n } catch (IllegalArgumentException e) {\n // ERROR: Intent is null.\n e.printStackTrace();\n }\n }",
"public void mo110584h() {\n if (this.f88308f != null && this.f90211A != null) {\n this.f88308f.removeView(this.f90211A);\n }\n }",
"private void removeArea() {\n \t\tthis.set.remove( this.area );\n \t\tthis.finish();\n \t}",
"public void removeAgent() {agent = null;}",
"public void gerak() \n {\n setLocation(getX(),getY()-5);\n if(getY()<20){\n getWorld().removeObject(this);\n }else\n cek_kena();\n \n }",
"public void setMatrixHome(MatrixHome pNewMatrixHome) {\n\t\tmMatrixHome = pNewMatrixHome;\n\t}",
"public void goHome() {\n shouldWork = false;\n }",
"protected void onStop() {\n super.onStop();\n String userId = FirebaseAuth.getInstance().getCurrentUser().getUid();\n DatabaseReference ref = FirebaseDatabase.getInstance().getReference(\"walkersAvailable\");\n GeoFire geoFire = new GeoFire(ref);\n geoFire.removeLocation(userId);\n }",
"public Location getHome() {\n return home;\n }",
"public boolean removeCard(HomeCellSpider x, Card top) {\n \tpiles= x.piles;\n \tif(piles.get(piles.size()-1) == top) {//check to see if top is really the top card of the homecellpile\n \t\tpiles.remove(piles.size()-1);//if so remove it and decrease the overall cardCounter\n \tcardCounter--;\n \treturn true;\n \t}else {\n \t\treturn false; // only top card can be removed\n \t}\n }",
"public final void removeBridgePart(BridgePart bridgePart) {\n/* 6642 */ if (this.bridgeParts != null) {\n/* */ \n/* 6644 */ this.bridgeParts.remove(bridgePart);\n/* 6645 */ if (this.bridgeParts.size() == 0)\n/* 6646 */ this.bridgeParts = null; \n/* */ } \n/* 6648 */ if (this.structure == null)\n/* */ return; \n/* 6650 */ if (this.watchers != null)\n/* */ {\n/* 6652 */ for (VirtualZone vz : getWatchers()) {\n/* */ \n/* */ \n/* */ try {\n/* 6656 */ vz.removeBridgePart(this.structure.getWurmId(), bridgePart);\n/* */ }\n/* 6658 */ catch (Exception e) {\n/* */ \n/* 6660 */ logger.log(Level.WARNING, e.getMessage(), e);\n/* */ } \n/* */ } \n/* */ }\n/* 6664 */ if (this.vitems != null)\n/* */ {\n/* 6666 */ for (Item pile : this.vitems.getPileItems()) {\n/* */ \n/* 6668 */ pile.setOnBridge(-10L);\n/* 6669 */ pile.updatePosZ(this);\n/* */ \n/* 6671 */ for (VirtualZone vz : getWatchers()) {\n/* */ \n/* */ \n/* */ try {\n/* 6675 */ if (vz.isVisible(pile, this))\n/* */ {\n/* 6677 */ vz.removeItem(pile);\n/* 6678 */ vz.addItem(pile, this, true);\n/* */ }\n/* */ \n/* 6681 */ } catch (Exception e) {\n/* */ \n/* 6683 */ logger.log(Level.WARNING, e.getMessage(), e);\n/* */ } \n/* */ } \n/* */ } \n/* */ }\n/* */ \n/* 6689 */ if (this.vitems != null)\n/* */ {\n/* 6691 */ for (Item item : this.vitems.getAllItemsAsArray()) {\n/* */ \n/* 6693 */ if (item.getBridgeId() == this.structure.getWurmId()) {\n/* */ \n/* 6695 */ item.setOnBridge(-10L);\n/* 6696 */ item.updatePosZ(this);\n/* 6697 */ item.updateIfGroundItem();\n/* */ } \n/* */ } \n/* */ }\n/* 6701 */ if (this.creatures != null)\n/* */ {\n/* 6703 */ for (Creature c : this.creatures) {\n/* */ \n/* 6705 */ if (c.getBridgeId() == this.structure.getWurmId()) {\n/* */ \n/* 6707 */ c.setBridgeId(-10L);\n/* 6708 */ if (!c.isPlayer()) {\n/* */ \n/* 6710 */ float oldposz = c.getPositionZ();\n/* 6711 */ float newPosz = c.calculatePosZ();\n/* 6712 */ float diffz = newPosz - oldposz;\n/* 6713 */ c.setPositionZ(newPosz);\n/* 6714 */ c.moved(0.0F, 0.0F, diffz, 0, 0);\n/* */ } \n/* */ } \n/* */ } \n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* 6723 */ checkDeletion();\n/* */ }",
"public void setPersonHome(PersonHome pNewPersonHome) {\r\n\t\tmPersonHome = pNewPersonHome;\r\n\t}",
"public HomeGroup getHomeGroup() {\n\t\treturn homeGroup;\n\t}",
"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}",
"void unsetOrganizationPositionList();",
"private void returnHome() {\n parentPane.getChildren().clear();\n parentPane.setTop(mainMenu);\n parentPane.setCenter(imgHome);\n }",
"void removeFeature(FriendPresence friendPresence);",
"public static void home(String homeName, Player player) {\n UUID Id = player.getUniqueId();\n World w = Bukkit.getServer().getWorld(FileManager.getHomeYml().getString(\"HOMES.\" + Id + \".\" + homeName + \".world\"));\n double x = FileManager.getHomeYml().getDouble(\"HOMES.\" + Id + \".\" + homeName + \".x\");\n double y = FileManager.getHomeYml().getDouble(\"HOMES.\" + Id + \".\" + homeName + \".y\");\n double z = FileManager.getHomeYml().getDouble(\"HOMES.\" + Id + \".\" + homeName + \".z\");\n int ya = FileManager.getHomeYml().getInt(\"HOMES.\" + Id + \".\" + homeName + \".yaw\");\n int pi = FileManager.getHomeYml().getInt(\"HOMES.\" + Id + \".\" + homeName + \".pitch\");\n player.teleport(new Location(w, x, y, z, ya, pi));\n if (Main.plugin.getConfig().getString(\"NOTIFICATIONS.Home\").equalsIgnoreCase(\"True\")) {\n String original = MessageManager.getMessageYml().getString(\"Home.Home\");\n String replaced = original.replaceAll(\"%home%\", homeName);\n player.sendMessage(MessageManager.getPrefix() + ChatColor.translateAlternateColorCodes('&', replaced));\n }\n }",
"void removeHasLatitude(Object oldHasLatitude);",
"@Override\n\tpublic void setHouseGui(HouseGUI homegui) {\n\t\thousegui = homegui;\n\t\t\n\t}",
"public void switchOff() throws RemoteHomeConnectionException {\n m.sendCommand(parseDeviceIdForMultipleDevice(getRealDeviceId()), \"l\"+getSubDeviceNumber()+\"f\");\n setCurrentState(false);\n }",
"public void transitionToHome() throws RemoteException{\n removeAll();\n mainPanel = new MainPanel(contr);\n add(mainPanel, \"span 1\");\n }",
"public void displayHome() {\n\t\tclearBackStack();\n\t\tselectItemById(KestrelWeatherDrawerFactory.MAP_OVERVIEW, getLeftDrawerList());\n\t}",
"public void switchToHomeScreen() {\n Intent startMain = new Intent(Intent.ACTION_MAIN);\n startMain.addCategory(Intent.CATEGORY_HOME);\n startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(startMain);\n }",
"private void unregisterForGPS() {\n Log.d(NAMAZ_LOG_TAG, \"unregisterForGPS:\");\n ((LocationManager) getSystemService(Context.LOCATION_SERVICE))\n .removeUpdates(qiblaManager);\n\n }",
"public void setHomeScore(int homeScore) {\n this.homeScore = homeScore;\n }",
"public void closeDrawerHome(View view) {\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_home_layout);\n if (drawer.isDrawerOpen(GravityCompat.START)) {\n drawer.closeDrawer(GravityCompat.START);\n }\n\n }",
"protected void refreshHome()\r\n/* 48: */ throws NamingException\r\n/* 49: */ {\r\n/* 50:121 */ synchronized (this.homeMonitor)\r\n/* 51: */ {\r\n/* 52:122 */ Object home = lookup();\r\n/* 53:123 */ if (this.cacheHome)\r\n/* 54: */ {\r\n/* 55:124 */ this.cachedHome = home;\r\n/* 56:125 */ this.createMethod = getCreateMethod(home);\r\n/* 57: */ }\r\n/* 58: */ }\r\n/* 59: */ }",
"public void removeMAddr() {\n LogWriter.logMessage(LogWriter.TRACE_DEBUG, \"removeMaddr () \");\n Via via=(Via)sipHeader;\n \n via.removeParameter(Via.MADDR);\n }",
"public void remove() {\r\n setRemovable(true);\r\n }",
"void unsetStation();",
"@DeleteMapping(\"/homes/{id}\")\n @Timed\n public ResponseEntity<Void> deleteHome(@PathVariable Long id) {\n log.debug(\"REST request to delete Home : {}\", id);\n homeService.delete(id);\n return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build();\n }",
"@Override\n\tpublic void setHomeTeam() {\n\t\t\n\t}",
"public void setHomePosition(String latlng) {\r\n\t\t\r\n\t\tdataStorage.setHomePosition(latlng);\r\n\t\t\r\n\t}",
"public void back()\n {\n if(!moveRooms.empty()){\n currentRoom = moveRooms.pop();\n look();\n } \n }",
"public void removeTab(HUDTab ht) {\r\n\t\ttabs.remove(ht);\r\n\t\tneedupdate = true;\r\n\t}",
"public boolean getIsHome() {\n return isHome;\n }",
"@Override\n\tpublic void removeGoal(Goal g) {\n\t\t\n\t}",
"@Override\n\tpublic void msgExitHome() {\n\t\t\n\t}",
"public void removeLocationObserver(String location);",
"public void removeAgent(Agent a)\n/* 81: */ {\n/* 82:132 */ this.mapPanel.removeAgent(a);\n/* 83: */ }",
"public void onStop(){mainActivity.locationManager.removeUpdates(mainActivity.locationListener);}",
"void removeBall(Coordinates at);",
"private void ExitRoom() {\n stopFirestoreListenerService();\n\n SharedPreferences roomInfo = getSharedPreferences(\"PreviousRoom\", 0);\n SharedPreferences.Editor roomInfoEditor = roomInfo.edit();\n\n roomInfoEditor.putString(\"roomID\", \"\");\n\n roomInfoEditor.apply();\n\n SelectRoomActivity.recentRooms.remove(roomId);\n }",
"public static void DrivingNavi_clean(){\n navInitManager = null;\n\n }",
"void unsetRegisteredOfficeCity();",
"public void removeComputer(Hardware computer) {\n if (!seats[computer.getPosition()].isAvailable()) {\n seats[computer.getPosition()].getCurrDev().setComputer(null);\n }\n computer.setTable(null, -1);\n computers.remove(computer);\n System.out.println(\"remove pos \" + computer.getPosition());\n Player.getInstance().getTableComputers().remove(computer.getSerial());\n setChanged();\n notifyObservers(computer.getPosition());\n// for(int i=0; i<computers.size(); i++) {\n// if(i < 2) {\n// computers.get(i).setFaceUp(true);\n// }\n// computers.get(i)\n// .setCoordinates(WorkingTableView.COMPUTER_POINTS[i].x, \n// WorkingTableView.COMPUTER_POINTS[i].y);\n// }\n\n// removeHardwareFromRoom(computer);\n }",
"void removeAllDesktops();",
"public void clearGotoFloor();",
"void pindahKeHome(){\n SessionManager sessionManager = new SessionManager(PrintPreviewActivity.this);\n sessionManager.clearPenjualanOffline();\n\n\n //pindah ke home\n Intent homeActivity = new Intent(PrintPreviewActivity.this, MainActivity.class);\n homeActivity.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n startActivity(homeActivity);\n this.finish();\n\n }",
"public void removeFromfeatures (org.unitime.timetable.model.RoomFeature roomFeature) {\n \t\tif (null == getFeatures()) \n \t\t\tsetFeatures(new java.util.HashSet());\n \t\tgetFeatures().remove(roomFeature);\n \t}",
"public void removeTile(Tile a_tile){\n for(int i = 0; i < playerHand.size(); i++){\n if(playerHand.get(i).getRight() == a_tile.getRight() && playerHand.get(i).getLeft() == a_tile.getLeft()){\n playerHand.remove(i);\n break;\n }\n }\n }",
"public void deleteLaser() {\n shotVisible = false;\n shot.setVisible(false);\n }",
"public void deleteSpace(){\n\t\t\t//TODO: need to pop-up a confirmation dialogue\n\t\t/*try {\n\t\t\tthis.muc.destroy(null, null);\n\t\t} catch (XMPPException e) {\n\t\t\tLog.d(TAG, \"Unable to destroy Space!\");\n\t\t}*/\n\t\t\tCollection<User> users = this.space.getAllParticipants().values();\n\t\t\tfor (User u : users) {\n\t\t\t\ttry {\n\t\t\t\t\tif(!u.getUsername().equals(MainApplication.user_primary.getUsername()))\n\t\t\t\t\t\tthis.space.getKickoutController().kickoutUser(u, Network.DEFAULT_KICKOUT);\n\t\t\t\t} catch (XMPPException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.space.getMUC().leave();\n\t\t\t//end experiment \n\t\t\t\n\t\t\tif(space.equals(Space.getMainSpace())){\n\t\t\t\tSpace.setMainSpace(null);\n\t\t\t}\n\t}"
] | [
"0.6608096",
"0.58763444",
"0.585116",
"0.5817634",
"0.5696138",
"0.564722",
"0.5547578",
"0.5534023",
"0.548113",
"0.5414235",
"0.54064804",
"0.5399175",
"0.5393153",
"0.53732526",
"0.53494275",
"0.52807117",
"0.5280127",
"0.52493286",
"0.52387536",
"0.52011544",
"0.51844394",
"0.5169412",
"0.51581234",
"0.5157181",
"0.5152095",
"0.51482403",
"0.5145216",
"0.51134515",
"0.5111695",
"0.51096094",
"0.5099165",
"0.5074284",
"0.50695765",
"0.50671005",
"0.503799",
"0.5037299",
"0.50256413",
"0.50223225",
"0.5021411",
"0.5021239",
"0.5010195",
"0.49966717",
"0.4984419",
"0.49825442",
"0.49766502",
"0.49704784",
"0.49684715",
"0.49560246",
"0.49511188",
"0.4926583",
"0.49189582",
"0.49159765",
"0.48917916",
"0.48817623",
"0.48815382",
"0.4880701",
"0.48791",
"0.4867503",
"0.48573762",
"0.48518586",
"0.48440695",
"0.4843297",
"0.482982",
"0.48264077",
"0.48069343",
"0.47997162",
"0.47977477",
"0.4785504",
"0.47801667",
"0.4776824",
"0.47697157",
"0.47577432",
"0.47536525",
"0.47497848",
"0.47493318",
"0.47465193",
"0.4739675",
"0.4736181",
"0.4734166",
"0.473098",
"0.47277558",
"0.47236773",
"0.47202826",
"0.47151083",
"0.47085455",
"0.47080475",
"0.4707592",
"0.47039682",
"0.47027043",
"0.47016135",
"0.4698321",
"0.4695169",
"0.4689285",
"0.46874094",
"0.46815816",
"0.46811873",
"0.4678394",
"0.46781495",
"0.46768698",
"0.46756786"
] | 0.71516204 | 0 |
goHome Try to send this mob to its current home coordinates | boolean goHome(IGeneticMob geneticMob); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void go_to_home_position() {\n stop_hold_arm();\n Pneumatics.get_instance().set_solenoids(false);\n Dispatcher.get_instance().add_job(new JMoveArm(RobotMap.Arm.pot_value_home, 0.9, 0.7, 0.7, 0.2, 0.8, false, false));\n hold_arm();\n }",
"@Override\n\tpublic void returnHome()\n\t{\n\t\tif (!isInsideRadius(getSpawn(), 200, false, false))\n\t\t{\n\t\t\tif (Config.DEBUG)\n\t\t\t{\n\t\t\t\tLOG.debug(\"{} moving home\", getObjectId());\n\t\t\t}\n\t\t\tsetisReturningToSpawnPoint(true);\n\t\t\tclearAggroList();\n\t\t\t\n\t\t\tif (hasAI())\n\t\t\t{\n\t\t\t\tgetAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, getSpawn().getLocation());\n\t\t\t}\n\t\t}\n\t}",
"@Override\n\tpublic void returnHome()\n\t{\n\t\tif(_returnHome && !isInsideRadius(getSpawn().getLocx(), getSpawn().getLocy(), 150, false))\n\t\t{\n\t\t\tclearAggroList();\n\t\t\tgetAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, getSpawn().getLoc());\n\t\t}\n\t}",
"public void msgAtHome() {\n\t\tatHome.release();\n\t\tstateChanged();\n\t}",
"public ReturnHome() {\n addSequential(new SetShooterPos(Constants.shooterHome));\n addParallel(new HoldIntakePosition(Constants.intakeArmHome));\n addSequential(new WaitCommand(1.5));\n addSequential(new StopChassisIntake());\n }",
"boolean setHome(IGeneticMob geneticMob, Vec3 coords);",
"@Override\n\tpublic void goHome() {\n\t\tSystem.out.println(\"回窝了!!!!\");\n\t}",
"private void stateReturnToHomeBase() {\n\t\tif (isCloserToBall()) {\n\t\t\tstate = State.ATTACKING;\n\t\t\treturn;\n\t\t}\n\n\t\tif (!isCloseTo(playerDeafaultPosition)) {\n\t\t\tif (isAlignedTo(playerDeafaultPosition)) {\n\t\t\t\tcommander.doDashBlocking(50.0d);\n\t\t\t} else {\n\t\t\t\tturnTo(playerDeafaultPosition);\n\t\t\t}\n\t\t}\n\t}",
"public void goHome() {\r\n\t\tif (mActivity instanceof DashboardActivity) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tfinal Intent intent = new Intent(mActivity, DashboardActivity.class);\r\n\t\tintent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\r\n\t\tmActivity.startActivity(intent);\r\n\r\n\t}",
"@Override\n\tpublic void msgAtHomePos() {\n\t\t\n\t}",
"private void goToHome() {\n finish();\n Intent onPropertyView = new Intent(ChatMessage.this, MainActivity.class);\n startActivity(onPropertyView);\n }",
"private void StartHomeActivity() {\n Intent intent = new Intent(this, PrivateGlobalActivity.class);\n intent.putExtra(ApiKeys.MANAGE_DEVICE_SSID, breathiWifiSSID);\n intent.putExtra(ApiKeys.MANAGE_DEVICE_PASSWORD, airOwlWifiPass);\n intent.putExtra(ApiKeys.MANAGE_DEVICE_ID, deviceId);\n intent.putExtra(ApiKeys.MANAGE_DEVICE_TYPE, type);\n intent.putExtra(ApiKeys.MANAGE_DEVICE_NAME, deviceName);\n startActivity(intent);\n }",
"public void goHome() {\n shouldWork = false;\n }",
"public void gotoHome(){ application.gotoHome(); }",
"private void returnPlayerHome(Player player_to_be_eaten)\n {\n player_to_be_eaten.setX_cordinate(player_to_be_eaten.getInitial_x());\n player_to_be_eaten.setY_cordinate(player_to_be_eaten.getInitial_y());\n player_to_be_eaten.setSteps_moved(0);\n }",
"public void goHome(View view) {\n String toastString = \"go home...\";\n Toast.makeText(FriendsList.this,toastString, Toast.LENGTH_SHORT).show();\n\n //TODO\n // go to list screen....\n Intent goToNextScreen = new Intent (this, AccountAccess.class);\n final int result = 1;\n startActivity(goToNextScreen);\n }",
"public void goHome();",
"@Override\n\tpublic void backToHomePosition() {\n\t\t\n\t}",
"public static void home(String homeName, Player player) {\n UUID Id = player.getUniqueId();\n World w = Bukkit.getServer().getWorld(FileManager.getHomeYml().getString(\"HOMES.\" + Id + \".\" + homeName + \".world\"));\n double x = FileManager.getHomeYml().getDouble(\"HOMES.\" + Id + \".\" + homeName + \".x\");\n double y = FileManager.getHomeYml().getDouble(\"HOMES.\" + Id + \".\" + homeName + \".y\");\n double z = FileManager.getHomeYml().getDouble(\"HOMES.\" + Id + \".\" + homeName + \".z\");\n int ya = FileManager.getHomeYml().getInt(\"HOMES.\" + Id + \".\" + homeName + \".yaw\");\n int pi = FileManager.getHomeYml().getInt(\"HOMES.\" + Id + \".\" + homeName + \".pitch\");\n player.teleport(new Location(w, x, y, z, ya, pi));\n if (Main.plugin.getConfig().getString(\"NOTIFICATIONS.Home\").equalsIgnoreCase(\"True\")) {\n String original = MessageManager.getMessageYml().getString(\"Home.Home\");\n String replaced = original.replaceAll(\"%home%\", homeName);\n player.sendMessage(MessageManager.getPrefix() + ChatColor.translateAlternateColorCodes('&', replaced));\n }\n }",
"public void goToHome() {\n navController.navigate(R.id.nav_home);\n }",
"public void setHome(Location home) {\n this.home = home;\n }",
"boolean isHome(IGeneticMob geneticMob);",
"protected void callHome() {\n\t\tIntent intent = new Intent(this, AdminHome.class);\r\n\t\tstartActivity(intent);\r\n\t}",
"public void switchToHomeScreen() {\n Intent startMain = new Intent(Intent.ACTION_MAIN);\n startMain.addCategory(Intent.CATEGORY_HOME);\n startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(startMain);\n }",
"@Override\n public void pressHomeButton() {\n System.out.println(\"TV is already on the home screen\\n\");\n tv.setState(tv.getHomeState());\n }",
"public void goHomeScreen(View view)\n {\n\n Intent homeScreen;\n\n homeScreen = new Intent(this, homeScreen.class);\n\n startActivity(homeScreen);\n\n }",
"@Override\n protected boolean doTask()\n {\n if (!this.homePos.isEmpty()) return true;\n final Brain<?> brain = this.entity.getBrain();\n if (brain.hasMemoryValue(MemoryModules.GOING_HOME.get())) return true;\n if (BurrowTasks.shouldBeInside(this.world, this.burrow))\n {\n brain.setMemory(MemoryModules.GOING_HOME.get(), true);\n return true;\n }\n return false;\n }",
"public void pressHomeButton() {\n System.out.println(\"TV is already on the home screen\\n\");\n }",
"public void teleport(boolean penalty) { \n\t\tPublisher teleport_h = new Publisher(\"/ariac_human/go_home\", \"std_msgs/Bool\", bridge);\n\t\tif(penalty)\t\n\t\t\tteleport_h.publish(new Bool(true));\t\n\t\telse\n\t\t\tteleport_h.publish(new Bool(false));\t\n\n\t\t// Reset \"smart\" orientation variables\n\t\tlastHumanState_MsgT = System.currentTimeMillis();\n\t\tlastUnsafeD_MsgT = System.currentTimeMillis();\n\t\tpreviousDistance = 50.0;\n\t\tisAproximating = false;\n\t}",
"public void toHomescreen () {\n Intent intent = new Intent(this, MainActivity.class);\n startActivity(intent);\n overridePendingTransition(R.anim.slide_in_left, R.anim.slide_out_right); //animation for transitioning back to the homescreen\n }",
"private void openHome() {\n Intent intent = new Intent(this, WelcomeActivity.class);\n startActivity(intent);\n\n finish();\n }",
"public void setHome(int home) {\n m_home = home;\n }",
"public void onePointHome(View view) {\r\n homeScore += 1;\r\n displayHomeScore(homeScore);\r\n }",
"@Override\n public void home() {\n System.out.println(\"They live underground.\");\n }",
"private void returnHome(){\n if (Boolean.toString(UpdatedHomePage.updatedHomeStarted).equals(\"false\")) {\n startActivity(new Intent(FinalPlan.this, Home.class));\n } else {\n Intent intent = new Intent(this, UpdatedHomePage.class);\n Bundle extras = new Bundle();\n extras.putBoolean(\"filtered\", true);\n intent.putExtras(extras);\n startActivity(intent);\n }\n }",
"public void returnHome(View view) {\n Intent intent = new Intent(GameDetailsActivity.this, HomeActivity.class);\n startActivity(intent);\n }",
"public void openHome() {\n connectionProgressDialog.dismiss();\n Intent i = new Intent(this, ZulipActivity.class);\n startActivity(i);\n finish();\n }",
"@Override\n public void start() {\n this.mob.getNavigation().startMovingTo(\n this.mob.getPositionTarget().getX(),\n this.mob.getPositionTarget().getY(),\n this.mob.getPositionTarget().getZ(),\n this.speed\n );\n }",
"public void setIsHome(boolean isHome) {\n this.isHome = isHome;\n }",
"public Integer goToHome() throws CallError, InterruptedException {\n return (Integer)service.call(\"goToHome\").get();\n }",
"public void goHome() throws ManipulatorException;",
"public void goHome(Context context) \n\t{\n\t\tfinal Intent intent = new Intent(context, HomeActivity.class);\n\t\tintent.setFlags (Intent.FLAG_ACTIVITY_CLEAR_TOP);\n\t\tcontext.startActivity (intent);\n\t}",
"public void navigateToHome() {\n Intent intent = new Intent(this, MainMenu.class);\n startActivity(intent);\n finish();\n }",
"boolean isValidHome(IGeneticMob geneticMob, Vec3 coords);",
"public void goToHome() {\n Intent intent = new Intent(this, MainActivity_3.class);\n startActivity(intent);\n }",
"public void home ()\r\n\t{\r\n\t\tthis.sector = this.head = this.cylinder = 0;\r\n\t}",
"public void navigateToHomePage()\n\t {\n\t if(getAdvertisementbtn().isPresent())\n\t getAdvertisementbtn().click();\n\t }",
"public void toHomeScreen(View view) {\n Intent intent = new Intent(SportHome.this, HomeScreen.class);\n startActivity(intent);\n\n }",
"public int home () {\n Location center = new Location(myCenterXValue, myCenterYValue);\n int distance = (int) Vector.distanceBetween(getLocation(), center);\n setLocation(center);\n resetHeading();\n return distance;\n }",
"boolean removeHome(IGeneticMob geneticMob);",
"public void clickOnHome() {\n\t\twait.waitForStableDom(250);\n\t\tisElementDisplayed(\"link_home\");\n\t\twait.waitForElementToBeClickable(element(\"link_home\"));\n\t\texecuteJavascript(\"document.getElementById('doctor-home').getElementsByTagName('i')[0].click();\");\n//\t\t element(\"link_home\").click();\n\t\tlogMessage(\"user clicks on Home\");\n\t}",
"private void goSomewhere() {\n\n Intent intent = new Intent();\n intent.setClassName(Home.this,this.tip.getTipIntent());\n startActivity(intent);\n }",
"public void sendToHome(User user){\n /*If the user name is valid then send to homescreen */\n Intent nextIntent = new Intent(this, Home.class);\n //Send the username and password to the database and then next activity\n nextIntent.putExtra(\"user\", user);\n\n //Start the activity (aka go to the next screen)\n startActivity(nextIntent);\n }",
"void showHomeScree(Context con) {\n\t\tIntent i = new Intent(con,CouponsScreen.class);\n\t\t//i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n\t\ti.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n\t\tcon.startActivity( i );\n\t}",
"public void clickHome(){\n try{\n Thread.sleep(500);\n new WebDriverWait(this.driver, 15)\n .until(ExpectedConditions.elementToBeClickable(this.home)).click();\n } catch (Exception e){\n System.out.println(e.getMessage());\n }\n }",
"boolean wouldBeValidHome(IGeneticMob geneticMob, Vec3 coords, Block block, int metadata, TileEntity te);",
"Vec3 getHomeCoords(IGeneticMob geneticMob);",
"default public void clickHome() {\n\t\tremoteControlAction(RemoteControlKeyword.HOME);\n\t}",
"public void goHome(Context context) \n{\n final Intent intent = new Intent(context, HomeActivity.class);\n intent.setFlags (Intent.FLAG_ACTIVITY_CLEAR_TOP);\n context.startActivity (intent);\n}",
"public interface MotorHomeInteraction {\n void onMotorHomeInteraction(int status, Object object);\n }",
"@Override\n\tpublic void msgExitHome() {\n\t\t\n\t}",
"public Location getHome() {\n return home;\n }",
"public Home clickonHome()\n\t{\n\t\tdriver.findElement(By.xpath(home_xpath)).click();\n\t\treturn new Home(driver);\n\t}",
"public void displayHome() {\n\t\tclearBackStack();\n\t\tselectItemById(KestrelWeatherDrawerFactory.MAP_OVERVIEW, getLeftDrawerList());\n\t}",
"public void onBottomNavHomeClick(View view){\n Intent intent = new Intent(user_history_activity.this, MainActivity.class);\n startActivity(intent);\n }",
"public void setHomePosition(String latlng) {\r\n\t\t\r\n\t\tdataStorage.setHomePosition(latlng);\r\n\t\t\r\n\t}",
"private void visitPatientAtHome(Patient patient) {\n patient.setHomeVisited(true);\n }",
"public void home(){\n Intent intent = new Intent(getApplicationContext(), TouchController.class);\n intent.setAction(Constant.ACTION_NOTIFICATION);\n startService(intent);\n }",
"public void goToHomeTeam(View view) {\n Intent intent = new Intent(this, teamDetailDone.class);\n intent.putExtra(\"id\", this.homeId.getText().toString());\n startActivity(intent);\n }",
"@And(\"navigate to home screen\")\n public void navigateToHomeScreen() throws InterruptedException {\n WebElement alert = getDriver().findElement(By.xpath(\"//button[@ng-click='alertModal.CancelError()']\"));\n if (alert.isDisplayed()) {\n alert.click();\n } else {\n getDriver().findElement(By.xpath(\"//body[@ng-controller='ApexZ as apexZ']\")).isDisplayed();\n }\n\n //resize browser window\n getDriver().manage().window().maximize();\n// org.openqa.selenium.Dimension dimension = new Dimension(1280, 800);\n// getDriver().manage().window().setSize(dimension);\n\n// And zoom out web page\n// JavascriptExecutor js = (JavascriptExecutor) driver;\n // js.executeScript(\"let style=document.body.style; style.transform='scale(1, 0.83)'; style.marginTop='-67px'\");\n\n// Hooks.zoomOutPage();\n// Thread.sleep(1000);\n\n }",
"@Override\n public void goToNextScreen(Home.HomeTo presenter) {\n toMapsState = new MapState();\n toMapsState.shop = presenter.getShop();\n\n Context view = presenter.getManagedContext();\n if (view != null) {\n Log.d(TAG, \"calling startingMapsScreen()\");\n view.startActivity(new Intent(view, MapsView.class));\n Log.d(TAG, \"calling destroyView()\");\n presenter.destroyView();\n }\n }",
"public static void goHome(Activity a) {\n\t\t\n\t\tIntent intent = new Intent(a, UserHome.class);\n\t\ta.startActivity(intent);\n\t}",
"public void backToHome(){\n logger.debug(\"click on Back to Home button\");\n driver.findElement(oBackToHome).click();\n }",
"private void launchHomeScreen(){\n\n prefManager.setFirstTimeLaunch(false);\n Intent i = new Intent(SplashActivity.this, MainActivity.class);\n startActivity(i);\n }",
"private void startHome() {\n if (context instanceof MainActivity) {\n CityListFragment fragment = CityListFragment\n .getInstance(fatherParent);\n ((MainActivity) context).switchContent(fragment, true);\n }\n }",
"public void navigateToHomePage() {\n\t\n\t\t\tScreenShot screen = new ScreenShot();\n\n\t\t\t// Utilize the driver and invoke the chrome browser\n\t\t\tdriver.get(\" https://www.progressive.com/\");\n\t\t\tdriver.manage().window().maximize();\n\n\t\t\t// Wait for page to be loaded\n\t\t\tdriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n\n\t\t\t// Take a Screenshot\n\t\t\tscreen.takeSnapShot(driver, \"Progressive Insurance HomePage\");\n\t\t\t\n\t\t\tclickAutoInsurance();\t\n\t\t\n\t\t}",
"public void twoPointsHome(View view) {\r\n homeScore += 2;\r\n displayHomeScore(homeScore);\r\n }",
"@Override\r\n\t\t\tpublic void onAnimationEnd(Animation arg0) {\n\t\t\t\tIntent intent = new Intent(MainActivity.this,HomeActivity.class);\r\n\t\t\t\tintent.putExtra(\"key\", \"0\");\r\n\t\t\t\tstartActivity(intent);\r\n\t\t\t\tfinish();\r\n\t\t\t}",
"public void homeKeyAndroid() {\n ((AndroidDriver) getDriver()).pressKey(new KeyEvent().withKey(AndroidKey.HOME));\n }",
"public void goToHomePage(View view)\n {\n Intent intent = new Intent( this, HomeActivity.class );\n startActivity( intent );\n }",
"@Override\r\n public void onClick(View v)\r\n {\n \r\n DJIDrone.getDjiMainController().setGohomeAltitude(50, new DJIExecuteBooleanResultCallback() {\r\n \r\n @Override\r\n public void onResult(boolean result)\r\n {\r\n // TODO Auto-generated method stub\r\n if (result) {\r\n handler.sendMessage(handler.obtainMessage(SHOWTOAST, \"Set Successfully\"));\r\n } else {\r\n handler.sendMessage(handler.obtainMessage(SHOWTOAST, \"Set Fail\"));\r\n }\r\n }\r\n });\r\n }",
"@Override\n\tpublic void goForward() {\n\t\t// check side and move the according room and side\n\t\tif (side.equals(\"hRight\")) {\n\t\t\tthis.side = \"bFront\";\n\t\t\tthis.room = properties.getRoomFromProperties().get(3);\n\n\t\t} else if (side.equals(\"hFront\")) {\n\t\t\tthis.side = \"mFront\";\n\t\t\tthis.room = properties.getRoomFromProperties().get(2);\n\n\t\t} else if (side.equals(\"bLeft\")) {\n\t\t\tthis.side = \"rLeft\";\n\t\t\tthis.room = properties.getRoomFromProperties().get(4);\n\n\t\t} else if (side.equals(\"rBack\")) {\n\t\t\tthis.side = \"bBack\";\n\t\t\tthis.room = properties.getRoomFromProperties().get(3);\n\n\t\t} else if (side.equals(\"bBack\")) {\n\t\t\tthis.side = \"hLeft\";\n\t\t\tthis.room = properties.getRoomFromProperties().get(1);\n\n\t\t} else if (side.equals(\"kBack\")) {\n\t\t\tthis.side = \"lFront\";\n\t\t\tthis.room = properties.getRoomFromProperties().get(5);\n\n\t\t} else if (side.equals(\"lLeft\")) {\n\t\t\tthis.side = \"kRight\";\n\t\t\tthis.room = properties.getRoomFromProperties().get(6);\n\n\t\t} else if (side.equals(\"lBack\")) {\n\t\t\tthis.side = \"mBack\";\n\t\t\tthis.room = properties.getRoomFromProperties().get(2);\n\n\t\t} else if (side.equals(\"mFront\")) {\n\t\t\tthis.side = \"lFront\";\n\t\t\tthis.room = properties.getRoomFromProperties().get(5);\n\n\t\t} else if (side.equals(\"mBack\")) {\n\t\t\tthis.side = \"hBack\";\n\t\t\tthis.room = properties.getRoomFromProperties().get(1);\n\n\t\t} else {\n\t\t\trandomRoom();\n\t\t\tSystem.out.println(\"Entered Wormhole!\");\n\t\t\tSystem.out.println(\"Location was chosen at random\");\n\t\t\tSystem.out.println(\"New location is: \" + room + \" room and \" + side.substring(1) + \" side\");\n\n\t\t}\n\t}",
"public void makegoaway(){\n if (!started_app){ // added to prevent running two copies when user clicks to skip\n // and when time runs out for splash\n Intent mainIntent = new Intent(SplashActivity.this,MainActivity.class);\n SplashActivity.this.startActivity(mainIntent);\n SplashActivity.this.finish();\n started_app=true;\n }\n }",
"@Override\n public void onCameraIdle() {\n Location centerLocation = new Location(\"\");\n LatLng midLatLng = this.map.getCameraPosition().target;\n centerLocation.setLatitude(midLatLng.latitude);\n centerLocation.setLongitude(midLatLng.longitude);\n hitNeighboursApi(centerLocation);\n HomeActivity activity = (HomeActivity) getActivity();\n activity.setmRequestLocation(midLatLng);\n requestedLocation.setText(\"\"+centerLocation.getLatitude()+\",\"+centerLocation.getLongitude());\n\n }",
"private void jumpToRoomDetail(UnitFamilyRoomModel roomModel){\n }",
"@Override\r\n\tpublic void eventRoutine(Human human) {\n\t\tWorkwayModel m = (WorkwayModel)this.getModel();\r\n\t\t\r\n\t\tUtils.log(human, human.getName() + \"Arrived at Home BusStop at \" + human.getHomeBusStop().getName() +\" by bus\");\r\n\t\thuman.arriveAtBusStopHomeByDriving();\r\n\t\tHumanWalkFromBusStopHomeToHomeEvent e = new HumanWalkFromBusStopHomeToHomeEvent(getModel(), \"WalkFromBusStopHomeToHome\");\r\n//\t\te.schedule(human, 0);\r\n\t\tm.getComponent().synchronisedAdvancedTime(0, e, human);\r\n\t}",
"public void goBackToAppHome() {\n UiObject topNavigationBar = mDevice.findObject(new UiSelector().text(\"mytaxi demo\"));\n int backpressCounter = 0; //to avoid infinite loops\n while(!topNavigationBar.exists()) {\n mDevice.pressBack();\n backpressCounter++;\n if(backpressCounter>10)\n break;\n }\n }",
"private void goAway() {\n CollaborationConnection connection = CollaborationConnection\n .getConnection();\n Presence presence = connection.getPresence();\n if (presence.getMode().equals(Mode.available)) {\n previousPresence = presence;\n Presence newPresence = new Presence(presence.getType(),\n presence.getStatus(), presence.getPriority(), Mode.away);\n Tools.copyProperties(presence, newPresence);\n timerSetAway = sendPresence(connection, newPresence);\n }\n }",
"public void switchOn() throws RemoteHomeConnectionException {\n m.sendCommand(parseDeviceIdForMultipleDevice(getRealDeviceId()), \"l\"+getSubDeviceNumber()+\"o\");\n setCurrentState(true);\n }",
"void keyHome();",
"public void ClickHome(View view){\n MainActivity.redirectActivity(this,MainActivity.class);\n\n }",
"public void launchHomePage() {\n Intent intent = new Intent(LoginActivity.this, HomeActivity.class);\n startActivity(intent);\n }",
"@Override\r\n\tprotected void onPause() {\n\t\tsuper.onPause();\r\n\t\tLog.d(\"alex\", \"on Pause\");\r\n\t\tHomeView.home_pressed = \"wait\";\r\n\t\t}",
"public void setSenderHomePhone(java.lang.String senderHomePhone) {\r\n this.senderHomePhone = senderHomePhone;\r\n }",
"public void goTo() { // Navigate to home page\n\t\tBrowser.goTo(url);\n\t}",
"public void gotoAMazeActivity(View view) {\n\t\tIntent intent = new Intent(this, AMazeActivity.class);\n\t\tstartActivity(intent);\n\t\tLog.v(\"MainActivity\", \"Created the intent to move to AMazeActivity\");\n\t}",
"public void goToHomePage() {\n super.onBackPressed();\n }",
"@Override\n\tpublic void setHomeTeam() {\n\t\t\n\t}",
"public static void selectedHomeScreen(Activity context) {\n\n // Get tracker\n Tracker tracker = ((GlobalEntity) context.getApplicationContext())\n .getTracker(TrackerName.APP_TRACKER);\n if (tracker == null) {\n return;\n }\n\n // Build and send an Event\n tracker.send(new HitBuilders.EventBuilder()\n .setCategory(\"Selected Home Screen\")\n .setAction(\"homeScreenSelect\")\n .setLabel(\n \"homeScreenSelect: \"\n + NavDrawerHomeScreenPreferences\n .getUserHomeScreenChoice(context))\n .build());\n }",
"public void go_to_switch_position() {\n stop_hold_arm();\n Dispatcher.get_instance().add_job(new JMoveArm(RobotMap.Arm.pot_value_switch, 0.9, 0.7, 0.7, 0.2, 0.8, false, false));\n hold_arm();\n }"
] | [
"0.77481216",
"0.74796987",
"0.7048764",
"0.69208246",
"0.68701077",
"0.6828129",
"0.6818263",
"0.6631181",
"0.6623191",
"0.65947247",
"0.6556591",
"0.6376272",
"0.6345812",
"0.6322431",
"0.6274678",
"0.6220312",
"0.6210703",
"0.61943984",
"0.61922115",
"0.618218",
"0.6176503",
"0.6131372",
"0.611695",
"0.61142546",
"0.6090639",
"0.6036339",
"0.60188526",
"0.6014043",
"0.6012248",
"0.5994502",
"0.59726006",
"0.5971718",
"0.596393",
"0.59507567",
"0.59423196",
"0.5913977",
"0.59109914",
"0.58298355",
"0.58278906",
"0.5824651",
"0.5820758",
"0.5789401",
"0.5778517",
"0.5765125",
"0.57634956",
"0.5759596",
"0.57514036",
"0.57419175",
"0.5738364",
"0.57281905",
"0.5719013",
"0.57055336",
"0.5702851",
"0.56885487",
"0.56811893",
"0.56735057",
"0.5666855",
"0.5655204",
"0.5622782",
"0.5608705",
"0.56037545",
"0.55991656",
"0.559781",
"0.5594603",
"0.5553379",
"0.5544016",
"0.5519793",
"0.5514367",
"0.5512837",
"0.5508373",
"0.5508011",
"0.54870707",
"0.54820615",
"0.5472193",
"0.5472173",
"0.5472171",
"0.5467076",
"0.54588383",
"0.5458031",
"0.54557985",
"0.5453728",
"0.5447914",
"0.54475415",
"0.5444236",
"0.54418486",
"0.5440204",
"0.54298526",
"0.54242486",
"0.54227483",
"0.53978276",
"0.5392678",
"0.5376917",
"0.5366684",
"0.53661895",
"0.53453124",
"0.5333857",
"0.53331494",
"0.5326999",
"0.53243625",
"0.53063786"
] | 0.68130887 | 7 |
isHome Checks to see if this mob is close enough to its home to count as being at home | boolean isHome(IGeneticMob geneticMob); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean getIsHome() {\n return isHome;\n }",
"public void setIsHome(boolean isHome) {\n this.isHome = isHome;\n }",
"public boolean isHome() {\n return getHomePackageNames().contains(\n mActivityManager.getRunningTasks(1).get(0).topActivity.getPackageName());\n }",
"protected boolean isHomeAsUpEnabled() {\n return true;\n }",
"public boolean isHomeLinkPresent() {\r\n\t\treturn isElementPresent(groupListSideBar.replace(\"Group List\", \"Home\"), SHORTWAIT);\r\n\t}",
"@Override\n protected boolean doTask()\n {\n if (!this.homePos.isEmpty()) return true;\n final Brain<?> brain = this.entity.getBrain();\n if (brain.hasMemoryValue(MemoryModules.GOING_HOME.get())) return true;\n if (BurrowTasks.shouldBeInside(this.world, this.burrow))\n {\n brain.setMemory(MemoryModules.GOING_HOME.get(), true);\n return true;\n }\n return false;\n }",
"boolean isValidHome(IGeneticMob geneticMob, Vec3 coords);",
"public boolean isHomeCollection();",
"public Boolean isInCurrentHome() throws CallError, InterruptedException {\n return (Boolean)service.call(\"isInCurrentHome\").get();\n }",
"boolean goHome(IGeneticMob geneticMob);",
"@Override\n\tpublic void returnHome()\n\t{\n\t\tif (!isInsideRadius(getSpawn(), 200, false, false))\n\t\t{\n\t\t\tif (Config.DEBUG)\n\t\t\t{\n\t\t\t\tLOG.debug(\"{} moving home\", getObjectId());\n\t\t\t}\n\t\t\tsetisReturningToSpawnPoint(true);\n\t\t\tclearAggroList();\n\t\t\t\n\t\t\tif (hasAI())\n\t\t\t{\n\t\t\t\tgetAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, getSpawn().getLocation());\n\t\t\t}\n\t\t}\n\t}",
"boolean wouldBeValidHome(IGeneticMob geneticMob, Vec3 coords, Block block, int metadata, TileEntity te);",
"protected boolean isHomeRefreshable()\r\n/* 92: */ {\r\n/* 93:178 */ return false;\r\n/* 94: */ }",
"public void setHome(int home) {\n m_home = home;\n }",
"public void goHome() {\n shouldWork = false;\n }",
"public static boolean isEnterHomeSent() {\n return mSent;\n }",
"public boolean isShowHomeLayout() {\n return isShowHomeLayout;\n }",
"boolean setHome(IGeneticMob geneticMob, Vec3 coords);",
"public void setHomeScore(int homeScore) {\n this.homeScore = homeScore;\n }",
"public void msgAtHome() {\n\t\tatHome.release();\n\t\tstateChanged();\n\t}",
"public void go_to_home_position() {\n stop_hold_arm();\n Pneumatics.get_instance().set_solenoids(false);\n Dispatcher.get_instance().add_job(new JMoveArm(RobotMap.Arm.pot_value_home, 0.9, 0.7, 0.7, 0.2, 0.8, false, false));\n hold_arm();\n }",
"public boolean isSetHomepage() {\n return this.homepage != null;\n }",
"boolean removeHome(IGeneticMob geneticMob);",
"public boolean verifyHomePageDisplayed(){\r\n\t\tWebDriver driver = SeleniumDriver.getInstance().getWebDriver();\r\n\t\tWebElement body;\r\n\t\ttry{\r\n\t\t\tbody = driver.findElement(By.tagName(\"body\"));\r\n\t\t\tif(body.getAttribute(\"class\").contains(\"home page\")){\r\n\t\t\t\tmyAssert.setGblPassFailMessage(\"pass\", \"UpTake home page is displayed\");\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tmyAssert.setGblPassFailMessage(\"fail\", \"UpTake home page is not displayed\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t return true;\r\n\t}",
"public void setHome(Location home) {\n this.home = home;\n }",
"public boolean isLanding() {\n\t\treturn isLanding;\n\t}",
"public int home () {\n Location center = new Location(myCenterXValue, myCenterYValue);\n int distance = (int) Vector.distanceBetween(getLocation(), center);\n setLocation(center);\n resetHeading();\n return distance;\n }",
"public boolean isOnLand() {\r\n\t\treturn isOnLand;\r\n\t}",
"public static void home(String homeName, Player player) {\n UUID Id = player.getUniqueId();\n World w = Bukkit.getServer().getWorld(FileManager.getHomeYml().getString(\"HOMES.\" + Id + \".\" + homeName + \".world\"));\n double x = FileManager.getHomeYml().getDouble(\"HOMES.\" + Id + \".\" + homeName + \".x\");\n double y = FileManager.getHomeYml().getDouble(\"HOMES.\" + Id + \".\" + homeName + \".y\");\n double z = FileManager.getHomeYml().getDouble(\"HOMES.\" + Id + \".\" + homeName + \".z\");\n int ya = FileManager.getHomeYml().getInt(\"HOMES.\" + Id + \".\" + homeName + \".yaw\");\n int pi = FileManager.getHomeYml().getInt(\"HOMES.\" + Id + \".\" + homeName + \".pitch\");\n player.teleport(new Location(w, x, y, z, ya, pi));\n if (Main.plugin.getConfig().getString(\"NOTIFICATIONS.Home\").equalsIgnoreCase(\"True\")) {\n String original = MessageManager.getMessageYml().getString(\"Home.Home\");\n String replaced = original.replaceAll(\"%home%\", homeName);\n player.sendMessage(MessageManager.getPrefix() + ChatColor.translateAlternateColorCodes('&', replaced));\n }\n }",
"public void onePointHome(View view) {\r\n homeScore += 1;\r\n displayHomeScore(homeScore);\r\n }",
"public Location getHome() {\n return home;\n }",
"@Override\n public void home() {\n System.out.println(\"They live underground.\");\n }",
"public void pressHomeButton() {\n System.out.println(\"TV is already on the home screen\\n\");\n }",
"public void verifyUserIsOnHomepage()\n {\n asserttextmessage(getTextFromElement(_welcomeTileText),expected,\"user on home page\");\n\n }",
"public void setAPIManagerIsHome(boolean apiManagerIsHome)\n {\n this.apiManagerIsHome = apiManagerIsHome;\n }",
"private void stateReturnToHomeBase() {\n\t\tif (isCloserToBall()) {\n\t\t\tstate = State.ATTACKING;\n\t\t\treturn;\n\t\t}\n\n\t\tif (!isCloseTo(playerDeafaultPosition)) {\n\t\t\tif (isAlignedTo(playerDeafaultPosition)) {\n\t\t\t\tcommander.doDashBlocking(50.0d);\n\t\t\t} else {\n\t\t\t\tturnTo(playerDeafaultPosition);\n\t\t\t}\n\t\t}\n\t}",
"public int getHome() {\n return m_home;\n }",
"@Override\n public void pressHomeButton() {\n System.out.println(\"TV is already on the home screen\\n\");\n tv.setState(tv.getHomeState());\n }",
"public boolean isGoal() {\n return hamming == 0;\n }",
"public boolean isGoal() {\n\t\treturn hamming == 0;\n\t}",
"@Override\n\tpublic void returnHome()\n\t{\n\t\tif(_returnHome && !isInsideRadius(getSpawn().getLocx(), getSpawn().getLocy(), 150, false))\n\t\t{\n\t\t\tclearAggroList();\n\t\t\tgetAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, getSpawn().getLoc());\n\t\t}\n\t}",
"private void returnHome(){\n if (Boolean.toString(UpdatedHomePage.updatedHomeStarted).equals(\"false\")) {\n startActivity(new Intent(FinalPlan.this, Home.class));\n } else {\n Intent intent = new Intent(this, UpdatedHomePage.class);\n Bundle extras = new Bundle();\n extras.putBoolean(\"filtered\", true);\n intent.putExtras(extras);\n startActivity(intent);\n }\n }",
"@Given(\"I am on Magalu HomePage\")\n\tpublic void i_am_on_the_homepage() {\n\t\tdriver.get(Homeurl);\n\t}",
"public boolean isGoal() {\n return hamming() == 0;\n }",
"public boolean isGoal() {\n return hamming() == 0;\n }",
"public boolean isGoal() {\n return hamming() == 0;\n }",
"public boolean isGoal() {\n return hamming() == 0;\n }",
"public boolean isGoal() {\n return hamming() == 0;\n }",
"public boolean isGoal() {\n return hamming() == 0;\n }",
"public void setHomeNumber(String homeNumber) {\r\n this.homeNumber = homeNumber;\r\n }",
"public void goHome() {\r\n\t\tif (mActivity instanceof DashboardActivity) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tfinal Intent intent = new Intent(mActivity, DashboardActivity.class);\r\n\t\tintent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\r\n\t\tmActivity.startActivity(intent);\r\n\r\n\t}",
"@Override\n\tpublic void setDisplayHomeAsUpEnabled(boolean showHomeAsUp) {\n\t\t\n\t}",
"public ReturnHome() {\n addSequential(new SetShooterPos(Constants.shooterHome));\n addParallel(new HoldIntakePosition(Constants.intakeArmHome));\n addSequential(new WaitCommand(1.5));\n addSequential(new StopChassisIntake());\n }",
"@Override\n\tpublic boolean goHomePage(PageContext context) {\n\t\treturn false;\n\t}",
"private Home getHome(final Context ctx)\r\n {\r\n return (Home) ctx.get(this.homeKey_);\r\n }",
"public void checkIfShowerOn(){\n double currentSMA = mySMA.currentAverage();\n Log.d(LOGTAG,\"currentSMA: \"+currentSMA);\n Log.d(LOGTAG,\"isShowerOn: \"+ isShowerOn);\n if (currentSMA>SMA_THRESHOLD && !isShowerOn){\n //Initialize stuff to do once shower is on\n isShowerOn=true;\n startShower();\n } else if (currentSMA<SMA_THRESHOLD && isShowerOn){\n //Shutdown\n isShowerOn=false;\n endShower();\n }\n }",
"@Override\n\tpublic void setDisplayShowHomeEnabled(boolean showHome) {\n\t\t\n\t}",
"public String getHomeNumber() {\r\n return homeNumber;\r\n }",
"public boolean check_Home_Buttom_AppBar_Presence() {\r\n\t\tWebElement bottomMenu_Home_Icon = driver.findElementByAccessibilityId(\"HomeAppBarButton\");\r\n\t\treturn IsElementVisibleStatus(bottomMenu_Home_Icon);\r\n\t}",
"public boolean isFullHouse(){\n // TODO\n return false;\n }",
"boolean isHomeIconEnabled()\n {\n return configfile.home_enabled;\n }",
"public boolean isMobHead() {\n return this.type == Type.MOBHEAD;\n }",
"public void setHomeAddress(String homeAddress) {\n this.homeAddress = homeAddress == null ? null : homeAddress.trim();\n }",
"boolean isFullHouse();",
"public void clickOnHome() {\n\t\twait.waitForStableDom(250);\n\t\tisElementDisplayed(\"link_home\");\n\t\twait.waitForElementToBeClickable(element(\"link_home\"));\n\t\texecuteJavascript(\"document.getElementById('doctor-home').getElementsByTagName('i')[0].click();\");\n//\t\t element(\"link_home\").click();\n\t\tlogMessage(\"user clicks on Home\");\n\t}",
"public String getHomeNum() {\n return homeNum;\n }",
"private void checkToHome() {\n toolbar.setTitle(R.string.find_food);\n homeFragment = new HomeFragment();\n if (searchMenuItem != null) {\n searchMenuItem.setVisible(true);\n }\n displaySelectedFragment(homeFragment);\n }",
"public boolean land() {\n\t\treturn ( Math.random() > this.crashProb);\r\n\t}",
"public boolean land() {\n\t\treturn (Math.random() > this.crashProb);\r\n\t}",
"private boolean setAway(boolean on) throws Exception {\n\t\tInteger hoursAway;\n\n\t\ttry {\n\t\t\thoursAway = Integer.parseInt(SettingsManager.getStringValue(this.getIdentifier(), Settings.HOURS_AWAY.get()));\n\t\t}catch (Exception e) {\n\t\t\thoursAway = 0;\n\t\t}\n\n\t\tboolean returnBoolean;\n\t\tCalendar endTime = null;\n\t\tif (hoursAway > 0) {\n\t\t\tendTime = Calendar.getInstance();\n\t\t\tendTime.setTime(new Date());\n\t\t\tendTime.add(Calendar.HOUR_OF_DAY, hoursAway);\n\t\t\treturnBoolean = this.setAway(on, endTime.getTime());\n\t\t} else {\n\t\t\treturnBoolean = this.setAway(on, null);\n\t\t}\n\n\t\tif (returnBoolean && on) {\n\t\t\tClientNotificationMessage notificationMessage = new ClientNotificationMessage();\n\t\t\tnotificationMessage.controlIdentifiers = this.values.get(this.AWAY_ACTIVE).controlIdentifiers;\n\t\t\tnotificationMessage.notificationType = MobileNotificationTypes.DATE_TIME_PICKER;\n\t\t\tnotificationMessage.subtitle = \"When will you be back home?\";\n\t\t\tnotificationMessage.title = \"Away mode activated\";\n\t\t\tif (endTime != null) {\n\t\t\t\tnotificationMessage.message = \"Until \" + new SimpleDateFormat(\"HH:mm, dd/MM\").format(endTime.getTime()) + \". Click to change\";\n\t\t\t\tnotificationMessage.startDate = new Date().getTime();\n\t\t\t}\n\t\t\tPushNotificationService.getInstance().sendMessage(notificationMessage);\n\t\t} else if (returnBoolean && !on) {\n\t\t\tClientNotificationMessage notificationMessage = new ClientNotificationMessage();\n\t\t\tnotificationMessage.controlIdentifiers = this.values.get(this.AWAY_ACTIVE).controlIdentifiers;\n\t\t\tnotificationMessage.notificationType = MobileNotificationTypes.DATE_TIME_PICKER;\n\t\t\tnotificationMessage.cancel = true;\n\t\t\tPushNotificationService.getInstance().sendMessage(notificationMessage);\n\t\t}\n\t\treturn returnBoolean;\n\t}",
"public void setSenderHomePhone(java.lang.String senderHomePhone) {\r\n this.senderHomePhone = senderHomePhone;\r\n }",
"public void goHome();",
"public int getHomeScore() {\n return homeScore;\n }",
"public interface MotorHomeInteraction {\n void onMotorHomeInteraction(int status, Object object);\n }",
"public boolean isGoal() {\n return hamming() == 0; // Board is solved if hamming distance is 0\n }",
"boolean hasHeadGear();",
"public HomeGroup getHomeGroup() {\n\t\treturn homeGroup;\n\t}",
"protected Object getHome()\r\n/* 75: */ throws NamingException\r\n/* 76: */ {\r\n/* 77:159 */ if ((!this.cacheHome) || ((this.lookupHomeOnStartup) && (!isHomeRefreshable()))) {\r\n/* 78:160 */ return this.cachedHome != null ? this.cachedHome : lookup();\r\n/* 79: */ }\r\n/* 80:163 */ synchronized (this.homeMonitor)\r\n/* 81: */ {\r\n/* 82:164 */ if (this.cachedHome == null)\r\n/* 83: */ {\r\n/* 84:165 */ this.cachedHome = lookup();\r\n/* 85:166 */ this.createMethod = getCreateMethod(this.cachedHome);\r\n/* 86: */ }\r\n/* 87:168 */ return this.cachedHome;\r\n/* 88: */ }\r\n/* 89: */ }",
"public boolean doPowerUpStuff() {\n System.out.println(\"* Performing robot stuff that we would do on power up.\");\n // Home motors, move stuff to starting position, etc.\n // System.out.println(\"Robot wheelbase in inches: \" + m_robotGeometry.wheelbaseInches);\n return true;\n }",
"private void visitPatientAtHome(Patient patient) {\n patient.setHomeVisited(true);\n }",
"private void shouldDisplayHomeUp() {\n boolean back = getSupportFragmentManager().getBackStackEntryCount() > 0;\n getSupportActionBar().setDisplayHomeAsUpEnabled(back);\n }",
"public boolean isGoal() {\n return humming() = 0;\n }",
"@Override\n\tpublic void goHome() {\n\t\tSystem.out.println(\"回窝了!!!!\");\n\t}",
"public boolean avengersAlive() {\n\t\tif (avengersHp <= 0) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"public boolean isGoal() {\n return (man == 0);\n }",
"public Home clickonHome()\n\t{\n\t\tdriver.findElement(By.xpath(home_xpath)).click();\n\t\treturn new Home(driver);\n\t}",
"public static boolean matchesHomeBinding(int givenStateMask, int givenKeyCode) {\n int requiredStateMask = 0;\n int requiredKeyCode = SWT.HOME;\n\n if (Platform.isWindows() || Platform.isLinux()) {\n requiredStateMask = SWT.ALT;\n }\n\n if (Platform.isMac()) {\n requiredStateMask = SWT.COMMAND;\n }\n\n return ((requiredStateMask + requiredKeyCode) == (givenStateMask + givenKeyCode));\n }",
"public boolean isOnGround() {\n return this.sim_pos.getY() <= 2;\n }",
"private void prepareAndShowHomeScreen() {\n\t\tFraHeader header = FraHeader.newInstance(true);\n\t\theader.showBackButton(false);\n\t\tFraHomeContent homeContent = FraHomeContent.newInstance();\n\t\tFraFooter footer = FraFooter.newInstance(FooterIcons.TOP10);\n\t\tFraSearch search = FraSearch.newInstance();\n\t\tFraFont font = FraFont.newInstance();\n\t\tFraShare share = FraShare.newInstance();\n\n\t\treplaceScreenWithNavBarContentAndMenu(header, FraHeader.TAG,\n\t\t\t\thomeContent, FraHomeContent.TAG, footer, FraFooter.TAG,\n\t\t\t\tFraMenu.newInstance(), FraMenu.TAG, search, FraSearch.TAG,\n\t\t\t\tfont, FraFont.TAG, share, FraShare.TAG, false);\n\t\tprepareAndShowHomeScreen(false);\n\t\t/*\n\t\t * replaceScreenWithNavBarContentAndFooter(homeContent,\n\t\t * FraHomeContent.TAG, footer, FraFooter.TAG, false);\n\t\t */\n\t}",
"private boolean isNeedFreshForHighlight(boolean isLand) {\n if (CommonUtilMethods.calcIfNeedSplitScreen() && isLand && (getActivity() instanceof PeopleActivity) && ((PeopleActivity) getActivity()).getNeedMaskDialpad()) {\n return true;\n }\n return false;\n }",
"public void twoPointsHome(View view) {\r\n homeScore += 2;\r\n displayHomeScore(homeScore);\r\n }",
"public boolean is_full(){\n return this.habitant.size() >= Constantes.HOUSE_FULL;\n }",
"public static boolean isLoadForHome() {\n boolean isSupport = 1 == SystemProperties.getInt(\n \"ro.mtk_c2k_om_nw_sel_type\", 0) ? false : true;\n Log.d(TAG, \"isLoadForHome(): \" + isSupport);\n return isSupport;\n }",
"@When(\"I am on Home page\")\n public void homepage_i_am_on_home_page() {\n homePage = new HomePage(driver);\n homePage.check_page_title();\n }",
"public void goHome(View view) {\n String toastString = \"go home...\";\n Toast.makeText(FriendsList.this,toastString, Toast.LENGTH_SHORT).show();\n\n //TODO\n // go to list screen....\n Intent goToNextScreen = new Intent (this, AccountAccess.class);\n final int result = 1;\n startActivity(goToNextScreen);\n }",
"public void clickHome(){\n try{\n Thread.sleep(500);\n new WebDriverWait(this.driver, 15)\n .until(ExpectedConditions.elementToBeClickable(this.home)).click();\n } catch (Exception e){\n System.out.println(e.getMessage());\n }\n }",
"public boolean isLegOut()\n{\n if (jumpState == 1)\n return true;\n return false;\n}",
"public void verifyHomeItemIsSelectedByDefault() {\n\t\tmoveToElement(ActiveHome);\n\t\tAssert.assertTrue(isElementPresent(ActiveHome));\n\t\treportInfo();\t\t\n\t}",
"public void home ()\r\n\t{\r\n\t\tthis.sector = this.head = this.cylinder = 0;\r\n\t}",
"private void StartHomeActivity() {\n Intent intent = new Intent(this, PrivateGlobalActivity.class);\n intent.putExtra(ApiKeys.MANAGE_DEVICE_SSID, breathiWifiSSID);\n intent.putExtra(ApiKeys.MANAGE_DEVICE_PASSWORD, airOwlWifiPass);\n intent.putExtra(ApiKeys.MANAGE_DEVICE_ID, deviceId);\n intent.putExtra(ApiKeys.MANAGE_DEVICE_TYPE, type);\n intent.putExtra(ApiKeys.MANAGE_DEVICE_NAME, deviceName);\n startActivity(intent);\n }"
] | [
"0.7159767",
"0.7037034",
"0.6904173",
"0.6386713",
"0.63694566",
"0.62990826",
"0.6237692",
"0.618573",
"0.61616707",
"0.6161035",
"0.6138407",
"0.6136529",
"0.61137396",
"0.61113036",
"0.61055124",
"0.60961914",
"0.6070881",
"0.6067027",
"0.60661554",
"0.6011901",
"0.5985267",
"0.59444326",
"0.5932806",
"0.5886499",
"0.5864916",
"0.58630264",
"0.58626246",
"0.5857004",
"0.5844954",
"0.58242494",
"0.5791693",
"0.57881963",
"0.5784986",
"0.5777274",
"0.5759842",
"0.57534647",
"0.5728529",
"0.5727587",
"0.5712613",
"0.5701524",
"0.56960905",
"0.5668733",
"0.56542504",
"0.5602241",
"0.5602241",
"0.5602241",
"0.5602241",
"0.5602241",
"0.5602241",
"0.5567897",
"0.5562381",
"0.556192",
"0.5559288",
"0.5558329",
"0.55578667",
"0.55545306",
"0.554347",
"0.5531555",
"0.5508495",
"0.5508128",
"0.54911244",
"0.5474516",
"0.5447451",
"0.54474324",
"0.54454374",
"0.5441153",
"0.5421876",
"0.5392873",
"0.53866726",
"0.5382644",
"0.53738654",
"0.53721976",
"0.5358992",
"0.5344103",
"0.5339319",
"0.53313565",
"0.5324373",
"0.5321997",
"0.53219545",
"0.5314865",
"0.53117007",
"0.53091925",
"0.5307952",
"0.52983755",
"0.52980465",
"0.52895087",
"0.5284903",
"0.52813154",
"0.5276583",
"0.52722466",
"0.5262236",
"0.5251857",
"0.5251305",
"0.5243364",
"0.52387214",
"0.5218356",
"0.52160215",
"0.5209597",
"0.5206812",
"0.52032346"
] | 0.734149 | 0 |
getting all the matches | @Override
public void onResults(Bundle results) {
ArrayList<String> matches = results
.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);
//displaying the first match
if (matches != null)
editText.setText(matches.get(0));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Match getMatches();",
"public List<Match> getAllMatches() {\n\t\treturn matchers.stream()\n\t\t\t\t.flatMap(m -> m.getMatches().stream())\n\t\t\t\t.distinct()\n\t\t\t\t.collect(Collectors.toList());\n\t}",
"public List<Match> listAllMatch() {\n\t\treturn matchDao.list(\"from Match\");\r\n\t}",
"public List<Match> getAllMatch() {\n return matchRepository.selectAllMatchesFromDatabase();\n }",
"Match getResultMatch();",
"public static ArrayList<RegexResult> getMatches(String text, String regex) {\n Pattern pattern = Pattern.compile(regex);\n Matcher matcher = pattern.matcher(text);\n // Check all occurrences\n\n ArrayList<RegexResult> results = new ArrayList<>();\n\n while (matcher.find()) {\n results.add(new RegexResult(matcher.group(), matcher.start(), matcher.end()));\n //System.out.print(\"Start index: \" + matcher.start());\n //System.out.print(\" End index: \" + matcher.end());\n //System.out.println(\" Found: \" + matcher.group());\n }\n\n return results;\n }",
"public ArrayList<Shout> getMatches(Pattern pattern, String text) {\r\n\t\tArrayList<Shout> matches = new ArrayList<Shout>();\r\n\t\tMatcher m = pattern.matcher(text);\r\n//\t\tint match= 0;\r\n\t\twhile(m.find()){\r\n//\t\t\tLog.i(\"FUCKING WORK\", \"a: \" + m.start());\r\n\t\t\tmatches.add(new Shout(Integer.parseInt(m.group(1)), m.group(2), m.group(3)));\r\n//\t\t\tmatch++;\r\n\t\t}\r\n\t\treturn matches;\r\n\t}",
"public MyStringBuilder2 [] regMatch(String [] pats)\n\t{\n\t\t//System.out.print(\"hi\");\n\t\t\tMyStringBuilder2[] answers = new MyStringBuilder2[pats.length];\n\t\t\tMyStringBuilder2[] finals = new MyStringBuilder2[pats.length];\n\t\t\tfinals = recursiveArrayAdd(finals, pats, 0);\n\t\t\tif(finals[0] == null) {\n\t\t\t\tfinals = null;\n\t\t\t}\n\t\t\treturn finals;\n\t\t\n\t}",
"ArrayList<Match> getMatchList( Filter filter ) {\n return list;\n }",
"private void extractAllCitations() {\r\n try {\r\n // gets all matched objects for extracting All Citations.\r\n Matcher matcherObject = matcher.patternMatcher(\"AllCitations\");\r\n\r\n\r\n while (matcherObject.find()) {\r\n allMatches.add(matcherObject.group(1));\r\n }\r\n\r\n // add all citations from allMatches, add it to outputResult\r\n if (!allMatches.isEmpty()) {\r\n format.Formatter(2, allMatches.get(0));\r\n }\r\n \r\n\r\n } catch (Exception e) {\r\n System.out.println(\"Error has occured in extractAllCitations method\");\r\n }\r\n }",
"public static List<String> get_matches(String s, String p) {\n List<String> matches = new ArrayList<String>();\r\n Matcher m = Pattern.compile(p).matcher(s);\r\n while (m.find()) {\r\n matches.add(m.group(1));\r\n }\r\n return matches;\r\n }",
"static Collection readMatches(Node nMagic, MagicImpl magic) {\n\t\t// get match nodes\n\t\tNode[] matches = getChildNodes(nMagic, \"match\");\n\t\tArrayList ret = new ArrayList(matches.length);\n\t\tfor (int i = 0; i < matches.length; i++) {\n\t\t\t// get attributes from match\n\t\t\tNode nMatch = matches[i];\n\t\t\tNamedNodeMap attrs = nMatch.getAttributes();\n\t\t\tNode nAttr = attrs.getNamedItem(\"type\");\n\t\t\tError.assertTrue(nAttr != null, \"Match does not contain type!\" + nMagic);\n\t\t\tString sType = nAttr.getNodeValue();\n\t\t\tint type = magic.typeToType(sType);\n\n\t\t\tnAttr = attrs.getNamedItem(\"offset\");\n\t\t\tError.assertTrue(nAttr != null, \"Match does not contain offset!\" + nMagic);\n\t\t\tString offset = nAttr.getNodeValue();\n\t\t\tint pos = offset.indexOf(':');\n\t\t\tint offsetStart = 0, offsetEnd = 0;\n\t\t\tif(pos < 0) {\n\t\t\t\toffsetStart = Integer.parseInt(offset);\n\t\t\t\toffsetEnd = offsetStart;\n\t\t\t} else {\n\t\t\t\toffsetStart = Integer.parseInt(offset.substring(0, pos));\t\t\t\t\n\t\t\t\toffsetEnd = Integer.parseInt(offset.substring(pos + 1));\n\t\t\t}\n\t\t\t\t \n\t\t\tnAttr = attrs.getNamedItem(\"value\");\n\t\t\tError.assertTrue(nAttr != null, \"Match does not contain value!\" + nMagic);\n\t\t\tString sValue = nAttr.getNodeValue();\n\t\t\tbyte[] value = ByteHelper.decode(-1, sValue, BIGENDIAN); \n\t\t\t\n\t\t\tnAttr = attrs.getNamedItem(\"mask\");\n\t\t\tString sMask = null;\n\t\t\tbyte[] mask = null;\n\t\t\tif(nAttr != null) {// mask is optional\n\t\t\t\tsMask = nAttr.getNodeValue();\n\t\t\t\tmask = ByteHelper.decode(-1, sMask, BIGENDIAN);\n\t\t\t}\n\t\t\t\n\t\t\tMatchImpl match = magic.addMatchImpl(type, offsetStart, offsetEnd, value, mask);\n\t\t\t// read sub matches\n\t\t\treadMatches(nMatch, match);\n\t\t}\n\t\t\n\t\treturn ret;\n\t}",
"public Map<String, Match> getReferenceMatches();",
"@Override\n public Set<Restaurant> getMatches(String queryString) {\n\n /* Setup grammar listener */\n CharStream stream = new ANTLRInputStream(queryString);\n QueryLexer lexer = new QueryLexer(stream);\n TokenStream tokens = new CommonTokenStream(lexer);\n QueryParser parser = new QueryParser(tokens);\n ParseTree tree = parser.root();\n ParseTreeWalker walker = new ParseTreeWalker();\n\n // Setup custom walker\n QueryCreator creator = new QueryCreator();\n walker.walk(creator, tree);\n\n Set<Restaurant> matches = new HashSet<Restaurant>();\n RestaurantHandle rH = creator.getHandle();\n Expression expTree = creator.getExpression();\n\n // Look through every restaurant, if one matches query add it to the set\n for (Restaurant r : this.restaurantMap.values()) {\n rH.setRestaurant(r);\n if (expTree.eval()) {\n matches.add(r);\n }\n }\n\n return matches;\n }",
"Match getCompleteMatch();",
"public static void main(String[] args) {\n\t\t Pattern p = Pattern.compile(\"(a+)\");\r\n\t\t Matcher m = p.matcher(\"aaaaaba\");\r\n\t\t //System.out.println(m.matches())\r\n\t\t m.find();\t\t \r\n\t\t m.find();\r\n\t\t System.out.println(\"grCount \"+m.groupCount());\t \r\n\t\t MatchResult mr = m.toMatchResult();\r\n\t\t \r\n\t\t System.out.println(m.end());\r\n\t\t System.out.println(\"'\"+mr.group()+\"'\");\r\n\t\t System.out.println(\"start \"+mr.start(1));\r\n\t\t \r\n\t}",
"List<T> findMatches(final String value);",
"public List<HashSet<Integer>> findMatchesAC(String text) {\n ArrayList<HashSet<Integer>> matches = new ArrayList<>();\n for (String s : words)\n matches.add(new HashSet<>());\n Node activeNode = root;\n for (int i = 0; i < text.length(); ++i) {\n char c = text.charAt(i);\n while (!activeNode.hasEdge(c)) {\n if (activeNode == root)\n break;\n else\n activeNode = activeNode.getFailureLink();\n }\n //If activeNode has an edge matching the current char inspected, follow it\n if (activeNode.hasEdge(c))\n activeNode = activeNode.getEdge(c).getTo();\n //If activeNode now corresponds to a word, save the match\n if (activeNode.isWordEnd())\n matches.get(activeNode.getWordIndex()).add(i - activeNode.getDepth() + 1);\n //Follow any valid chain of dictionary links to save these possible matches\n Node dictNode = activeNode.getDictionaryLink();\n while (dictNode != null) {\n matches.get(dictNode.getWordIndex()).add(i - dictNode.getDepth() + 1);\n dictNode = dictNode.getDictionaryLink();\n }\n }\n return matches;\n }",
"public abstract Collection<T> getMatches(T first);",
"public ArrayList<String> getKeywordExactMatch(String word, ArrayList<String> allkeywords){\n ArrayList<String> arrayListResult = new ArrayList<String> ();\n ArrayList<String> ngramList;\n ArrayList<String> keywordList;\n int equalKeys = 0, ngramListSize;\n\n ngramList = processWord(word, \"_\");\n ngramListSize = ngramList.size();\n\n for (int iterator = 0; iterator<ngramListSize; iterator++)\n System.out.print(\"ngram\"+iterator+\":\"+ngramList.get(iterator)+\";\");\n System.out.print(\"\\n\");\n\n if (!allkeywords.isEmpty()) \n for (int i=0, i2 = allkeywords.size();i<i2;i++){\n keywordList = processWord(allkeywords.get(i), \" \");\n\n if (ngramListSize == keywordList.size())\n for (int h=0; h<ngramListSize;h++){\n if ( keywordList.get(h).startsWith(ngramList.get(h)) ){\n equalKeys++;\n System.out.println(\"keywordList»\"+keywordList+\"«ngramsList»\"+ngramList.get(h)+\"«equalKeys:\"+equalKeys);\n }\n else\n h = ngramListSize+999;\n }\n if (equalKeys == ngramListSize){\n arrayListResult.add(allkeywords.get(i));\n System.out.println(\"Added: \"+allkeywords.get(i));\n }\n equalKeys = 0;\n }\n return arrayListResult;\n }",
"private static List<String> getAllMatches(final String page, final String pattern, final int group)\n {\n if (page == null || page.length() == 0)\n {\n return Collections.emptyList();\n }\n\n final List<String> trimmedMatches = new ArrayList<String>();\n final List<String> matches = RegExUtils.getAllMatches(page, \"(?is)\" + pattern, group);\n\n for (int i = 0; i < matches.size(); i++)\n {\n final String s = matches.get(i);\n\n final String trimmed = s.trim();\n if (trimmed.length() > 0)\n {\n trimmedMatches.add(trimmed);\n }\n }\n\n return trimmedMatches;\n }",
"java.util.List<org.sas04225.proto.LookupResultProto.DMatch> \n getMatchesList();",
"private static Message[] extractAllMatches(MessageKind kind, Mailbox incoming) {\n int count = 0;\n // Count the number of matches\n for (int i = 0; i != incoming.size(); ++i) {\n Message ith = incoming.read(i);\n if (ith.getKind() == kind) {\n count = count + 1;\n }\n }\n // Now, construct resulting array\n Message[] matches = new Message[count];\n int index = 0;\n for (int i = 0; i != incoming.size(); ++i) {\n Message ith = incoming.read(i);\n if (ith.getKind() == kind) {\n matches[index++] = ith;\n }\n }\n return matches;\n }",
"public abstract Match match();",
"int getMatchedElements();",
"@SuppressWarnings(\"unchecked\")\n\tpublic JSONArray findMatches(String query){\n\t\t\n\t\t// Increment the search tasks counter\n\t\t++numOfSearchTasks;\n\t\t\n\t\t// Start the timer for this task\n\t\tTimer.start();\n\t\t\n\t\t// Number of needed matches\n\t\tresultsToBeFound = 10;\n\t\t\n\t\t// Clear the matches list\n\t\tsetForTypeahead.clear();\n\t\t\n\t\t// The returned JSON array\n\t\tJSONArray arrayObj = new JSONArray();\n\t\t\n\t\t// Search in all predicates\n\t\tfor(int i = 0; i < predicatesList.size(); ++i){\n\t\t\tif(predicatesList.get(i).toLowerCase().contains(query.toLowerCase())){\n\t\t\t\tarrayObj.add(predicatesList.get(i));\n\t\t\t}\n\t\t\tArrayList<String> semanticRelations = semanticRelationsMap.get(query.toLowerCase());\n\t\t\tif(semanticRelations != null) {\n\t\t\t\tfor(String s : semanticRelations) {\n\t\t\t\t\tif(predicatesList.get(i).toLowerCase().contains(s.toLowerCase())){\n\t\t\t\t\t\tarrayObj.add(predicatesList.get(i));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Start the timer for this task\n\t\tTimer.start();\n\t\t\n\t\t// Search in index first\n\t\tCollection<Integer> list = in.search(query.toLowerCase());\n\t\tHashSet<Integer> output = null;\n\t\tif(list.size() > 0) {\n\t\t\toutput = (HashSet<Integer>) list;\n\t\t}\n\t\telse {\n\t\t\toutput = new HashSet<Integer>();\n\t\t}\n\n\t\t// If found a match, that's a hit\n\t\tif(output.size() > 0) {\n\t\t\t++numOfIndexHits;\n\t\t}\n\t\t\n\t\tfor(Integer index : output) {\n\t\t\tarrayObj.add(frequentLiteralsList.get(index));\n \t\t--resultsToBeFound;\n \t}\n\t\tdouble tempStopTime;\n\t\t// If all results were found in suffix tree\n\t\tif(resultsToBeFound < 0) {\n\t\t\tTimer.stop();\n\t\t\tsuffixTreeTime += Timer.getTimeInSeconds();\n\t\t\ttotalTime += Timer.getTimeInSeconds();\n\t\t\twriteStatsToFile();\n\t\t\treturn arrayObj;\n\t\t}\n\t\t\n\t\tTimer.stop();\n\t\tsuffixTreeTime += Timer.getTimeInSeconds();\n\t\ttempStopTime = Timer.getTimeInSeconds();\n\t\tTimer.start();\n\t\t// In length bins\n\t\t// Search in bins with a minimum length of the query\n\t\t// and a maximum of the query length + 10\n\t\tint minLength = query.length()-1;\n\t\tint maxLength = query.length() + 9;\n\t\t\n\t\tint minIndex = Integer.MAX_VALUE;\n\t\tint maxIndex = -1;\n\t\t\n\t\t// Determine which indices of the literals array\n\t\t// to search within\n\t\tfor(int i = 0; i < lengths.size(); ++i){\n\t\t\tif(lengths.get(i) > maxLength) {\n\t\t\t\tmaxIndex = indexes.get(i);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(minLength >= lengths.get(i)) {\n\t\t\t\tminIndex = indexes.get(i);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpruningPercentage += 1 - (1.0 * (maxIndex - minIndex) / literalsList.size());\n\t\ttry{\n\t\tSystem.out.println(\"Searching for \" + query + \" between indeces: \" + minIndex + \n\t\t\t\t\" corresponding to length \" + (literalsList.get(minIndex).length()-5) +\n\t\t\t\t\" and \" + maxIndex + \" corresponding to length \" + \n\t\t\t\t(literalsList.get(maxIndex).length()-5));\n\t\t}\n\t\tcatch(IndexOutOfBoundsException e) {\n\t\t\tSystem.out.println(\"query = \" + query);\n\t\t\tSystem.out.println(\"minIndex = \" + minIndex);\n\t\t\tSystem.out.println(\"maxIndex = \" + maxIndex);\n\t\t}\n\t\t\n\t\t// Assign threads to search tasks\n\t\tint indexesPerThread = (maxIndex - minIndex) / (numOfCores);\n\t\t\n\t\t// Arraylist to keep track of threads\n\t\tArrayList<Thread> threads = new ArrayList<Thread>();\n\t\t\n\t\tfor(int i = minIndex; i < maxIndex; i += indexesPerThread) {\n\t\t\tthreads.add(new Thread(new SearchTask(i, i + indexesPerThread, query)));\n\t\t}\n\t\t\n\t\t// Start threads\n\t\tfor(int i = 0; i < threads.size(); ++i) {\n\t\t\tthreads.get(i).start();\n\t\t}\n\t\t\n\t\t// Join threads before continue\n\t\tfor(int i = 0; i < threads.size(); ++i) {\n\t\t\ttry {\n\t\t\t\tthreads.get(i).join();\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Stop timer\n\t\tTimer.stop();\n\t\ttotalTime += tempStopTime + Timer.getTimeInSeconds();\n\t\t\n\t\t// Sort by length\n\t\tArrayList<String> tempList = new ArrayList<String>();\n\t\tfor(String string : setForTypeahead) {\n\t\t\tif(!arrayObj.contains(string))\n\t\t\t\ttempList.add(string);\n\t\t}\n\t\tjava.util.Collections.sort(tempList, new LengthComparator());\n\t\t\n\t\t// Fill the array\n\t\tfor(int i = 0; i < tempList.size() && resultsToBeFound > 0; ++i, --resultsToBeFound) {\n\t\t\tarrayObj.add(tempList.get(i));\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t// Update the stats file with number of tasks and hits\n\t\twriteStatsToFile();\n\t\t\n\t\treturn arrayObj;\n\t}",
"Match getPartialMatch();",
"@Test\n public void testFindNMatches() {\n List<Path> files = new ArrayList<>();\n files.add(new File(String.join(File.separator, \"src\", \"test\", \"resources\"),\n \"logviewer-search-context-tests.log.test\").toPath());\n files.add(new File(String.join(File.separator, \"src\", \"test\", \"resources\"),\n \"logviewer-search-context-tests.log.gz\").toPath());\n\n final LogviewerLogSearchHandler handler = getSearchHandler();\n\n final List<Map<String, Object>> matches1 = handler.findNMatches(files, 20, 0, 0, \"needle\").getMatches();\n final List<Map<String, Object>> matches2 = handler.findNMatches(files, 20, 0, 126, \"needle\").getMatches();\n final List<Map<String, Object>> matches3 = handler.findNMatches(files, 20, 1, 0, \"needle\").getMatches();\n\n assertEquals(2, matches1.size());\n assertEquals(4, ((List) matches1.get(0).get(\"matches\")).size());\n assertEquals(4, ((List) matches1.get(1).get(\"matches\")).size());\n assertEquals(String.join(File.separator, \"test\", \"resources\", \"logviewer-search-context-tests.log.test\"), matches1.get(0).get(\"fileName\"));\n assertEquals(String.join(File.separator, \"test\", \"resources\", \"logviewer-search-context-tests.log.gz\"), matches1.get(1).get(\"fileName\"));\n\n assertEquals(2, ((List) matches2.get(0).get(\"matches\")).size());\n assertEquals(4, ((List) matches2.get(1).get(\"matches\")).size());\n\n assertEquals(1, matches3.size());\n assertEquals(4, ((List) matches3.get(0).get(\"matches\")).size());\n }",
"public ResultSet getMatches() throws SQLException {\n\t\tPreparedStatement statement = null;\n\t\tResultSet rs = null;\n\t\tString matchRecords_sql = \"SELECT * FROM \" + match_table;\n\t\tconnection = connector.getConnection();\n\t\tstatement = connection.prepareStatement(matchRecords_sql);\n\t\trs = statement.executeQuery();\n\t\treturn rs;\n\t}",
"public Term[] allMatches(String prefix) {\r\n if (prefix == null) {\r\n throw new java.lang.NullPointerException();\r\n }\r\n Term temporary = new Term(prefix, 0);\r\n \r\n int x = BinarySearchDeluxe.firstIndexOf(queries, temporary, Term.byPrefixOrder(prefix.length()));\r\n int y = BinarySearchDeluxe.lastIndexOf(queries, temporary, Term.byPrefixOrder(prefix.length()));\r\n \r\n if (x == -1 || y == -1) {\r\n throw new java.lang.NullPointerException();\r\n }\r\n Term[] matches = new Term[y - x + 1];\r\n matches = Arrays.copyOfRange(queries, x, y);\r\n Arrays.sort(matches, Term.byReverseWeightOrder());\r\n return matches;\r\n }",
"private List<ExactMatchResponse> getMatchingResponses(List<String> curies) {\n\t\t\n\t\tList<Graph> graphs = searchByIds( search::nodesBy, curies, NdexClient.QUERY_FOR_NODE_MATCH);\n\t\tCollection<Node> nodes = Util.flatmap( Graph::getNodes, graphs );\n\t\t\n\t\tMap<String, Set<String>> aliases = getAliases(curies, nodes);\n\t\t\n\t\tList<ExactMatchResponse> results = new ArrayList<>();\n\t\tfor (String curie : curies) {\n\t\t\tExactMatchResponse match = new ExactMatchResponse();\n\t\t\tmatch.setId(curie);\n\t\t\t\n\t\t\tcurie = curie.toLowerCase();\n\t\t\tif (aliases.containsKey(curie)) {\n\t\t\t\tmatch.setWithinDomain(true);\n\t\t\t\tList<String> exactMatches = Util.filter(Node::isCurie, aliases.get(curie));\n\t\t\t\tmatch.setHasExactMatches(exactMatches);\n\t\t\t} else {\n\t\t\t\tmatch.setWithinDomain(false);\n\t\t\t}\n\t\t\tresults.add(match);\n\t\t}\n\t\t\n\t\treturn results;\n\t}",
"public ArrayList<NameRecord> getMatches(String partialName){\n\t\tpartialName=partialName.toLowerCase();\n\t\tArrayList<NameRecord> result = new ArrayList<NameRecord>();\n\t\tfor (int i = 0;i<names.size();i++){\n\t\t\tString s = names.get(i).toLowerCase();\n\t\t\tif (s.contains(partialName)){\n\t\t\t\tresult.add(list.get(i));\n\t\t\t}\n\t\t}\t\n\t\treturn result;\n\t}",
"public static void matchMaker()\n {\n \n }",
"void matchStart();",
"public static ArrayList<Match> allMatches(String season){\n PremierLeagueManager.loadingData();\n\n // getting the clubs with the filtered matches by season\n guiSeasonFilteredClubs = getGuiSeasonFilteredClubs(season);\n\n // getting the matches filtered by season\n ArrayList<Match> matchesDisplayed = getMatchesForSeason(guiSeasonFilteredClubs);\n\n return matchesDisplayed;\n }",
"private DynamicObject getMatchResult(TruffleObject result, String inputStr) {\n return JSArray.createLazyRegexArray(context, regexResultAccessor.groupCount(result), result, inputStr);\n }",
"public Iterable<String> keysThatMatch(String pat) {\n LinkedList<String> q = new LinkedList<String>();\n collect(root, pat, \"\", q);\n return q;\n }",
"public MatchResult getResult() {\n return result;\n }",
"public Collection<T> findMatching(Collection<T> all) {\r\n // no criteria means get all\r\n if (criteria == null) {\r\n return all;\r\n }\r\n int count = -1;\r\n int startAt = 0;\r\n if (this.criteria.getStartAtIndex() != null) {\r\n startAt = this.criteria.getStartAtIndex();\r\n }\r\n int maxResults = Integer.MAX_VALUE;\r\n if (this.criteria.getMaxResults() != null) {\r\n maxResults = this.criteria.getMaxResults();\r\n }\r\n List<T> selected = new ArrayList<T>();\r\n for (T obj : all) {\r\n if (matches(obj)) {\r\n count++;\r\n if (count < startAt) {\r\n continue;\r\n }\r\n selected.add(obj);\r\n if (count > maxResults) {\r\n break;\r\n }\r\n }\r\n }\r\n return selected;\r\n }",
"public int getMatches() {\n\t\treturn matches;\n\t}",
"private List<Map<String, String>> matchAnswers(Collection<Expr> database, List<Expr> goals) {\n List<Map<String, String>> answers = matchGoals(goals, database, null).map(StackMap::flatten).collect(Collectors.toList());\n return answers;\n }",
"private static List<MatchEntity> parseLiveMatchDocumentToListMatches(Document document)\n {\n List<MatchEntity> listMatches = new ArrayList<>();\n\n if(document != null)\n {\n\n switch (Urls.SOURCE_TYPE)\n {\n case LIVEFOOTBALLVIDEO:\n // Parser Ids\n final String SELECT_LIST_MATCHES = \"div#main div.listmatch li\"; // Should return a list of li.odd\n // Get Matches Elements\n Elements elements = document.select(SELECT_LIST_MATCHES);\n\n if(elements == null || elements.isEmpty())\n {\n // Cannot parrse Matches\n return listMatches;\n }\n\n // Complete each match\n for (Element element : elements)\n {\n try\n {\n listMatches.add(parseLiveMatchLineToMatchEntity(element));\n }\n catch (Exception e)\n {\n LogUtil.e(TAG, e.getMessage(), e);\n }\n }\n break;\n\n case LIVESPORTWS:\n final String selectMatches = \"ul.events li\";\n\n // Get Matches Elements\n elements = document.select(selectMatches);\n\n if(elements == null || elements.isEmpty())\n {\n // Cannot parrse Matches\n return listMatches;\n }\n\n for (Element element : elements)\n {\n try\n {\n listMatches.add(parseLiveMatchLineToMatchEntity(element));\n }\n catch (Exception e)\n {\n LogUtil.e(TAG, e.getMessage(), e);\n }\n }\n\n break;\n }\n\n }\n\n // Check if should log data\n if(LogUtil.IS_DEBUG)\n {\n // Logo Matches\n LogUtil.d(TAG, \"Request Url: \" + REQUEST_URL + \" ResponseData: \" + GSONParser.parseListObjectToString(listMatches));\n }\n\n return listMatches;\n }",
"public static ArrayList<String> getMatches(String text, String regex) {\n\t\tArrayList<String> matches = new ArrayList<String>();\n\n\t\t// create regex pattern and matcher\n\t\tPattern pattern = Pattern.compile(regex);\n\t\tMatcher matcher = pattern.matcher(text);\n\n\t\tint index = 0;\n\n\t\t// keep going while found a match in text\n\t\twhile (index < text.length() && matcher.find(index)) {\n\n\t\t\t// store matching substring\n\t\t\tmatches.add(replaceSymbols(text.substring(matcher.start(), matcher.end())));\n\n\t\t\tif (matcher.start() == matcher.end()) {\n\t\t\t\t// advance index if matched empty string\n\t\t\t\tindex = matcher.end() + 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// otherwise start looking at end of last match\n\t\t\t\tindex = matcher.end();\n\t\t\t}\n\t\t}\n\n\t\treturn matches;\n\t}",
"public List<HashSet<Integer>> findMatches(String text) {\n ArrayList<HashSet<Integer>> matches = new ArrayList<>();\n for (String s : words)\n matches.add(new HashSet<>());\n for (int i = 0; i < text.length(); ++i) {\n Node activeNode = root;\n int offset = i;\n while (offset < text.length() && activeNode.numEdges() != 0) {\n char current = text.charAt(offset);\n if (activeNode.hasEdge(current)) {\n activeNode = activeNode.getEdge(current).getTo();\n if (activeNode.isWordEnd())\n matches.get(activeNode.getWordIndex()).add(i);\n ++offset;\n } else\n break;\n }\n }\n return matches;\n }",
"public int numMatches();",
"public ArrayList<GrammarMatch> extract(String text) {\n text = text.replaceAll(\"\\\\s+\", \" \");\n\n ArrayList<GrammarMatch> bigResult = new ArrayList();\n\n List<ParserToken> stream = this.tokenizer.transform(text);\n\n /**\n * Get morfological data for whole list of tokens\n */\n // TODO make this flexible \n // provide tagger as a parameter to parser\n // add posibility to skip tagging to boost performance\n List<AnalyzedTokenReadings> tags = null;\n\n try {\n UkrainianTagger ut = new UkrainianTagger();\n List<String> sentence = new ArrayList();\n\n stream.forEach(t -> {\n sentence.add(t.value);\n });\n\n tags = ut.tag(sentence);\n\n } catch (IOException ex) {\n Logger.getLogger(GrammarMatch.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n // merge pos tags with ParserTokens\n int currentIndex = 0;\n for (ParserToken token : stream) {\n AnalyzedTokenReadings forms = tags.get(currentIndex);\n\n if (forms != null) {\n token.setRawForms(forms);\n }\n currentIndex++;\n }\n\n // preprocess tokens\n for (ParserTokenPreprocessor preprocessor : this.preprocessors) {\n stream = preprocessor.proceed(stream);\n }\n\n // match with grammars\n// int tokenIndex = 0;\n// int lastInsertTokenIndex = 0;\n this.currentTokens = stream;\n\n for (ParserToken token : stream) {\n for (GrammarRuleI grule : this.grammars) {\n\n // TODO get rid of this. use based on interface implementation\n ParserGrammar grammar = (ParserGrammar) grule;\n\n boolean recheck = grammar.shift(token);\n // TODO substitute ParserMatch with parserToken\n ArrayList<ParserMatch> match = grammar.reduce();\n\n if (match.size() > 0) {\n bigResult.add(new GrammarMatch(grammar, match));\n }\n\n if (recheck) {\n grammar.shift(token);\n match = grammar.reduce();\n\n if (match.size() > 0) {\n bigResult.add(new GrammarMatch(grammar, match));\n }\n\n }\n\n }\n\n }\n\n // shift repeatable rules to the terminal symbol if any\n// for (GrammarRuleI gr : this.grammars) {\n//\n// visitAllRules(null,gr, (rule,parent) -> {\n// if (!rule.isSimple()) {\n//\n// ParserGrammar pg = (ParserGrammar) rule;\n// System.out.print(\" %%% -> [\"+parent+\"]\" + ((ParserGrammar) rule).getName());\n// if (pg.isRepeatable()) {\n// System.out.print(\" repeatable\");\n// if (pg.isInserted()) {\n// System.out.print(\" is_inserted\");\n// } else {\n// System.out.print(\" not_inserted\");\n//\n// if (!pg.isFirstRun() && pg.getCurrentIndex() == 0) {\n// System.out.print(\" dirty\");\n// \n// pg.setCurrentIndex(pg.rulesCount());\n// \n// if (parent != null) {\n// ParserGrammar pgp = (ParserGrammar) parent;\n// \n// \n// pgp.setCurrentIndex(pgp.getCurrentIndex()+1);\n// System.out.print(\" shift_head[\"+pgp.getCurrentIndex()+\"->\"+(pgp.getCurrentIndex()+1)+\"]\");\n// }\n// \n// \n// }\n// \n// }\n//\n// }\n// System.out.println(\"\");\n//\n// } else {\n//// System.out.println(\" [%%%] -> \");\n// }\n// });\n// }\n\n for (GrammarRuleI grule : this.grammars) {\n\n ParserGrammar grammar = (ParserGrammar) grule;\n\n ArrayList<ParserMatch> match = grammar.reduce(true, false);\n\n if (match.size() > 0) {\n bigResult.add(new GrammarMatch(grammar, match));\n\n }\n grammar.reset();\n }\n\n return bigResult;\n }",
"void findMatchings(boolean isProtein) {\n\n GraphDatabaseFactory dbFactory = new GraphDatabaseFactory();\n HashSet<String > searchSpaceList = new HashSet<>();\n GraphDatabaseService databaseService = dbFactory.newEmbeddedDatabase(graphFile);\n for (int id: queryGraphNodes.keySet()) {\n if(isProtein)\n searchSpaceList.add(queryGraphNodes.get(id).label);\n else\n searchSpaceList.add(String.valueOf(queryGraphNodes.get(id).labels.get(0)));\n }\n for(String x: searchSpaceList) {\n ResourceIterator<Node> xNodes;\n try(Transaction tx = databaseService.beginTx()) {\n xNodes = databaseService.findNodes(Label.label(x));\n tx.success();\n }\n\n while (xNodes.hasNext()) {\n Node node = xNodes.next();\n if (searchSpaceProtein.containsKey(x))\n searchSpaceProtein.get(x).add(node.getId());\n else {\n HashSet<Long> set = new HashSet<>();\n set.add(node.getId());\n searchSpaceProtein.put(x, set);\n }\n }\n\n }\n\n if(isProtein)\n search(0, databaseService, true);\n else\n search(0, databaseService, false);\n databaseService.shutdown();\n }",
"private ArrayList<String> findChampions() {\n\t\tString searchContents = search.getText();\n\t\tArrayList<String> result = new ArrayList<String>();\n\t\tfor (String c : CHAMPIONLIST) {\n\t\t\tif (c.toLowerCase().contains(searchContents.toLowerCase())) {\n\t\t\t\tresult.add(c);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}",
"public void setMatches() {\r\n this.matches++;\r\n\r\n }",
"public List<AbstractMatcher> getMatchers() {\n\t\tList<AbstractMatcher> list = new LinkedList<AbstractMatcher>();\n\t\tlist.addAll(matcherList);\n\t\t\n\t\t// HACK to show matcher\n\t\tAbstractMatcher partitionMatcher = new PartitionMatcher();\n\t\tlist.add(partitionMatcher);\n\t\t\n\t\treturn list;\n\t}",
"public java.util.List<PartialMatch> getPartialMatches() {\n return partialMatches;\n }",
"@Test\n public void testMatch()\n {\n\n List<Match> matches;\n String password;\n PasswordMatcher matcher = new SpacialMatcher();\n\n password = \"aw3ennbft6y\";\n matches = matcher.match(configuration, password);\n\n assert matches.get(0).getToken().equals(\"aw3e\");\n assert matches.get(1).getToken().equals(\"ft6y\");\n assert SpacialMatch.class.cast(matches.get(0)).getShiftedNumber() == 0;\n assert SpacialMatch.class.cast(matches.get(1)).getShiftedNumber() == 0;\n assert SpacialMatch.class.cast(matches.get(0)).getTurns() == 2;\n assert SpacialMatch.class.cast(matches.get(1)).getTurns() == 2;\n\n\n password = \"aW3ennbfT6y\";\n matches = matcher.match(configuration, password);\n\n assert matches.get(0).getToken().equals(\"aW3e\");\n assert matches.get(1).getToken().equals(\"fT6y\");\n assert SpacialMatch.class.cast(matches.get(0)).getShiftedNumber() == 1;\n assert SpacialMatch.class.cast(matches.get(1)).getShiftedNumber() == 1;\n assert SpacialMatch.class.cast(matches.get(0)).getTurns() == 2;\n assert SpacialMatch.class.cast(matches.get(1)).getTurns() == 2;\n\n\n password = \"h\";\n matches = matcher.match(configuration, password);\n\n assert matches.isEmpty();\n\n\n password = \"hl5ca\";\n matches = matcher.match(configuration, password);\n\n assert matches.isEmpty();\n }",
"public List search(String str) {\n List searchList = new ArrayList();\n try {\n //set the scanner to the entire bible file\n scan = new Scanner(new File(\"kjvdat.txt\"));\n //set the regex pattern with the search string\n Pattern p = Pattern.compile(\"(\" + str + \")\");\n //scan through the entire verses for the search parameter\n while (scan.hasNext()) {\n String txt = scan.nextLine();\n Matcher m = p.matcher(txt);\n if (m.find()) {\n //insert verses that are found into the searchlist\n searchList.add(txt.substring(0, txt.length() - 1));\n }\n }\n\n } catch (FileNotFoundException ex) {\n Logger.getLogger(Finder.class.getName()).log(Level.SEVERE, null, ex);\n }\n //return list of all verses found containing the search parameter\n scan.close();\n return searchList;\n }",
"public void sortMatches();",
"private ArrayList<String> matchingWords(String word){\n\t\tArrayList<String> list = new ArrayList<String>();\n\t\tfor(int i=0; i<words.size();i++){\n\t\t\tif(oneCharOff(word,words.get(i))){\n\t\t\t\tlist.add(words.get(i));\n\t\t\t}\n\t\t}\n\t\treturn list;\n\t}",
"private void readAllRelevantMatches(){\n\n DatabaseReference ref = db.getReference().child(\"matches\");\n\n //TODO\n //this is expensive for a huge database, but we\n //can't select matches distant x meters from the user position directly\n //in the database\n\n ref.addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n //prevent the attached listener to update the list\n //in the middle of a full read\n synchronized (FragmentAvailableMatches.this){\n matches.clear();\n for(DataSnapshot data: dataSnapshot.getChildren()){\n Match m = data.getValue(Match.class);\n boolean booked = data.child(\"members/\" + ActivityLogin.currentUserID).exists();\n assert m != null;\n //we show relevant matches only, this is self explaining\n if(m.getPlayersNumber() > 0 && m.getTimestamp() > Calendar.getInstance().getTimeInMillis() && !booked && isLocationNearby(m.getLatitude(), m.getLongitude())\n && !ActivityLogin.currentUserID.equals(m.getCreatorID()))\n addUI(m);\n }\n matchAdapter.notifyDataSetChanged();\n } //release the object only when we have read everything\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n\n }\n });\n }",
"public static String[] getPossibles(int match)\n\t{\n\t\tString[] result;\n\t\tint start;\n\t\tif(!possibleResults[match][0].equals(\"\"))\n\t\t\treturn possibleResults[match];\n\t\tArrayList<String> temp = new ArrayList<String>();\n\t\tif(match < 96)\n\t\t{\n\t\t\tstart = (match-64)*2;\n\t\t}else if(match < 112)\n\t\t{\n\t\t\tstart = (match-96)*2+64;\n\t\t}else if(match < 120)\n\t\t{\n\t\t\tstart = (match-112)*2+96;\n\t\t}else if(match < 124)\n\t\t{\n\t\t\tstart = (match-120)*2+112;\n\t\t}else if(match < 126)\n\t\t{\n\t\t\tstart = (match-124)*2+120;\n\t\t}else\n\t\t{\n\t\t\tstart = 124;\n\t\t}\n\t\tfor(int i = start; i < start+2; i++)\n\t\t{\n\t\t\tif(i < nextMatch)\n\t\t\t{\n\t\t\t\ttemp.add(results[i]);\n\t\t\t}else{\n\t\t\t\tfor(int j = 0; j < possibleResults[i].length; j++)\n\t\t\t\t{\n\t\t\t\t\ttemp.add(possibleResults[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tresult = temp.toArray(new String[temp.size()]);\n\t\t\n\t\treturn result;\n\t}",
"private ArrayList<Trie> matchAll(DotNode dotNode, int wordID) {\n ArrayList<Trie> trieList = new ArrayList<>();\n HashMap<Integer, ? extends Trie> childrenTbl = dotNode.trieNode.getChildren();\n\n if (childrenTbl != null && wordID >= 0) {\n // get all the extensions, map to string, check for *, build regexp\n for (Map.Entry<Integer, ? extends Trie> entry : childrenTbl.entrySet()) {\n Integer arcID = entry.getKey();\n if (arcID == wordID) {\n trieList.add(entry.getValue());\n } else {\n String arcWord = Vocabulary.word(arcID);\n if (Vocabulary.word(wordID).matches(arcWord)) {\n trieList.add(entry.getValue());\n }\n }\n }\n }\n return trieList;\n }",
"boolean hasMatchedElements();",
"public T[] matches(T element);",
"private void findMatches() {\n this.user.getMatches().clear();\n final String HOST_MATCH = HOST_URL + \"/match/\" + user.getId() + \"/?page=0\" + HomeView.MATCH_LIMIT;\n RequestQueue que = Volley.newRequestQueue(this);\n JsonObjectRequest req = new JsonObjectRequest(Request.Method.GET, HOST_MATCH, null,\n new Response.Listener<JSONObject>() {\n @Override\n public void onResponse(JSONObject response) {\n try { //String id, String firstName, String lastName, String email) {\n MatchView.parseEdges(response.getJSONArray(\"matches\"), toBeMatched);\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n Log.d(\"HomeView\", \"Could not find matches\");\n }\n });\n que.add(req);\n }",
"java.util.List<speech.multilang.Params.MultiRecognizerGrammarMatchList.MultiRecognizerGrammarMatch> \n getGrammarMatchList();",
"public void addMatch() {\n totalMatches ++;\n }",
"public Iterable<String> matches(String prefix, int k) {\n\t\tmatchesList = new ArrayList<String>();\n\t\t\n\t\tif(prefix != null){\n\t\t\tfor(Term term : data.getRawList()){\n\t\t\t\tif((term.getWord().startsWith(prefix))&&(matchesList.size() < k)){\n\t\t\t\t\tmatchesList.add(term.getWord());\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn matchesList;\n\t\t}\n\t\telse{\n\t\t\treturn null;\n\t\t}\n\t}",
"private final List<Object> searchForResults(@Nullable String query)\n {\n ArrayList<Object> results = new ArrayList<>();\n try {\n results.addAll(crDao.getRecordsLike(query));\n } catch (Exception e) {\n Logger.error(\"Failed to search the cr dao for results.\", e);\n }\n\n try {\n results.addAll(customMonsterDao.getRecordsLike(query));\n } catch (Exception e) {\n Logger.error(\"Failed to search the custom monster dao for results.\", e);\n }\n\n try {\n results.addAll(monsterDao.getRecordsLike(query));\n } catch (Exception e) {\n Logger.error(\"Failed to search the standard monster dao for results.\", e);\n }\n\n return results;\n }",
"public static ArrayList<Result> findMatches(Query query, DataManager myVocab){\n\n\t\t//Uncomment this for logging in this class\t\n//\t\tmyLogger.setLevel(Level.INFO); \n\n\t\t// get the term we're going to search for and\n\t\t// take out any leading or trailing whitespaces\n\t\tString querystr = query.getQuery();\n\t\tquerystr = querystr.trim();\n\t\tString uncleaned = querystr;\n\t\t\n\t\t// This is in case of numeric entries. Google Refine doesn't seem\n\t\t// to have int cell types, instead it adds an invisible .0 to all\n\t\t// numbers. This fixes that issue, as it sometimes causes false negatives.\n\t\tif (querystr.endsWith(\".0\")){\n\t\t Pattern p = Pattern.compile(\"[^0-9\\\\.]+\");\n\t\t Matcher m = p.matcher(querystr);\n\t\t boolean result = m.find();\n\t\t if (!result){\n\t\t \t querystr = querystr.substring(0, querystr.length()-2);\n\t\t }\n\t\t}\n\t\t// see if it's in the synonyms map, if it is\n\t\t// replace it with the appropriate term, if it's\n\t\t// not, don't do anything. \n\n\t\tif (myVocab.subMap.get(querystr)!=null){\n\t\t\tquerystr = myVocab.subMap.get(querystr);\n\t\t\tquery.setQuery(querystr);\n\t\t}\n\t\t\n\t\t// Clean up the query string if it isn't case/punctuation sensitive\n\t\tif (!myVocab.capsSensitive()){\t\t\n\t\t\tquerystr = querystr.toLowerCase();\n\t\t}\n\t\tif (! myVocab.punctSensitive()){\t\t\n\t\t\tquerystr = querystr.replaceAll(\"[\\\\W_]\", \"\");\n\t\t}\n\t\t\n\t\t// see if it's in the synonyms map, if it is\n\t\t// replace it with the appropriate term, if it's\n\t\t// not, don't do anything. \n\t\tif(myVocab.subMap.get(querystr)!=null){\n\t\t\tquerystr = myVocab.subMap.get(querystr);\n\t\t\tquery.setQuery(querystr);\n\t\t}\n\n\t\tString type = query.getType();\n\n\t\t// This ArrayList is the results that are going to be returned. \n\t\tArrayList<Result> results = getDirectMatches(myVocab, querystr, uncleaned, type);\n\t\t\n\t\t// If there's a perfect match return it.\n\t\tif (results.size() == 1 && results.get(0).match){\n\t\t\treturn results;\n\t\t}else{\n\t\t\t// Otherwise, add the initial ones and try matching\n\t\t\t// based on distance to vocabulary terms.\n\t\t\tresults.addAll(distanceMatching(query, myVocab));\n\t\t\t\n\t\t\t// Split the original query term by space and non-alphanumeric characters \n\t\t\t// to find how many words there are.\n\t\t\t//querystr = query.getQuery().replaceAll(\"[\\\\W_]\", \" \");\n\t\t\tString [] termList = querystr.split(\" \");\n\t\t\t\n\t\t\t// if there's more than one, run bagOfWords\n\t\t\t// which tries to find a match for each of the words.\n\t\t\tif (termList.length > 1){\n\t\t\t\tresults.addAll(bagOfWords(query, myVocab));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Clean the results: no duplicates\n\t\t// no extra results to return, and sorted\n\t\t// them by score before returning them\n\t\tresults = removeDuplicates(results);\n\t\t\n\t\t// They do not need to be reduced in \n\t\t// number if there are fewer than \n\t\t// the max results.\n\t\t// The pruneResults sorts them\n\t\t// by score already.\n\t\tif(query.getLimit()!=null){\n\t\t\tresults = pruneResults(results,Integer.parseInt(query.getLimit()));\n\t\t}else{\n\t\t\tresults = pruneResults(results,MAX_RESULTS);\n\t\t}\n\t\t\t\n\t\tresults = sortByScore(results);\n\t\tfor (int i = 0; i< results.size(); i++){\n//\t\t\tmyLogger.log(Level.SEVERE,results.get(i).getScore()+ \" is bigger than 100?\");\n\t\t\tif(results.get(i).getScore() > (double)100){\n\t\t\t\tresults.get(i).setScore((double)100 - (results.get(i).getScore()-(double)100));\n//\t\t\t\tmyLogger.log(Level.SEVERE,results.get(i).getScore()+\" is bigger than 100! and was set to \"+\n//\t\t\t\t\t\t((double)100 - (results.get(i).getScore()-(double)100)));\n\t\t\t}\n\t\t}\n\t\treturn results;\n\t}",
"public Iterable<Integer> findAll (String pat, String txt) {\n // Fila que armazena as posicoes nas quais foram encontradas \n // o padrao no texto \n Queue<Integer> queue = new Queue<Integer> ();\n\n int N = txt.length ();\n int M = pat.length ();\n // Armazena a posicao das ocorrencias do padrao no texto\n int position;\n // Posicao a partir do qual o texto sera processado\n int start = 0;\n\n // Achando o estado que devemos ficar apos encontrar um padrao no texto\n int X = 1;\n\n // Achando todas as ocorrencias do padrao\n do { \n position = search (txt, start);\n if (position < N) {\n queue.enqueue (position);\n }\n start = position + X;\n } while (start < txt.length ());\n \n return queue;\n }",
"public static void printMatches(String text, String regex) {\n Pattern pattern = Pattern.compile(regex);\n Matcher matcher = pattern.matcher(text);\n // Check all occurrences\n while (matcher.find()) {\n System.out.print(\"Start index: \" + matcher.start());\n System.out.print(\" End index: \" + matcher.end());\n System.out.println(\" Found: \" + matcher.group());\n }\n }",
"public synchronized Set<String> getMatchList(String word, MatchingStrategy strategy, Database database) throws DictConnectionException {\n Set<String> set = new LinkedHashSet<>();\n \n // DONE Add your code here\n String userInput;\n String fromServer;\n\n try {\n userInput = \"MATCH \" + database.getName() + \" \" + strategy.getName() + \" \" + \"\\\"\"+word+\"\\\"\" ;\n //out.println(\"Client: \" + userInput);\n output.println(userInput);\n\n String check = input.readLine();\n //out.println(\"Server: \" + check);\n\n if (check.contains(\"552\")) { // 552: no match\n return set ;\n }\n if (check.contains(\"152\")) { // 152: successfully found matches\n\n while ((fromServer = input.readLine()) != null) {\n if (fromServer.contains(\"250 ok\")) {\n //out.println(\"Server: Successfully found match \");\n break;\n }\n if (fromServer.contains(\"552 no match\")) {\n //out.println(\"Server: \" + fromServer);\n break;\n }\n if (!(fromServer.equals(\".\"))) {\n String[] temp = DictStringParser.splitAtoms(fromServer);\n set.add(temp[1]);\n }\n }\n\n }else {\n throw new DictConnectionException() ; // all other status codes throw exceptions\n }\n }catch (IOException e){\n throw new DictConnectionException() ;\n }\n //out.println(\"Server: \" + set);\n return set;\n }",
"public int findAllMatches(String regularExpression, BirdView birdView) {\n getLock().getWriteLock();\n try {\n return findAllMatchesWithWriteLockAlreadyHeld(regularExpression, birdView);\n } finally {\n getLock().relinquishWriteLock();\n }\n }",
"@Override\n\tpublic void visit(Matches arg0) {\n\t\t\n\t}",
"public void matchesDemo() \n {\n Map<String, Set<String>> clientMap = new HashMap<>();\n Set<String> interests = new HashSet<>();\n\n interests.add(\"Food\");\n interests.add(\"Wine\");\n interests.add(\"Tandems\");\n clientMap.put(\"Hal\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Walking\");\n interests.add(\"Welding\");\n clientMap.put(\"Gemma\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Cinema\");\n interests.add(\"Wine\");\n clientMap.put(\"Caroline\", interests);\n\n Set<String> halsInterests = clientMap.get(\"Hal\");\n String outputString;\n Set<String> eachClientInterests;\n Set<String> intersection;\n\n for (String eachClient : clientMap.keySet()) \n {\n eachClientInterests = clientMap.get(eachClient);\n intersection = new HashSet<>(halsInterests);\n intersection.retainAll(eachClientInterests);\n outputString = \"Hal and \" + eachClient \n + \" have common interests: \"\n + intersection;\n System.out.println(outputString) ;\n }\n }",
"public int getExact() { return exactMatches; }",
"public List<Match> getAllMatches(String limit, String page) throws SQLException\n\t{\n\t\tLong lim = limit == null ? (long) Constants.DEFAULT_PAGINATION_LIMIT : Long.valueOf(limit);\n\t\tLong p = page == null ? (long) 0 : Long.valueOf(page);\n\n\t\tQueryBuilder<Match, String> qb = matchDao.queryBuilder();\n\t\tqb.orderBy(\"match_timestamp\", false);\n\t\tqb.limit(lim);\n\t\tqb.offset(lim * p);\n\n\t\tList<Match> matchList = qb.query();\n\n\t\tfor (Match m : matchList)\n\t\t{\n\t\t\tuserDao.refresh(m.getCreatorUser());\n\t\t\tuserDao.refresh(m.getOpponentUser());\n\t\t}\n\t\treturn matchList;\n\n\t}",
"@Override // com.oppo.enterprise.mdmcoreservice.utils.defaultapp.DefaultApp\n public List<Integer> getMatchList() {\n List<Integer> matchList = new ArrayList<>();\n for (int i = 0; i < DEFAULT_MATCH_TYPE_LIST.size(); i++) {\n for (int j = 0; j < DEFAULT_SCHEME_LIST.size(); j++) {\n for (int k = 0; k < DEFAULT_URI_DATA_TYPE_LIST.size(); k++) {\n matchList.add(DEFAULT_MATCH_TYPE_LIST.get(i));\n }\n }\n }\n matchList.add(5242880);\n matchList.add(3145728);\n matchList.add(3145728);\n return matchList;\n }",
"@Override\n\tpublic void visit(Matches arg0) {\n\n\t}",
"public List<TagPregunta> findMatchingTags(String parcial);",
"public List<Class<?>> getAnnotatedMatches(Class<? extends Annotation> annotation)\n\t{\n\t\treturn getAnnotatedMatches(annotation, false);\n\t}",
"int getGrammarMatchCount();",
"public void testSearchByContent() {\n Message m1 = new Message(\"test\",\"bla bla david moshe\",_u1);\n Message.incId();\n try {\n Thread.sleep(10);\n } catch (InterruptedException ex) {\n ex.printStackTrace();\n }\n Message m2 = new Message(\"test2\",\"bla2 bla david tikva moshe\",_u1);\n Message.incId();\n Message m3 = new Message(\"test2\",\"moshe cohen\",_u1);\n Message.incId();\n\n this.allMsgs.put(m1.getMsg_id(), m1);\n this.allMsgs.put(m2.getMsg_id(), m2);\n this.allMsgs.put(m3.getMsg_id(), m3);\n\n this.searchEngine.addData(m1);\n this.searchEngine.addData(m2);\n this.searchEngine.addData(m3);\n\n /* SearchHit[] result = this.searchEngine.searchByContent(\"bla2\", 0,1);\n assertTrue(result.length==1);\n assertTrue(result[0].getMessage().equals(m2));\n\n SearchHit[] result2 = this.searchEngine.searchByContent(\"bla david tikva\", 0,2);\n assertTrue(result2.length==1);\n assertEquals(result2[0].getScore(),3.0);\n //assertEquals(result2[1].getScore(),2.0);\n assertTrue(result2[0].getMessage().equals(m2));\n //assertTrue(result2[1].getMessage().equals(m1));\n\n SearchHit[] result3 = this.searchEngine.searchByContent(\"bla2 tikva\", 0, 5);\n assertTrue(result3.length==0);\n */\n\n/*\n SearchHit[] result4 = this.searchEngine.searchByContent(\"bla OR tikva\", 0, 5);\n assertTrue(result4.length==2);\n assertTrue(result4[0].getMessage().equals(m2));\n assertTrue(result4[1].getMessage().equals(m1));\n\n SearchHit[] result5 = this.searchEngine.searchByContent(\"bla AND cohen\", 0, 5);\n assertTrue(result5.length==0);\n\n result5 = this.searchEngine.searchByContent(\"bla AND moshe\",0,5);\n assertTrue(result5.length==2);\n assertTrue(result5[0].getScore() == result5[1].getScore());\n assertTrue(result5[0].getMessage().equals(m2));\n assertTrue(result5[1].getMessage().equals(m1));\n\n result5 = this.searchEngine.searchByContent(\"bla AND moshe\", 10, 11);\n assertTrue(result5.length==0);\n */\n\n }",
"String findMatches(String filePath, String pattern) {\n\t Pattern regexp = Pattern.compile(pattern);\n\t Matcher m = null;\n\t String output = \"\";\n\t Path path = Paths.get(filePath);\n\t try {\n\t \t\tBufferedReader reader = Files.newBufferedReader(path, m_oEncoding);\n\t \t\tLineNumberReader lineReader = new LineNumberReader(reader);\n\t \t\tString line = null;\n\t \t\twhile ((line = lineReader.readLine()) != null) {\n\t \t\t\tm = regexp.matcher(line); //reset the input\n\t \t\t\tif (m.find()) {\n\t \t\t\t\tm_nCount ++;\n\t \t\t\t\toutput = output + String.valueOf(m_nCount) +\" - \" + String.valueOf(lineReader.getLineNumber()) +\": \"+ line + \"\\n\";\n\t \t\t\t}\n\t \t\t}\n\t } catch (IOException ex){\n\t ex.printStackTrace();\n\t }\n\t return output;\n\t }",
"public String getMatched() {\r\n\t\treturn matched;\r\n\t}",
"public TaskList matchTasks(String match) {\n TaskList output = new TaskList();\n try {\n for (int f = 0; f < this.getSize(); f++) {\n Task selectedTask = this.getSingleTask(f);\n if (selectedTask.toString().contains(match)) {\n output.addTask(selectedTask);\n }\n }\n } catch (DukeException e) {\n return new TaskList();\n }\n\n return output;\n }",
"@Override\r\n\tpublic String getMatch() {\n\t\treturn match;\r\n\t}",
"public List<CorpusSearchHit> searchNext() {\n List<CorpusSearchHit> hits;\n Path file = fileIterator.next();\n\n hits = new ArrayList<>();\n try {\n MDCDocumentReader reader = new MDCDocumentReader();\n MDCDocument mdcDocument = reader.loadFile(file.toFile());\n List<MDCPosition> positions = query.doSearch(mdcDocument.getHieroglyphicTextModel().getModel());\n // see information about MDCPosition for more details.\n for (MDCPosition pos : positions) {\n hits.add(new CorpusSearchHit(file, pos.getIndex()));\n }\n result.addAll(hits);\n } catch (MDCSyntaxError | IOException e) {\n System.err.println(\"Error in file \" + file.toString());\n }\n\n return hits;\n }",
"public Iterable<String> keysThatMatch(String pattern)\r\n {\r\n Queue<String> q = new Queue<String>();\r\n if ((pattern.equals(\"\") || pattern.equals(\".\")) && null_str_val != null)\r\n q.enqueue(\"\");\r\n collect(root, \"\", pattern, q);\r\n return q;\r\n }",
"@Override\n\tpublic List<Applicant> getAllApplicantUsingRegex() {\n\t\tSystem.out.println(\"Fname Ending with a \");\n\t\tQuery query = new Query().addCriteria(Criteria.where(\"fname\").regex(\"a$\"));\n\t\treturn applicantMongoTemplate.find(query, Applicant.class);\n\t}",
"public static void printMatches(ArrayList<Glootie> aliens, Glootie g) {\r\n\t\tSystem.out.println(\"Matches for \"+ g);\r\n\t\tArrayList<Glootie> gMatches = findMatches(g,aliens);\r\n\t\tif(gMatches.size() < 10) {\r\n\t\t\tSystem.out.println(gMatches);\r\n\t\t}else {\r\n\t\t\tSystem.out.println(gMatches.size() + \" matches is too many to print\");\r\n\t\t}\r\n\r\n\t}",
"Match createMatch();",
"@In String search();",
"public ArrayList<String> call() {\n\t\t\treturn grepMultiThreadExecute(file, pattern, start, end);\n\t\t}",
"private void getMatches(){\r\n\t\tString cLong = commandList.get(2);//holds client's longitude in string form\r\n\t\tString cLat = commandList.get(3);//holds the client's latitude in String form\r\n\r\n\t\tArrayList<String> matchList = new ArrayList<>();//holds user names of found matches\r\n\t\t\r\n\t\tString[] clientPSliders = getPSliders(commandList.get(1));\r\n\r\n\t\t//load in SQL command to find matches using given client's min and max values\r\n\t\tcommand =\"SELECT location.userName FROM (location INNER JOIN users \"\r\n\t\t\t\t+ \"ON location.userName = users.userName) INNER JOIN personalSlider \"\r\n\t\t\t\t+ \"ON users.userName = personalSlider.userName WHERE (((location.longitude) <= \";\r\n\t\tcommand += roundLongUp(cLong) + \" And (location.longitude) >= \";\r\n\t\tcommand += roundLongDown(cLong) + \") AND ((location.latitude) <= \";\r\n\t\tcommand += roundLatUp(cLat) + \" And (location.latitude) >= \";\r\n\t\tcommand += roundLatDown(cLat) + \") AND ((personalSlider.pGender) >= \";\r\n\t\tcommand += commandList.get(4) + \" And (personalSlider.pGender) <= \" + commandList.get(5);\r\n\t\tcommand += \" AND ((personalSlider.pExpression) >= \" + commandList.get(6) +\r\n\t\t\t\t\" And (personalSlider.pExpression) <= \" + commandList.get(7) + \")\";\r\n\t\tcommand += \" AND ((personalSlider.pOrientation) >= \" + commandList.get(8) +\r\n\t\t\t\t\" And (personalSlider.pOrientation) <= \" + commandList.get(9) + \")));\";\r\n\r\n\t\t\r\n\t\ttry {//try block for sending SQL command\r\n\t\t\trs = stmt.executeQuery(command);//send command\r\n\r\n\t\t\twhile(rs.next()){//while there are matches\r\n\t\t\t\tmatchList.add(rs.getString(\"userName\"));//load userName\r\n\t\t\t}\r\n\r\n\t\t\t//each String[] is a match, 0 = userName, 1 = pGenderMin, .....6=pOrientationMax, 7=distance (used later)\r\n\t\t\tArrayList<String[]> fullMatches = getSeekingSlider(matchList);\r\n\r\n\t\t\t//remove the non-overlapping matches, pass clients ratings and the list of matches\r\n\t\t\tcrossMatch(strArrToIntArr(clientPSliders), fullMatches);\r\n\t\t\t\r\n\t\t\t//remove matches over 25 miles away\r\n\t\t\tlimitDistance(Double.valueOf(cLat), Double.valueOf(cLong), fullMatches);\r\n\t\t\t\r\n\t\t\trs = null;//null the result set\r\n\t\t\t\r\n\t\t\tString[] tempStrArr;//holds the personal slider for the current match\r\n\t\t\tfor(String[] currArr: fullMatches){//for all the remaining matches\r\n\t\t\t\ttempStrArr = getPSliders(currArr[0]);//get personal slider for current matches\r\n\t\t\t\tout.println(tempStrArr[0] + \", \" + tempStrArr[1] + \", \"//loads userName, pGen, pExpr, pOrient\r\n\t\t\t\t\t\t\t+ tempStrArr[2] + \", \" + tempStrArr[3] + \", \" + currArr[7]);//line 2\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t\tout.println(e.getMessage());\r\n\t\t}\r\n\t}",
"Pair<Boolean, List<Result>> execQuery(int matchLimit);",
"public Set<RecordPair> match(Record record) throws ApplicationException;",
"public Vector match(boolean test) {\r\n Vector matchList = new Vector() ;\r\n Enumeration enum2 = ruleList.elements() ;\r\n // System.out.println(enum2.toString());\r\n while (enum2.hasMoreElements()) {\r\n Rule testRule = (Rule)enum2.nextElement() ;\r\n if (test) testRule.check() ; // test the rule antecedents\r\n if (testRule.truth == null) continue ;\r\n // fire the rule only once for now\r\n if ((testRule.truth.booleanValue() == true) &&\r\n (testRule.fired == false)) matchList.addElement(testRule) ;\r\n }\r\n displayConflictSet(matchList) ;\r\n return matchList ;\r\n }",
"@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data)\n {\n if (requestCode == REQUEST_CODE && resultCode == RESULT_OK)\n {\n // Populate the wordsList with the String values the recognition engine thought it heard\n ArrayList<String> matches = data.getStringArrayListExtra(\n RecognizerIntent.EXTRA_RESULTS);\n \n for(int i=0;i<matches.size();i++)\n {\n \tif(counter==0)\n \t{\n \t\t\n\t \tif(matches.get(i).equals(\"moo\") || matches.get(i).equals(\"moore\") ||\n\t \t\t\tmatches.get(i).equals(\"mou\") || matches.get(i).equals(\"moon\") ||\n\t \t\t\tmatches.get(i).equals(\"movie\") || matches.get(i).equals(\"boo\")\n\t \t|| matches.get(i).equals(\"boohoo\") || matches.get(i).equals(\"boom\"))\n\t \t{\n\t \t\t\n\t \t\n\t \t\tresume();\n\t \t\tbreak;\n\t \t}\n\t \telse{\n\t \t\twrong();\n\t \t\t}\n \t}\n \telse if(counter==1){\n \t\t\n\t \tif(matches.get(i).equals(\"name\") || matches.get(i).equals(\"names\") ||\n\t \t\t\tmatches.get(i).equals(\"nay\") || matches.get(i).equals(\"neigh\") ||\n\t \t\t\tmatches.get(i).equals(\"nee\") || matches.get(i).equals(\"nays\")\n\t \t\t\t|| matches.get(i).equals(\"knee\") || matches.get(i).equals(\"nees\")\n\t \t\t\t|| matches.get(i).equals(\"ne\") || matches.get(i).equals(\"ni\")){\n\t \t\t\n\t \t\tresume();\n\t \t\tbreak;\n\t \t}\n\t \telse\n\t \t\twrong();\n\t \t\n \t}\n \telse if(counter==2){\n\t \tif(matches.get(i).equals(\"oink\") || matches.get(i).equals(\"on\") ||\n\t \t\t\tmatches.get(i).equals(\"oint\") || matches.get(i).equals(\"point\") ||\n\t \t\t\tmatches.get(i).equals(\"online\") || matches.get(i).equals(\"going\")\n\t \t\t\t|| matches.get(i).equals(\"awning\") || matches.get(i).equals(\"wapking\")){\n\t \t\t\n\t \t\n\t \t\tresume();\n\t \t\tbreak;\n\t \t}\n\t \telse\n\t \t\twrong();\n\t \t\n \t}\n \telse if(counter==3){\n \t\t//TextView tv = (TextView) findViewById(R.id.text);\n \t\t//tv.setText(\"Sheep says?\");\n\t \tif(matches.get(i).equals(\"ba\") || matches.get(i).equals(\"baa\") ||\n\t \t\t\tmatches.get(i).equals(\"bar\") || matches.get(i).equals(\"bah\") ||\n\t \t\t\tmatches.get(i).equals(\"baba\") || matches.get(i).equals(\"bleach\")\n\t \t\t\t|| matches.get(i).equals(\"please\") || matches.get(i).equals(\"plate\")\n\t \t\t\t|| matches.get(i).equals(\"pa\") || matches.get(i).equals(\"paa\")){\n\t \t\t\n\t \t\tresume();\n\t \t\tbreak;\n\t \t}\n\t \telse\n\t \t\twrong();\n \t}\n \telse if(counter==4){\n\t \tif(matches.get(i).equals(\"quack\") || matches.get(i).equals(\"crack\") ||\n\t \t\t\tmatches.get(i).equals(\"kodak\") || matches.get(i).equals(\"back\") ||\n\t \t\t\tmatches.get(i).equals(\"call back\") || matches.get(i).equals(\"quake\")\n\t \t\t\t|| matches.get(i).equals(\"quiet\")|| matches.get(i).equals(\"quiet\")\n\t \t\t\t|| matches.get(i).equals(\"whack\")\n\t \t\t\t|| matches.get(i).equals(\"quack quack\")){\n\t \t\tif(counter<4)\n\t \t\t{\n\t \t\t\tcounter++;\n\t \t\t\tloadActivity();\n\t \t\t}\n\t \t\tresume();\n\t \t\tbreak;\n\t \t}\n\t \telse\n\t \t\twrong();\n \t}\n }\n }\n super.onActivityResult(requestCode, resultCode, data);\n }",
"public List<Match> getAllMatchesBySeason(Season stagione){\r\n\t\t\tif(matchesBySeason==null)\t{\r\n\t\t\t\tmatchesBySeason= dao.getMatchesForSeason(stagione,mapTeam);\r\n\t\t\tfor(Match atemp:matchesBySeason){ this.mapMatchBySeason.put(atemp.getId(), atemp);}\r\n\t\t\t\t}\r\n\t\t\treturn matchesBySeason;\r\n\t\t\t}",
"public int searchTweetsBoyerMoore(String pattern, List<String> ans) {\n int compCost = 0;\n Assoc<Integer, Integer> holder;\n\n for(String tweet : tweets) {\n\n holder = StringMatch.matchBoyerMoore(pattern.toLowerCase(), tweet.toLowerCase());\n compCost += holder.value;\n\n if(holder.key != -1)\n ans.add(tweet);\n }\n return compCost;\n\n }",
"private List<EObject> getElements(ISelector s) {\n\t\tList<EObject> result = new ArrayList<EObject>();\n\t\t\n\t\tfor (EObject next : charStartMap.keySet()) {\n\t\t\tint start = charStartMap.get(next);\n\t\t\tint end = charEndMap.get(next);\n\t\t\tif (s.accept(start, end)) {\n\t\t\t\tresult.add(next);\n\t\t\t}\n\t\t}\n\t\tCollections.sort(result, new Comparator<EObject>() {\n\t\t\tpublic int compare(EObject objectA, EObject objectB) {\n\t\t\t\tint lengthA = getCharEnd(objectA) - getCharStart(objectA);\n\t\t\t\tint lengthB = getCharEnd(objectB) - getCharStart(objectB);\n\t\t\t\treturn lengthA - lengthB;\n\t\t\t}\n\t\t});\n\t\treturn result;\n\t}",
"public Instances getMatchedTest() {\n return this.getMatchedInstances(\"test\", this.test);\n }",
"@Override\n public Map<K, ICacheElement<K, V>> getMatchingCacheElements( final String pattern )\n {\n return this.getCacheControl().getMatching( pattern );\n }"
] | [
"0.80759805",
"0.72830695",
"0.6935073",
"0.6904236",
"0.6869159",
"0.65027815",
"0.6385258",
"0.618343",
"0.6151057",
"0.61478305",
"0.61444956",
"0.6122036",
"0.61217093",
"0.6088543",
"0.6085373",
"0.6056622",
"0.603643",
"0.5976066",
"0.59593135",
"0.5935304",
"0.59124756",
"0.58971983",
"0.5883552",
"0.58476233",
"0.5836588",
"0.5834713",
"0.58287305",
"0.5796176",
"0.5790777",
"0.5780069",
"0.5741129",
"0.573775",
"0.5721695",
"0.5716548",
"0.56975317",
"0.5692658",
"0.5689756",
"0.5687474",
"0.5687087",
"0.56712",
"0.56691116",
"0.5654114",
"0.5643132",
"0.56353927",
"0.56228054",
"0.56056386",
"0.56022185",
"0.55758935",
"0.5555869",
"0.5549394",
"0.5537286",
"0.5527326",
"0.5520463",
"0.55131847",
"0.54933894",
"0.5484139",
"0.5478098",
"0.54607904",
"0.5458712",
"0.545637",
"0.54538417",
"0.54506606",
"0.54480684",
"0.5441211",
"0.5427116",
"0.5419773",
"0.5419033",
"0.5402845",
"0.53875387",
"0.53842795",
"0.5382245",
"0.53795433",
"0.53752476",
"0.53738713",
"0.5369777",
"0.53652996",
"0.5343661",
"0.53422016",
"0.53412473",
"0.5337842",
"0.53298587",
"0.5289514",
"0.5271988",
"0.52658457",
"0.52606636",
"0.525827",
"0.525596",
"0.5255006",
"0.5253592",
"0.52511257",
"0.5247731",
"0.5239603",
"0.52359",
"0.52294886",
"0.52263457",
"0.5217094",
"0.52168286",
"0.5214326",
"0.52069587",
"0.52067",
"0.5203245"
] | 0.0 | -1 |
/ replace the propertyResolver with one that does our bidding for this test. | public void replacePropertyResolver(ActionEvent action) {
FacesContext context = FacesContext.getCurrentInstance();
Application app = context.getApplication();
// see if we need to take action-
if (null == context.getExternalContext().getSessionMap().get("systest.replacePropertyResolver")) {
final PropertyResolver oldProp = app.getPropertyResolver();
PropertyResolver
newProp = new PropertyResolver() {
public Object getValue(Object base, Object property)
throws EvaluationException, PropertyNotFoundException {
return oldProp.getValue(base, property);
}
public Object getValue(Object base, int index)
throws EvaluationException, PropertyNotFoundException {
return oldProp.getValue(base, index);
}
public void setValue(Object base, Object property, Object value)
throws EvaluationException, PropertyNotFoundException {
TestBean.this.setValueChangeMessage("setValue() called");
oldProp.setValue(base, property, value);
}
public void setValue(Object base, int index, Object value)
throws EvaluationException, PropertyNotFoundException {
TestBean.this.setValueChangeMessage("setValue() called");
oldProp.setValue(base, index, value);
}
public boolean isReadOnly(Object base, Object property)
throws EvaluationException, PropertyNotFoundException {
return oldProp.isReadOnly(base, property);
}
public boolean isReadOnly(Object base, int index)
throws EvaluationException, PropertyNotFoundException {
return oldProp.isReadOnly(base, index);
}
public Class getType(Object base, Object property)
throws EvaluationException, PropertyNotFoundException {
return oldProp.getType(base, property);
}
public Class getType(Object base, int index)
throws EvaluationException, PropertyNotFoundException {
return oldProp.getType(base, index);
}
};
app.setPropertyResolver(newProp);
context.getExternalContext().getSessionMap().put("systest.replacePropertyResolver", oldProp);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setResolver( final PropertyResolver propertyResolver )\n {\n m_propertyResolver = propertyResolver;\n }",
"@Test\n public void testResolveWithSysPropResolver() {\n Resolver sysPropResolver = VariableExpansion.SYS_PROP_RESOLVER;\n\n assertNull(\"System property value unexpectedly set already\", System.getProperty(testPropName));\n assertNull(\"Expected resolve to return null as property not set\", sysPropResolver.resolve(testPropName));\n\n setTestSystemProperty(testPropName, testPropValue);\n\n assertEquals(\"System property value not as expected\", testPropValue, System.getProperty(testPropName));\n assertEquals(\"Resolved variable not as expected\", testPropValue, sysPropResolver.resolve(testPropName));\n }",
"@Test\n public void testActualPropertiesValues() { // wipe everything other\n testEnv = null;\n resolver = null;\n // use the default ctor to grab discoveryenvironment.properties\n // resolver = new DefaultServiceCallResolver();\n resolver = new ServiceCallResolver();\n resolver.setAppProperties(createFromExpected());\n // ensure it was set\n assertNotNull(resolver);\n verifyExpectedValues(EXPECTED);\n\n }",
"public void restorePropertyResolver(ActionEvent action) {\n FacesContext context = FacesContext.getCurrentInstance();\n Application app = context.getApplication();\n PropertyResolver oldProp = null;\n \n // see if we need to take action-\n if (null != (oldProp = (PropertyResolver) context.getExternalContext().getSessionMap().get(\"systest.replacePropertyResolver\"))) {\n app.setPropertyResolver(oldProp);\n context.getExternalContext().getSessionMap().remove(\"systest.replacePropertyResolver\");\n setValueChangeMessage(null);\n \n }\n }",
"PropertyRealization createPropertyRealization();",
"protected void afterPropertiesSetInternal() {\n\t\t// override this method\n\t}",
"@Bean\n\tPropertyResolverUtils propertyResolverUtils(ConfigurableBeanFactory factory) {\n\t\treturn new PropertyResolverUtils(factory);\n\t}",
"public void setBeanResolver(BeanResolver beanResolver) {\n\t\tthis.evalContext.setBeanResolver(beanResolver);\n\t\tthis.evalContext.setTypeConverter(new StandardTypeConverter());\n\t\tthis.evalContext.addPropertyAccessor(new MapAccessor());\n\t}",
"public void setEntityResolver(EntityResolver resolver)\n {\n if (resolver instanceof EntityResolver2)\n {\n resolver2 = (EntityResolver2) resolver;\n }\n else\n {\n resolver2 = null;\n }\n if (resolver == null)\n {\n resolver = base;\n }\n entityResolver = resolver;\n }",
"public EntityResolver getEntityResolver()\n {\n return (entityResolver == base) ? null : entityResolver;\n }",
"@Override\n public void afterPropertiesSet() {\n }",
"protected void setUp()\n {\n typeResolver = new TypeResolver();\n }",
"protected ComponentResolver createComponentResolver() {\n return new DefaultComponentResolver();\n }",
"private PropertyEvaluator createEvaluator() {\n return helper.getStandardPropertyEvaluator();\n }",
"private void processPropertyPlaceHolders() {\n\t\tMap<String, PropertyResourceConfigurer> prcs = applicationContext.getBeansOfType(PropertyResourceConfigurer.class);\n\n\t\tif (!prcs.isEmpty() && applicationContext instanceof GenericApplicationContext) {\n\t\t\tBeanDefinition mapperScannerBean = ((GenericApplicationContext) applicationContext)\n\t\t\t\t\t.getBeanFactory().getBeanDefinition(beanName);\n\n\t\t\t// PropertyResourceConfigurer does not expose any methods to explicitly perform\n\t\t\t// property placeholder substitution. Instead, create a BeanFactory that just\n\t\t\t// contains this mapper scanner and post process the factory.\n\t\t\tDefaultListableBeanFactory factory = new DefaultListableBeanFactory();\n\t\t\tfactory.registerBeanDefinition(beanName, mapperScannerBean);\n\n\t\t\tfor (PropertyResourceConfigurer prc : prcs.values()) {\n\t\t\t\tprc.postProcessBeanFactory(factory);\n\t\t\t}\n\n\t\t\tPropertyValues values = mapperScannerBean.getPropertyValues();\n\n\t\t\tthis.basePackage = updatePropertyValue(\"basePackage\", values);\n\t\t\tthis.sqlSessionFactoryBeanName = updatePropertyValue(\"sqlSessionFactoryBeanName\", values);\n\t\t\tthis.sqlSessionTemplateBeanName = updatePropertyValue(\"sqlSessionTemplateBeanName\", values);\n\t\t}\n\t}",
"private void initializePropertySubstitution() {\n log.debug(\"Initializing property substitution\");\r\n String discoveryBundleName = discoveryBootstrapService.getSymbolicBundleName();\r\n DiscoveryConfiguration discoveryConfiguration = getConfiguration(discoveryBundleName, DiscoveryConfiguration.class);\r\n\r\n // initialize discovery; may start a local discovery server and/or query existing servers\r\n Map<String, String> discoveryProperties = discoveryBootstrapService.initializeDiscovery(discoveryConfiguration);\r\n\r\n // register the properties learned from discovery (if any) under the \"discovery\" namespace\r\n this.addSubstitutionProperties(\"discovery\", discoveryProperties);\r\n }",
"@Before(order=0)\n\tpublic void getProperty() {\n\t\tconfigReader = new ConfigReaders();\n\t\tprop = configReader.init_prop();\n\t\t\n\t}",
"public void setDependencyResolver( DependencyResolver resolver )\r\n {\r\n this.resolver = resolver;\r\n }",
"public void setURIResolver(URIResolver resolver){\n m_uriResolver=resolver;\n }",
"private void setAttributesIntoStrategy() {\n ResolverStrategy strategy = _resolverStrategy;\n strategy.setProperty(\n ResolverStrategy.PROPERTY_LOAD_PACKAGE_MAPPINGS, \n _loadPackageMappings);\n strategy.setProperty(\n ResolverStrategy.PROPERTY_USE_INTROSPECTION, _useIntrospector);\n strategy.setProperty(\n ResolverStrategy.PROPERTY_MAPPING_LOADER, _mappingLoader);\n strategy.setProperty(\n ResolverStrategy.PROPERTY_INTROSPECTOR, _introspector);\n }",
"public Object getValue(ELContext context, Object base, Object property) {\n/* 143 */ context.setPropertyResolved(false);\n/* */ \n/* 145 */ Object value = null;\n/* 146 */ for (int i = 0; i < this.size; i++) {\n/* 147 */ value = this.elResolvers[i].getValue(context, base, property);\n/* 148 */ if (context.isPropertyResolved()) {\n/* 149 */ return value;\n/* */ }\n/* */ } \n/* 152 */ return null;\n/* */ }",
"private void addProperties() {\n\n\t\t/**\n\t\t * Add fusion.conf = src/test/resource\n\t\t */\n\t\tif (isPropertyRequired(\"fusion.conf.dir\")) {\n\t\t\texpect(bundleContextMock.getProperty(\"fusion.conf.dir\")).andReturn(\n\t\t\t\t\t\"src/test/resources/\").anyTimes();\n\t\t}\n\t\t/**\n\t\t * set fusion.process.dir\n\t\t */\n\t\tif (isPropertyRequired(\"fusion.process.dir\")) {\n\t\t\texpect(bundleContextMock.getProperty(\"fusion.process.dir\"))\n\t\t\t\t\t.andReturn(\"src/test/resources/\").anyTimes();\n\t\t}\n\n\t\t/**\n\t\t * set fusion.process.temp\n\t\t */\n\t\tif (isPropertyRequired(\"fusion.process.temp.dir\")) {\n\t\t\texpect(bundleContextMock.getProperty(\"fusion.process.temp.dir\"))\n\t\t\t\t\t.andReturn(\"src/test/resources/\").anyTimes();\n\t\t}\n\n\t\t/**\n\t\t * set fusion.home\n\t\t */\n\t\tif (isPropertyRequired(\"fusion.home\")) {\n\t\t\texpect(bundleContextMock.getProperty(\"fusion.home\")).andReturn(\n\t\t\t\t\t\"src/test/resources/\").anyTimes();\n\t\t}\n\t}",
"@Test public void testGetPropertiesDefaultBehavior() {\r\n Properties baseProperties = new Properties();\r\n Properties developmentModeProperties = new Properties();\r\n\r\n GaeAwarePropertySource source = new GaeAwarePropertySource();\r\n source.setProductionModeProperties(baseProperties);\r\n source.setDevelopmentModeProperties(developmentModeProperties);\r\n\r\n // local testing will always be non-production).\r\n assertSame(developmentModeProperties, source.getProperties());\r\n }",
"protected Property mapProperty(Node root, Property property)\n throws RepositoryException {\n if (property.getType() != PropertyType.STRING) {\n // a mapped property must be of type string\n return null;\n }\n\n // array containing the expressions: ${<path>}\n Value[] values;\n if (property.isMultiple()) {\n values = property.getValues();\n } else {\n values = new Value[1];\n values[0] = property.getValue();\n }\n\n boolean deleteProperty = false;\n for (Value value : values) {\n Matcher matcher = MAPPED_PATTERN.matcher(value.getString());\n if (matcher.matches()) {\n // this is a mapped property, we will delete it if the mapped destination\n // property doesn't exist\n deleteProperty = true;\n String path = matcher.group(2);\n // unwrap quoted property paths\n path = StringUtils.removeStart(StringUtils.stripEnd(path, \"\\'\"), \"\\'\");\n if (root.hasProperty(path)) {\n // replace property by mapped value in the original tree\n Property originalProperty = root.getProperty(path);\n String name = property.getName();\n Node parent = property.getParent();\n property.remove();\n Property newProperty = JcrUtil.copy(originalProperty, parent, name);\n\n // negate boolean properties if negation character has been set\n String negate = matcher.group(1);\n if (\"!\".equals(negate) && originalProperty.getType() == PropertyType.BOOLEAN) {\n newProperty.setValue(!newProperty.getBoolean());\n }\n\n // the mapping was successful\n deleteProperty = false;\n break;\n } else {\n String defaultValue = matcher.group(4);\n if (defaultValue != null) {\n if (property.isMultiple()) {\n // the property is multiple in the replacement,\n // recreate it so we can set the property to the default\n String name = property.getName();\n Node parent = property.getParent();\n property.remove();\n parent.setProperty(name, defaultValue);\n } else {\n property.setValue(defaultValue);\n }\n\n deleteProperty = false;\n break;\n }\n }\n }\n }\n if (deleteProperty) {\n // mapped destination does not exist, we don't include the property in replacement tree\n property.remove();\n return null;\n }\n\n return property;\n }",
"public void setValue(ELContext context, Object base, Object property, Object val) {\n/* 349 */ context.setPropertyResolved(false);\n/* */ \n/* 351 */ for (int i = 0; i < this.size; i++) {\n/* 352 */ this.elResolvers[i].setValue(context, base, property, val);\n/* 353 */ if (context.isPropertyResolved()) {\n/* */ return;\n/* */ }\n/* */ } \n/* */ }",
"public Staff getResolver(){return resolver;}",
"public IDefinition resolveProperty(IClassDefinition classDefinition, String propertyName)\n {\n Iterator<IClassDefinition> classIterator = classDefinition.classIterator(this, true);\n while (classIterator.hasNext())\n {\n IClassDefinition c = classIterator.next();\n \n ASScope classScope = ((ClassDefinition)c).getContainedScope();\n IDefinitionSet definitionSet = classScope.getLocalDefinitionSetByName(propertyName);\n if (definitionSet != null)\n {\n IDefinition winner = null;\n \n int n = definitionSet.getSize();\n for (int i = 0; i < n; i++)\n {\n IDefinition definition = definitionSet.getDefinition(i);\n \n // Look for vars and setters, but not getters.\n // Remember that getters and setters implement IVariableDefinition!\n if (definition instanceof IVariableDefinition &&\n !(definition instanceof IGetterDefinition))\n {\n // TODO Add namespace logic.\n // Can MXML set protected properties?\n // Can MXML set mx_internal properties if you've done\n // 'use namesapce mx_internal' in a <Script>?\n winner = definition;\n final INamespaceReference namespaceReference = definition.getNamespaceReference();\n final INamespaceDefinition thisNamespaceDef = namespaceReference.resolveNamespaceReference(this);\n final boolean isBindable = ((NamespaceDefinition)thisNamespaceDef).getAETNamespace().getName().equals(\n BindableHelper.bindableNamespaceDefinition.getAETNamespace().getName());\n // if we find a setter always take it, otherwise \n // keep looking for a setter\n if (winner instanceof ISetterDefinition && !isBindable)\n break;\n }\n }\n if (winner != null)\n {\n \tif (apiReportFile != null)\n \t\taddToAPIReport(classDefinition, winner);\n return winner;\n }\n }\n }\n \n return null;\n }",
"@Test\n public void getSettingsResolved_orgPropertiesDefined_noPlatformPropertiesDefined()\n throws Throwable {\n clearAllPlatformSettings();\n final String myLdapUrl = \"someUrl\";\n final String myBaseDn = \"ou=people,dc=est,dc=fujitsu,dc=de\";\n final LdapProperties props = new LdapProperties();\n props.setProperty(SettingType.LDAP_URL.name(), myLdapUrl);\n props.setProperty(SettingType.LDAP_BASE_DN.name(), myBaseDn);\n\n runTX(new Callable<Void>() {\n @Override\n public Void call() throws Exception {\n Properties settingsResolved = ldapSettingsMgmtSvc\n .getSettingsResolved(props.asProperties());\n\n assertEquals(\"Only given properties must be returned\", 2,\n settingsResolved.size());\n assertEquals(\"LDAP URL must have been returned as given\",\n myLdapUrl,\n settingsResolved.getProperty(SettingType.LDAP_URL\n .name()));\n assertEquals(\"LDAP BASE DN must have been returned as given\",\n myBaseDn,\n settingsResolved.getProperty(SettingType.LDAP_BASE_DN\n .name()));\n return null;\n }\n });\n }",
"@Override\n\tpublic IPropertySetter getPropertySetter() {\n\t\treturn null;\n\t}",
"@Override\n\tpublic void afterPropertiesSet() throws Exception {\n\t\t\n\t}",
"@Override\n\tpublic void afterPropertiesSet() throws Exception {\n\t\t\n\t}",
"@Override\n\tpublic void afterPropertiesSet() throws Exception {\n\t\t\n\t}",
"@Override\n public void setEntityResolver(EntityResolver entityResolver) {\n this.entityResolver = entityResolver;\n }",
"public DependencyResolver getResolver() {\n return resolver;\n }",
"protected XmlPropertiesProvider() {\n // do nothing for now\n }",
"@BeforeTest\n\t\tpublic void propCalling() throws IOException\n\t\t{\n\t\t\t\n\t\t\tIntializingProperties();\n\t\t}",
"@Override\n public void afterPropertiesSet() throws Exception {\n }",
"private PropertySetFactory() {}",
"public PropertiesQDoxPropertyExpander() {\n super();\n }",
"public void afterPropertiesSet() {\r\n\t}",
"@Test\n\tpublic void testResolveOldAPIVersionFromSysProp()\n\t\t\tthrows Exception {\n\t\tAPIVersionResolver fixture = new APIVersionResolver();\n\n\t\tfinal String sysPropBefore = System.getProperty(CloudifyConstants.SYSTEM_PROPERTY_CLI_OLD_REST_API_VERSION);\n\t\tString value = \"10.0.0\";\n\t\tSystem.setProperty(CloudifyConstants.SYSTEM_PROPERTY_CLI_OLD_REST_API_VERSION, value);\n\n\t\tString result = fixture.resolveOldAPIVersion();\n\t\ttry {\n\t\t\tAssert.assertEquals(value, result);\n\t\t} finally {\n\t\t\tif (sysPropBefore == null) {\n\t\t\t\tSystem.clearProperty(CloudifyConstants.SYSTEM_PROPERTY_CLI_OLD_REST_API_VERSION);\n\t\t\t} else {\n\t\t\t\tSystem.setProperty(CloudifyConstants.SYSTEM_PROPERTY_CLI_OLD_REST_API_VERSION, sysPropBefore);\n\t\t\t}\n\n\t\t}\n\n\t}",
"public void afterPropertiesSet() {\n\t}",
"public void afterPropertiesSet() {\n\t}",
"public void afterPropertiesSet() {\n\t}",
"public void afterPropertiesSet() {\n\t}",
"public void afterPropertiesSet() {\n\t}",
"public void afterPropertiesSet() {\n\t}",
"public void afterPropertiesSet() {\n\t}",
"public void afterPropertiesSet() {\n\t}",
"private void appendResolver(IPropertyResolver resolver) {\r\n List<IPropertyResolver> existingResolvers = resolvers.get();\r\n List<IPropertyResolver> newResolvers = new ArrayList<>(existingResolvers);\r\n newResolvers.add(resolver);\r\n resolvers.set(newResolvers);\r\n }",
"void setupPropertiesPostDeserialization() {\n initLayout();\n List<NamedThing> properties = getProperties();\n for (NamedThing prop : properties) {\n if (prop instanceof Properties) {\n ((Properties) prop).setupPropertiesPostDeserialization();\n } else {\n prop.setI18nMessageFormater(getI18nMessageFormater());\n }\n }\n\n }",
"DispatchingProperties() {\r\n\t\tsuper();\r\n\t\t// if (handler != null) {\r\n\t\t// throw new\r\n\t\t// RuntimeException(\"ServicePropertiesHandler: class already instantiated!\");\r\n\t\t// }\r\n\t\t// handler = this;\r\n\t}",
"@Override\n public void afterPropertiesSet() {\n validateProperties();\n }",
"@Override\r\n\tpublic void setProperty(Properties prop) {\n\t}",
"public ListProperty<IPropertyResolver> getResolvers() {\r\n return resolvers;\r\n }",
"@Override\r\n public void afterPropertiesSet() throws Exception {\n }",
"@Override\n\tpublic IPropertyGetter getPropertyGetter() {\n\t\treturn null;\n\t}",
"private PropertyHolder() {\n }",
"public void setupProperties() {\n // left empty for subclass to override\n }",
"@Test\n\tpublic void testResolveAPIVersionFromSysProp()\n\t\t\tthrows Exception {\n\t\tAPIVersionResolver fixture = new APIVersionResolver();\n\n\t\tfinal String sysPropBefore = System.getProperty(CloudifyConstants.SYSTEM_PROPERTY_CLI_REST_API_VERSION);\n\t\tString value = \"10.0.0\";\n\t\tSystem.setProperty(CloudifyConstants.SYSTEM_PROPERTY_CLI_REST_API_VERSION, value);\n\n\t\tString result = fixture.resolveAPIVersion();\n\t\ttry {\n\t\t\tAssert.assertEquals(value, result);\n\t\t} finally {\n\t\t\tif (sysPropBefore == null) {\n\t\t\t\tSystem.clearProperty(CloudifyConstants.SYSTEM_PROPERTY_CLI_REST_API_VERSION);\n\t\t\t} else {\n\t\t\t\tSystem.setProperty(CloudifyConstants.SYSTEM_PROPERTY_CLI_REST_API_VERSION, sysPropBefore);\n\t\t\t}\n\n\t\t}\n\n\t}",
"private void overrideProperties() throws BuildException {\n // remove duplicate properties - last property wins\n // Needed for backward compatibility\n Set set = new HashSet();\n for (int i = properties.size() - 1; i >= 0; --i) {\n Property p = (Property) properties.get(i);\n if (p.getName() != null && !p.getName().equals(\"\")) {\n if (set.contains(p.getName())) {\n properties.remove(i);\n } else {\n set.add(p.getName());\n }\n }\n }\n Enumeration e = properties.elements();\n while (e.hasMoreElements()) {\n Property p = (Property) e.nextElement();\n p.setProject(newProject);\n p.execute();\n }\n getProject().copyInheritedProperties(newProject);\n }",
"@Override\n\t\tpublic void processPropertyDocument(PropertyDocument propertyDocument) {\n\t\t}",
"@Override\r\n\tpublic void afterPropertiesSet() throws Exception {\n\t\t\r\n\t}",
"PropertyRegistry getPropertyRegistry();",
"@Override\n public void afterPropertiesSet() {\n // TODO: instead of autowiring initialize page objects with proxies\n try {\n Field mapField = Validator.class.getDeclaredField(\"map\");\n mapField.setAccessible(true);\n mapField.set(validator, map);\n\n Field uiField = Validator.class.getDeclaredField(\"ui\");\n uiField.setAccessible(true);\n uiField.set(validator, ui);\n } catch (ReflectiveOperationException e) {\n throw new RuntimeException(\"Could not instantiate the page object!\", e);\n }\n }",
"@Bean\n\t@ConditionalOnProperty(SPRINGDOC_SCHEMA_RESOLVE_PROPERTIES)\n\t@Lazy(false)\n\tOpenApiCustomiser propertiesResolverForSchema(PropertyResolverUtils propertyResolverUtils, OpenAPIBuilder openAPIBuilder) {\n\t\treturn openApi -> {\n\t\t\tComponents components = openApi.getComponents();\n\t\t\tMap<String, Schema> schemas = components.getSchemas();\n\t\t\tschemas.values().forEach(schema -> openAPIBuilder.resolveProperties(schema, propertyResolverUtils));\n\t\t};\n\t}",
"public void replaceWicketComponentResolver(Class<? extends IComponentResolver> replacedClass, IComponentResolver newResolver) {\n\t\tPageSettings pageSettings = (PageSettings)getPageSettings();\n\t\tfor (Iterator<IComponentResolver> it = pageSettings.getComponentResolvers().iterator(); it.hasNext(); ) {\n\t\t\tIComponentResolver existingResolver = it.next();\n\t\t\tif (replacedClass.isInstance(existingResolver)) {\n\t\t\t\tit.remove();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (newResolver != null) {\n\t\t\tpageSettings.addComponentResolver(newResolver);\n\t\t}\n\t}",
"@Override\n public String getProperty(String s) {\n return null;\n }",
"@Test\n\tvoid thirdPartyConfigurationPropertiesWithImportAsConfigurationPropertiesCanOptInForJavaBeanConvention() {\n\t\tthis.contextRunner.withUserConfiguration(ImportThirdParty3PropertiesConfiguration.class)\n\t\t\t\t.withPropertyValues(\"test.name=test\", \"test.counter=20\").run((context) -> {\n\t\t\t\t\tThirdParty3Properties properties = context.getBean(ThirdParty3Properties.class);\n\t\t\t\t\tassertThat(properties.getName()).isEqualTo(\"test\");\n\t\t\t\t\tassertThat(properties.getCounter()).isEqualTo(42);\n\t\t\t\t});\n\t}",
"@Override\n\tpublic void afterPropertiesSet() throws Exception {\n\n\t}",
"@Override\n\tpublic void afterPropertiesSet() throws Exception {\n\n\t}",
"protected NodeNameResolver getNodeNameResolver(Properties props) {\n\t\treturn null;\n\t}",
"@Bean\n @Profile(\"test\")\n public static PropertySourcesPlaceholderConfigurer pspcTest() {\n\n PropertySourcesPlaceholderConfigurer pspc\n = new PropertySourcesPlaceholderConfigurer();\n\n pspc.setLocalOverride(true);\n\n return pspc;\n }",
"@Override\n public EntityResolver getEntityResolver() {\n return entityResolver;\n }",
"@Test\n public void testConfigurationBuilderProviderOverrideProperties()\n throws Exception\n {\n factory.addProperty(\"override.configuration[@fileName]\",\n TEST_FILE.getAbsolutePath());\n factory.addProperty(\"override.configuration[@basePath]\", \"base\");\n factory.addProperty(\"override.configuration[@throwExceptionOnMissing]\",\n \"false\");\n factory.setBasePath(\"conf\");\n factory.setThrowExceptionOnMissing(true);\n DefaultConfigurationBuilder.ConfigurationDeclaration decl =\n new DefaultConfigurationBuilder.ConfigurationDeclaration(\n factory,\n factory.configurationAt(\"override.configuration\"));\n DefaultConfigurationBuilder.ConfigurationBuilderProvider provider =\n new DefaultConfigurationBuilder.ConfigurationBuilderProvider();\n DefaultConfigurationBuilder child =\n (DefaultConfigurationBuilder) provider.createBean(\n provider.fetchConfigurationClass(), decl, null);\n assertEquals(\"Wrong base path\", \"base\", child.getBasePath());\n assertFalse(\"Wrong exception flag\", child.isThrowExceptionOnMissing());\n }",
"public void setEntityResolver(final EntityResolver resolver) {\r\n _resolver = new DTDResolver(resolver);\r\n }",
"@Override\n public Property getProperty() throws ItemNotFoundException,\n ValueFormatException, RepositoryException {\n return null;\n }",
"public void setNamedObjectResolver(NamedObjectResolver namedObjectResolver) {\n this.namedObjectResolver = namedObjectResolver;\n }",
"public void configure(PropertiesGetter properties) {\n\t\t// TODO Auto-generated method stub\n\n\t}",
"public TestProperties() {\n\t\tthis.testProperties = new Properties();\n\t}",
"@Override\n protected void updateProperties() {\n }",
"public SpotPropertyManager() {\r\n\t\tsuper();\r\n\t}",
"public void testBeforeSet() throws Exception {\r\n GroovyClassLoader gcl = new GroovyClassLoader();\r\n final Class<?> testClass = gcl.parseClass(\"class Test { def prop = 'hello' }\");\r\n GroovyObject go = (GroovyObject)testClass.newInstance();\r\n\r\n ProxyMetaClass pmc = ProxyMetaClass.getInstance(testClass);\r\n go.setMetaClass(pmc);\r\n\r\n pmc.setInterceptor( new PropertyAccessInterceptor(){\r\n\r\n public Object beforeGet(Object object, String property, InvocationCallback callback) {\r\n return null;\r\n }\r\n\r\n public void beforeSet(Object object, String property, Object newValue, InvocationCallback callback) {\r\n assertEquals(\"prop\", property);\r\n BeanWrapper bean = new BeanWrapperImpl(object);\r\n bean.setPropertyValue(\"prop\",\"success\");\r\n callback.markInvoked();\r\n }\r\n\r\n public Object beforeInvoke(Object object, String methodName, Object[] arguments, InvocationCallback callback) {\r\n return null;\r\n }\r\n\r\n public Object afterInvoke(Object object, String methodName, Object[] arguments, Object result) {\r\n return null;\r\n }\r\n });\r\n\r\n go.setProperty(\"prop\", \"newValue\");\r\n Object result = go.getProperty(\"prop\");\r\n assertNotNull(result);\r\n assertEquals(\"success\",result);\r\n }",
"public void verify()\n\t{\n\t\ttry\n\t\t{\n\t\t\tClass<?> propertyType = descriptor.getPropertyType();\n\t\t\t// delegate first to the provided type factory to create a type\n\t\t\t// instance\n\t\t\tObject propertyInstance = typeFactory.create(propertyType);\n\t\t\tif (propertyInstance == null)\n\t\t\t{\n\t\t\t\tpropertyInstance = createInstanceOfType(propertyType);\n\t\t\t}\n\t\t\tif (propertyInstance == null)\n\t\t\t{\n\t\t\t\t// Use Mockito to mock the property\n\t\t\t\t// TODO Use the Reflection API's Proxy instead\n\t\t\t\tpropertyInstance = mock(propertyType);\n\t\t\t}\n\t\t\tif (propertyInstance == null)\n\t\t\t{\n\t\t\t\tfail(\"Failed to create a mock object of type\" + propertyType.getName());\n\t\t\t}\n\n\t\t\t// Setup\n\t\t\tObject system = typeFactory.create(type);\n\t\t\tif (system == null)\n\t\t\t{\n\t\t\t\tsystem = type.newInstance();\n\t\t\t}\n\n\t\t\t// Execute\n\t\t\tMethod writeMethod = descriptor.getWriteMethod();\n\t\t\tMethod readMethod = descriptor.getReadMethod();\n\t\t\twriteMethod.invoke(system, propertyInstance);\n\t\t\tObject actualObject = readMethod.invoke(system, (Object[]) null);\n\n\t\t\t// Verify\n\t\t\tassertEquals(String.format(\"Verification failed for property %s\", descriptor.getName()), propertyInstance,\n\t\t\t\t\tactualObject);\n\t\t}\n\t\tcatch (IllegalAccessException illegalEx)\n\t\t{\n\t\t\tlogger.error(null, illegalEx);\n\t\t\tfail(\"Verification failed for property:\" + descriptor.getName());\n\t\t}\n\t\tcatch (InstantiationException instanceEx)\n\t\t{\n\t\t\tlogger.error(null, instanceEx);\n\t\t\tfail(\"Verification failed for property:\" + descriptor.getName());\n\t\t}\n\t\tcatch (InvocationTargetException invokeEx)\n\t\t{\n\t\t\tlogger.error(null, invokeEx);\n\t\t\tfail(\"Verification failed for property:\" + descriptor.getName());\n\t\t}\n\t}",
"public void setEntityResolver(EntityResolver aEntityResolver) {\n\t\tparserImpl.setEntityResolver(aEntityResolver);\n\t}",
"public ValidatorFactory setMessageResolver(MessageResolver resolver) {\n this.messageResolver = resolver == null ? MessageResolver.DEFAULT : resolver;\n return this;\n }",
"public CatalogResolver getResolver() {\n return resolver;\n }",
"private void setBasePolicyClassProp(String name) throws TestException {\n try {\n Security.setProperty(basePolicyClassProperty, name);\n logger.log(Level.FINE, \"Reset basePolicyClassProperty to \" + name);\n } catch (Exception e) {\n throw new TestException(e.toString());\n }\n }",
"@Override\n public abstract boolean needsResolving();",
"@Override\n\tpublic void afterPropertiesSet() {\n\t\tinitExceptionHandlerAdviceCache();\n\n\t\tif (this.argumentResolvers == null) {\n\t\t\tList<HandlerMethodArgumentResolver> resolvers = getDefaultArgumentResolvers();\n\t\t\tthis.argumentResolvers = new HandlerMethodArgumentResolverComposite().addResolvers(resolvers);\n\t\t}\n\t\tif (this.returnValueHandlers == null) {\n\t\t\tList<HandlerMethodReturnValueHandler> handlers = getDefaultReturnValueHandlers();\n\t\t\tthis.returnValueHandlers = new HandlerMethodReturnValueHandlerComposite().addHandlers(handlers);\n\t\t}\n\t}",
"private PropertyAccess() {\n\t\tsuper();\n\t}",
"@Override\n public String replace(String s)\n {\n if (this.propertyName.equals(s))\n {\n if (this.parentContext != null)\n {\n return this.parentContext.findProperty(s);\n }\n\n // Property is referencing equally named property from higher context\n // but there is no higher context\n return s;\n }\n\n // Property is referencing NOT equally named property from its context or higher context\n return this.context.findProperty(s);\n }",
"@Override\n\tprotected void retractResolverSub(ConstraintNetwork metaVariable,\n\t\t\tConstraintNetwork metaValue) {\n\t\t\n\t}",
"protected abstract String getFactPropertyType(Object property);",
"PropertyRule createPropertyRule();",
"private ReadProperty()\r\n {\r\n\r\n }",
"public T caseProperty(Property object) {\r\n\t\treturn null;\r\n\t}",
"private DiffProperty() {\n\t\t// No implementation\n\t}",
"public Property getProperty() {\n\treturn commonproperty;\r\n}",
"@Autowired\n public final void setLocaleResolver(final LocaleResolver localeResolver) {\n this.localeResolver = localeResolver;\n }"
] | [
"0.6673479",
"0.629805",
"0.6243793",
"0.6045432",
"0.6038588",
"0.57540816",
"0.5719035",
"0.5617479",
"0.5607412",
"0.55774325",
"0.55176014",
"0.54933447",
"0.5431183",
"0.5401168",
"0.5379556",
"0.536488",
"0.53642625",
"0.53364664",
"0.5297101",
"0.5274983",
"0.5262303",
"0.52530015",
"0.5231443",
"0.5210427",
"0.51696247",
"0.5167494",
"0.51662314",
"0.51479965",
"0.5135102",
"0.5124697",
"0.5124697",
"0.5124697",
"0.5112891",
"0.51112777",
"0.51006883",
"0.5082271",
"0.50812846",
"0.5081234",
"0.5081133",
"0.5078558",
"0.50707304",
"0.5068479",
"0.5068479",
"0.5068479",
"0.5068479",
"0.5068479",
"0.5068479",
"0.5068479",
"0.5068479",
"0.50546473",
"0.5051986",
"0.5047956",
"0.50389916",
"0.5033876",
"0.5032145",
"0.50285023",
"0.5013119",
"0.5006569",
"0.49833533",
"0.49826378",
"0.49789652",
"0.49767464",
"0.49744734",
"0.49739406",
"0.49645242",
"0.49620867",
"0.49443996",
"0.49412102",
"0.49364784",
"0.49334064",
"0.49334064",
"0.49331594",
"0.49189693",
"0.49147263",
"0.49086037",
"0.49059865",
"0.4895305",
"0.48894998",
"0.4882312",
"0.48796892",
"0.48705256",
"0.4868225",
"0.48637497",
"0.48619494",
"0.48543656",
"0.48527765",
"0.48519415",
"0.48503703",
"0.48495203",
"0.484579",
"0.48403737",
"0.48364025",
"0.48353004",
"0.48341155",
"0.48300102",
"0.48293447",
"0.48270306",
"0.48243934",
"0.48227954",
"0.48193556"
] | 0.62167454 | 3 |
/ restore the original PropertyResolver. | public void restorePropertyResolver(ActionEvent action) {
FacesContext context = FacesContext.getCurrentInstance();
Application app = context.getApplication();
PropertyResolver oldProp = null;
// see if we need to take action-
if (null != (oldProp = (PropertyResolver) context.getExternalContext().getSessionMap().get("systest.replacePropertyResolver"))) {
app.setPropertyResolver(oldProp);
context.getExternalContext().getSessionMap().remove("systest.replacePropertyResolver");
setValueChangeMessage(null);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void replacePropertyResolver(ActionEvent action) {\n FacesContext context = FacesContext.getCurrentInstance();\n Application app = context.getApplication();\n \n // see if we need to take action-\n if (null == context.getExternalContext().getSessionMap().get(\"systest.replacePropertyResolver\")) {\n final PropertyResolver oldProp = app.getPropertyResolver();\n PropertyResolver\n newProp = new PropertyResolver() {\n public Object getValue(Object base, Object property)\n throws EvaluationException, PropertyNotFoundException {\n return oldProp.getValue(base, property);\n }\n \n public Object getValue(Object base, int index)\n throws EvaluationException, PropertyNotFoundException {\n return oldProp.getValue(base, index);\n }\n \n public void setValue(Object base, Object property, Object value)\n throws EvaluationException, PropertyNotFoundException {\n TestBean.this.setValueChangeMessage(\"setValue() called\");\n oldProp.setValue(base, property, value);\n }\n \n public void setValue(Object base, int index, Object value)\n throws EvaluationException, PropertyNotFoundException {\n TestBean.this.setValueChangeMessage(\"setValue() called\");\n oldProp.setValue(base, index, value);\n }\n \n public boolean isReadOnly(Object base, Object property)\n throws EvaluationException, PropertyNotFoundException {\n return oldProp.isReadOnly(base, property);\n }\n \n public boolean isReadOnly(Object base, int index)\n throws EvaluationException, PropertyNotFoundException {\n return oldProp.isReadOnly(base, index);\n }\n \n public Class getType(Object base, Object property)\n throws EvaluationException, PropertyNotFoundException {\n return oldProp.getType(base, property);\n }\n \n public Class getType(Object base, int index)\n throws EvaluationException, PropertyNotFoundException {\n return oldProp.getType(base, index);\n }\n \n };\n app.setPropertyResolver(newProp);\n context.getExternalContext().getSessionMap().put(\"systest.replacePropertyResolver\", oldProp);\n }\n }",
"public void setResolver( final PropertyResolver propertyResolver )\n {\n m_propertyResolver = propertyResolver;\n }",
"@Override\n public void restore() {\n }",
"public void setEntityResolver(EntityResolver resolver)\n {\n if (resolver instanceof EntityResolver2)\n {\n resolver2 = (EntityResolver2) resolver;\n }\n else\n {\n resolver2 = null;\n }\n if (resolver == null)\n {\n resolver = base;\n }\n entityResolver = resolver;\n }",
"private void restoreProperties() {\n restoreModeAndItemValue();\n restoreStringValue(Variable.DEST_PATH);\n restoreBooleanValue(Variable.MAXTRACKS_ENABLED);\n restoreIntValue(Variable.MAXTRACKS);\n restoreBooleanValue(Variable.MAXSIZE_ENABLED);\n restoreIntValue(Variable.MAXSIZE);\n restoreBooleanValue(Variable.MAXLENGTH_ENABLED);\n restoreIntValue(Variable.MAXLENGTH);\n restoreBooleanValue(Variable.ONE_MEDIA_ENABLED);\n restoreStringValue(Variable.ONE_MEDIA);\n restoreBooleanValue(Variable.CONVERT_MEDIA);\n restoreStringValue(Variable.CONVERT_COMMAND);\n if (StringUtils.isBlank((String) data.get(Variable.CONVERT_COMMAND))) {\n data.put(Variable.CONVERT_COMMAND, \"pacpl\"); // use default value if none set\n // yet\n }\n restoreBooleanValue(Variable.NORMALIZE_FILENAME);\n restoreIntValue(Variable.RATING_LEVEL);\n }",
"void restoreDefaultProperties() throws StorageException, ValidationException, KeyValueStoreException;",
"public EntityResolver getEntityResolver()\n {\n return (entityResolver == base) ? null : entityResolver;\n }",
"private void restoreOriginalDomainConfig() {\n getDASDomainXML().delete();\n report(\"restored-domain\", movedDomXml.renameTo(getDASDomainXML()));\n }",
"protected void afterPropertiesSetInternal() {\n\t\t// override this method\n\t}",
"@Override\n\tprotected void retractResolverSub(ConstraintNetwork metaVariable,\n\t\t\tConstraintNetwork metaValue) {\n\t\t\n\t}",
"public abstract void restore();",
"@Override\n public EntityResolver getEntityResolver() {\n return entityResolver;\n }",
"public static void forceReload() {\n properties = null;\n getProperties();\n }",
"PropertyChangeEvent rollback()\n {\n PropertyChangeEvent result\n = new PropertyChangeEvent(source, propertyName, newValue, oldValue);\n result.propagationId = propagationId;\n return result;\n }",
"private void appendResolver(IPropertyResolver resolver) {\r\n List<IPropertyResolver> existingResolvers = resolvers.get();\r\n List<IPropertyResolver> newResolvers = new ArrayList<>(existingResolvers);\r\n newResolvers.add(resolver);\r\n resolvers.set(newResolvers);\r\n }",
"PropertyRealization createPropertyRealization();",
"protected Object readResolve() {\n\t\ttry {\n\t\t\treturn fromLotus(resurrectAgent(), Agent.SCHEMA, getAncestorDatabase());\n\t\t} catch (NotesException e) {\n\t\t\tDominoUtils.handleException(e);\n\t\t\treturn this;\n\t\t}\n\t}",
"public DependencyResolver getResolver() {\n return resolver;\n }",
"@Test\n public void testResolveWithSysPropResolver() {\n Resolver sysPropResolver = VariableExpansion.SYS_PROP_RESOLVER;\n\n assertNull(\"System property value unexpectedly set already\", System.getProperty(testPropName));\n assertNull(\"Expected resolve to return null as property not set\", sysPropResolver.resolve(testPropName));\n\n setTestSystemProperty(testPropName, testPropValue);\n\n assertEquals(\"System property value not as expected\", testPropValue, System.getProperty(testPropName));\n assertEquals(\"Resolved variable not as expected\", testPropValue, sysPropResolver.resolve(testPropName));\n }",
"public void resetProperties ()\n\t{\n\t\tproperties.clear();\n\t}",
"private Object readResolve() {\r\n return this;\r\n }",
"public interface LazyResolver {\n\n LazyResolveContext getLazyResolveContext();\n\n void setLazyResolveContext(LazyResolveContext context);\n\n /**\n * Base class of {@link ObjectResolver} instances that are owned by a parent {@link LazyResolver}.\n */\n abstract class ObjectResolverImpl<T extends UniqueIdentifiable> implements ObjectResolver<T>, DeepResolver {\n\n private final LazyResolver _parent;\n private final ObjectResolver<T> _underlying;\n\n public ObjectResolverImpl(final LazyResolver parent, final ObjectResolver<T> underlying) {\n _parent = parent;\n _underlying = underlying;\n }\n\n protected ObjectResolver<T> getUnderlying() {\n return _underlying;\n }\n\n protected abstract T lazy(T object, LazyResolveContext.AtVersionCorrection context);\n\n @Override\n public T resolveObject(final UniqueId uniqueId, final VersionCorrection versionCorrection) {\n final T underlying = _underlying.resolveObject(uniqueId, versionCorrection);\n if (underlying == null) {\n return null;\n }\n return lazy(underlying, _parent.getLazyResolveContext().atVersionCorrection(versionCorrection));\n }\n\n @Override\n public ChangeManager changeManager() {\n return getUnderlying().changeManager();\n }\n\n @Override\n public DeepResolver deepResolver() {\n return this;\n }\n\n }\n\n /**\n * Base class of {@link Resolver} instances that are owned by a parent {@link LazyResolver}.\n */\n abstract class ResolverImpl<T extends UniqueIdentifiable> extends ObjectResolverImpl<T> implements Resolver<T> {\n\n public ResolverImpl(final LazyResolver parent, final Resolver<T> underlying) {\n super(parent, underlying);\n }\n\n @Override\n protected Resolver<T> getUnderlying() {\n return (Resolver<T>) super.getUnderlying();\n }\n\n @Override\n public UniqueId resolveExternalId(final ExternalIdBundle identifiers, final VersionCorrection versionCorrection) {\n return getUnderlying().resolveExternalId(identifiers, versionCorrection);\n }\n\n @Override\n public Map<ExternalIdBundle, UniqueId> resolveExternalIds(final Collection<ExternalIdBundle> identifiers, final VersionCorrection versionCorrection) {\n return getUnderlying().resolveExternalIds(identifiers, versionCorrection);\n }\n\n @Override\n public UniqueId resolveObjectId(final ObjectId identifier, final VersionCorrection versionCorrection) {\n return getUnderlying().resolveObjectId(identifier, versionCorrection);\n }\n\n @Override\n public Map<ObjectId, UniqueId> resolveObjectIds(final Collection<ObjectId> identifiers, final VersionCorrection versionCorrection) {\n return getUnderlying().resolveObjectIds(identifiers, versionCorrection);\n }\n\n }\n\n /**\n * Lazy resolution of portfolios.\n */\n class LazyPortfolioResolver extends ResolverImpl<Portfolio> {\n\n public LazyPortfolioResolver(final LazyResolver parent, final Resolver<Portfolio> underlying) {\n super(parent, underlying);\n }\n\n // ObjectResolverImpl\n\n @Override\n public Portfolio lazy(final Portfolio object, final LazyResolveContext.AtVersionCorrection context) {\n return new LazyResolvedPortfolio(context, object);\n }\n\n // DeepResolver\n\n @Override\n public UniqueIdentifiable withLogger(final UniqueIdentifiable underlying, final ResolutionLogger logger) {\n if (underlying instanceof Portfolio) {\n return new LoggedResolutionPortfolio((Portfolio) underlying, logger);\n }\n return null;\n }\n\n }\n\n /**\n * Lazy resolution of portfolio nodes.\n */\n class LazyPortfolioNodeResolver extends ResolverImpl<PortfolioNode> {\n\n public LazyPortfolioNodeResolver(final LazyResolver parent, final Resolver<PortfolioNode> underlying) {\n super(parent, underlying);\n }\n\n // ObjectResolverImpl\n\n @Override\n public PortfolioNode lazy(final PortfolioNode object, final LazyResolveContext.AtVersionCorrection context) {\n return new LazyResolvedPortfolioNode(context, object);\n }\n\n // DeepResolver\n\n @Override\n public UniqueIdentifiable withLogger(final UniqueIdentifiable underlying, final ResolutionLogger logger) {\n if (underlying instanceof PortfolioNode) {\n return new LoggedResolutionPortfolioNode((PortfolioNode) underlying, logger);\n }\n return null;\n }\n\n }\n\n /**\n * Lazy resolution of positions.\n */\n class LazyPositionResolver extends ResolverImpl<Position> {\n\n public LazyPositionResolver(final LazyResolver parent, final Resolver<Position> underlying) {\n super(parent, underlying);\n }\n\n // ResolverImpl\n\n @Override\n public Position lazy(final Position object, final LazyResolveContext.AtVersionCorrection context) {\n return new LazyResolvedPosition(context, object);\n }\n\n // DeepResolver\n\n @Override\n public UniqueIdentifiable withLogger(final UniqueIdentifiable underlying, final ResolutionLogger logger) {\n if (underlying instanceof Position) {\n return new LoggedResolutionPosition((Position) underlying, logger);\n }\n return null;\n }\n\n }\n\n /**\n * Lazy resolution of trades.\n */\n class LazyTradeResolver extends ResolverImpl<Trade> {\n\n public LazyTradeResolver(final LazyResolver parent, final Resolver<Trade> underlying) {\n super(parent, underlying);\n }\n\n // ObjectResolverImpl\n\n @Override\n public Trade lazy(final Trade object, final LazyResolveContext.AtVersionCorrection context) {\n return new LazyResolvedTrade(context, object);\n }\n\n // DeepResolver\n\n @Override\n public UniqueIdentifiable withLogger(final UniqueIdentifiable underlying, final ResolutionLogger logger) {\n if (underlying instanceof Trade) {\n return new LoggedResolutionTrade((Trade) underlying, logger);\n }\n return null;\n }\n\n }\n\n}",
"@Override\n public void setEntityResolver(EntityResolver entityResolver) {\n this.entityResolver = entityResolver;\n }",
"private final void restoreOriginalGraph() {\n // Safeguard against multiple restores\n if (startIndex == -1) return;\n \n markEdgesFrom(startIndex, false);\n markEdgesFrom(endIndex, false);\n markHasEdgeToGoal(false);\n nOutgoingEdgess[endIndex] = endOriginalSize;\n nOutgoingEdgess[startIndex] = startOriginalSize;\n nEdges = originalNEdges;\n\n nNodes = originalSize;\n startIndex = -1;\n endIndex = -1;\n }",
"public void setBeanResolver(BeanResolver beanResolver) {\n\t\tthis.evalContext.setBeanResolver(beanResolver);\n\t\tthis.evalContext.setTypeConverter(new StandardTypeConverter());\n\t\tthis.evalContext.addPropertyAccessor(new MapAccessor());\n\t}",
"public ListProperty<IPropertyResolver> getResolvers() {\r\n return resolvers;\r\n }",
"public Resolver(Resolver parentResolver) {\n\t\tparent = parentResolver;\n\t\tstorage = new Slots();\n\t}",
"public Staff getResolver(){return resolver;}",
"public void setDependencyResolver( DependencyResolver resolver )\r\n {\r\n this.resolver = resolver;\r\n }",
"public void revise()\n {\n \n super.revise();\n }",
"public CatalogResolver getResolver() {\n return resolver;\n }",
"protected AbstractNamedValueArgumentResolver() {\n\t\tthis.conversionService = null;\n\t}",
"@Override\r\n\t\t\tprotected void restoreContext() {\n\t\t\t\t\r\n\t\t\t}",
"public void restore() {\n setOrientation(0);\n setCropRect(getMaxCenteredCropRect(), false);\n autoZoom(true);\n }",
"@Override\r\n\tpublic void resetPropertyValue(Object id) {\n\r\n\t}",
"public void refresh()\n {\n PropertyManager.getInstance().refresh();\n init(this.path);\n }",
"private Object readResolve() {\n\t\tSystem.out.println(\"------\");\n\t\treturn this;\n\t}",
"public void restoreState() {\n\t\tsuper.restoreState();\n\t}",
"void load() {\n\t\ttry {\n\t\t\tfinal FileInputStream fis = new FileInputStream(propertyFile);\n\t\t\tfinal Properties newProperties = new Properties();\n\t\t\tnewProperties.load(fis);\n\t\t\ttimeLastRead = propertyFile.lastModified();\n\t\t\tproperties = newProperties;\n\t\t\tfis.close();\n\t\t} catch (final Exception e) {\n\t\t\tlogger.info(\"Property file \" + propertyFile + \" \" + e.getMessage());\n\t\t}\n\t}",
"protected Object readResolve() {\n return Holder.INSTANCE;\n }",
"protected Object readResolve() throws ObjectStreamException {\n\t\tfinalizeData();\n\t\treturn this;\n\t}",
"public void setURIResolver(URIResolver resolver){\n m_uriResolver=resolver;\n }",
"@Override\n\tpublic void propertyChange() {\n\t\tthis.apply();\n\t}",
"protected Property mapProperty(Node root, Property property)\n throws RepositoryException {\n if (property.getType() != PropertyType.STRING) {\n // a mapped property must be of type string\n return null;\n }\n\n // array containing the expressions: ${<path>}\n Value[] values;\n if (property.isMultiple()) {\n values = property.getValues();\n } else {\n values = new Value[1];\n values[0] = property.getValue();\n }\n\n boolean deleteProperty = false;\n for (Value value : values) {\n Matcher matcher = MAPPED_PATTERN.matcher(value.getString());\n if (matcher.matches()) {\n // this is a mapped property, we will delete it if the mapped destination\n // property doesn't exist\n deleteProperty = true;\n String path = matcher.group(2);\n // unwrap quoted property paths\n path = StringUtils.removeStart(StringUtils.stripEnd(path, \"\\'\"), \"\\'\");\n if (root.hasProperty(path)) {\n // replace property by mapped value in the original tree\n Property originalProperty = root.getProperty(path);\n String name = property.getName();\n Node parent = property.getParent();\n property.remove();\n Property newProperty = JcrUtil.copy(originalProperty, parent, name);\n\n // negate boolean properties if negation character has been set\n String negate = matcher.group(1);\n if (\"!\".equals(negate) && originalProperty.getType() == PropertyType.BOOLEAN) {\n newProperty.setValue(!newProperty.getBoolean());\n }\n\n // the mapping was successful\n deleteProperty = false;\n break;\n } else {\n String defaultValue = matcher.group(4);\n if (defaultValue != null) {\n if (property.isMultiple()) {\n // the property is multiple in the replacement,\n // recreate it so we can set the property to the default\n String name = property.getName();\n Node parent = property.getParent();\n property.remove();\n parent.setProperty(name, defaultValue);\n } else {\n property.setValue(defaultValue);\n }\n\n deleteProperty = false;\n break;\n }\n }\n }\n }\n if (deleteProperty) {\n // mapped destination does not exist, we don't include the property in replacement tree\n property.remove();\n return null;\n }\n\n return property;\n }",
"public final void restoreValueOriginal(){\n wChanged = false;\n try {\n wValue = this.getValueOriginal();\n wValueOriginal = wValue;\n setMessage(null);\n\t\t} catch (Exception xE) {\n\t\t\twLogger.error(xE);\n\t\t}\n }",
"@Override\n\tpublic void afterPropertiesSet() {\n\t\tinitExceptionHandlerAdviceCache();\n\n\t\tif (this.argumentResolvers == null) {\n\t\t\tList<HandlerMethodArgumentResolver> resolvers = getDefaultArgumentResolvers();\n\t\t\tthis.argumentResolvers = new HandlerMethodArgumentResolverComposite().addResolvers(resolvers);\n\t\t}\n\t\tif (this.returnValueHandlers == null) {\n\t\t\tList<HandlerMethodReturnValueHandler> handlers = getDefaultReturnValueHandlers();\n\t\t\tthis.returnValueHandlers = new HandlerMethodReturnValueHandlerComposite().addHandlers(handlers);\n\t\t}\n\t}",
"@Override\n\tpublic IPropertySetter getPropertySetter() {\n\t\treturn null;\n\t}",
"protected Object readResolve() {\r\n\t\treturn getInstance();\r\n\t}",
"protected Object readResolve() {\r\n\t\treturn getInstance();\r\n\t}",
"@Override\n public void afterPropertiesSet() {\n }",
"public void reset() {\r\n properties.clear();\r\n }",
"public void restoreState() \n\t{\n\t\tsuper.restoreState();\n\t}",
"public Resolution reset() {\r\n this.resetData();\r\n return new RedirectResolution(ADD_ORG_PAGE).flash(this);\r\n }",
"private void setAttributesIntoStrategy() {\n ResolverStrategy strategy = _resolverStrategy;\n strategy.setProperty(\n ResolverStrategy.PROPERTY_LOAD_PACKAGE_MAPPINGS, \n _loadPackageMappings);\n strategy.setProperty(\n ResolverStrategy.PROPERTY_USE_INTROSPECTION, _useIntrospector);\n strategy.setProperty(\n ResolverStrategy.PROPERTY_MAPPING_LOADER, _mappingLoader);\n strategy.setProperty(\n ResolverStrategy.PROPERTY_INTROSPECTOR, _introspector);\n }",
"@Override\n\tpublic IPropertyGetter getPropertyGetter() {\n\t\treturn null;\n\t}",
"public Object cloner() {\n return cloner((Sommet)origine.cloner(), (Sommet)destination.cloner());\n }",
"public void setValue(ELContext context, Object base, Object property, Object val) {\n/* 349 */ context.setPropertyResolved(false);\n/* */ \n/* 351 */ for (int i = 0; i < this.size; i++) {\n/* 352 */ this.elResolvers[i].setValue(context, base, property, val);\n/* 353 */ if (context.isPropertyResolved()) {\n/* */ return;\n/* */ }\n/* */ } \n/* */ }",
"@Override\n public void afterPropertiesSet() {\n validateProperties();\n }",
"private void restore() {\n AppSettings.setInstance(backupConfig);\n }",
"void invalidateProperties() {\n super.invalidateProperties();\n token_ = null;\n }",
"@Bean\n\tpublic LocaleResolver localResolver(){\n\t\tSessionLocaleResolver slr = new SessionLocaleResolver();\n\t\tslr.setDefaultLocale(Locale.FRANCE);\n\t\treturn slr;\n\t}",
"protected String convertPropertyValue(String originalValue) {\n\t\treturn originalValue;\n\t}",
"public void restore() {\n currentIm= originalIm.copy();\n }",
"protected Object readResolve() {\n calculateHashCode(keys);\n return this;\n }",
"protected Object readResolve() {\n return getInstance();\n }",
"@Bean\n\tPropertyResolverUtils propertyResolverUtils(ConfigurableBeanFactory factory) {\n\t\treturn new PropertyResolverUtils(factory);\n\t}",
"protected ComponentResolver createComponentResolver() {\n return new DefaultComponentResolver();\n }",
"public void changePolyOriginal() {\n this.changePoly(this.aorg, this.borg, this.corg, this.dorg, this.yorg);\n }",
"public void replaceWicketComponentResolver(Class<? extends IComponentResolver> replacedClass, IComponentResolver newResolver) {\n\t\tPageSettings pageSettings = (PageSettings)getPageSettings();\n\t\tfor (Iterator<IComponentResolver> it = pageSettings.getComponentResolvers().iterator(); it.hasNext(); ) {\n\t\t\tIComponentResolver existingResolver = it.next();\n\t\t\tif (replacedClass.isInstance(existingResolver)) {\n\t\t\t\tit.remove();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (newResolver != null) {\n\t\t\tpageSettings.addComponentResolver(newResolver);\n\t\t}\n\t}",
"public ValidatorFactory setMessageResolver(MessageResolver resolver) {\n this.messageResolver = resolver == null ? MessageResolver.DEFAULT : resolver;\n return this;\n }",
"public NamePathResolver getNamePathResolver() {\n return resolver;\n }",
"@Override\n public void restoreState(Map<String, Object> state) {\n\n }",
"public void setEntityResolver(EntityResolver aEntityResolver) {\n\t\tparserImpl.setEntityResolver(aEntityResolver);\n\t}",
"protected void forceLazyInitialization() {\n getExchangeConverter();\n getInjector();\n getLanguageResolver();\n getTypeConverter();\n }",
"@Override\n public void resolve(DeserializationContext ctxt) throws JsonMappingException {\n ((ResolvableDeserializer) defaultDeserializer).resolve(ctxt);\n }",
"@Override\n protected void updateProperties() {\n }",
"public void restore(Object obj) throws HibException;",
"@Override\r\n\tpublic void afterPropertiesSet() throws Exception {\n\t\tloadRules2();\r\n\t}",
"public void afterPropertiesSet() {\r\n\t}",
"public void afterPropertiesSet() {\n\t}",
"public void afterPropertiesSet() {\n\t}",
"public void afterPropertiesSet() {\n\t}",
"public void afterPropertiesSet() {\n\t}",
"public void afterPropertiesSet() {\n\t}",
"public void afterPropertiesSet() {\n\t}",
"public void afterPropertiesSet() {\n\t}",
"public void afterPropertiesSet() {\n\t}",
"@Before(order=0)\n\tpublic void getProperty() {\n\t\tconfigReader = new ConfigReaders();\n\t\tprop = configReader.init_prop();\n\t\t\n\t}",
"@Bean\n public LocaleResolver localeResolver() {\n SessionLocaleResolver slr = new SessionLocaleResolver();\n slr.setDefaultLocale(Locale.US);\n return slr;\n }",
"private void overrideProperties() throws BuildException {\n // remove duplicate properties - last property wins\n // Needed for backward compatibility\n Set set = new HashSet();\n for (int i = properties.size() - 1; i >= 0; --i) {\n Property p = (Property) properties.get(i);\n if (p.getName() != null && !p.getName().equals(\"\")) {\n if (set.contains(p.getName())) {\n properties.remove(i);\n } else {\n set.add(p.getName());\n }\n }\n }\n Enumeration e = properties.elements();\n while (e.hasMoreElements()) {\n Property p = (Property) e.nextElement();\n p.setProject(newProject);\n p.execute();\n }\n getProject().copyInheritedProperties(newProject);\n }",
"@Parameterized.AfterParam\n public static void restoreAfter() {\n getApplicationContext().getResources().getDisplayMetrics().setTo(OLD_DISPLAY_METRICS);\n }",
"public Object getValue(ELContext context, Object base, Object property) {\n/* 143 */ context.setPropertyResolved(false);\n/* */ \n/* 145 */ Object value = null;\n/* 146 */ for (int i = 0; i < this.size; i++) {\n/* 147 */ value = this.elResolvers[i].getValue(context, base, property);\n/* 148 */ if (context.isPropertyResolved()) {\n/* 149 */ return value;\n/* */ }\n/* */ } \n/* 152 */ return null;\n/* */ }",
"void setupPropertiesPostDeserialization() {\n initLayout();\n List<NamedThing> properties = getProperties();\n for (NamedThing prop : properties) {\n if (prop instanceof Properties) {\n ((Properties) prop).setupPropertiesPostDeserialization();\n } else {\n prop.setI18nMessageFormater(getI18nMessageFormater());\n }\n }\n\n }",
"@Override\n public void loadFromProperties(PropertiesWrapper properties) {\n\n useForeignKeyPrefix = properties.getBoolean(\"namingConvention.useForeignKeyPrefix\", useForeignKeyPrefix);\n sequenceFormat = properties.get(\"namingConvention.sequenceFormat\", sequenceFormat);\n schema = properties.get(\"namingConvention.schema\", schema);\n }",
"protected ResultTransformer resolveResultTransformer(ResultTransformer resultTransformer) {\n \t\treturn resultTransformer;\n \t}",
"public static void restoreValue(String key) {\n setProperty(key, defaults.getProperty(key));\n }",
"public void restoreOldFolders() {\n setConfigurationAndLog(ArecoDeploymentScriptFinder.RESOURCES_FOLDER_CONF, this.oldResourcesFolder);\n setConfigurationAndLog(ArecoDeploymentScriptFinder.UPDATE_SCRIPTS_FOLDER_CONF, this.oldUpdateScriptsFolder);\n setConfigurationAndLog(ArecoDeploymentScriptFinder.INIT_SCRIPTS_FOLDER_CONF, this.oldInitScriptsFolder);\n setConfigurationAndLog(FlexibleSearchDeploymentEnvironmentDAO.CURRENT_ENVIRONMENT_CONF, this.oldEnvironmentName);\n setConfigurationAndLog(LocalizedImpexImportService.IMPEX_LOCALE_CONF, this.oldImpexLocaleCode);\n }",
"@Override\n\tpublic void afterPropertiesSet() throws Exception {\n\t\t\n\t}",
"@Override\n\tpublic void afterPropertiesSet() throws Exception {\n\t\t\n\t}",
"@Override\n\tpublic void afterPropertiesSet() throws Exception {\n\t\t\n\t}"
] | [
"0.63226587",
"0.6070676",
"0.58032113",
"0.5686828",
"0.56485754",
"0.56336933",
"0.54001844",
"0.5313503",
"0.5294512",
"0.5288753",
"0.5241778",
"0.52223665",
"0.5221265",
"0.5211519",
"0.5157029",
"0.51502603",
"0.5135488",
"0.51281637",
"0.5119545",
"0.5077623",
"0.5067938",
"0.5063459",
"0.5042473",
"0.50389683",
"0.5029337",
"0.5016333",
"0.500242",
"0.50017",
"0.49668694",
"0.49647328",
"0.49594733",
"0.4945215",
"0.49372074",
"0.49317187",
"0.49221745",
"0.4908817",
"0.4895639",
"0.48847046",
"0.4878235",
"0.48710194",
"0.48534536",
"0.48495466",
"0.4834176",
"0.48229793",
"0.48177823",
"0.48015323",
"0.47973642",
"0.47905385",
"0.47905385",
"0.47851297",
"0.4779959",
"0.4768843",
"0.47666517",
"0.47642326",
"0.47467494",
"0.4743541",
"0.47347754",
"0.4731142",
"0.47133458",
"0.47091246",
"0.47058013",
"0.46910414",
"0.46850488",
"0.46790764",
"0.46737468",
"0.4668508",
"0.46640727",
"0.46545714",
"0.46514827",
"0.4643942",
"0.46390846",
"0.4634043",
"0.46320835",
"0.4621578",
"0.46126473",
"0.4611718",
"0.46106276",
"0.46091253",
"0.46014664",
"0.45897028",
"0.45897028",
"0.45897028",
"0.45897028",
"0.45897028",
"0.45897028",
"0.45897028",
"0.45897028",
"0.45888647",
"0.45808274",
"0.45712996",
"0.4570243",
"0.45629746",
"0.45612535",
"0.45599067",
"0.45555148",
"0.45522785",
"0.45455295",
"0.4540704",
"0.4540704",
"0.4540704"
] | 0.7490115 | 0 |
Getter for property setPropertyTarget. | public String getSetPropertyTarget() {
return this.setPropertyTarget;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setSetPropertyTarget(String setPropertyTarget) {\n \n this.setPropertyTarget = setPropertyTarget;\n }",
"Property getProperty();",
"Property getProperty();",
"public String propertyName() {\n\t\t\treturn target != null ? target : name;\n\t\t}",
"String getTarget() {\r\n return this.target;\r\n }",
"public Object getTarget()\n {\n return __m_Target;\n }",
"public Target getTarget() {\n return target;\n }",
"public Target getTarget() {\n\n return target;\n }",
"public Target getTarget() {\n\t\treturn target;\n\t}",
"public Target getTarget() {\n\t\treturn target;\n\t}",
"public Target getTarget() {\n\t\treturn target;\n\t}",
"public String getTarget() {\n return this.target;\n }",
"public Point getTarget() {\n\t\treturn _target;\n\t}",
"java.lang.String getProperty();",
"public String getTarget() {\n return target;\n }",
"public String getTarget() {\n return target;\n }",
"public Point getTarget()\n\t{\n\t\treturn this.target;\n\t}",
"public String getTarget() {\n return JsoHelper.getAttribute(jsObj, \"target\");\n }",
"public Entity getmTarget() {\n return mTarget;\n }",
"public Property getProperty() {\n\t\treturn _property;\n\t}",
"public Object getTargetObject() {\n return targetObject;\n }",
"public java.lang.String getTarget() {\n return target;\n }",
"protected java.beans.PropertyChangeSupport getPropertyChange() {\n\t\tif (propertyChange == null) {\n\t\t\tpropertyChange = new java.beans.PropertyChangeSupport(this);\n\t\t};\n\t\treturn propertyChange;\n\t}",
"protected PropertyChangeSupport getPropertyChange() {\r\n\t\tif (propertyChange == null) {\r\n\t\t\tpropertyChange = new PropertyChangeSupport(this);\r\n\t\t}\r\n\t\t;\r\n\t\treturn propertyChange;\r\n\t}",
"public String getTarget()\r\n\t{\r\n\t\treturn _target;\r\n\t}",
"@Override\n\tpublic IPropertySetter getPropertySetter() {\n\t\treturn null;\n\t}",
"public Mob getTarget() {\r\n return target.get();\r\n }",
"Object getTarget();",
"Object getTarget();",
"protected java.beans.PropertyChangeSupport getPropertyChange() {\r\n\tif (propertyChange == null) {\r\n\t\tpropertyChange = new java.beans.PropertyChangeSupport(this);\r\n\t};\r\n\treturn propertyChange;\r\n}",
"public com.commercetools.api.models.common.Reference getTarget() {\n return this.target;\n }",
"public String getTargetName() {\n return this.targetName;\n }",
"public EntityID getTarget() {\n\t\treturn target.getValue();\n\t}",
"public String getTargetName() {\n\t\treturn targetName;\n\t}",
"String getProperty();",
"String getProperty();",
"String getProperty();",
"Attribute getTarget();",
"public final EventTarget getEventTarget() {\n return this.target;\n }",
"public Node getTarget() {\n return target;\n }",
"@JsonProperty(\"target\")\n public String getTarget() {\n return target;\n }",
"public String getProperty();",
"public String getTargetUrl() {\n return targetUrl;\n }",
"protected PropertyDescriptor getPropDescriptor(Object target, String propName)\n\t\t\tthrows IntrospectionException {\n\t\tPropertyDescriptor result = null;\n\t\tBeanInfo bi = Introspector.getBeanInfo(target.getClass());\n\t\tPropertyDescriptor[] properties = bi.getPropertyDescriptors();\n\t\tfor (PropertyDescriptor p : properties) {\n\t\t\tif (p.getName().equals(propName)) {\n\t\t\t\tresult = p;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}",
"java.lang.String getTarget();",
"java.lang.String getTarget();",
"public ObjectProperty<EventHandler<ScrollToEvent<Integer>>> onScrollToProperty() {\n\n return this.getWrappedControl().onScrollToProperty();\n }",
"Path getTargetPath()\n {\n return targetPath;\n }",
"public Long getTargetId() {\r\n return targetId;\r\n }",
"boolean isProxyTargetAware() {\n\t\treturn this.proxyTargetAware;\n\t}",
"public Name getTarget() {\n\t\treturn getSingleName();\n\t}",
"@Override\n public void setProperty(final Object bean, String name, final Object value) throws InvocationTargetException, IllegalAccessException {\n {\n if (logger.isDebugEnabled()) {\n logger.debug(\"setProperty on {}, name: {}, value: {}\", bean.getClass(), name, value);\n }\n // Resolve any nested expression to get the actual target bean\n Object target = bean;\n final Resolver resolver = getPropertyUtils().getResolver();\n while (resolver.hasNested(name)) {\n try {\n target = getPropertyUtils().getProperty(target, resolver.next(name));\n if (target == null) {\n throw new InvocationTargetException(null, \"Resolved nested property for:\" + name + \", on: \" + bean + \" was null\");\n }\n name = resolver.remove(name);\n } catch (final NoSuchMethodException e) {\n throw new InvocationTargetException(e, \"No getter for property:\" + name + \", on: \" + bean);\n }\n }\n logger.trace(\"resolved target, bean: {}, name: {}\", target.getClass(), name);\n\n final String propName = resolver.getProperty(name); // Simple name of target property\n if (autoFillCollections.isRemoveValue(value)) {\n logger.trace(\"removing from target, bean: {}, name: {}\", target.getClass(), name);\n\n // we may do a further get but no longer want to reference our nested collection stack\n if (!autoFillCollections.collections.isEmpty()) {\n autoFillCollections.collections.pop();\n }\n if (target instanceof Map) {\n Map targetMap = (Map) target;\n Iterator<Map.Entry<String, Object>> i = targetMap.entrySet().iterator();\n while (i.hasNext()) {\n String key = i.next().getKey();\n if (propName.equals(key)) {\n i.remove();\n break;\n }\n }\n } else if (target instanceof Collection) {\n try {\n autoFillCollections.removeByNameProperty(propName, (Collection) target);\n } catch (NoSuchMethodException e) {\n throw new InvocationTargetException(e, \"Can only remove named entries from collections or maps\" + name + \", on: \" + target);\n }\n } else {\n throw new InvocationTargetException(null, \"Can only remove entries from collections or maps\" + name + \", on: \" + target);\n }\n\n logger.trace(\"removed from target, bean: {}, name: {}\", target.getClass(), name);\n return;\n }\n\n Class<?> type = null; // Java type of target property\n final int index = resolver.getIndex(name); // Indexed subscript value (if any)\n final String key = resolver.getKey(name); // Mapped key value (if any)\n\n // Calculate the property type\n if (target instanceof DynaBean) {\n throw new InvocationTargetException(null, \"Cannot determine DynaBean type to access: \" + name + \" on: \" + target);\n } else if (target instanceof Map) {\n type = Object.class;\n } else if (target != null && target.getClass().isArray() && index >= 0) {\n type = Array.get(target, index).getClass();\n } else {\n PropertyDescriptor descriptor = null;\n try {\n descriptor = getPropertyUtils().getPropertyDescriptor(target, name);\n if (descriptor == null) {\n throw new InvocationTargetException(null, \"No accessor method descriptor for: \" + name + \" on: \" + target.getClass());\n }\n } catch (final NoSuchMethodException e) {\n throw new InvocationTargetException(e, \"Failed to get descriptor for: \" + name + \" on: \" + target.getClass());\n }\n if (descriptor instanceof MappedPropertyDescriptor) {\n if (((MappedPropertyDescriptor) descriptor).getMappedWriteMethod() == null) {\n throw new InvocationTargetException(null, \"No mapped Write method for: \" + name + \" on: \" + target.getClass());\n }\n type = ((MappedPropertyDescriptor) descriptor).getMappedPropertyType();\n } else if (index >= 0 && descriptor instanceof IndexedPropertyDescriptor) {\n if (((IndexedPropertyDescriptor) descriptor).getIndexedWriteMethod() == null) {\n throw new InvocationTargetException(null, \"No indexed Write method for: \" + name + \" on: \" + target.getClass());\n }\n type = ((IndexedPropertyDescriptor) descriptor).getIndexedPropertyType();\n } else if (index >= 0 && List.class.isAssignableFrom(descriptor.getPropertyType())) {\n type = Object.class;\n } else if (key != null) {\n if (descriptor.getReadMethod() == null) {\n throw new InvocationTargetException(null, \"No Read method for: \" + name + \" on: \" + target.getClass());\n }\n type = (value == null) ? Object.class : value.getClass();\n } else {\n if (descriptor.getWriteMethod() == null) {\n throw new InvocationTargetException(null, \"No Write method for: \" + name + \" on: \" + target.getClass());\n }\n type = descriptor.getPropertyType();\n }\n }\n\n // Convert the specified value to the required type\n Object newValue = null;\n if (type.isArray() && (index < 0)) { // Scalar value into array\n if (value == null) {\n final String[] values = new String[1];\n values[0] = null;\n newValue = getConvertUtils().convert(values, type);\n } else if (value instanceof String) {\n newValue = getConvertUtils().convert(value, type);\n } else if (value instanceof String[]) {\n newValue = getConvertUtils().convert((String[]) value, type);\n } else {\n newValue = convert(value, type);\n }\n } else if (type.isArray()) { // Indexed value into array\n if (value instanceof String || value == null) {\n newValue = getConvertUtils().convert((String) value, type.getComponentType());\n } else if (value instanceof String[]) {\n newValue = getConvertUtils().convert(((String[]) value)[0], type.getComponentType());\n } else {\n newValue = convert(value, type.getComponentType());\n }\n } else { // Value into scalar\n if (value instanceof String) {\n newValue = getConvertUtils().convert((String) value, type);\n } else if (value instanceof String[]) {\n newValue = getConvertUtils().convert(((String[]) value)[0], type);\n } else {\n newValue = convert(value, type);\n }\n }\n\n // Invoke the setter method\n try {\n getPropertyUtils().setProperty(target, name, newValue);\n } catch (final NoSuchMethodException e) {\n throw new InvocationTargetException(e, \"Cannot set: \" + propName + \" on: \" + target.getClass());\n }\n }\n }",
"public static boolean canTransferToProperty( TestProperty source, TestProperty target )\r\n \t{\r\n \t\treturn false;\r\n \t}",
"public TestExecutionTarget getTarget() {\n return this.target;\n }",
"String getTarget();",
"String getTarget();",
"public String targetId() {\n return this.targetId;\n }",
"public Node target() {\n return target;\n }",
"@Override\n\tpublic void setProperty(String propertyName, Object value) {\n\t\t\n\t}",
"public Entity.ID getTargetID() {\n return targetID;\n }",
"public java.lang.String getTargetServiceURL() {\r\n return targetServiceURL;\r\n }",
"public PhineasHoverListener getInnerListener()\n\t{\n\t\treturn target;\n\t}",
"public EObject getTarget() {\n\t\treturn adaptee.getTarget();\n\t}",
"public String getPropertyLabel() {\n \t\treturn propertyLabel;\n \t}",
"public Object get(Object target)\n\t\tthrows IllegalAccessException,\n\t\tInvocationTargetException {\n\t\tgetter.setAccessible(true);\n\t\treturn getter.invoke(target);\n\t}",
"protected final LogTarget getLogTarget() \n {\n return m_wrappedLogTarget; \n }",
"public String valueInTargetSlot() {\n return this.innerProperties() == null ? null : this.innerProperties().valueInTargetSlot();\n }",
"public AstNode getTarget() {\n return target;\n }",
"private String getPropertyValue() {\n return EmfPropertyHelper.getValue(itemPropertyDescriptor, eObject);\n }",
"public Spatial getTarget() {\r\n return target;\r\n }",
"public Player getTarget() {\n return target;\n }",
"Object getPropertytrue();",
"public long getTargetId() {\n return targetId;\n }",
"public DvEHRURI getTarget() {\n return target;\n }",
"public void setTarget(String newValue);",
"protected void setValue(Object target, String targetName, String propName,\n\t\t\tObject valToSet) throws WekaException {\n\n\t\ttry {\n\t\t\tgetStepManager().logDebug(\n\t\t\t\t\t\"Attempting to set property '\" + propName + \"' \"\n\t\t\t\t\t\t\t+ \"with value of type '\" + valToSet.getClass().getCanonicalName()\n\t\t\t\t\t\t\t+ \" '(\" + valToSet + \") on '\" + targetName + \"'\");\n\t\t\tPropertyDescriptor prop = getPropDescriptor(target, propName);\n\n\t\t\tif (prop == null) {\n\t\t\t\tthrow new WekaException(\"Unable to find method '\" + propName + \"'\");\n\t\t\t}\n\t\t\tMethod setMethod = prop.getWriteMethod();\n\t\t\tsetMethod.invoke(target, valToSet);\n\t\t} catch (Exception e) {\n\t\t\tthrow new WekaException(e);\n\t\t}\n\t}",
"PropertyChangeListener[] getPropertyChangeListeners();",
"public void setTarget(Object method)\n {\n __m_Target = method;\n }",
"public ProxySelector proxySelector() {\n return proxySelector;\n }",
"public K getUiTarget() {\n return this.uiTarget;\n }",
"boolean hasSetProperty();",
"public ObjectSequentialNumber getTarget() {\n return target;\n }",
"private PropertyPagePropertyDescriptor getPropertyDescriptor() {\n \t\treturn propertyDescriptor;\n \t}",
"String getProperty(String property);",
"public String getDefaultTargetPropertyName() {\r\n return null;\r\n }",
"public String targetResourceId() {\n return this.targetResourceId;\n }",
"@SuppressWarnings( \"unchecked\" )\n public static <T> PropertyFunction<T> property( Property<T> property )\n {\n return ( (PropertyReferenceHandler<T>) Proxy.getInvocationHandler( property ) ).property();\n }",
"protected PropertyChangeListener createPropertyChangeListener() {\n return new PropertyChangeHandler(); }",
"@NotNull\n Resource getTarget();",
"public ArrayList getTargetList() {\r\n\t\treturn targetList;\r\n\t}",
"public String getPropertyId() {\n return propertyId;\n }",
"boolean isSetTarget();",
"State getTarget();",
"public PropertyDefinitionBase getPropertyDefinition() {\n return propertyDefinition;\n }",
"public java.lang.String getTargetNumber() {\r\n return targetNumber;\r\n }",
"public Integer getTargetId() {\n\t\treturn targetId;\n\t}",
"@Override\r\n\tpublic void setProperty(Properties prop) {\n\t}",
"public message.Figure.FigureData.FigureProperty getProperty() {\n return property_;\n }",
"public String setter() {\n\t\treturn prefix(\"set\");\n\t}",
"public abstract boolean getProperty(String propertyName);"
] | [
"0.73731506",
"0.62644106",
"0.62644106",
"0.61308",
"0.6055199",
"0.601758",
"0.5983369",
"0.5981977",
"0.59547955",
"0.59547955",
"0.59547955",
"0.58336264",
"0.58280826",
"0.5804406",
"0.58024687",
"0.58024687",
"0.57713085",
"0.5769123",
"0.571878",
"0.5679757",
"0.56687874",
"0.566384",
"0.5644453",
"0.5628186",
"0.5627295",
"0.56201535",
"0.5618818",
"0.56131756",
"0.56131756",
"0.5596042",
"0.55935454",
"0.5576422",
"0.5573482",
"0.5499712",
"0.5490032",
"0.5490032",
"0.5490032",
"0.54828215",
"0.5447921",
"0.5428093",
"0.5423821",
"0.54225165",
"0.53807324",
"0.5373309",
"0.5371839",
"0.5371839",
"0.5348837",
"0.5348505",
"0.5335853",
"0.53329796",
"0.53249586",
"0.53153646",
"0.5299862",
"0.52807885",
"0.5278069",
"0.5278069",
"0.5273249",
"0.5255633",
"0.52522063",
"0.5250824",
"0.52414906",
"0.52400875",
"0.5239237",
"0.52305037",
"0.52128464",
"0.5207916",
"0.52037996",
"0.5187894",
"0.51868147",
"0.51797426",
"0.51762855",
"0.51755583",
"0.5157101",
"0.5156064",
"0.51520294",
"0.5143804",
"0.51381695",
"0.5137928",
"0.511631",
"0.5092635",
"0.5091908",
"0.5079977",
"0.506777",
"0.50558066",
"0.5052469",
"0.5051973",
"0.50428045",
"0.50402164",
"0.5039585",
"0.5032757",
"0.5026001",
"0.50235224",
"0.50218153",
"0.5003518",
"0.49990138",
"0.49979645",
"0.4988298",
"0.4986061",
"0.4985343",
"0.49835247"
] | 0.82209975 | 0 |
Setter for property setPropertyTarget. | public void setSetPropertyTarget(String setPropertyTarget) {
this.setPropertyTarget = setPropertyTarget;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getSetPropertyTarget() {\n \n return this.setPropertyTarget;\n }",
"protected void setValue(Object target, String targetName, String propName,\n\t\t\tObject valToSet) throws WekaException {\n\n\t\ttry {\n\t\t\tgetStepManager().logDebug(\n\t\t\t\t\t\"Attempting to set property '\" + propName + \"' \"\n\t\t\t\t\t\t\t+ \"with value of type '\" + valToSet.getClass().getCanonicalName()\n\t\t\t\t\t\t\t+ \" '(\" + valToSet + \") on '\" + targetName + \"'\");\n\t\t\tPropertyDescriptor prop = getPropDescriptor(target, propName);\n\n\t\t\tif (prop == null) {\n\t\t\t\tthrow new WekaException(\"Unable to find method '\" + propName + \"'\");\n\t\t\t}\n\t\t\tMethod setMethod = prop.getWriteMethod();\n\t\t\tsetMethod.invoke(target, valToSet);\n\t\t} catch (Exception e) {\n\t\t\tthrow new WekaException(e);\n\t\t}\n\t}",
"public void setTarget(String newValue);",
"@Override\n\tpublic void setProperty(String propertyName, Object value) {\n\t\t\n\t}",
"protected void setTarget(Command target) {\n\t\tproxy.setTarget(target);\n\t}",
"public void setProperty(String name,Object value);",
"public void setTarget(Object method)\n {\n __m_Target = method;\n }",
"void setTarget(java.lang.String target);",
"@Override\r\n\tpublic void setProperty(Properties prop) {\n\t}",
"public void setProperty(String property) {\n }",
"public void setTarget(Target target) {\n\t\tthis.target = target;\n\t}",
"public void setTargetValue(String name, Object def);",
"@Override\n\tpublic void setProperty(String name, Object value)\n\t{\n\t\tsuper.setProperty(name, value);\n\n\t\tprocessProperty(name, value);\n\t}",
"@Override\n\tpublic void setProperty(String name, Object value)\n\t{\n\t\tsuper.setProperty(name, value);\n\n\t\tprocessProperty(name, value);\n\t}",
"T setUrlTarget(String urlTarget);",
"@Override\n\t\tpublic void setProperty(String key, Object value) {\n\n\t\t}",
"public void setProperty(String name,Object value)\n {\n ClassAnalyzer.setProperty(m_Source,name,value);\n }",
"public void setProperty(String propertyName, boolean value);",
"@Override\n public void setProperty(final Object bean, String name, final Object value) throws InvocationTargetException, IllegalAccessException {\n {\n if (logger.isDebugEnabled()) {\n logger.debug(\"setProperty on {}, name: {}, value: {}\", bean.getClass(), name, value);\n }\n // Resolve any nested expression to get the actual target bean\n Object target = bean;\n final Resolver resolver = getPropertyUtils().getResolver();\n while (resolver.hasNested(name)) {\n try {\n target = getPropertyUtils().getProperty(target, resolver.next(name));\n if (target == null) {\n throw new InvocationTargetException(null, \"Resolved nested property for:\" + name + \", on: \" + bean + \" was null\");\n }\n name = resolver.remove(name);\n } catch (final NoSuchMethodException e) {\n throw new InvocationTargetException(e, \"No getter for property:\" + name + \", on: \" + bean);\n }\n }\n logger.trace(\"resolved target, bean: {}, name: {}\", target.getClass(), name);\n\n final String propName = resolver.getProperty(name); // Simple name of target property\n if (autoFillCollections.isRemoveValue(value)) {\n logger.trace(\"removing from target, bean: {}, name: {}\", target.getClass(), name);\n\n // we may do a further get but no longer want to reference our nested collection stack\n if (!autoFillCollections.collections.isEmpty()) {\n autoFillCollections.collections.pop();\n }\n if (target instanceof Map) {\n Map targetMap = (Map) target;\n Iterator<Map.Entry<String, Object>> i = targetMap.entrySet().iterator();\n while (i.hasNext()) {\n String key = i.next().getKey();\n if (propName.equals(key)) {\n i.remove();\n break;\n }\n }\n } else if (target instanceof Collection) {\n try {\n autoFillCollections.removeByNameProperty(propName, (Collection) target);\n } catch (NoSuchMethodException e) {\n throw new InvocationTargetException(e, \"Can only remove named entries from collections or maps\" + name + \", on: \" + target);\n }\n } else {\n throw new InvocationTargetException(null, \"Can only remove entries from collections or maps\" + name + \", on: \" + target);\n }\n\n logger.trace(\"removed from target, bean: {}, name: {}\", target.getClass(), name);\n return;\n }\n\n Class<?> type = null; // Java type of target property\n final int index = resolver.getIndex(name); // Indexed subscript value (if any)\n final String key = resolver.getKey(name); // Mapped key value (if any)\n\n // Calculate the property type\n if (target instanceof DynaBean) {\n throw new InvocationTargetException(null, \"Cannot determine DynaBean type to access: \" + name + \" on: \" + target);\n } else if (target instanceof Map) {\n type = Object.class;\n } else if (target != null && target.getClass().isArray() && index >= 0) {\n type = Array.get(target, index).getClass();\n } else {\n PropertyDescriptor descriptor = null;\n try {\n descriptor = getPropertyUtils().getPropertyDescriptor(target, name);\n if (descriptor == null) {\n throw new InvocationTargetException(null, \"No accessor method descriptor for: \" + name + \" on: \" + target.getClass());\n }\n } catch (final NoSuchMethodException e) {\n throw new InvocationTargetException(e, \"Failed to get descriptor for: \" + name + \" on: \" + target.getClass());\n }\n if (descriptor instanceof MappedPropertyDescriptor) {\n if (((MappedPropertyDescriptor) descriptor).getMappedWriteMethod() == null) {\n throw new InvocationTargetException(null, \"No mapped Write method for: \" + name + \" on: \" + target.getClass());\n }\n type = ((MappedPropertyDescriptor) descriptor).getMappedPropertyType();\n } else if (index >= 0 && descriptor instanceof IndexedPropertyDescriptor) {\n if (((IndexedPropertyDescriptor) descriptor).getIndexedWriteMethod() == null) {\n throw new InvocationTargetException(null, \"No indexed Write method for: \" + name + \" on: \" + target.getClass());\n }\n type = ((IndexedPropertyDescriptor) descriptor).getIndexedPropertyType();\n } else if (index >= 0 && List.class.isAssignableFrom(descriptor.getPropertyType())) {\n type = Object.class;\n } else if (key != null) {\n if (descriptor.getReadMethod() == null) {\n throw new InvocationTargetException(null, \"No Read method for: \" + name + \" on: \" + target.getClass());\n }\n type = (value == null) ? Object.class : value.getClass();\n } else {\n if (descriptor.getWriteMethod() == null) {\n throw new InvocationTargetException(null, \"No Write method for: \" + name + \" on: \" + target.getClass());\n }\n type = descriptor.getPropertyType();\n }\n }\n\n // Convert the specified value to the required type\n Object newValue = null;\n if (type.isArray() && (index < 0)) { // Scalar value into array\n if (value == null) {\n final String[] values = new String[1];\n values[0] = null;\n newValue = getConvertUtils().convert(values, type);\n } else if (value instanceof String) {\n newValue = getConvertUtils().convert(value, type);\n } else if (value instanceof String[]) {\n newValue = getConvertUtils().convert((String[]) value, type);\n } else {\n newValue = convert(value, type);\n }\n } else if (type.isArray()) { // Indexed value into array\n if (value instanceof String || value == null) {\n newValue = getConvertUtils().convert((String) value, type.getComponentType());\n } else if (value instanceof String[]) {\n newValue = getConvertUtils().convert(((String[]) value)[0], type.getComponentType());\n } else {\n newValue = convert(value, type.getComponentType());\n }\n } else { // Value into scalar\n if (value instanceof String) {\n newValue = getConvertUtils().convert((String) value, type);\n } else if (value instanceof String[]) {\n newValue = getConvertUtils().convert(((String[]) value)[0], type);\n } else {\n newValue = convert(value, type);\n }\n }\n\n // Invoke the setter method\n try {\n getPropertyUtils().setProperty(target, name, newValue);\n } catch (final NoSuchMethodException e) {\n throw new InvocationTargetException(e, \"Cannot set: \" + propName + \" on: \" + target.getClass());\n }\n }\n }",
"public void set(Object target, Object value)\n\t\tthrows IllegalAccessException,\n\t\tInvocationTargetException {\n\t\tsetter.setAccessible(true);\n\t\tsetter.invoke(target, value);\n\t}",
"@Override\n\tpublic void setTarget(Object arg0) {\n\t\tdefaultEdgle.setTarget(arg0);\n\t}",
"public void setTarget(String val)\r\n\t{\r\n\t\t_target = val;\r\n\t}",
"void setTarget(Node target) {\n\t\tthis.target = target;\n\t}",
"void setProperty(String attribute, String value);",
"public void setTargetValue(int idx, Object value);",
"private void updateTarget(Object newValue) {\r\n if (this.bindingTarget != null) {\r\n // let the target update the new value\r\n this.bindingTarget.updateTarget(newValue);\r\n }\r\n }",
"public void setTarget(DmcObjectName value) {\n DmcAttribute<?> attr = get(DmpDMSAG.__target);\n if (attr == null)\n attr = new DmcTypeNameContainerSV(DmpDMSAG.__target);\n \n try{\n attr.set(value);\n set(DmpDMSAG.__target,attr);\n }\n catch(DmcValueException ex){\n throw(new IllegalStateException(\"The alternative type specific set() method shouldn't throw exceptions!\",ex));\n }\n }",
"public abstract void setProperty(String property, Object value)\n throws SOAPException;",
"public void setTarget(TestExecutionTarget target) {\n this.target = target;\n }",
"public void setTarget(String target) {\n this.target = target;\n }",
"public void setTarget(java.lang.String target) {\n this.target = target;\n }",
"public boolean setProperty(String attName, Object value);",
"public void setProperty(String arg0, Object arg1)\n throws UniquePropertyValueConflictException,\n\n EntityPersistenceException {\n\n }",
"void setTarget(String target) {\n try {\n int value = Integer.valueOf(target);\n game.setTarget(value);\n } catch (NumberFormatException e) {\n // caused by inputting strings\n } catch (IllegalArgumentException e) {\n // caused by number < 6.\n game.setTarget(10);\n }\n }",
"public void setProperty(String key, Object value);",
"public void setProperty( String key, Object value );",
"@objid (\"8fb70c43-b102-4a64-9424-c7cc07d58fcf\")\n void setTarget(Instance value);",
"public void setProperty(String property) {\n \t\t_property = property;\n \t}",
"public void setTarget(CPointer<BlenderObject> target) throws IOException\n\t{\n\t\tlong __address = ((target == null) ? 0 : target.getAddress());\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__io__block.writeLong(__io__address + 128, __address);\n\t\t} else {\n\t\t\t__io__block.writeLong(__io__address + 104, __address);\n\t\t}\n\t}",
"public void setTarget(double target)\n {\n setTarget(target, null);\n }",
"public void setProperty(Integer t) {\n\n\t\t}",
"public void setTarget(String s) { \n shortcutValue(s, GENERAL_TARGET);\n }",
"public void setField(final Object target, final String name, final Object value) {\n\n // check if the object is a proxy object\n if (AopUtils.isAopProxy(target) && target instanceof Advised) {\n try {\n ReflectionTestUtils.setField(((Advised) target).getTargetSource().getTarget(), name, value);\n } catch (Exception e) {\n e.printStackTrace();\n }\n } else {\n ReflectionTestUtils.setField(target, name, value);\n }\n }",
"void setProperty(String key, Object value);",
"void setTarget(IWfnTransitionAndPlace elem);",
"public void setProperty(String name, String value) {\n PropertyHelper.getPropertyHelper(this).\n setProperty(null, name, value, true);\n }",
"public void setTarget(Object value) throws DmcValueException {\n DmcTypeNameContainerSV attr = (DmcTypeNameContainerSV) get(DmpDMSAG.__target);\n if (attr == null)\n attr = new DmcTypeNameContainerSV(DmpDMSAG.__target);\n \n attr.set(value);\n set(DmpDMSAG.__target,attr);\n }",
"public void setTargetObject(Object targetObject) {\n this.targetObject = targetObject;\n }",
"void\t\tsetCommandPropertyValue(String command, String propertyName, String propertyValue);",
"public Object setPossibleProperty( Map<String, Object> context, Object target, String name, Object value )\n throws OgnlException\n {\n Object result = null;\n OgnlContext ognlContext = (OgnlContext) context;\n\n try\n {\n if ( !OgnlRuntime.setMethodValue( ognlContext, target, name, value, true ) )\n {\n result = OgnlRuntime.setFieldValue( ognlContext, target, name, value ) ? null : OgnlRuntime.NotFound;\n }\n\n if ( result == OgnlRuntime.NotFound )\n {\n Method m = OgnlRuntime.getWriteMethod( target.getClass(), name );\n if ( m != null )\n {\n result = m.invoke( target, value );\n }\n }\n } catch ( OgnlException ex )\n {\n throw ex;\n } catch ( Exception ex )\n {\n throw new OgnlException( name, ex );\n }\n\n return result;\n }",
"void updatedProperty(TestResult tr, String name, String value);",
"public static void setLogTarget(final String logTarget)\n {\n BaseBoot.getConfiguration().setConfigProperty (LOGTARGET, logTarget);\n }",
"public void setProperty(java.lang.String name, java.lang.Object value)\n throws javax.xml.bind.PropertyException\n {\n super.setProperty(name, value);\n }",
"public void setProperty(final String property, final String value) {\n\n\t\tthis.engine.setProperty(property, value);\n\t}",
"public void setProperty(String propertyId, Object value)\n throws SAXNotRecognizedException, SAXNotSupportedException\n {\n // see if the property is recognized\n getProperty(propertyId);\n \n // Properties with a defined value, we just change it if we can.\n \n if ((PROPERTY + \"declaration-handler\").equals(propertyId))\n {\n if (value == null)\n {\n declHandler = base;\n }\n else if (!(value instanceof DeclHandler))\n {\n throw new SAXNotSupportedException(propertyId);\n }\n else\n {\n declHandler = (DeclHandler) value;\n }\n return ;\n }\n \n if ((PROPERTY + \"lexical-handler\").equals(propertyId))\n {\n if (value == null)\n {\n lexicalHandler = base;\n }\n else if (!(value instanceof LexicalHandler))\n {\n throw new SAXNotSupportedException(propertyId);\n }\n else\n {\n lexicalHandler = (LexicalHandler) value;\n }\n return;\n }\n \n throw new SAXNotSupportedException(propertyId);\n }",
"@JsonProperty(\"target\")\n public void setTarget(String target) {\n this.target = target;\n }",
"public void setTarget(String target) {\n this.target = target == null ? null : target.trim();\n }",
"public void setTarget(NameContainer value) {\n DmcAttribute<?> attr = get(DmpDMSAG.__target);\n if (attr == null)\n attr = new DmcTypeNameContainerSV(DmpDMSAG.__target);\n \n try{\n attr.set(value);\n set(DmpDMSAG.__target,attr);\n }\n catch(DmcValueException ex){\n throw(new IllegalStateException(\"The type specific set() method shouldn't throw exceptions!\",ex));\n }\n }",
"public static void setTargetAnnotation (ITextUnit textUnit,\r\n \t\tLocaleId locId,\r\n \t\tIAnnotation annotation)\r\n \t{\r\n \t\tif ( textUnit == null ) return;\r\n \t\tif ( Util.isNullOrEmpty(locId) ) return;\r\n \t\tif ( textUnit.getTarget(locId) == null ) return;\r\n \t\ttextUnit.getTarget(locId).setAnnotation(annotation);\r\n \t}",
"public static void setProperty( Object object, String name, String value )\r\n {\r\n Object[] arguments = new Object[]{ value };\r\n\r\n Class<?>[] parameterTypes = new Class<?>[]{ String.class };\r\n\r\n if ( name.length() > 0 )\r\n {\r\n name = \"set\" + name.substring( 0, 1 ).toUpperCase() + name.substring( 1, name.length() );\r\n\r\n try\r\n {\r\n Method concatMethod = object.getClass().getMethod( name, parameterTypes );\r\n\r\n concatMethod.invoke( object, arguments );\r\n }\r\n catch ( Exception ex )\r\n {\r\n throw new UnsupportedOperationException( \"Failed to set property\", ex );\r\n }\r\n }\r\n }",
"public void setProperty(String property) {\n\t\tthis.property = property;\n\t}",
"public void setTarget(Object target) {\n/* 116 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"private void setExtProperty(String propertyName, String dataConfigPropertyName, Object value) {\n ReflectionTestUtils.invokeMethod(this, \"setProperty\", new Object[]{propertyName, dataConfigPropertyName, value});\n }",
"public void setTarget(String targetToAdd) {\n if (targetToAdd.equals(\"\")) {\n throw new BuildException(\"target attribute must not be empty\");\n }\n targets.add(targetToAdd);\n targetAttributeSet = true;\n }",
"public void setProperty(String name, String value) {\n\t\tif (value!=null)\n\t\t testProperties.setProperty(name, value);\n\t}",
"public void setProperty(String aProperty, Object aObject)\n\t\t\t\t\t throws SAXNotSupportedException, SAXNotRecognizedException {\n\t\tparserImpl.setProperty(aProperty, aObject);\n\t}",
"protected void addTargetPropertyDescriptor(Object object) {\n\t\titemPropertyDescriptors.add(new EdgeTargetPropertyDescriptor(\n\t\t\t\t((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),\n\t\t\t\tgetResourceLocator(), getString(\"_UI_Edge_target_feature\"), getString(\n\t\t\t\t\t\t\"_UI_PropertyDescriptor_description\", \"_UI_Edge_target_feature\",\n\t\t\t\t\t\t\"_UI_Edge_type\"), HenshinPackage.Literals.EDGE__TARGET));\n\t}",
"public void setTarget(Object t) {\n\n if (!(t instanceof UMLDiagram)) {\n // This is perfectly normal and happens among other things\n // within the call to setDiagram (below).\n LOG.debug(\"target is null in set target or \"\n\t\t + \"not an instance of UMLDiagram\");\n return;\n }\n UMLDiagram newTarget = (UMLDiagram) t;\n\n if (target != null) {\n target.removePropertyChangeListener(\"remove\", this);\n }\n \n newTarget.addPropertyChangeListener(\"remove\", this);\n\n setToolBar(newTarget.getJToolBar());\n\n // NOTE: This listener needs to always be active \n // even if this tab isn't visible\n graph.removeGraphSelectionListener(this);\n graph.setDiagram(newTarget);\n graph.addGraphSelectionListener(this);\n target = newTarget;\n }",
"@Required\n\tpublic void setTargetService(TargetService service) {\n\t\tthis.targetService = service;\n\t}",
"public Builder setProperty(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n property_ = value;\n onChanged();\n return this;\n }",
"public void setProperty(Object key, Object value) {\r\n\t\tproperties.put(key, value);\r\n\t}",
"private void setProperty(Builder builder, String propertyName, String value) throws HorizonDBException {\r\n\r\n Method method = this.methods.get(propertyName);\r\n\r\n try {\r\n\r\n method.invoke(builder, toType(propertyName, value.trim(), method.getParameterTypes()[0]));\r\n\r\n } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | NullPointerException e) {\r\n\r\n throw new HorizonDBException(ErrorCodes.INVALID_CONFIGURATION, \"The configuration property: \"\r\n + propertyName + \" does not exists.\");\r\n }\r\n }",
"void set(ExecutionContext context, String propertyName, Value propertyValue);",
"public void setTarget(AbstractModelElement target, EditPart editPart) {\n\t\tif (target == null) {\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\tthis.target = target;\n\t\tthis.targetEditPart = editPart;\n\t}",
"public void setTargetLocation(Location targetLocation) \n {\n this.targetLocation = targetLocation;\n }",
"public void setPropertyValue(Object propertyId, Object value) {\n\t\tproperties.put((String) propertyId, value);\n\t\t// tooltipInformation.get(propertyId).setPropertyValue(value);\n\t}",
"public void setKeyEventTarget(JavaScriptObject value) {\n getPolymerElement().setKeyEventTarget(value);\n }",
"public static void setProperty(String tag, String val) {\n\n prop.setProperty(tag, val);\n }",
"public void setTargetPosition(double position){\n targetPosition = position;\n }",
"public void setTargetType(TargetTypes targetType) {\n this.targetType = targetType.getValue();\n }",
"protected void setProperty(java.lang.String propertyName, java.lang.Object propertyValue) {\n properties.put(propertyName, propertyValue);\n }",
"public void setTargetName(String targetName) {\r\n this.targetName = targetName;\r\n }",
"public void setPoint(Point operand, Point target) {\n\tfor (Shape s : this.shapes)\n\t s.setPoint(operand, target);\n }",
"public void setProperty(String key, Object value) {\n commandData.put(key, value);\n }",
"public void setTarget(ObjectSequentialNumber target) {\n this.target = target;\n }",
"@Override\n\t\t\tpublic void setPropertyValue(Object value) {\n\t\t\t\t\n\t\t\t}",
"PropertiesTask setProperty( String key, String value );",
"public void setProperty(String name, String value)\n\t{\n\t\tprops.setProperty(name, value);\n\t}",
"public void setUserProperty(String name, String value) {\n PropertyHelper.getPropertyHelper(this).setUserProperty(null, name,\n value);\n }",
"@Override\n\tpublic void setBindingValue(T value, Object target, BindingEvaluationContext context) {\n\n\t}",
"public void setTargetUrl(String targetUrl) {\n this.targetUrl = targetUrl == null ? null : targetUrl.trim();\n }",
"protected void setPropertyTree(PropertyTree tree) {\n propertyTree = tree;\n }",
"public void setSetpointValue(float targetSetPointValue) {\r\n\t\t//setpoint clamp\r\n\t\ttargetSetPointValue = MathHelper.clamp(targetSetPointValue, restrictSetpointFrom, restrictSetpointTo);\r\n\r\n\t\tthis.setpointValue = targetSetPointValue;\r\n\t}",
"public void setTarget(Vector3f target) \n {\n float distance = FastMath.abs(target.y - this.getPosition().y);\n this.motionTarget = target;\n this.motionPath = new MotionPath();\n \n this.motionPath.addWayPoint(this.getPosition());\n\n this.motionPath.addWayPoint(new Vector3f(this.getPosition().x, target.y, this.getPosition().z));\n \n grabberMotion = new MotionEvent(this.node, this.motionPath);\n grabberMotion.setInitialDuration(distance / this.speed);\n }",
"public void setProperty( String name, String value )\n {\n if ( config != null )\n {\n config.setProperty( name, value );\n }\n else\n {\n LOG.warn( \"setProperty invalid config, can't set prop name [{}], value [{}]\" + name, value);\n }\n }",
"public static void setProperty(Object beanObject, String propertyName, Object value) {\n getCachedSetter(beanObject.getClass(), propertyName).accept(beanObject, value);\n }",
"public void setTargetSelected(boolean targetSelected) {\n this.targetSelected = targetSelected;\n }",
"private void setPropertyInternal(String name, String value) {\n PropertyHelper ph = PropertyHelper.getPropertyHelper(this);\n ph.setProperty(null, name, value, false);\n }",
"public void setTargeted() {\n targeted ++;\n }",
"public void setCurrentTarget(Object target) {\r\n if (target instanceof IModelNode) {\r\n newSource = null;\r\n newTarget = (IModelNode) target;\r\n }\r\n }"
] | [
"0.70539385",
"0.64112264",
"0.63356054",
"0.6262528",
"0.61386913",
"0.6113934",
"0.61058974",
"0.60720223",
"0.59967965",
"0.5949177",
"0.58943325",
"0.5881766",
"0.58252823",
"0.58252823",
"0.5821029",
"0.5814518",
"0.5789569",
"0.57798517",
"0.5716645",
"0.5706041",
"0.5671346",
"0.5664527",
"0.56595135",
"0.5641823",
"0.559757",
"0.5587963",
"0.5565342",
"0.55566007",
"0.5536275",
"0.5476608",
"0.5475524",
"0.54612625",
"0.543867",
"0.53923595",
"0.5386658",
"0.53761864",
"0.5363461",
"0.5351437",
"0.533527",
"0.5333004",
"0.5322668",
"0.5321492",
"0.5317854",
"0.5310964",
"0.5270034",
"0.525577",
"0.5247",
"0.52458644",
"0.5243835",
"0.52402085",
"0.522307",
"0.5218664",
"0.52013",
"0.5195296",
"0.5183609",
"0.5179261",
"0.5177881",
"0.5157222",
"0.51483536",
"0.5143281",
"0.5135984",
"0.51285154",
"0.5126649",
"0.5098769",
"0.50975823",
"0.50810117",
"0.5075845",
"0.5073158",
"0.5068105",
"0.5065273",
"0.5063875",
"0.50621605",
"0.5034026",
"0.50312155",
"0.5030907",
"0.5011693",
"0.5006501",
"0.49883074",
"0.49618825",
"0.49598703",
"0.49556145",
"0.4942329",
"0.49420768",
"0.4932166",
"0.4929564",
"0.4927305",
"0.49185127",
"0.49180925",
"0.49144354",
"0.49096295",
"0.48979664",
"0.48978475",
"0.48971114",
"0.4895701",
"0.48928508",
"0.48832154",
"0.48789787",
"0.487893",
"0.48784506",
"0.4876606"
] | 0.8505647 | 0 |
Getter for property counter. | public String getCounter() {
counter = Integer.valueOf(counterInt++).toString();
return counter;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getCounter() {\r\n return counter;\r\n }",
"public int getCounter(){\n return counter;\n }",
"public int getCounter() {\n return counter;\n }",
"public int getCounter()\n {\n return counter;\n }",
"public Integer getCounter() {\n return counter;\n }",
"@Override\n\tpublic int getCounter() {\n\t\treturn counter;\n\t}",
"public int getcounter() {\n\t\treturn counter;\r\n\t}",
"public static int getCounter() {return counter;}",
"public int getCounter() {\nreturn this.counter;\n}",
"@Override\n public Integer get() {\n return ++counter;\n }",
"public Integer getProperty() {\n\t\t\treturn null;\n\t\t}",
"public int getProperty0() {\n return property0_;\n }",
"public io.dstore.values.IntegerValue getCounter() {\n return counter_ == null ? io.dstore.values.IntegerValue.getDefaultInstance() : counter_;\n }",
"public int getProperty0() {\n return property0_;\n }",
"public long count() { return count.get(); }",
"public AtomicLong getCounter() {\n return counter;\n }",
"@DISPID(118)\n @PropGet\n int getCount();",
"int getPropertiesCount();",
"public io.dstore.values.IntegerValue getCounter() {\n if (counterBuilder_ == null) {\n return counter_ == null ? io.dstore.values.IntegerValue.getDefaultInstance() : counter_;\n } else {\n return counterBuilder_.getMessage();\n }\n }",
"public io.dstore.values.IntegerValueOrBuilder getCounterOrBuilder() {\n return getCounter();\n }",
"io.dstore.values.IntegerValue getCounter();",
"public int count() {\n return this.count;\n }",
"public long count() {\n return this.count;\n }",
"public long getCount() {\n return counter.get();\n }",
"public Short getCounter()\n {\n return counter;\n }",
"int getPropsCount();",
"public int getPropertyInt(String key);",
"int getInCount();",
"public int getObjectCounter() {\n return objectCounter;\n }",
"public int counter (){\n return currentID;\n }",
"public int\t\tget() { return value; }",
"@FameProperty(name = \"numberOfAccesses\", derived = true)\n public Number getNumberOfAccesses() {\n throw new UnsupportedOperationException(\"Not yet implemented!\"); \n }",
"public int currentCount () {\n return count;\n }",
"public long get_counter() {\n return (long)getUIntBEElement(offsetBits_counter(), 32);\n }",
"public static int returnCount()\n {return counter;}",
"@Override\n\tpublic int getPropertyCount() {\n\t\treturn 5;\n\t}",
"@Override\n\tpublic int getPropertyCount() {\n\t\treturn 5;\n\t}",
"public String get_count() {\n\t\treturn count;\n\t}",
"public Integer getIncrement() {\n return increment;\n }",
"public int count() {\r\n return count;\r\n }",
"public io.dstore.values.IntegerValueOrBuilder getCounterOrBuilder() {\n if (counterBuilder_ != null) {\n return counterBuilder_.getMessageOrBuilder();\n } else {\n return counter_ == null ?\n io.dstore.values.IntegerValue.getDefaultInstance() : counter_;\n }\n }",
"public int get_count();",
"public Map<Object, Integer> getCounter() {\n if (counterMap == null) {\n counterMap = FxSharedUtils.getMappedFunction(new FxSharedUtils.ParameterMapper<Object, Integer>() {\n @Override\n public Integer get(Object key) {\n if (counters == null) {\n counters = new HashMap<Object, Integer>();\n }\n final int ctr = FxSharedUtils.get(counters, key, -1) + 1;\n counters.put(key, ctr);\n return ctr;\n }\n }, true);\n }\n return counterMap;\n }",
"public int count() {\n return count;\n }",
"public long count() {\n/* 154 */ return this.count;\n/* */ }",
"public static int getNumberOfProperty(int i){\n\t\t int temp = 0;\r\n\t\t for(int x = 0; x < whoOwnsIt.length; x++){\r\n\t\t\t if(whoOwnsIt[x] == i){\r\n\t\t\t\t temp++;\r\n\t\t\t }\r\n\t\t }\r\n\t\t return temp;\r\n\t }",
"public int _count() {\n return _count(\"\");\n }",
"public int getProperty1() {\n return property1_;\n }",
"public String getCount() {\r\n\t\treturn this.count;\r\n\t}",
"public int getProperty1() {\n return property1_;\n }",
"public double getIncrement() {\n return increment;\n }",
"int getProperty0();",
"public int getListCounter() {\n return listCounter;\n }",
"public double getPrevCount()\n {\n\n return this.prevCount;\n }",
"public long getCount() {\n return count.get();\n }",
"public Integer getCounts() {\n return counts;\n }",
"public int getCompCount(){\n return this.compCount;\n }",
"public final int getRefCount() { return refCount.get(); }",
"public int getCurrentCounter() {\n return currentCounter;\n }",
"public long getReadCounter () {\n\t\treturn readCounter;\n\t}",
"public Long getCount() {\n return this.Count;\n }",
"io.dstore.values.IntegerValueOrBuilder getCounterOrBuilder();",
"public static int GetIncrement(){\n\t\treturn m_Incrementer;\n\t}",
"public int getCounterId() {\r\n\t\treturn counterId;\r\n\t}",
"public int getWordsQuantity(){\n\t\treturn counter;\n\t}",
"protected long getObjectCount() {\r\n return objectCount;\r\n }",
"int getNumber () { return number; }",
"public myCounter() {\n\t\tcounter = 1;\n\t}",
"public int count() {\n\t\treturn count;\n\t}",
"private int getPositiveCount(){\n return m_PositiveCount;\n }",
"public int getIntegerProperty(String key) {\n\t\treturn Integer.parseInt(this.getProperty(key));\n\t}",
"static IterV<String, Integer> counter() {\n return cont(count.f(0));\n }",
"public Integer getCount() {\n return this.count;\n }",
"public String getHitcounter() {\r\n return hitcounter;\r\n }",
"public static int getIntProperty(String key) {\r\n\t\treturn getIntProperty(key, 0);\r\n\t}",
"public int getCountdown() {\r\n\t\treturn this.Countdown;\r\n\t}",
"public Integer getChapterCount() {\n return chapterCount;\n }",
"public int getPropertyInt(String key, int defaultValue);",
"public int count() {\n\treturn 1;\n}",
"private int getNegativeCount(){\n return m_NegativeCount;\n }",
"public int getIntegerProperty(String key) {\n String val = getProperty(key);\n return (null == val ? 1 : Integer.parseInt(val));\n }",
"public long getCount() {\n return count_;\n }",
"public int getCoinCount() {\n return coinCount;\n }",
"public int lireCount() {\n\t\treturn cpt;\n\t}",
"public int getCount() {\n lock.lock();\n try {\n System.out.println(Thread.currentThread().getName() + \" gets Count: \" + count.incrementAndGet());\n return count.intValue();\n } finally {\n lock.unlock();\n }\n }",
"public int getPoisonCounters() {\n\t\treturn this.PoisonCounters;\n\t}",
"public long count() ;",
"public int getPropsCount() {\n return props_.size();\n }",
"public IntegerProperty getReactorFrequency() {\n return this.reactorLine.getCurrentFrequency();\n }",
"@Override\n\tpublic int getMessageCounter() {\n\t\treturn counter;\n\t}",
"public Counter() {\r\n this.count = 0;\r\n }",
"public String getTitleCounter() {\r\n\t\treturn titleCounter;\r\n\t}",
"public int getAddCount() {\n return addCount;\n }",
"Property getProperty();",
"Property getProperty();",
"public static int getIdcounter() {\n return idcounter;\n }",
"@XmlAttribute\r\n public Integer getCount() {\r\n return count;\r\n }",
"int getReaultCount();",
"public MessageCountDetails countDetails() {\n return this.countDetails;\n }",
"public Integer getCount() {\n return count;\n }"
] | [
"0.7566968",
"0.7535598",
"0.7532318",
"0.7488184",
"0.74614793",
"0.7431591",
"0.7324225",
"0.7256066",
"0.7252001",
"0.69623756",
"0.6773025",
"0.67710674",
"0.6769036",
"0.6721143",
"0.6701539",
"0.67007136",
"0.6643195",
"0.6632502",
"0.6554182",
"0.6550067",
"0.653914",
"0.65072954",
"0.64597917",
"0.6454348",
"0.64319897",
"0.64172155",
"0.64121294",
"0.63530385",
"0.6337155",
"0.6333237",
"0.63215846",
"0.63132083",
"0.6311922",
"0.6299866",
"0.6297744",
"0.6274435",
"0.6274435",
"0.62719375",
"0.6263147",
"0.6254911",
"0.6249102",
"0.6244202",
"0.6228195",
"0.6227207",
"0.61886007",
"0.61607814",
"0.6146041",
"0.6143739",
"0.6126053",
"0.6115197",
"0.61028624",
"0.6100509",
"0.60873294",
"0.60629755",
"0.6058363",
"0.60255665",
"0.601948",
"0.6019129",
"0.6016513",
"0.60029846",
"0.59916407",
"0.5981588",
"0.596716",
"0.5964681",
"0.5955427",
"0.59538347",
"0.59398186",
"0.5930072",
"0.5929222",
"0.5928078",
"0.5925022",
"0.5921757",
"0.5911891",
"0.5902855",
"0.58944017",
"0.5890358",
"0.5889216",
"0.5885886",
"0.5878359",
"0.58716154",
"0.5870241",
"0.5864292",
"0.5861892",
"0.5861246",
"0.58603597",
"0.5859731",
"0.5854365",
"0.5851109",
"0.5850565",
"0.58491826",
"0.58476573",
"0.58459306",
"0.5843894",
"0.5841869",
"0.5841869",
"0.5838949",
"0.5830709",
"0.58183557",
"0.58132005",
"0.57946146"
] | 0.663302 | 17 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.